gpt4 book ai didi

phpunit 无法在全新安装的 laravel 5.7 上运行

转载 作者:行者123 更新时间:2023-11-28 20:18:38 24 4
gpt4 key购买 nike

我在使用新安装的 Laravel 时遇到问题。

当我尝试使用 phpunit 命令运行默认的 ExampleTest.php 时,我得到了这个错误:

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!

有人可以帮我解决吗?

最佳答案

这里的问题是您正在运行安装在您的系统上的 PHPUnit,该系统非常旧,而不是应该为该项目运行的 PHPUnit。

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

vendor/bin/phpunit

vendor/bin/phpunit.bat

关于phpunit 无法在全新安装的 laravel 5.7 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54631099/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com