From 851afe866b4725f503737be6c3ee144b98875481 Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Fri, 15 Jul 2022 20:47:21 +0300 Subject: [PATCH] Fix compatibility with Codeception 5 --- composer.json | 2 +- src/Codeception/Module/Yii2.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 5da8f83..5d6a81f 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "minimum-stability": "dev", "require": { "php": "^8.0", - "codeception/codeception": "^5.0.0", + "codeception/codeception": "^5.0.0-RC6", "codeception/lib-innerbrowser": "^3.0" }, "require-dev": { diff --git a/src/Codeception/Module/Yii2.php b/src/Codeception/Module/Yii2.php index 996a91c..862ea2e 100644 --- a/src/Codeception/Module/Yii2.php +++ b/src/Codeception/Module/Yii2.php @@ -333,7 +333,9 @@ public function _before(TestInterface $test) // load fixtures before db transaction if ($test instanceof \Codeception\Test\Cest) { - $this->loadFixtures($test->getTestClass()); + $this->loadFixtures($test->getTestInstance()); + } elseif ($test instanceof \Codeception\Test\TestCaseWrapper) { + $this->loadFixtures($test->getTestCase()); } else { $this->loadFixtures($test); }