I don't understand why PHPStorm does not see cv
tool when I call "run" or "debug" the class from extension:
cv: not found PHP Fatal error: Uncaught RuntimeException: Command failed (cv php:boot --level=classloader)
I can use cv
tool when I'm on vagrant machine (vagrant up, vagrant ssh, cv --version)
However I can run the test directly from vagrant machine. I also can debug any civicrm form called by browser (remote debugging).
My setup:
- civicrm-buildkit-vagrant on virtualbox
- cv version v0.1.29
- PHP7.1 + PHPUnit 4.8.36 + xdebug 2.6.0
- PHPStorm 2018.1
- runner is configured for extension (configuration and bootstrap file)
Languages & Frameworks > PHP:
Languages & Frameworks > PHP > Test Frameworks:
Remote CLI Interpreters:
vagrant:///home/tomasz/cividev/usr/bin/php7.1 /home/vagrant/.phpstorm_helpers/phpunit.php --bootstrap
/srv/www/wemove/sites/default/files/civicrm/ext/eu.wemove.gidipirus/tests/phpunit/bootstrap.php --configuration /srv/www/wemove/sites/default/files/civicrm/ext/eu.wemove.gidipirus/phpunit.xml.dist CRM_Gidipirus_BaseTest /srv/www/wemove/sites/default/files/civicrm/ext/eu.wemove.gidipirus/tests/phpunit/CRM/Gidipirus/BaseTest.php sh: 1: cv: not found PHP Fatal error: Uncaught RuntimeException: Command failed (cv php:boot --level=classloader): in /srv/www/wemove/sites/default/files/civicrm/ext/eu.wemove.gidipirus/tests/phpunit/bootstrap.php:31 Stack trace: #0 /srv/www/wemove/sites/default/files/civicrm/ext/eu.wemove.gidipirus/tests/phpunit/bootstrap.php(6): cv('cv php:boot --l...', 'phpcode') #1 phar:///srv/config/phpunit-4.8.36.phar/phpunit/Util/Fileloader.php(56): include_once('/srv/www/wemove...') #2 phar:///srv/config/phpunit-4.8.36.phar/phpunit/Util/Fileloader.php(38): PHPUnit_Util_Fileloader::load('/srv/www/wemove...') #3 phar:///srv/config/phpunit-4.8.36.phar/phpunit/TextUI/Command.php(779): PHPUnit_Util_Fileloader::checkAndLoad('/srv/www/wemove...') #4 phar:///srv/config/phpunit-4.8.36.phar/phpunit/TextUI/Command.php(596): PHPUnit_TextUI_Command->handleBootstrap('/srv/www/wemove...') #5 /home/vagrant/.phpstorm_helpers/phpunit.php(304): PHPUnit_TextUI_Command->handleArguments(Array) #6 phar:///srv/config/phpunit-4.8.36.phar/phpunit/TextUI/Command.php(111): IDE_Base in /srv/www/wemove/sites/default/files/civicrm/ext/eu.wemove.gidipirus/tests/phpunit/bootstrap.php on line 31
Process finished with exit code 255
I know there is a How do I run PHP Unit Tests w/ XDEBUG from within PHPStorm [on Mac]? question but there is a standard installation of civicrm by buildkit, not by whole vagrant script.
Any ideas? Thanks in advance.