I am testing an object that returns an instance of another class. Internally, that class calls require_once. However, when I try to check that the object returned is of that type I get this message:

InvalidArgumentException: Argument #1 of PHPUnit_Framework_Assert::assertInstanceOf() must be a class or interface name

This message goes away once I call require_once again in my test before the call to assertInstanceOf. This doesn't seem right. It seems like PHPUnit should be smart enough to know that the class is already loaded, so I shouldn't have to load it again. Am I thinking of this wrong? Do I have my PHPUnit configured wrong? Is there a way to avoid requiring this class again in my test?

Edit
Report