I have a Base class that needs to be extended using controller tests:
//Base.php namespace AppBundle\Tests\System; abstract class Base extends \PHPUnit_Framework_TestCase { ... }
But when I try to expand it,
//DefaultControllerTest.php namespace AppBundle\Tests\Controller; use AppBundle\Tests\System\Base; class DefaultControllerTest extends Base { ... }
I get this error:
/usr/bin/php/tmp/ide-phpunit.php --configuration / server / project / phpunit.xml / server / project / src / AppBundle / Tests Testing started at 18:36 ... PHP Fatal error: Class' AppBundle \ Tests \ System \ Base 'not found in /server/project/src/AppBundle/Tests/Controller/DefaultControllerTest.php on line 7
Process terminated with exit code 255
PhpStorm detects the Base class in DefaultController.php , so it does not look like a typo.
This is my phpunit.xml :
<?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals = "false" backupStaticAttributes = "false" colors = "true" convertErrorsToExceptions = "true" convertNoticesToExceptions = "true" convertWarningsToExceptions = "true" processIsolation = "false" stopOnFailure = "false" syntaxCheck = "false" bootstrap = "app/bootstrap.php.cache" > <testsuites> <testsuite name="Tests"> <directory>src/AppBundle/Tests</directory> </testsuite> </testsuites> <php> <server name="KERNEL_DIR" value="app" /> </php> <groups> <exclude> <group>slow</group> </exclude> </groups> <filter> <whitelist> <directory>app</directory> <directory>src</directory> <exclude> <directory>app/cache/*</directory> <file>app/check.php</file> </exclude> </whitelist> </filter> </phpunit>
Any idea on what I am missing?
source share