致命错误:在(laravel)Php Storm中找不到类"TestCase" [英] Fatal error: Class 'TestCase' not found in (laravel) Php Storm
问题描述
我从composer创建了一个laravel框架的新副本,并且在PHP Storm上运行时,我在PHP Storm中遇到了此错误
I create a laravel framework fresh copy from composer and when run on PHP Storm i m facing this error in PHP Storm
严重错误:找不到"TestCase"类 第3行上的C:\ xampp \ htdocs \ testproject \ app \ tests \ ExampleTest.php
Fatal error: Class 'TestCase' not found in C:\xampp\htdocs\testproject\app\tests\ExampleTest.php on line 3
cd C:\ xampp \ htdocs \ testproject当前工作目录为 'C:\ xampp \ htdocs \ testproject'.
cd C:\xampp\htdocs\testproject Current working directory is 'C:\xampp\htdocs\testproject'.
phpunit
无法运行程序"phpunit"
(在目录"C:\xampp\htdocs\testproject"
中):CreateProcess错误= 2,系统找不到指定的文件
Cannot run program "phpunit"
(in directory "C:\xampp\htdocs\testproject"
): CreateProcess error=2, The system cannot find the file specified
推荐答案
我过去在Laravel 4和5中遇到了这个问题.结果是我的composer.json中没有这个问题.
I had this problem in the past with Laravel 4 and 5. Turns out I was missing this in my composer.json.
Laravel 5:
"autoload-dev": {
"classmap": [ "tests/TestCase.php" ]
},
Laravel 4:
"autoload-dev": {
"classmap": [ "app/tests/TestCase.php" ]
},
这篇关于致命错误:在(laravel)Php Storm中找不到类"TestCase"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!