Laravel 5:致命错误:[关闭]中找不到类'TestCase'

http://localhost/laravel/tests/ExampleTest.php if i run laravel it shows the following error

Fatal error: Class 'TestCase' not found in /var/www/html/laravel/tests/ExampleTest.php on line 3

To run tests you should install phpunit:

wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit

Then cd to the project folder and run phpunit:

cd /var/www/html/laravel/
phpunit

Output should be something like this:

PHPUnit 5.1.3 by Sebastian Bergmann and contributors.

.........E.....................EEEEE 36 / 36 (100%)

Time: 1.84 seconds, Memory: 104.02Mb

You can not run your tests from the web browser, you need to use PHPUnit on the command line instead.

Are you using Homestead? If so you will have PHPUnit installed on that machine.

Laravel specific testing information can be found here and PHPUnit docs can be found here.