- Ошибка PHPunit Uncaught: вызов метода undefined PHPUnit_Util_Configuration:: getTestdoxGroupConfiguration()
- ОТВЕТЫ
- Ответ 1
- Ответ 2
- Ответ 3
- Ответ 4
- Ответ 5
- Ответ 6
- Проверьте версию diff
- Обновить глобальный phpunit:
- проверьте еще раз версии
- Ответ 7
- Ответ 8
- Saved searches
- Use saved searches to filter your results more quickly
- Fatal error : undefined method PHPUnit\TextUI\TestRunner::doRun() #11
- Fatal error : undefined method PHPUnit\TextUI\TestRunner::doRun() #11
- Comments
- Saved searches
- Use saved searches to filter your results more quickly
- Call to undefined method doRun() #565
- Call to undefined method doRun() #565
- Comments
- Preconditions
- Steps to reproduce
Ошибка PHPunit Uncaught: вызов метода undefined PHPUnit_Util_Configuration:: getTestdoxGroupConfiguration()
Я не знаю, связано ли это с Laravel 5.4. когда я запускаю команду phpunit после установки laravel 5.4 без каких-либо изменений, я получаю Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() , но когда я запускаю php artisan dusk , он нормально работает
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 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() 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 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 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%)
любые идеи, как это исправить?
ОТВЕТЫ
Ответ 1
Похоже, ваша версия, установленная глобально, не соответствует минимально необходимой версии. Попробуй запустить
Бьюсь об заклад, вы получите что-то вроде 5.1 . Команда php artisan dusk использует другую версию, которая находится в vendor/bin/phpunit . Таким образом, вы также можете использовать эту версию вместо. Просто введите:
вместо phpunit . Вы должны обновить свою глобальную версию phpunit, если она работает.
Ответ 2
Была та же проблема в Laravel 5.4. Это сработало для меня.
Шаг 1: обновите композитор
Вы можете запустить специальный тест, указав файл
vendor/bin/phpunit tests/Feature/ExampleTest.php
Ответ 3
В моем случае следующая команда работала в среде Windows с \ вместо / :
Ответ 4
У меня была такая же ошибка с усадьбой Laravel 5.6 когда я запускал команду phpunit от моего пользователя, она работает нормально, но когда я запускал ее с помощью sudo, я получал эту ошибку. попробуйте запустить эту команду от своего пользователя, но не sudo, возможно, она тоже работает для вас
Ответ 5
Одним из решений является добавление vendor/bin в начало вашего пути. В Unix-подобных ОС, работающих под управлением bash, вы можете добавить следующее в конец файла .bashrc:
В Windows 10 вы можете получить доступ к переменной среды Path , перейдя на вкладку Свойства системы, Дополнительно и нажав кнопку Переменные среды.
.В любом случае, вставка vendor/bin в начало пути приведет к тому, что ваша ОС будет искать phpunit в. /vendor/bin. Если вы находитесь в корне вашего проекта laravel, он найдет исполняемый файл, включенный в Laravel. Если нет, то перейдем к использованию глобальной версии.
Ответ 6
У меня та же проблема, и с помощью этого шага:
Проверьте версию diff
$ phpunit --version PHPUnit 6.5.5 by Sebastian Bergmann and contributors. $ ./vendor/bin/phpunit --version PHPUnit 8.3.5 by Sebastian Bergmann and contributors.
Обновить глобальный phpunit:
если версии не совпадают, обновите phpunit с помощью
composer global require phpunit/phpunit:^8
проверьте еще раз версии
$ phpunit --version PHPUnit 8.3.5 by Sebastian Bergmann and contributors. $ ./vendor/bin/phpunit --version PHPUnit 8.3.5 by Sebastian Bergmann and contributors.
Ответ 7
Для любого, кто испытывает это, vendor/bin/phpunit определенно работает, но вы можете добавить эту строку в ваш .bashrc или .bash_profile или любой другой удобный для вас способ заставить его работать.
* проверено только на Linux
Ответ 8
Обновите ваши зависимости: composer update .
Тогда Laravel не будет использовать phpunit, расположенный в «vendor/bin/phpunit».
Он будет использовать один в «vendor/vendor/phpunit». И там, это скрипт php. Вы можете посмотреть версию с php phpunit —version .
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error : undefined method PHPUnit\TextUI\TestRunner::doRun() #11
Fatal error : undefined method PHPUnit\TextUI\TestRunner::doRun() #11
Comments
I will try you action for auto launch PHPunit but
i have this error :
Fatal error: Uncaught Error: Call to undefined method PHPUnit\TextUI\TestRunner::doRun() in /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:204
Stack trace:
#0 /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php(163): PHPUnit\TextUI\Command->run(Array, true)
#1 /tmp/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#2
thrown in /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php on line 204
The text was updated successfully, but these errors were encountered:
Hi @kadevland , I noticed that your project was using PhpUnit v9, which the Github action hadn’t been made compatible with. I’m just making and testing a new release (v2) for this action, which will fix your issue.
I will confirm here once it is tested, hopefully within the next few minutes.
Hi @g105b , first of all, thanks for this useful GH action ! I encounter the same issue as @kadevland , hope the v2 will come 🙂 Any help needed ?
Hi @neveldo thank you for your offer. Any help is appreciated.
I am skipping v2 release, and instead I will release v7, v8 and v9 concurrently to match the version of PHPUnit the version represents. This issue is here because the project uses PHPUnit v9, but this repo is only using PHPUnit v8 currently. There is no way to indicate this other than the version numbers of the actual action, which seem to make perfect sense for this.
Let me know what you think about the versioning idea. If you want to pick this up yourself, I’m happy to offer you advice either here or via email, but I am planning on getting round to this over the next few days, just super busy right now.
I like that idea, and I’m curious about the progress. Matching the version to the PHPUnit version is a good idea.
I understand, having different versions of phpunit installed globally and locally can lead to weird issues.
I also think following the versions of phpunit could be a good idea. And/Or maybe we could also add some kind of option to run the project local phpunit if it exists, instead of running it globally ?
(If you have planned to work on it in the days to come, I think I will be useless as I’m still learning how do create github actions for now :p)
Running a local phpunit would defeat the point of a separate action.
@neveldo yes I am planning on implementing these changes within the next few days. I don’t have a huge amount of time right now for open source stuff, but I will find some time as soon as possible.
@JC5 you’re right, running the local PHP Unit will defeat the point, but there is nothing from stopping someone from configuring this in their own action runner.
Sorry for taking so long fixing this issue for you. I now have more time for open source, and I’m happy to say that I have managed to come to a good solution for this project.
Due to PHPUnit versions being incompatible with each other, you can now state the version of PHPUnit you wish to use your action yaml configuration.
I’ve put together an example project here, tested using PHPUnit v8 and v9: https://github.com/php-actions/example-phpunit
Let me know how you get on by replying here.
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call to undefined method doRun() #565
Call to undefined method doRun() #565
Comments
Preconditions
- Bundle version 4.0
- PHP Unit version 7.5.20
- Symfony version 5.0.5
- PHP version 7.3.13
- My .env.test looks like this:
DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/test.sqlite
and the test.sqlite database has been created and has the correct schema.
Steps to reproduce
After installing the bundle and running ./bin/phpunit , I get this error:
HP Fatal error: Uncaught Error: Call to undefined method PHPUnit\TextUI\TestRunner::doRun() in /app/bin/.phpunit/phpunit-7.5-0/src/TextUI/Command.php:206
Stack trace:
#0 /app/bin/.phpunit/phpunit-7.5-0/src/TextUI/Command.php(162): PHPUnit\TextUI\Command->run(Array, true)
#1 /app/bin/.phpunit/phpunit-7.5-0/phpunit(17): PHPUnit\TextUI\Command::main()
#2 /app/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php(343): include(‘/app/bin/.phpun. ‘)
#3 /app/bin/phpunit(13): require(‘/app/vendor/sym. ‘)
#4
thrown in /app/bin/.phpunit/phpunit-7.5-0/src/TextUI/Command.php on line 206
It works if you run ./vendor/bin/phpunit . So apparently it doesn’t work with the bridge version.
The text was updated successfully, but these errors were encountered: