Skip to content

Commit a9ba9d8

Browse files
authored
Merge pull request Codeception#3579 from Codeception/Naktibalda-yii2-after-patch
[Yii2] Check if Yii::$app is set in _after before using it
2 parents 783d44a + 701c02d commit a9ba9d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Codeception/Module/Yii2.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public function _after(\Codeception\TestInterface $test)
194194

195195
$this->client->resetPersistentVars();
196196

197-
if (\Yii::$app->has('session', true)) {
197+
if (isset(\Yii::$app) && \Yii::$app->has('session', true)) {
198198
\Yii::$app->session->close();
199199
}
200200
parent::_after($test);

0 commit comments

Comments
 (0)