I added a simple test to a bundle.
As suggested in the manual I tried to have PHPUnit load the configuration with:
phpunit -c /app
phpunit.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit
backupGlobals = "false"
backupStaticAttributes = "false"
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
syntaxCheck = "false"
bootstrap = "bootstrap.php.cache" >
<testsuites>
<testsuite name="Project Test Suite">
<directory>../src/*Bundle/Tests</directory>
</testsuite>
</testsuites>
</phpunit>
The error message I get is:
root@h0x03:/var/www/fi/FrontendIntegrator# phpunit -c app/
PHP Fatal error: Uncaught exception 'PHPUnit_Framework_Exception' with message 'Neither "Project Test Suite.php" nor "Project Test Suite.php" could be opened.' in /usr/share/php/PHPUnit/Util/Skeleton/Test.php:102
Stack trace:
#0 /usr/share/php/PHPUnit/TextUI/Command.php(157): PHPUnit_Util_Skeleton_Test->__construct('Project Test Su...', '')
#1 /usr/share/php/PHPUnit/TextUI/Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#2 /usr/bin/phpunit(49): PHPUnit_TextUI_Command::main()
#3 {main}
thrown in /usr/share/php/PHPUnit/Util/Skeleton/Test.php on line 102
PHPUnit apparently loads the file and tries to find a PHP-file named after the test suites name. I cannot find any information on why it does so or how such a file should look like.
It seems like PHPUnit tries to find a file named after the name-attribute of the testsuite-tag
if it either cannot find any tests (wrong naming or wrong directory) or
if there is a fatal error occuring in a test-script; which occures so early that PHPUnit cannot identify the content of that file as a test - as no class could be loaded up until that point.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With