简体   繁体   中英

PHPStorm 8.0.3 and Remote ssh phpunit bug

I was following this official tutorial on how to run phpunit tests via ssh to another server. Everything went fine, until I actually created test configuration and tried to run the test. The error that I'm getting is this:

ssh://root@172.17.0.1:22/usr/bin/php /root/.phpstorm_helpers/phpunit.php --no-configuration /opt/container/www/app/lib/tests
Testing started at 19.51 ...
bash: line 0: cd: /opt/container/www/app/lib: No such file or directory
Cannot open file "/opt/container/www/app/lib/tests.php".

So I figured that actually the problem is in the path to the test folder. But this is the thing, in this dialog:

https://confluence.jetbrains.com/download/attachments/53345260/test-configuration.png?version=1&modificationDate=1401444064000

directory of the test folder must be located using the local file system, but the actual test folder is on the remote machine and has a different path. As a test, I created '/opt/container/www/app/lib/tests' path on remote server, and voila, phpunit is running successfully. So, the point is that I can't put in the Directory input box the real location of the test folder on remote server, and the tutorial doesn't say nothing about that. Did I miss somethimg, or this is really a bug ?

EDIT: Here is my current configuration:

http://i.imgur.com/5BnTrZZ.png

where directory points to the directory on local file system

Remote interpreter configured:

在此处输入图片说明

And

在此处输入图片说明

I was able actually to select autload.php from remote server.

For anyone having in PHPStorm error like:

PHP Fatal error: Uncaught PHPUnit_Framework_Exception: Class ... not found...

You have to install phpunit by composer on project level:

  • by add phpunit to project composer.json file in require-dev section and run composer update ,
  • by run composer require phpunit/phpunit in project root directory,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM