Details
Description
Running mvn sonar:sonar with sonar.dynamicAnalysis=true generates the following phpunit command
'phpunit.bat --log-junit=$
{basedir}\target\logs\phpunit.xml --coverage-clover=${basedir}\target\logs\ <mavenProjectName> <testDir>
where mavenProjectName is the value of project>name tag
and testDir is the value of project>properties>sonar.phpUnit.mainTestClass tag
of the pom.xml file
Removing mavenProjectName (from phpunit command line) would make multiple tests files projects working.
Issue Links
- is related to
-
SONARPLUGINS-748
Support test-directory based PHPUnit tests when 'AllTests.php' is not defined.
-
please remove the execution of tools in the Sonar plugin.
the sonar plugin should depends on the php-maven-plugin: http://www.php-maven.org/phpunit-mojo.html
So unit tests should be executed by "php:unit"
It's better to have "execution of tools" inside the php-maven-plugin, because you can execute these tools without sonar (in Hudson for example).
.Net plugin do it like that:
It will also reduce the support, because you will fix bugs in one place only (instead of fixing phpunit plugin in Sonar AND php-maven-plugin)