Trying to fix `vendor/bin/codecept bootstrap` command for Codeception 5
I don't really know what I'm doing here, so this is probably not the right way to fix it!
Anyway - when following https://codeception.com/quickstart, I'm getting v1.0.0 of module-phpbrowser and module-asserts added to composer.json, which aren't compatible with Codeception 5.
Output:
$ php vendor/bin/codecept bootstrap
Bootstrapping Codeception
File codeception.yml created <- global configuration
Adding codeception/module-phpbrowser for PhpBrowser to composer.json
Adding codeception/module-asserts for Asserts to composer.json
2 new packages added to require-dev
? composer.json updated. Do you want to run "composer update"? (y/n) y
Running composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- codeception/module-phpbrowser[1.0.0, ..., 1.0.1] require php >=5.6.0 <8.0 -> your php version (8.1.8) does not satisfy that requirement.
- codeception/module-phpbrowser 1.0.2 requires codeception/codeception ^4.0 -> found codeception/codeception[4.0.0, ..., 4.2.1] but it conflicts with your root composer.json require (^5.0).
- codeception/module-phpbrowser 1.0.3 requires codeception/codeception ^4.1 -> found codeception/codeception[4.1.0, ..., 4.2.1] but it conflicts with your root composer.json require (^5.0).
- Root composer.json requires codeception/module-phpbrowser ^1.0.0 -> satisfiable by codeception/module-phpbrowser[1.0.0, 1.0.1, 1.0.2, 1.0.3].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Composer installation failed. Please check composer.json and try to run "composer update" manually
In ModuleContainer.php line 100:
Module Asserts is not installed.
Use Composer to install corresponding package:
composer require codeception/module-asserts --dev
bootstrap [-s|--namespace [NAMESPACE]] [-a|--actor [ACTOR]] [-e|--empty] [--] [<path>]
I noticed this issue too and raised #6542
^3.0 is a better constraint for Codeception 5, but not all modules have versions 3 yet, for example module-cli is at 2.0.0 still, because no changes were required to support Codeception 5, and module-yii2 is 1.1.4.
It is possible that none of these modules are used in templates, but we will certainly have to release module-webdriver 4.0.0 to support PHPUnit 10.
The simplest and most flexible solution would be to use * in constrait,
alternatively we could specify version constraint of each module in template:
$this->addModulesToComposer(['WebDriver' => '^3.0 | ^4.0']);
What's the purpose of having this code at all? Is this just used in bootstrap or somewhere else too?
Cause it looks like a nightmare to maintain - so maybe the best solution is getting rid of it...?
See https://codeception.com/docs/Customization#Installation-Templates
I fixed this and other template issues in https://github.com/Codeception/Codeception/pull/6552 please review it.
Great! :-)