This repository was archived by the owner on Mar 4, 2020. It is now read-only.
File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ This project versioning adheres to [Semantic Versioning](http://semver.org/).
18
18
19
19
### Fixed
20
20
- ` WebDriverExpectedCondition::presenceOfElementLocated() ` works correctly when used within ` WebDriverExpectedCondition::not() ` .
21
+ - Improper behavior of Microsoft Edge when retrieving all cookies via ` getCookies() ` (it was causing fatal error when there were no cookies).
21
22
22
23
## 1.7.1 - 2019-06-13
23
24
### Fixed
Original file line number Diff line number Diff line change @@ -107,6 +107,10 @@ public function getCookieNamed($name)
107
107
[':name ' => $ name ]
108
108
);
109
109
110
+ if (!is_array ($ cookieArray )) { // Microsoft Edge returns null even in W3C mode => emulate proper behavior
111
+ throw new NoSuchCookieException ('no such cookie ' );
112
+ }
113
+
110
114
return Cookie::createFromArray ($ cookieArray );
111
115
}
112
116
@@ -128,8 +132,11 @@ public function getCookieNamed($name)
128
132
public function getCookies ()
129
133
{
130
134
$ cookieArrays = $ this ->executor ->execute (DriverCommand::GET_ALL_COOKIES );
131
- $ cookies = [];
135
+ if (!is_array ($ cookieArrays )) { // Microsoft Edge returns null if there are no cookies...
136
+ return [];
137
+ }
132
138
139
+ $ cookies = [];
133
140
foreach ($ cookieArrays as $ cookieArray ) {
134
141
$ cookies [] = Cookie::createFromArray ($ cookieArray );
135
142
}
You can’t perform that action at this time.
0 commit comments