Reputation: 3496
Isn't PHPUnit supposed to require the class itself using the naming conventiong "ClassTest"?
My PHPUnit testing class is defined as following:
class RouterTest extends PHPUnit_Framework_TestCase
However it raises a fatal error for file not found "Router.php". If I require it manually everything is ok.
What's wrong with it?
Upvotes: 0
Views: 214
Reputation: 43700
There is nothing wrong with it. How would PHPUnit know where your classes are in relation from the tests?
For your tests, you need to either require the class under test yourself or create an autoloader that will require the class for you. PHPUnit has no idea where it should be getting the files from. It has an autoloader for its internal files but that is it.
Upvotes: 1