I have problems with running PHPUnit tests using phpunit.xml
file. I configured remote PHP interpreter like this:
This configuration allows me to debug PHP Web Application. I have the problem trying to debug PHPUnit scripts. I configured it like this:
With such configuration I can debug PHPUnit tests:
The problem is that my PHPUnit file is not read and my environment variables are not used. As a result I got some errors like CSRF Token Validation exceptions in my tests.
How do I use my phpunit.xml
file? I can see I can add default configuration file in PHPUnit configuration. I need to specify there my project directory, not the phpunit.xml itself
.
I can see in PHPUnit's Command->handleArguments()
function there are only two ways to load this file. I can either specify the directory where phpunit.xml
is located or don't use --no-configuration
option.
Unfortunately when I specify the directory where my project is located as location of phpunit.xml
, I loose the ability to debug my tests. What's interesting, I can still debug PHPUnit scripts (for example Command.php file).
I'd like not to add --no-configuration
option in IntelliJ (PhpStorm), but it is automatically added when the field "Default configuration file" is not selected.
How do I load phpunit.xml
file without loosing ability to debug my tests?