I try running this command :
php bin/phpunit
I get this error :
PHP Fatal error: Uncaught Error: Call to undefined method PHPUnit\TextUI\TestRunner::doRun() in C:\wamp64\www\Test___Hanff_Web\bin.phpunit\phpunit-7.5-0\src\TextUI\Command.php:206
I see that it is using phpunit 7.5, but i have require phpunit 9.2 in my composer.json :
// composer.json
"require": {
"php": "^7.4",
...
"phpunit/phpunit": "^9.2", <-- here
"sensio/framework-extra-bundle": "^5.1",
"spatie/enum": "^2.3",
"symfony/asset": "^5.1",
...
"symfony/framework-bundle": "5.1.*",
...
},
"require-dev": {
"dama/doctrine-test-bundle": "^6.3",
"doctrine/doctrine-fixtures-bundle": "^3.3",
"symfony/browser-kit": "^5.1",
"symfony/css-selector": "^5.1",
"symfony/debug-pack": "^1.0",
"symfony/phpunit-bridge": "^5.1", <-- Also here because symfony doc told me to import that
"symfony/stopwatch": "^5.1",
"symfony/twig-bundle": "^5.1",
"symfony/web-profiler-bundle": "^5.1"
},
When i trying to execute this :
> vendor\bin\phpunit --version
PHPUnit 9.2.6 by Sebastian Bergmann and contributors.
I get version 9.2 instead of this :
> php bin/phpunit --version
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.
So i try to run composer update
but it don't change anything.
Then i try to self update phpunit as described here but nothing do !
I'm actually only being able to run my php test by execute this command :
> vendor\bin\phpunit tests/Controller/WebTest_ArticleController.php
It execute all the tests in one TestCase file, but i can't execute all the test for all the tests/* directory.
I would like to be able to run all my test as :
> php bin/phpunit
... Runing all test
Or something like :
> vendor\bin\phpunit tests/*
... Runing all test in tests/ directory
I have also read this PHPunit Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() But it doesn't provide me any satisfying solution