Closed maikgreubel closed 8 years ago
Quick question: how/why are you calling PHPUnit_TextUI_TestRunner::run()
?
It was just a test. I have a warning message in
piece/stagehand-testrunner/src/Runner/PHPUnitRunner.php
and just walked through code how to fix it properly.
I am getting the same Missing argument 3 for PHPUnit_TextUI_TestRunner::doRun()
warning for PHP 5.6 and hhvm on Travis, though PHP 7 passes.
Here is the full warning:
PHP Warning: Missing argument 3 for PHPUnit_TextUI_TestRunner::doRun(), called in phar:///home/travis/.phpenv/versions/5.6.5/bin/phpunit/phpunit/TextUI/Command.php on line 152 and defined in /home/travis/build/tam5/Arbitrage/vendor/phpunit/phpunit/src/TextUI/TestRunner.php on line 148
PHP Stack trace:
PHP 1. {main}() /home/travis/.phpenv/versions/5.6.5/bin/phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() /home/travis/.phpenv/versions/5.6.5/bin/phpunit:722
PHP 3. PHPUnit_TextUI_Command->run() phar:///home/travis/.phpenv/versions/5.6.5/bin/phpunit/phpunit/TextUI/Command.php:104
PHP 4. PHPUnit_TextUI_TestRunner->doRun() phar:///home/travis/.phpenv/versions/5.6.5/bin/phpunit/phpunit/TextUI/Command.php:152
Then, my tests all pass, but i get the following:
PHP Fatal error: Uncaught exception 'Illuminate\Contracts\Container\BindingResolutionException' with message 'Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable.' in /home/travis/build/tam5/Arbitrage/bootstrap/cache/compiled.php:1341
Stack trace:
#0 /home/travis/build/tam5/Arbitrage/bootstrap/cache/compiled.php(1287): Illuminate\Container\Container->build('Illuminate\\Cont...', Array)
#1 /home/travis/build/tam5/Arbitrage/bootstrap/cache/compiled.php(1837): Illuminate\Container\Container->make('Illuminate\\Cont...', Array)
#2 /home/travis/build/tam5/Arbitrage/bootstrap/cache/compiled.php(2156): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#3 /home/travis/build/tam5/Arbitrage/bootstrap/cache/compiled.php(2125): Illuminate\Foundation\Bootstrap\HandleExceptions->getExceptionHandler()
#4 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(ErrorException))
#5 {main}
thrown in /home/travis/build/tam5/Arbitrage/bootstrap/cache/compiled.php on line 1341
And then phpunit exists with 255.
Any ideas?
Make sure that if you're just running phpunit
to run your tests that your globally scoped version is up to date to using phpunit --self-update
.
I just had this problem and it seems to have been caused by my composer installed phpunit being a wildly different version to the globally installed one.
Ah yes.
I was using travis to test on php 5.6, php 7.0, and hhvm. I definitely cannot say I understand why I got this problem, for starters my tests were in fact being run by PHPUnit 5.2.9 (and all passed), plus I was not getting any errors on the php 7.0 build.
However, based on your suggestion @Dolondro, it turned out that indeed while my tests were seemingly being run by PHPUnit 5.2.9, the global version of PHPUnit seemed to be 4.5.0. So based on your suggestion I changed the script in my .travis.yml
from:
script: phpunit
to:
script: vendor/phpunit/phpunit/phpunit
and I got greens on all builds.
Thus, this seems to be a Travis issue and not really a PHPUnit issue.
Can this be closed?
good w me
Using PHPUnit 5.2.5 I get multiple warning messages when calling PHPUnit_TextUI_TestRunner::run():
1.
2.
No. 1 seems to be fixed if 2 is fixed first. Patch in line 86 => 97: