I have a 2 files in my controller and here is the folder list
-controller (folder)
- AbstractTestCase.php
- PatientControllerTest.php
In my AbstractWebtestCase.php
namespace AdminBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
abstract class AbstractTestCase extends WebTestCase{}
In my PatientControllerTest.php
use AdminBundle\Tests\Controller\AbstractTestCase;
class PatientControllerTest extends AbstractTestCase {}
I inherit the AbstractTestCase in SpecializationControllerTest when the time I run phpunit I get this error
PHP Fatal error: Class 'AdminBundle\Tests\Controller\AbstractTestCase' not found in /Users/helloworld/Projects/sample/src/AdminBundle/Tests/Contoller/PatientControllerTest.php on line 11
Why is it I can't inherit it? but when I separate it to other it works.
AbstractTestCase.phpbut your file is namedAbstractWebtestCase.phpPatientControllerTestis in the same namespace asAbstractTestCase, you don't need ausestatement to import the symbolcomposer dump-autoload -oautoload.phpin your PHPUnit bootstrap file