The issue is the unit tests are restricted to be run by "apache" user and the way I run them from the command line is:
sudo -u apache phpunit tests/EmailFunctionsLargeTest.php --stop-on-failure
and it works, but how do I simulate the sudo -u apache phpunit
when using PhpStorm?
P.S.
PhpStorm runs the tests as vagrant user...
Not possible yet. Feel free to add your scenario as a comment to https://youtrack.jetbrains.com/issue/WI-38656
Create a file php_wrapper.sh at /home/vagrant/php_wrapper.sh
with below contents:
#!/bin/bash
sudo /usr/bin/php $@
Replace the command with sudo -u apache $@
if you want.
In your PhpStorm setup the remote interpreter as shown in the below screenshot. When you run phpunit, it uses the php_wrapper.sh as a PHP executable and runs seamlessly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With