Closed MalteWunsch closed 9 years ago
How does your phpunit.xml
look like?
This is an example configuration depending on the Symfony Standard Edition:
<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="Functional App Tests">
<directory>Tests</directory>
<directory>../vendor/webfactory/symfony-application-tests/src/Webfactory/Tests/</directory>
</testsuite>
</testsuites>
</phpunit>
It uses Symfony's autoload file, which configures annotation loading properly.
Thank you, that does the trick! I had bootstrap = "vendor/autoload.php"
.
Do you think this might be a mistake common enough to mention it in the readme? I tend to say no, as the default value is fine and anybody changing that should know what they're doing :smile:
Where does the bootstrap.php.cache come from?
@mpdude In vanilla Symfony, the generated bootstrap.php.cache contains definitions of many core classes to reduce disc I/O and therefore increase performance. Here, it is used slightly different for bootstrapping the loading of required classes.
After configuring PHPUnit to use the newly installed tests, I get failures like this:
Same with the autoloading of the
@Doctrine\ORM\Mapping\Entity
annotation.