Add support for symfony 8 · Codeception/Codeception@c7281f1 · GitHub
Skip to content

Commit c7281f1

Browse files
committed
Add support for symfony 8
1 parent 8fb4553 commit c7281f1

4 files changed

Lines changed: 66 additions & 37 deletions

File tree

‎app.php‎

Lines changed: 42 additions & 24 deletions

‎composer.json‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
"phpunit/php-text-template": "^2.0 | ^3.0 | ^4.0 | ^5.0",
2727
"phpunit/php-timer": "^5.0.3 | ^6.0 | ^7.0 | ^8.0",
2828
"phpunit/phpunit": "^9.5.20 | ^10.0 | ^11.0 | ^12.0",
29-
"psy/psysh": "^0.11.2 | ^0.12",
29+
"psy/psysh": "dev-main",
3030
"sebastian/comparator": "^4.0.5 | ^5.0 | ^6.0 | ^7.0",
3131
"sebastian/diff": "^4.0.3 | ^5.0 | ^6.0 | ^7.0",
32-
"symfony/console": ">=5.4.24 <8.0",
33-
"symfony/css-selector": ">=5.4.24 <8.0",
34-
"symfony/event-dispatcher": ">=5.4.24 <8.0",
35-
"symfony/finder": ">=5.4.24 <8.0",
36-
"symfony/var-dumper": ">=5.4.24 <8.0",
37-
"symfony/yaml": ">=5.4.24 <8.0"
32+
"symfony/console": ">=5.4.24 <9.0",
33+
"symfony/css-selector": ">=5.4.24 <9.0",
34+
"symfony/event-dispatcher": ">=5.4.24 <9.0",
35+
"symfony/finder": ">=5.4.24 <9.0",
36+
"symfony/var-dumper": ">=5.4.24 <9.0",
37+
"symfony/yaml": ">=5.4.24 <9.0"
3838
},
3939
"require-dev": {
4040
"ext-simplexml": "*",
@@ -51,10 +51,10 @@
5151
"jetbrains/phpstorm-attributes": "^1.0",
5252
"laravel-zero/phar-updater": "^1.4",
5353
"php-webdriver/webdriver": "^1.15",
54-
"stecman/symfony-console-completion": "^0.14",
55-
"symfony/dotenv": ">=5.4.24 <8.0",
56-
"symfony/error-handler": ">=5.4.24 <8.0",
57-
"symfony/process": ">=5.4.24 <8.0",
54+
"stecman/symfony-console-completion": "^0.14 || ^0.15",
55+
"symfony/dotenv": ">=5.4.24 <9.0",
56+
"symfony/error-handler": ">=5.4.24 <9.0",
57+
"symfony/process": ">=5.4.24 <9.0",
5858
"vlucas/phpdotenv": "^5.1"
5959
},
6060
"conflict": {

‎src/Codeception/Application.php‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ protected function readCustomCommandsFromConfig(): void
5858
}
5959

6060
foreach ($config['extensions']['commands'] as $commandClass) {
61-
$this->add(new $commandClass($this->getCustomCommandName($commandClass)));
61+
$command = new $commandClass($this->getCustomCommandName($commandClass));
62+
// addCommand() is available since symfony 7.4
63+
if (method_exists($this, 'addCommand')) {
64+
$this->addCommand($command);
65+
} else {
66+
$this->add($command);
67+
}
6268
}
6369
}
6470

‎tests/unit/Codeception/Command/BaseCommandRunner.php‎

Lines changed: 6 additions & 1 deletion

0 commit comments

Comments
 (0)