Hello everyone PhpUnit installed in my Symfony3 project, and when I run the terminal application bin / phpunit -c, I get this error:
Could not load XML from empty string
I got to Google, and it turned out that I need to attach the phpunit.xml file in my app / directory so that it looks like this:
<?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 = "autoload.php" >
<testsuites>
<testsuite name="Project Test Suite">
<directory>../src/*/*Bundle/Tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>../src</directory>
<exclude>
<directory>../src/*/*Bundle/Resources</directory>
<directory>../src/*/*Bundle/Tests</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
So, now it works fine, but the questions that I cannot find answers to are the following:
Why does the php module need this file, I see that the file shows phpunit where to look for tests, but is that all?
I created this file manually to create it automatically using the terminal command.
As far as I understand, <whitelist>where is phpunit allowed to "watch"? and <exlude>, where phpunit is not allowed to "watch"? and if so, why would it <directory>../src/*/*Bundle/Tests</directory>be in <exlude>, if that's where the test is.