2016-05-13 54 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