Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


By default, Sonar runs PHPUnit. To configure the execution of PHPUnit, you can set the following properties:



Default value


sonar.phpUnit.configuration Read configuration from XML file. Recommended way to configure the tests that should be launched.



If true, PHPUnit will ignore any phpunit.xml file for launching the unit tests.
If false, PHPUnit will use any existing phpunit.xml file in the running directory.



The project main test file including the relative path, ie: "/source/tests/AllTests.php". If not present, PHPUnit will look for phpunit.xml file in the test directory.



Ignore the unit tests files matching this pattern.



Use this bootsrap file to initialize the unit tests.


If true, Sonar PHP will append test directory to PHPUnit. This will make PHPUnit look for test cases inside this directory. If several directories are defined as test directories, a phpunitRANDOM.xml file will be generated and passed to phpunit --configuration=. This generated file will contain all files inside the test directories. Only runs tests from the specified group(s).
sonar.phpUnit.loader To specify which TestSuiteLoader implementation to use.