Sonar + PHP Unit

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Sonar + PHP Unit

Emiliano Bacci

Hello,

my company is attempting to use Sonar and Maven to manage PHP-based web projects.

Since we have to deploy the projects in different environments, we have taken advantage of the resource filtering capabilities of Maven so to create different installations based on Maven profiles.

 

Now, the project layout is as follows:

·         Src

o   Main

§  Php

§  Resources

o   Test

§  Php

§  Resources

o   Site

 

All resources (both folders) are filtered before being copied to the target folder.

The command mvn test (through PHP Maven plugin) makes PHPUnit work on the folder target/test-classes.

However, mvn sonar:sonar invokes PHPUnit on the maven testSourceDirectory, so the test obsiously fail because any reference to the resources is invalid.

 

In my understanding Sonar plugin should invoke PHPUnit on target/test-classes, do you agree with me?

Actually I have not found any way to achieve this.

Can you help me in this?

 

Thanks for your support,

 

Emiliano Bacci