fix: Check if cookies are iterable before iterating
It can happen that the returned value is not iterable. The geetAllCookies() methode also declares the its return as "mixed". Just about having slightly more defensive code.
Codecov Report
Merging #356 (f387514) into master (e5f8421) will increase coverage by
0.02%. The diff coverage is100.00%.
@@ Coverage Diff @@
## master #356 +/- ##
============================================
+ Coverage 90.02% 90.04% +0.02%
- Complexity 150 151 +1
============================================
Files 1 1
Lines 421 422 +1
============================================
+ Hits 379 380 +1
Misses 42 42
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/Selenium2Driver.php | 90.04% <100.00%> (+0.02%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update e5f8421...f387514. Read the comment docs.
In which case does this happen ?
I had a request to wd/hub/session/chrome-100-0-4896-75-1-bc5dc535-0653-4f64-814c-d172db4c1582/session/bed6779a89bb52104cef11e83d40d7e6/cookie return null as value.
Underlying library is instaclick/php-webdriver - \WebDriver\Session::getAllCookies() which just passes the value as received from the endpoint back to the consumer.
It is highly likely this is / was an error on the endpoint but I don't think this warrants a generic failure.