Codeception: Incompatible with PHPUnit ^7.2

What are you trying to achieve?

Installing Codeception 2.4 together with PHPUnit 7.2.

Codeception/Stub requires phpunit/phpunit-mock-objects, which is now merged in PHPUnit.

Pull request already opened in Stub: https://github.com/Codeception/Stub/pull/9

$ composer.phar require phpunit/phpunit:^7.2 codeception/codeception:^2.4

What do you get instead?

Click to show composer output

./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1 - Conclusion: don’t install phpunit/phpunit 7.2.7 - Conclusion: don’t install phpunit/phpunit 7.2.6 - Conclusion: don’t install phpunit/phpunit 7.2.5 - Conclusion: don’t install phpunit/phpunit 7.2.4 - Conclusion: don’t install phpunit/phpunit 7.2.3 - Conclusion: don’t install phpunit/phpunit 7.2.2 - Conclusion: don’t install phpunit/phpunit 7.2.1 - codeception/codeception 2.4.0 requires codeception/stub ^1.0 -> satisfiable by codeception/stub[1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4]. - codeception/codeception 2.4.1 requires codeception/stub ^1.0 -> satisfiable by codeception/stub[1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4]. - codeception/codeception 2.4.2 requires codeception/stub ^2.0 -> satisfiable by codeception/stub[2.0.0, 2.0.1]. - codeception/codeception 2.4.3 requires codeception/stub ^2.0 -> satisfiable by codeception/stub[2.0.0, 2.0.1]. - codeception/codeception 2.4.4 requires codeception/stub ^2.0 -> satisfiable by codeception/stub[2.0.0, 2.0.1]. - codeception/stub 1.0.0 requires phpunit/phpunit-mock-objects ^2.3|^3.0|^4.0|5.0 -> satisfiable by phpunit/phpunit-mock-objects[2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 5.0.0]. - codeception/stub 1.0.1 requires phpunit/phpunit-mock-objects ^2.3|^3.0|^4.0|^5.0 -> satisfiable by phpunit/phpunit-mock-objects[2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.0.6, 5.0.7, 5.0.8]. - codeception/stub 1.0.2 requires phpunit/phpunit-mock-objects >2.3 <7.0 -> satisfiable by phpunit/phpunit-mock-objects[2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.0.6, 5.0.7, 5.0.8, 6.0.0, 6.0.1, 6.1.0, 6.1.1, 6.1.2]. - codeception/stub 1.0.3 requires phpunit/phpunit-mock-objects >2.3 <7.0 -> satisfiable by phpunit/phpunit-mock-objects[2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.0.6, 5.0.7, 5.0.8, 6.0.0, 6.0.1, 6.1.0, 6.1.1, 6.1.2]. - codeception/stub 1.0.4 requires phpunit/phpunit-mock-objects >2.3 <7.0 -> satisfiable by phpunit/phpunit-mock-objects[2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.0.6, 5.0.7, 5.0.8, 6.0.0, 6.0.1, 6.1.0, 6.1.1, 6.1.2]. - codeception/stub 2.0.0 requires phpunit/phpunit-mock-objects >2.3 <7.0 -> satisfiable by phpunit/phpunit-mock-objects[2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.0.6, 5.0.7, 5.0.8, 6.0.0, 6.0.1, 6.1.0, 6.1.1, 6.1.2]. - codeception/stub 2.0.1 requires phpunit/phpunit-mock-objects >2.3 <7.0 -> satisfiable by phpunit/phpunit-mock-objects[2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0, 3.3.1, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.0.6, 5.0.7, 5.0.8, 6.0.0, 6.0.1, 6.1.0, 6.1.1, 6.1.2]. - phpunit/phpunit-mock-objects 2.3.0 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 2.3.1 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 2.3.2 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 2.3.3 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 2.3.4 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 2.3.5 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 2.3.6 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 2.3.7 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 2.3.8 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.0.0 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.0.1 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.0.2 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.0.3 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.0.4 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.0.5 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.0.6 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.1.0 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.1.1 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.1.2 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.1.3 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.2.1 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.2.2 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.2.3 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.2.4 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.2.5 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.2.6 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.2.7 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.3.0 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.3.1 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.4.0 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.4.1 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.4.2 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.4.3 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 3.4.4 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 4.0.0 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 4.0.1 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 4.0.2 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 4.0.3 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 4.0.4 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 5.0.0 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 5.0.1 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 5.0.2 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 5.0.3 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 5.0.4 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 5.0.5 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 5.0.6 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 5.0.7 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 5.0.8 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 6.0.0 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 6.0.1 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 6.1.0 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 6.1.1 conflicts with phpunit/phpunit[7.2.0]. - phpunit/phpunit-mock-objects 6.1.2 conflicts with phpunit/phpunit[7.2.0]. - Installation request for phpunit/phpunit ^7.2 -> satisfiable by phpunit/phpunit[7.2.0, 7.2.1, 7.2.2, 7.2.3, 7.2.4, 7.2.5, 7.2.6, 7.2.7]. - Installation request for codeception/codeception ^2.4 -> satisfiable by codeception/codeception[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4].

Details

  • Codeception version: ^2.4
  • PHPUnit version: ^7.2
  • PHP Version: 7.2
  • Installation type: Composer

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 5
  • Comments: 16 (11 by maintainers)

Commits related to this issue

Most upvoted comments

New incompatibility:

PHP Fatal error: Declaration of Codeception\Test\Unit::getDependencies() must be compatible with PHPUnit\Framework\TestCase::getDependencies(): array in /home/travis/build/Codeception/Codeception/src/Codeception/Test/Unit.php on line 14

It seems the bug was fixed. In Codeception\Test\Unit class, I saw that the “getDependencies” function had been renamed to “fetchDependencies”.

Anyway this bug could be fixed defining type of data to return, but this solution will be more complicated to maintain because the getDependencies of PHPUnit\Framework\TestCase class could change his type of data and once again the Codeception libary would need a new correction.

Nice job! Thanks for correction 👍

I had the same problem. I saw that in PHPUnit\Framework\TestCase the function getDependencies() has “: array”, which means that this function will return an array for certain.

To solve this little problem, i went to the Codeception\Test\Unit class in line 133 and i added “: array” and it worked.

https://github.com/Codeception/Codeception/blob/8a4bb3d12e4aed2755f0d063fea9fd94bc603eb8/src/Codeception/Test/Unit.php#L133

Maybe the next PHPUnit update will be necessary to check if the every functions from Codeception\Test\Unit class because each function needs to have the same value like the “parent” function.

can you show the function “getDependencies()” after you did the change?

@NicolasCARPi: From the release notes it looks like the 2.0.4 is just a revert of the revert in 2.0.3, which means the 2.0.4 basically the same as 2.0.2 along with all the issues.

I would suggest downgrading to 2.0.1 for the time being.

Hello everyone,

I just upgraded to 2.0.4 of codeception/stub, and still run into the error:

PHP Fatal error: Declaration of Codeception\Test\Unit::getDependencies() must be compatible with PHPUnit\Framework\TestCase::getDependencies(): array in /home/travis/build/Codeception/Codeception/src/Codeception/Test/Unit.php on line 14

Is there a step I missed? From the comments in this issue it looked like 2.0.4 would work but it does not. Thanks for your help 😃 (phpunit is 7.2.7)