Reputation: 406
I'm very new to Sonar, so I might be skipping something obvious :-/.
My problem is: I configured Sonar nearly correctly, many things work but not PHPUnit.
I installed the PHP Plugin but when I run sonar-runner -e or -X
, PHP CodeSniffer is run, PHP Mess Detector is run, ..., but not PHPUnit.
Project settings like sonar.phpUnit.skip
are the default ones (meaning it's configured to run).
There is nothing related to PHPUnit in my sonar-project.properties
file in my project root folder.
phpunit.xml.dist
file (while adapting file-paths to test files) around because at first it was in a subfolder of my project but it didn't work either.PHPUnit works on the box'es command-line with the command named
phpunit
and also with using it's switches like phpunit -c path/to/my/phpunit.xml.dist
/ folder
Upvotes: 0
Views: 1759
Reputation: 795
I had the same problem after upgrading to sonar 3.7 and it seems to be fixed when I explicitly define the test source directories in sonar-project.properties :
sonar.tests=src/path/to/test
The runner logs will show something like this :
23:02:59.370 INFO - Sensor PHPUnit Sensor...
This works as well when sonar is in "analyze only" mode and reading existing test and coverage report files.
Upvotes: 2