Now that I am setting up a new test for my Laravel application, it is spreading from the TestCase base class
class SomeTest extends TestCase { }
I would like to create a new base test class called AnotherTestCase , so I can create test cases that share setup / break / helper / etc methods ...
class SomeTest extends AnotherTestCase { }
However, when I run
phpunit app/tests/SomeTest.php
I get the following error
PHP Fatal error: Class 'AnotherTestCase' not found in /[...]/app/tests/SomeTest.php on line 3
This is despite the fact that I have a class defined in
#File: app/tests/AnotherTestCase.php <?php class AnotherTestCase extends TestCase { }
This is confusing since phpunit automatically loads the TestCase class.
Do I need to manually require in custom base test classes, or is there a way to tell phpunit about my new base test class? In other words, why phpunit automatically loads TestCase but does not automatically load AnotherTestCase
source share