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,
请先登录再写评论。
According to the
-vmappings in theDocker containerfield, you are mapping the project root to/opt/projectand not to/srv/project.Given that
phpunit.xmlis located in the project root'stestssubfolder, its path should be/opt/project/tests/phpunit.xmland not/srv/project/tests/phpunit.xml.I edited the settings following your instructions and it worked.
Thanks for your help and for the amazing software :)
Great! Thank you for the update, I am happy you got it sorted!