Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
730 views
in Technique[技术] by (71.8m points)

laravel - PHPunit Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration()

i don't know if it's related to Laravel 5.4. when i run phpunit command after installing laravel 5.4 without making any changes i get Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() but when i run php artisan dusk it runs normally

c:xampphtdocsublocker>phpunit
PHP Fatal error:  Uncaught Error: Call to undefined method
PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in C:xampphtdocsublockervendorphpunitphpunitsrcTextUITestRunner.php:1046
Stack trace:
#0 C:xampphtdocsublockervendorphpunitphpunitsrcTextUITestRunner.php(167): PHPUnit_TextUI_TestRunner->handleConfiguration(Array)
#1 C:xamppphppearPHPUnitTextUICommand.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#2 C:xamppphppearPHPUnitTextUICommand.php(129): PHPUnit_TextUI_Command->run(Array, true)
#3 C:xamppphpphpunit(46): PHPUnit_TextUI_Command::main()
#4 {main}
thrown in C:xampphtdocsublockervendorphpunitphpunitsrcTextUITestRunner.php on line 1046

Fatal error: Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in C:xampphtdocsublockervendorphpunitphpunitsrcTextUITestRunner.php:1046
Stack trace:
 C:xampphtdocsublockervendorphpunitphpunitsrcTextUITestRunner.php(167): PHPUnit_TextUI_TestRunner->handleConfiguration(Array)
C:xamppphppearPHPUnitTextUICommand.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
C:xamppphppearPHPUnitTextUICommand.php(129): PHPUnit_TextUI_Command->run(Array, true)
C:xamppphpphpunit(46): PHPUnit_TextUI_Command::main()
{main}
thrown in C:xampphtdocsublockervendorphpunitphpunitsrcTextUITestRunner.php on line 1046

c:xampphtdocsublocker>phpunit
PHP Fatal error:  Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in C:xampphtdocsublockervendorphpunitphpunitsrcTextUITestRunner.php:1046
Stack trace:
#0 C:xampphtdocsublockervendorphpunitphpunitsrcTextUITestRunner.php(167): PHPUnit_TextUI_TestRunner->handleConfiguration(Array)
#1 C:xamppphppearPHPUnitTextUICommand.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#2 C:xamppphppearPHPUnitTextUICommand.php(129): PHPUnit_TextUI_Command->run(Array, true)
#3 C:xamppphpphpunit(46): PHPUnit_TextUI_Command::main()
#4 {main}
thrown in C:xampphtdocsublockervendorphpunitphpunitsrcTextUITestRunner.php on line 1046

Fatal error: Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in C:xampphtdocsublockervendorphpunitphpunitsrcTextUITestRunner.php:1046
Stack trace:
#0    C:xampphtdocsublockervendorphpunitphpunitsrcTextUITestRunner.php(167): PHPUnit_TextUI_TestRunner->handleConfiguration(Array)
#1 C:xamppphppearPHPUnitTextUICommand.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#2 C:xamppphppearPHPUnitTextUICommand.php(129): PHPUnit_TextUI_Command->run(Array, true)
#3 C:xamppphpphpunit(46): PHPUnit_TextUI_Command::main()
#4 {main}
thrown in C:xampphtdocsublockervendorphpunitphpunitsrcTextUITestRunner.php on line 1046

c:xampphtdocsublocker>php artisan dusk
PHPUnit 5.7.7 by Sebastian Bergmann and contributors.

F.                                                                  2 / 2 (100%)

any ideas how to fix this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Seems like your version installed globally does not meet minimal required version. Try to run

phpunit --version

I bet you will get some like 5.1. The php artisan dusk command uses different version which is located in vendor/bin/phpunit. So, you are also able to use this version instead. Just type:

vendor/bin/phpunit

instead of phpunit. You have to upgrade your global phpunit version if it works.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...