Running PhpUnit inside Docker from PhpStorm : could not read phpunit.xml

Hello there !

I am trying to setup my PhpStorm so that I can run PhpUnit from it.

Here is my setup :

When I try to run my tests (litterally by right-clicking on my test folder and choosing "Run tests : PhpUnit"), I get this output :

About my docker config : I already have integrated other features inside my container (like PhpStan or Psalm) and they work like a charm. I should also point out that when I copy/paste the command PhpStorm is displaying (php /srv/..../phpunit --config ..... --teamcity) in my docker bash, it works like a charm.

So why would be the issue, so that PhpStorm couldn't read my config file ?

Best regards,

Comment actions Permalink

According to the -v mappings in the Docker container field, you are mapping the project root to /opt/project and not to /srv/project.

Given that phpunit.xml is located in the project root's tests subfolder, its path should be /opt/project/tests/phpunit.xml and not /srv/project/tests/phpunit.xml.

Comment actions Permalink

I edited the settings following your instructions and it worked.

Thanks for your help and for the amazing software :)


Comment actions Permalink

Great! Thank you for the update, I am happy you got it sorted!


Please sign in to leave a comment.