phpunit - PHP fatal error :未捕获错误:调用未定义的方法 PHPUnit\Util\Configuration::getExtensionConfiguration()

标签 phpunit laravel-5.6

我正在尝试按照此处的说明进行操作 https://laravel.com/docs/5.6/testing 。在环境部分我做了什么。

php artisan env --env=testing

然后运行

phpunit

但之后,此消息出现

PHP Fatal error:  Uncaught Error: Call to undefined method PHPUnit\Util\Configuration::getExtensionConfiguration() in /mnt/c/projects/www/janicalizdotcom/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:953
Stack trace:
#0 /mnt/c/projects/www/janicalizdotcom/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(153): PHPUnit\TextUI\TestRunner->handleConfiguration(Array)
#1 /usr/share/php/PHPUnit/TextUI/Command.php(195): PHPUnit\TextUI\TestRunner->doRun(Object(PHPUnit\Framework\TestSuite), Array, true)
#2 /usr/share/php/PHPUnit/TextUI/Command.php(148): PHPUnit\TextUI\Command->run(Array, true)
#3 /usr/bin/phpunit(34): PHPUnit\TextUI\Command::main()
#4 {main}
  thrown in /mnt/c/projects/www/janicalizdotcom/vendor/phpunit/phpunit/src/TextUI/TestRunner.php on line 953

这是什么意思?我该怎么办?

自从第一次运行 laravel 测试以来我不知道

最佳答案

如果 phpunit 有效,则意味着您已经全局安装了 PHPUnit。您可能想使用 vendor/bin/phpunit 来代替。

关于phpunit - PHP fatal error :未捕获错误:调用未定义的方法 PHPUnit\Util\Configuration::getExtensionConfiguration(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51617371/

相关文章:

php - 确定对象是否是 PHPUnit 模拟对象

php - Laravel 5.6 Ajax 发布数据

php - Laravel Socialite - 谷歌登录失败 “Missing required parameter: code”

vue.js - Laravel 5.6 Passport 驱动程序无法在 socket.io 中运行并给出未经授权的异常

selenium - phpunit Selenium 用法

php - 如何在 PHPUnit 中模拟 MongoClient

php - 确定将在 php 中发送的 http 状态

laravel - Xdebug 断点总是有效,除非使用 @runTestsInSeparateProcesses 时?

php - Laravel 5.6-禁用错误

php - 如何使用 logrotate 在 Laravel 中旋转日志?