Skip to content

Commit 6ba79d9

Browse files
NaktibaldaDavertMik
authored andcommitted
2.5 Fixed loadSessionSnapshot with php-webdriver 1.1.3 (#5480)
* Fixed loadSessionSnapshot with php-webdriver 1.1.3 It is a minor issue which could affect a handful of Codeception 2.5 users Closes #5456 * Cast cookie to array
1 parent 38dd005 commit 6ba79d9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Codeception/Module/WebDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3109,7 +3109,7 @@ public function loadSessionSnapshot($name)
31093109
}
31103110

31113111
foreach ($this->sessionSnapshots[$name] as $cookie) {
3112-
$this->setCookie($cookie->getName(), $cookie->getValue(), $cookie->toArray());
3112+
$this->setCookie($cookie['name'], $cookie['value'], (array)$cookie);
31133113
}
31143114
$this->debugSection('Snapshot', "Restored \"$name\" session snapshot");
31153115
return true;

tests/web/WebDriverTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -676,17 +676,17 @@ public function testSaveSessionSnapshotsExcludeInvalidCookieDomains()
676676
$fakeWdOptions = Stub::make('\Facebook\WebDriver\WebDriverOptions', [
677677
'getCookies' => Stub::atLeastOnce(function () {
678678
return [
679-
Cookie::createFromArray([
679+
[
680680
'name' => 'PHPSESSID',
681681
'value' => '123456',
682682
'path' => '/',
683-
]),
684-
Cookie::createFromArray([
683+
],
684+
[
685685
'name' => '3rdParty',
686686
'value' => '_value_',
687687
'path' => '/',
688688
'domain' => '.3rd-party.net',
689-
]),
689+
],
690690
];
691691
}),
692692
]);

0 commit comments

Comments
 (0)