phpunit - PHP Fatal error: Uncaught Error: Call to undefined method PHPUnit\Util\Configuration::getExtensionConfiguration()
问题描述
I am trying to follow the instructions here https://laravel.com/docs/5.6/testing. On the Environment section here what I did.
php artisan env --env=testing
and then run
phpunit
but after that, this message show up
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
What is that mean? and what I should do about it?
I have no idea since its the first time running laravel test
解决方案
If just phpunit
works that means that you have a global installation of PHPUnit. You probably want to use vendor/bin/phpunit
instead.
推荐阅读
- tooltip - 在散景的悬停工具中显示情节图例-我得到“???” 当我在工具提示中使用“$name”关键字时
- javascript - 更改单选按钮Angular 11的文本颜色
- macos - 为什么 micro 需要 sudo 才能在 Mac 上工作?
- python - Django - 将函数值保存到每个模型实例
- angular - 为什么样式不适用于动态创建容器?
- woocommerce - 单击继续付款按钮后,如何在结帐页面上显示消息?
- typescript - 等效类型但在使用可选索引签名时不可分配:为什么?
- javascript - 有人可以告诉我如何在游戏结束后显示按钮吗?
- android - 如何使用 RecyclerView 显示下载列表?
- javascript - 将 html 选择下拉列表转换为单个按钮导航栏