致命错误:在(laravel)Php Storm中找不到类"TestCase" [英] Fatal error: Class 'TestCase' not found in (laravel) Php Storm

查看:409
本文介绍了致命错误:在(laravel)Php Storm中找不到类"TestCase"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆