Codeception: PHP warning is thrown when running tests using PHPUnit 7.1.x

What are you trying to achieve?

Run all tests

What do you get instead?

PHP warning message and test runner output

PHP Warning:  Declaration of Codeception\PHPUnit\ResultPrinter\UI::printDefect(PHPUnit\Framework\TestFailure $defect, $count): void should be compatible with PHPUnit\TextUI\ResultPrinter::printDefect(PHPUnit\Framework\TestFailure $defect, int $count): void in /ably/magento2-kellfri-base-install/vendor/codeception/phpunit-wrapper/src/ResultPrinter/UI.php on line 10

Details

  • Codeception version: 2.4.1
  • PHP Version: 7.1.16
  • Operating System: Debian
  • Installation type: Composer
  • List of installed packages (composer show)
  • Suite configuration:
namespace: Fizz\Tests
paths:
    tests: tests
    output: tests/_output
    data: tests/_data
    support: tests/_support
    envs: tests/_envs
actor_suffix: Tester
extensions:
    enabled:
        - Codeception\Extension\RunFailed

Docker demo: https://github.com/isunja/codeception-phpunit-result-report-warning

Seems codeception/phpunit-wrapper 7.0.x is not compatible with phpunit 7.1.x, since the constraint for phpunit is set as phpunit/phpunit ^7.0.

Works fine with phpunit 7.0.3.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (3 by maintainers)

Most upvoted comments

Same here.

Working combination:

  • codeception/codeception 2.4.0
  • phpunit/phpunit 7.0.2

After a composer update the combination which throws the mentioned PHP warning message:

  • codeception/codeception 2.4.1
  • phpunit/phpunit 7.1.1

The error message comes with PHP 7.1.16, but it does not come with PHP 7.2.3 (Probably my php.ini is slightly different)