Skip to content

Commit

Permalink
Merge pull request #16580 from qrazi/patch_16577
Browse files Browse the repository at this point in the history
refactor: make test integration compatible with newer versions of `codeception/module-yii2`
  • Loading branch information
brandonkelly authored Jan 29, 2025
2 parents a41444a + 1a95ee7 commit e716c71
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/test/CraftConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,20 @@ public function resetApplication($closeSession = true): void
* We'll open the connection after all of the transaction listeners are
* registered.
*
* Method has nullable param to support `codeception/module-yii2` both in
* the < 1.1.6 and >= 1.1.6 versions. The method signature is now compliant
* with the `parent` for both branches.
*
* @param null|\yii\log\Logger $logger
*
* @inheritDoc
*/
public function startApp(): void
public function startApp(?\yii\log\Logger $logger = null): void
{
parent::startApp();
// Pass through all method arguments as to support
// `codeception/module-yii2` < 1.1.6 AND >= 1.1.6 versions, whilst
// also keeping PHPStan satisfied for both versions.
parent::startApp(...func_get_args());

\Craft::$app->db->close();
}
Expand Down

0 comments on commit e716c71

Please sign in to comment.