2016-05-13 147 views
1

我正在處理流浪者/家園,並配置了一個盒子。啓用PhpStorm上的Laravel/Homestead PHPUnit 2016.1至

我可以在PhpStorm中啓用Xdebug!

現在,我想啓用PHPUnit的,但我不能這樣做...

我跟着幾個教程: https://blog.mayflower.de/5274-Run-your-tests-with-PHPStorm-on-your-vagrant-box.html https://confluence.jetbrains.com/display/PhpStorm/Running+PHPUnit+tests+over+SSH+on+a+remote+server+with+PhpStorm 這裏是我的設置:

Php 7 Interpreter Via Vagrant

Php 7 Interpreter

Server

Phpunit

Configuration

這裏是代碼覆蓋率

vagrant:///Users/julien/Homestead/usr/bin/php -dxdebug.coverage_enable=1 /home/vagrant/.phpstorm_helpers/phpunit.php --coverage-clover /home/vagrant/.phpstorm_helpers/coverage/Laravel_PhpUnit.coverage -- configuration /home/vagrant/Code/vendor/autoload.php /Users/julien/Documents/Proyectos/laravel/tests/functional 
Testing started at 11:12 AM ... 


bash: line 0: cd: /Users/julien/Documents/Proyectos/laravel/tests/functional: No such file or directory 
PHP Fatal error: Uncaught UnexpectedValueException: Cannot create phar '/home/vagrant/Code/vendor/bin', file extension (or combination) not recognised or the directory does not exist in /home/vagrant/.phpstorm_helpers/phpunit.php:181 
Stack trace: 
Fatal error: Uncaught UnexpectedValueException: Cannot create phar '/home/vagrant/Code/vendor/bin', file extension (or combination) not recognised or the directory does not exist in /home/vagrant/.phpstorm_helpers/phpunit.php on line 181#0 /home/vagrant/.phpstorm_helpers/phpunit.php(181): Phar- >__construct('/home/vagrant/C...') 

#1 /home/vagrant/.phpstorm_helpers/phpunit.php(250): IDE_PHPUnit_Loader::init() 

#2 {main} 
UnexpectedValueException: Cannot create phar '/home/vagrant/Code/vendor/bin', file extension (or combination) not recognised or the directory does not exist in /home/vagrant/.phpstorm_helpers/phpunit.php on line 181 
thrown in /home/vagrant/.phpstorm_helpers/phpunit.php on line 181 

Call Stack: 
0.0006  442920 1. {main}() /home/vagrant/.phpstorm_helpers/phpunit.php:0 
0.0006  442920 2. IDE_PHPUnit_Loader::init() /home/vagrant/.phpstorm_helpers/phpunit.php:250 
0.0006  451168 3. Phar->__construct() /home/vagrant/.phpstorm_helpers/phpunit.php:181 


Process finished with exit code 255 

回答

1

運行PHPUnit時設置了PhpStorm和PHPUnit的流浪漢可以是一個有點令人生畏,因爲它真的不是我收到消息那直接...從你的控制檯輸出我會說你的解釋器設置不正確,因爲它在你的本地機器上執行PHP。

總是對我有效的方式是將vagrant設置爲SFTP部署配置並將該配置用作PHP解釋器。正如你已經在使用Homesteasd,這些教程可以擺脫一些更多的光線進入設置:

以下是主要部分:

Set interpreter Configure STFP Deployment Configure path mappings Configure PHPUnit