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
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].
I merged your pull request and released a new version of Stub
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
@DavertMik PhpUnit introduced getDependencies method in 7.2.0, maybe we should rename our method to avoid conflict.
I will revert Stub change to prevent installation of PhpUnit 7.2
Link to PhpUnit change: https://github.com/sebastianbergmann/phpunit/commit/66a0765da30140eb9618b50cbeddd6223eccdf4a#diff-511c90242d5589e941582006e0485184R964
@Naktibalda actually reverting the changes and tagging made the situation much worse.
For composer it doesn't matter what's the latest version, it only matters the version that comply with the requirements.
If you run now:
$ composer.phar require phpunit/phpunit:^7.2 codeception/codeception:^2.4
You'll end up with codeception/stub:2.0.2
The correct process now to fix everything is:
2.0.2 and 2.0.3 tags of codeception/stubcodeception/codeception with codeception/stub:@dev-mastercodeception/stub:2.0.4 skipping 2.0.2 and 2.0.3 forever@Slamdunk I've done 1 and 2,
3 and 4 is on you.
As I wrote in linked pull request:
@DavertMik tried to fix phpunit signature compatibility issues by moving PhpUnit related code to phpunit-wrapper.
It looks like we have to move test format classes to phpunit-wrapper too.
Version without result types goes to 6.0 branch, version with result types - to 7.0 branch.
This change will make phpunit-wrapper incompatible with older versions of Codeception (the same classes will exist in Codeception 2.4.4 and new version of phpunit-wrapper).
Two ways to solve this:
@Naktibalda Packagist doesn't seem updated to the tag removal:
https://packagist.org/packages/codeception/stub
You should remove those tags in Packagist too
I can't do that.
I can't do that.
Well, someone shall do that to avoid issues.
The owner of the page has some easy to click crosses near the tag list on the right.
@Slamdunk I've done 1 and 2,
3 and 4 is on you.
3 and 4 done: https://github.com/Codeception/Codeception/pull/5097
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)
@Naktibalda why did you tag https://github.com/Codeception/Stub/tree/2.0.4 ?
You basically restored the issue like it was 2.0.2. 2.0.4 should have been tagged only after the merge and tag on https://github.com/Codeception/Codeception/pull/5097
@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.
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.
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?
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 馃憤
PhpUnit 7.3.0 will be released tomorrow - https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-7.3.md
Does anybody want to start working on compatibility?
Most helpful comment
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 馃憤