Skip to content

Commit 0e33d34

Browse files
authored
Merge pull request #12 from smichae/master
Fix ModuleException parameters, handle undefined
2 parents 5934f8e + 8351b6b commit 0e33d34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Codeception/Module/Yii2.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -886,13 +886,13 @@ public function _initializeSession()
886886
public function _backupSession()
887887
{
888888
if (isset(Yii::$app) && Yii::$app->session->useCustomStorage) {
889-
throw new ModuleException("Yii2 MultiSession only supports the default session backend.");
889+
throw new ModuleException($this, "Yii2 MultiSession only supports the default session backend.");
890890
}
891891
return [
892892
'clientContext' => $this->client->getContext(),
893893
'headers' => $this->headers,
894-
'cookie' => $_COOKIE,
895-
'session' => $_SESSION,
894+
'cookie' => isset($_COOKIE) ? $_COOKIE : [],
895+
'session' => isset($_SESSION) ? $_SESSION : [],
896896
];
897897
}
898898

0 commit comments

Comments
 (0)