Skip to content

Commit 0630dba

Browse files
committed
Fix some comments
1 parent 5bbd2af commit 0630dba

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ before_script:
9393
- if [ "$BROWSER_NAME" = "chrome" ]; then mkdir chromedriver; wget -q -t 3 https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip; unzip chromedriver_linux64 -d chromedriver; fi
9494
- if [ "$BROWSER_NAME" = "chrome" ]; then export CHROMEDRIVER_PATH=$PWD/chromedriver/chromedriver; fi
9595
- sh -e /etc/init.d/xvfb start
96-
- if [ ! -f jar/selenium-server-standalone-3.8.1.jar ]; then wget -q -t 3 -P jar https://selenium-release.storage.googleapis.com/3.8/selenium-server-standalone-3.8.1.jar; fi
97-
- java -Dwebdriver.firefox.marionette=false -Dwebdriver.chrome.driver="$CHROMEDRIVER_PATH" -jar jar/selenium-server-standalone-3.8.1.jar -enablePassThrough false -log ./logs/selenium.log &
96+
- if [ ! -f jar/selenium-server-standalone-3.8.1.jar ]; then wget -q -t 3 -P jar https://selenium-release.storage.googleapis.com/3.14/selenium-server-standalone-3.14.0.jar; fi
97+
- java -Dwebdriver.firefox.marionette=false -Dwebdriver.chrome.driver="$CHROMEDRIVER_PATH" -jar jar/selenium-server-standalone-3.14.0.jar -enablePassThrough false -log ./logs/selenium.log &
9898
- until $(echo | nc localhost 4444); do sleep 1; echo Waiting for Selenium server on port 4444...; done; echo "Selenium server started"
9999
- php -S 127.0.0.1:8000 -t tests/functional/web/ &>>./logs/php-server.log &
100100
- until $(echo | nc localhost 8000); do sleep 1; echo waiting for PHP server on port 8000...; done; echo "PHP server started"

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ For the functional tests you must first [download](http://selenium-release.stora
3737
the selenium standalone server, start the local PHP server which will serve the test pages and then run the `functional`
3838
test suite:
3939

40-
java -jar selenium-server-standalone-3.12.0.jar -log selenium.log &
40+
java -jar selenium-server-standalone-3.14.0.jar -log selenium.log &
4141
php -S localhost:8000 -t tests/functional/web/ &
4242
./vendor/bin/phpunit --testsuite functional
43-
43+
4444
The functional tests will be started in HtmlUnit headless browser by default. If you want to run them in eg. Firefox,
4545
simply set the `BROWSER_NAME` environment variable:
4646

lib/Exception/WebDriverException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ public function getResults()
8484
* @throws WebDriverCurlException
8585
* @throws XPathLookupException
8686
*/
87-
public static function throwException($status_code, $message, $results, $w3c_compliant = false)
87+
public static function throwException($status_code, $message, $results)
8888
{
89-
if ($w3c_compliant) {
89+
if (is_string($status_code)) {
9090
// see https://w3c.github.io/webdriver/webdriver-spec.html#handling-errors
9191
switch ($status_code) {
9292
case 'no such element':

lib/Remote/HttpCommandExecutor.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public function execute(WebDriverCommand $command)
273273
}
274274
}
275275

276-
if ($params && \is_array($params) && $http_method !== 'POST') {
276+
if ($params && is_array($params) && $http_method !== 'POST') {
277277
throw new BadMethodCallException(sprintf(
278278
'The http method called for %s is %s but it has to be POST' .
279279
' if you want to pass the JSON params %s',
@@ -292,7 +292,7 @@ public function execute(WebDriverCommand $command)
292292
curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, $http_method);
293293
}
294294

295-
if (\in_array($http_method, ['POST', 'PUT'])) {
295+
if (in_array($http_method, ['POST', 'PUT'])) {
296296
// Disable sending 'Expect: 100-Continue' header, as it is causing issues with eg. squid proxy
297297
// https://tools.ietf.org/html/rfc7231#section-5.1.1
298298
curl_setopt($this->curl, CURLOPT_HTTPHEADER, array_merge(static::DEFAULT_HTTP_HEADERS, ['Expect:']));
@@ -302,7 +302,7 @@ public function execute(WebDriverCommand $command)
302302

303303
$encoded_params = null;
304304
if ($http_method === 'POST') {
305-
$encoded_params = $params && \is_array($params) ? json_encode($params) : '{}';
305+
$encoded_params = $params && is_array($params) ? json_encode($params) : '{}';
306306
}
307307

308308
curl_setopt($this->curl, CURLOPT_POSTFIELDS, $encoded_params);
@@ -315,7 +315,7 @@ public function execute(WebDriverCommand $command)
315315
$http_method,
316316
$url
317317
);
318-
if ($params && \is_array($params)) {
318+
if ($params && is_array($params)) {
319319
$msg .= sprintf(' with params: %s', json_encode($params));
320320
}
321321

@@ -337,20 +337,20 @@ public function execute(WebDriverCommand $command)
337337
}
338338

339339
$value = null;
340-
if (\is_array($results) && array_key_exists('value', $results)) {
340+
if (is_array($results) && array_key_exists('value', $results)) {
341341
$value = $results['value'];
342342
}
343343

344344
$message = null;
345-
if (\is_array($value) && array_key_exists('message', $value)) {
345+
if (is_array($value) && array_key_exists('message', $value)) {
346346
$message = $value['message'];
347347
}
348348

349349
$sessionId = null;
350-
if (\is_array($value) && array_key_exists('sessionId', $value)) {
350+
if (is_array($value) && array_key_exists('sessionId', $value)) {
351351
// W3C's WebDriver
352352
$sessionId = $value['sessionId'];
353-
} elseif (\is_array($results) && array_key_exists('sessionId', $results)) {
353+
} elseif (is_array($results) && array_key_exists('sessionId', $results)) {
354354
// Legacy JsonWire
355355
$sessionId = $results['sessionId'];
356356
}

lib/Remote/JsonWireCompat.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ public static function getElement(array $rawElement)
4747
* @param bool $w3cCompliance
4848
* @return array
4949
*/
50-
public static function getUsing(WebDriverBy $by, $w3cCompliance)
50+
public static function getUsing(WebDriverBy $by, $w3cCompliant)
5151
{
5252
$mechanism = $by->getMechanism();
5353
$value = $by->getValue();
5454

55-
if ($w3cCompliance) {
56-
switch ($mechanism) {
55+
if ($w3cCompliant) {
56+
switch ($w3cCompliant) {
5757
// Convert to CSS selectors
5858
case 'class name':
5959
$mechanism = 'css selector';

0 commit comments

Comments
 (0)