You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WIP: Try a better fix for issue 57, with functional testing added
Fix: require phpunit when installing via composer in dev mode
Allow configuring testsuite via env var (for root url)
Refactor error handling for curl requests
Clean up leftover code
Remove one more leftover var_dump comment
Add one more test for Selenium different response types
Better detection of non-running selenium (tested on php 5.5.17 windows)
Proper fix for last commit (skip tests when selenium down, not otherwise)
Merge branch 'master' of github.com:instaclick/php-webdriver into issue_57_bis
Conflicts:
lib/WebDriver/SauceLabs/SauceRest.php
Fix the travis build which runs selenium
fix travis/selenium/firefox: 2nd try
Remove one more leftover
Revert: declare dependency on phpunit
Merge branch 'master' of github.com:instaclick/php-webdriver into issue_57_bis
Implement changes according to PR review
One more PR fix: even more detailed error message for bad responses from Selenium
Fix previous commit: typo
Implement changes recommended by @robocoder
if (is_array($result) && array_key_exists('value', $result)) {
133
+
if ($result === null && json_last_error() != JSON_ERROR_NONE) {
134
+
throw WebDriverException::factory(WebDriverException::CURL_EXEC, 'Payload received from webdriver is not valid json: ' . substr($rawResult, 0, 1000));
135
+
}
136
+
137
+
if (!is_array($result) || !array_key_exists('status', $result)) {
138
+
throw WebDriverException::factory(WebDriverException::CURL_EXEC, 'Payload received from webdriver is valid but unexpected json: ' . substr($rawResult, 0, 1000));
139
+
}
140
+
141
+
$value = null;
142
+
if (array_key_exists('value', $result)) {
129
143
$value = $result['value'];
130
144
}
131
145
132
146
$message = null;
133
-
134
147
if (is_array($value) && array_key_exists('message', $value)) {
0 commit comments