Docker + PHPUnit

I've got my project set up using Docker Compose. I've configured PHPStorm to use PHPunit within my container.

I can start a debug session and it fires up PHPUnit correctly and I can step through the code. 

The tests execute correctly, however, when PHPUnit exits using

exit(self::SUCCESS_EXIT);

What I get in PHPStorm is

Testing started at 23:52 ...
docker-compose://[/Users/david/Projects/Yukon/yukon-mvp/docker-compose.yml]:web//opt/remi/php72/root/usr/bin/php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=10200 -dxdebug.remote_host=192.168.1.1 /opt/taso/vendor/phpunit/phpunit/phpunit --no-configuration --filter "/(::test_login)( .*)?$/" SimpleTest /opt/taso/tests/Simple.Test.php --teamcity

Process finished with exit code 120

and the event log says:

23:52 Tests passed: 0

There's no output anywhere from PHPUnit.

Also, if I run the test instead of debugging, it just hangs on the docker-composer:// command.

Can anyone shed any light on why this might be? I'm so close to getting this config working, it's really frustrating to not see the results.

1
3 comments

Please try updating to 2018.1.1 and check again

0
Avatar
Permanently deleted user

I have the same issue and updating to 2018.1.1 did not change anything. (OSX, Docker for Mac)

Within the docker tab (or in the terminal when manually starting docker-compose) I can see phpunit's output, but the tests tab does not show any results.

1

I solved it by using the Docker setting in the Command Line Interpreter options rather than Docker compose.

1

Please sign in to leave a comment.