I am trying the webdriver patch over at #2775653: JavascriptTests with webDriver but I think this is a general issue ...
If one passes a mink driver config that contains associative arrays (which get turned into objects when converting to JSON),
like:
'["chrome",{"chrome":{"switches":["disable-gpu"],"binary":"\/Applications\/Google Chrome Canary.app\/Contents\/MacOS\/Google Chrome Canary"}}]'
one gets an Exception:
Error: Cannot use object of type stdClass as array
The reason for this is that the minkDefaultDriverArgs property is supposed to be an array structure but json_decode creates stdClass objects by default. Will upload a patch that addresses this.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 2894482-7.patch | 1.41 KB | dawehner |
| #8 | 2894482-fail.patch | 768 bytes | dawehner |
| #6 | 2894482-6.patch | 764 bytes | dawehner |
| #2 | 2894482-2-keep-json_decode-from-creating-objects.patch | 675 bytes | cspitzlay |
Comments
Comment #2
cspitzlayComment #3
cspitzlayComment #4
cspitzlayComment #6
dawehnerI totally agree. None of those configurations uses stdclass objects.
Here is a test
Comment #8
dawehnerHere is a proper failing and passing test.
Comment #9
lendudeThe docblock for
minkDefaultDriverArgsalready states that this should be an array, so this gets the actual data in line with the API.Comment #11
lendudeLooks good.
Comment #13
lendudeUnrelated fail
Comment #17
dawehnerI guess this should be marked as fixed now :)