From ac59fe65565c79360cd41976933bb39cb1f8bc6f Mon Sep 17 00:00:00 2001 From: Maxim Antonov Date: Mon, 21 Dec 2020 18:20:43 +0300 Subject: [PATCH] Fix for support of Instance::of() in configuration (#21) --- src/Codeception/Lib/Connector/Yii2.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Codeception/Lib/Connector/Yii2.php b/src/Codeception/Lib/Connector/Yii2.php index 745b4d7..22b5e9d 100644 --- a/src/Codeception/Lib/Connector/Yii2.php +++ b/src/Codeception/Lib/Connector/Yii2.php @@ -269,6 +269,12 @@ public function startApp() $config['class'] = 'yii\web\Application'; } + if (isset($config['container'])) + { + Yii::configure(Yii::$container, $config['container']); + unset($config['container']); + } + $config = $this->mockMailer($config); /** @var \yii\web\Application $app */ Yii::$app = Yii::createObject($config);