迁移到Homestead后,在PhpStorm中为Laravel运行测试
我已经将我的项目从经典安装迁移到Homestead,如Laravel主页所述。除了我的测试用例之外,一切都正常 结果如下:迁移到Homestead后,在PhpStorm中为Laravel运行测试,php,laravel,phpunit,vagrant,phpstorm,Php,Laravel,Phpunit,Vagrant,Phpstorm,我已经将我的项目从经典安装迁移到Homestead,如Laravel主页所述。除了我的测试用例之外,一切都正常 结果如下: [vagrant:///Users/<username>/Homestead]:/usr/bin/php /home/vagrant/<projectname>/vendor/phpunit/phpunit/phpunit --configuration /home/vagrant/<projectname>/phpunit.xml --
[vagrant:///Users/<username>/Homestead]:/usr/bin/php /home/vagrant/<projectname>/vendor/phpunit/phpunit/phpunit --configuration /home/vagrant/<projectname>/phpunit.xml --filter Tests\\Feature\\LoggingTest --test-suffix LoggingTest.php /Users/<username>/projects/<projectname>/tests/Feature --teamcity
Cannot open file "/Users/<username>/projects/<projectname>/tests/Feature.php".
[vagrant:///Users//Homestead]:/usr/bin/php/home/vagrant//vendor/phpunit/phpunit/phpunit--configuration/home/vagrant//phpunit.xml--filter Tests\\Feature\\LoggingTest--test后缀LoggingTest.php/Users//projects//Tests/Feature teamcity
无法打开文件“/Users//projects//tests/Feature.php”。
所以我的问题是,我在PhpStorm中从哪里更改最后一条路径
/Users/<username>/projects/<projectname>/tests/Feature
/Users//projects//tests/Feature
到
/home/vagrant//tests/Feature
或者最好完全删除它,因为该文件根本不存在
测试在迁移之前运行良好,那么我错过了什么呢
这是我的家园。亚马尔:
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: parallels
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/projects/<projectname>
to: /home/vagrant/<projectname>
type: "nfs"
- map: ~/projects/php
to: /home/vagrant/php
type: "nfs"
sites:
- map: homestead.local
to: /home/vagrant/<projectname>/public
type: "laravel"
databases:
- <correct_database_name>
features:
- mysql: true
- mariadb: false
- ohmyzsh: true
- webdriver: false
ip:“192.168.10.10”
内存:2048
中央处理器:2
提供者:parallels
授权:~/.ssh/id\u rsa.pub
钥匙:
-~/.ssh/id\u rsa
文件夹:
-地图:~/projects/
回家/流浪/
类型:“nfs”
-映射:~/projects/php
至:/home/vagrant/php
类型:“nfs”
地点:
-地图:homestead.local
致:/home/流浪者//公众
类型:“laravel”
数据库:
-
特征:
-mysql:是的
-马里亚布:错
-ohmyzsh:是的
-webdriver:false
解决方案是将tests目录添加到PHPStorm首选项中的路径映射中
转到:
首选项->语言和框架->PHP
然后卸载“路径映射:”单击文件夹图标
通过加号按钮手动添加本地路径:
/Users/<username>/projects/<projectname>/tests
/Users//projects//tests
和远程路径:
/home/vagrant/<projectname>/tests
/home/vagrant//测试
/home/vagrant/<projectname>/tests