phpunit无法在laravel 5.7的全新安装上工作

问题描述:

我刚安装的Laravel出现问题.

I'm having a problem with my freshly installed Laravel.

当我尝试使用phpunit命令运行默认的ExampleTest.php时,出现此错误:

when I'm trying to use phpunit command to run default ExampleTest.php , I got this error :

D:\Laravel\Rahimi0151>phpunit
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 277

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 277
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 285

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PHPUnit\TextUI\Command.php on line 285
PHPUnit 3.7.21 by Sebastian Bergmann.

Configuration read from D:\Laravel\Rahimi0151\phpunit.xml



Time: 0 seconds, Memory: 4.00Mb

[30;43m[2KNo tests executed!
[0m[2K

在底部说:

No tests executed!

有人可以帮助我解决问题吗?

Can someone please help me with a solution?

此处的问题是您正在运行的系统上安装的PHPUnit相当老,而不是应为此项目运行的PHPUnit.

The problem here is that you are running PHPUnit installed on your system that is pretty old and not PHPUnit that should be run for this project.

要确保您运行的是为该项目安装的PHPUnit,您应该运行:

To make sure you run the PHPUnit that is really installed for this project you should rather run:

vendor/bin/phpunit

vendor/bin/phpunit.bat