Skip to content

Commit 316c346

Browse files
committed
Fix for support Instance::of in configuration v2
Using createObject with \yii\di\Instance::of in configuration does not work. Creating an instance of the application in the suggested way solves the problem.
1 parent 84fe26b commit 316c346

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Codeception/Lib/Connector/Yii2.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ public function startApp()
269269
$config['class'] = 'yii\web\Application';
270270
}
271271

272+
if (isset($config['container']))
273+
{
274+
Yii::configure(Yii::$container, $config['container']);
275+
unset($config['container']);
276+
}
277+
272278
$config = $this->mockMailer($config);
273279
/** @var \yii\web\Application $app */
274280
Yii::$app = Yii::createObject($config);

0 commit comments

Comments
 (0)