Skip to content

Commit 7949d4b

Browse files
NaktibaldaDavertMik
authored andcommitted
Merge 2.5 to 3.0 (#5479)
* Proposed solution for #5457 gherkin scenarios not loaded from group file (#5458) * proposed solution for #5457 gherkin scenarios not loaded from group file * testing for getMetaData method before calling it in GroupManager * reformatting if statement to appease nitpick * adding tests for #5457 * Update LOCAL_FILE constant for new version of phpseclib (#5461) * Using button formaction attr in proceedSubmitForm method (#5440) * Using button formaction attr in proceedSubmitForm method (AcceptanceTesterActions::submitForm) * Update InnerBrowser.php * Avoid removing required fields in cookies. (#5470)
1 parent 280c37e commit 7949d4b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Codeception/Module/WebDriver.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,13 +835,17 @@ public function setCookie($cookie, $value, array $params = [])
835835
}
836836
}
837837
// #5401 Supply defaults, otherwise chromedriver 2.46 complains.
838-
$params = array_filter($params);
839-
$params += [
838+
$defaults = [
840839
'path' => '/',
841840
'expiry' => time() + 86400,
842841
'secure' => false,
843842
'httpOnly' => false,
844843
];
844+
foreach ($defaults as $key => $default) {
845+
if (empty($params[$key])) {
846+
$params[$key] = $default;
847+
}
848+
}
845849
$this->webDriver->manage()->addCookie($params);
846850
$this->debugSection('Cookies', json_encode($this->webDriver->manage()->getCookies()));
847851
}

0 commit comments

Comments
 (0)