I want to configure my PhpStorm IDE to run PHPUnit tests within my Docker container.
It seems like I'm restricted to either using a local PHP executable, or one through SSH, as the interpreter for the tests.
I could install an SSH service on my PHP container, but it seems like a bit of a hacky solution, and articles online discourage installing an SSH service on containers.
To try and get a local interpreter working, I tried creating a bash script that would proxy calls to PHP within the container, like this:
#!/usr/bin/env bash
# Run PHP through Docker
docker exec -t mycontainer_php_1 php "$@"
This works perfectly when I run it myself, but when I point PhpStorm to it as a local PHP interpreter, it doesn't recognize it as a valid PHP executable.
So what's a good way to get this working?
--version. Are you saying I should try and trick PHPStorm by pointing it to a real local php interpreter so it recognizes it, then swap it out for the bash script? I have PHPStorm 10 installed, but it appears that the only Docker features it has is deployment related.