Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:\xampp\htdocs\ublocker>phpunit
PHP Fatal error:  Uncaught Error: Call to undefined method
PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in C:\xampp\htdocs\ublocker\vendor\phpunit\phpunit\src\TextUI\TestRunner.php:1046
Stack trace:
#0 C:\xampp\htdocs\ublocker\vendor\phpunit\phpunit\src\TextUI\TestRunner.php(167): PHPUnit_TextUI_TestRunner->handleConfiguration(Array)
#1 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#2 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#3 C:\xampp\php\phpunit(46): PHPUnit_TextUI_Command::main()
#4 {main}
thrown in C:\xampp\htdocs\ublocker\vendor\phpunit\phpunit\src\TextUI\TestRunner.php on line 1046

Fatal error: Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in C:\xampp\htdocs\ublocker\vendor\phpunit\phpunit\src\TextUI\TestRunner.php:1046
Stack trace:
 C:\xampp\htdocs\ublocker\vendor\phpunit\phpunit\src\TextUI\TestRunner.php(167): PHPUnit_TextUI_TestRunner->handleConfiguration(Array)
C:\xampp\php\pear\PHPUnit\TextUI\Command.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
C:\xampp\php\pear\PHPUnit\TextUI\Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
C:\xampp\php\phpunit(46): PHPUnit_TextUI_Command::main()
{main}
thrown in C:\xampp\htdocs\ublocker\vendor\phpunit\phpunit\src\TextUI\TestRunner.php on line 1046

c:\xampp\htdocs\ublocker>phpunit
PHP Fatal error:  Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in C:\xampp\htdocs\ublocker\vendor\phpunit\phpunit\src\TextUI\TestRunner.php:1046
Stack trace:
#0 C:\xampp\htdocs\ublocker\vendor\phpunit\phpunit\src\TextUI\TestRunner.php(167): PHPUnit_TextUI_TestRunner->handleConfiguration(Array)
#1 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#2 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#3 C:\xampp\php\phpunit(46): PHPUnit_TextUI_Command::main()
#4 {main}
thrown in C:\xampp\htdocs\ublocker\vendor\phpunit\phpunit\src\TextUI\TestRunner.php on line 1046

Fatal error: Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in C:\xampp\htdocs\ublocker\vendor\phpunit\phpunit\src\TextUI\TestRunner.php:1046
Stack trace:
#0    C:\xampp\htdocs\ublocker\vendor\phpunit\phpunit\src\TextUI\TestRunner.php(167): PHPUnit_TextUI_TestRunner->handleConfiguration(Array)
#1 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#2 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#3 C:\xampp\php\phpunit(46): PHPUnit_TextUI_Command::main()
#4 {main}
thrown in C:\xampp\htdocs\ublocker\vendor\phpunit\phpunit\src\TextUI\TestRunner.php on line 1046

c:\xampp\htdocs\ublocker>php artisan dusk
PHPUnit 5.7.7 by Sebastian Bergmann and contributors.

F.                                                                  2 / 2 (100%)

any ideas how to fix this?

like image 276
ishadif Avatar asked Jan 26 '17 06:01

ishadif


4 Answers

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.

like image 188
arku Avatar answered Nov 02 '22 09:11

arku


In my case the following command worked in windows environment, with \ in place of /:

vendor\bin\phpunit
like image 34
Taranjeet Singh Avatar answered Nov 02 '22 09:11

Taranjeet Singh


Had the same problem at Laravel 5.4. This worked for me.

Step 1: update your composer

composer update

Step 2: run the phpunit

vendor/bin/phpunit

You can run a specific test by specifying the file

vendor/bin/phpunit tests/Feature/ExampleTest.php
like image 8
mpalencia Avatar answered Nov 02 '22 09:11

mpalencia


I have same issue ans solved with this step :

Check diff version

$ phpunit --version
PHPUnit 6.5.5 by Sebastian Bergmann and contributors.

$ ./vendor/bin/phpunit --version
PHPUnit 8.3.5 by Sebastian Bergmann and contributors.

Update global phpunit:

if versions not equal update phpunit with

 composer global require phpunit/phpunit:^8

check again versions

$ phpunit --version
PHPUnit 8.3.5 by Sebastian Bergmann and contributors.

$ ./vendor/bin/phpunit --version
PHPUnit 8.3.5 by Sebastian Bergmann and contributors.
like image 4
Ali Yousefi Avatar answered Nov 02 '22 08:11

Ali Yousefi