Skip to content

Commit 455aa86

Browse files
SamMousaDavertMik
authored andcommitted
Reset global event handlers (#4621)
Global event handlers should not persist between tests. The `if` statement is needed since the `offAll()` function exists only since 2.0.10 of the framework.
1 parent d3b532c commit 455aa86

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Codeception/Lib/Connector/Yii2.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ public function resetPersistentVars()
8383
static::$db = null;
8484
static::$mailer = null;
8585
\yii\web\UploadedFile::reset();
86+
if (method_exists(yii\base\Event::className(), 'offAll')) {
87+
\yii\base\Event::offAll();
88+
}
8689
}
8790

8891
/**

0 commit comments

Comments
 (0)