运行 在 PhpStorm 中针对 Laravel Homestead vagrant VM 进行测试
Running tests in PhpStorm for Laravel Homestead vagrant VM
我根据以下内容全新安装了 Laravel Homestead:https://laravel.com/docs/master/homestead
以及使用 Laravel new 的全新项目。
我正在尝试 运行 通过 PhpStorm 的 "Run configurations" 进行示例测试,但我得到
vagrant:///Users/si/vagrant/Homestead/usr/bin/php /home/vagrant/.phpstorm_helpers/phpunit.php --no-configuration /home/vagrant/Code/homestead/tests
Testing started at 00:49 ...
Process finished with exit code 1
Cannot find PHPUnit in include path (.:/usr/share/php)
在 PhpStorm PHPUnit 设置中,我加载了 PHPUnit 库 "Use custom autoloader" 指向作曲家 autoload.php 文件,如下所示:
/Users/si/Code/homestead/vendor/autoload.php
作曲家在
添加了 PHPUnit 可执行文件
/Users/si/Code/homestead/vendor/bin/phpunit
当我告诉 PhpStorm 使用 composer autoload 来查找它时,我很困惑为什么 PhpStorm 找不到它。
好的,我解决了这个问题。我在 PHP 设置中添加了一个远程解释器,但仍在 PHP 单元设置中使用 'local' 设置。我在语言和框架 > PHP > PHP单位设置屏幕中添加了新的 PHP单位设置配置 'By Remote Interpreter'。
我选择了 'Use custom autoloader' 并指定了以下内容:
/home/vagrant/Code/homestead/vendor/autoload.php
我根据以下内容全新安装了 Laravel Homestead:https://laravel.com/docs/master/homestead
以及使用 Laravel new 的全新项目。
我正在尝试 运行 通过 PhpStorm 的 "Run configurations" 进行示例测试,但我得到
vagrant:///Users/si/vagrant/Homestead/usr/bin/php /home/vagrant/.phpstorm_helpers/phpunit.php --no-configuration /home/vagrant/Code/homestead/tests
Testing started at 00:49 ...
Process finished with exit code 1
Cannot find PHPUnit in include path (.:/usr/share/php)
在 PhpStorm PHPUnit 设置中,我加载了 PHPUnit 库 "Use custom autoloader" 指向作曲家 autoload.php 文件,如下所示:
/Users/si/Code/homestead/vendor/autoload.php
作曲家在
添加了 PHPUnit 可执行文件/Users/si/Code/homestead/vendor/bin/phpunit
当我告诉 PhpStorm 使用 composer autoload 来查找它时,我很困惑为什么 PhpStorm 找不到它。
好的,我解决了这个问题。我在 PHP 设置中添加了一个远程解释器,但仍在 PHP 单元设置中使用 'local' 设置。我在语言和框架 > PHP > PHP单位设置屏幕中添加了新的 PHP单位设置配置 'By Remote Interpreter'。
我选择了 'Use custom autoloader' 并指定了以下内容:
/home/vagrant/Code/homestead/vendor/autoload.php