Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Commit

Permalink
let's set the browserName for convenience
Browse files Browse the repository at this point in the history
  • Loading branch information
santiycr committed Jun 23, 2011
1 parent f94f89a commit e12662a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions PHPUnit/Extensions/SeleniumTestCase/SauceOnDemandTestCase.php
Expand Up @@ -90,10 +90,12 @@ protected function getDriver(array $browser)
'Array element "browser" is not a string.'
);
}
$this->browserName = $browser['browser'];
} else {
$browser['browser'] = '';
}


if (isset($browser['host'])) {
if (!is_string($browser['host'])) {
throw new InvalidArgumentException(
Expand Down Expand Up @@ -185,24 +187,26 @@ protected function getDriver(array $browser)
error_log('Warning: no access key provided. This may result in "Could not connect to Selenium RC serve". Run "sauce configure <username> <accesskey>" or call $this->setAccessKey to fix');
}

if (isset($browser['os'])) {
if (!is_string($browser['os'])) {
if (isset($browser['browserVersion'])) {
if (!is_string($browser['browserVersion'])) {
throw new InvalidArgumentException(
'Array element "os" is not a string.'
'Array element "browserVersion" is not a string.'
);
}

$driver->setOs($browser['os']);
$driver->setBrowserVersion($browser['browserVersion']);
$this->browserName .= " ".$browser['browserVersion'];
}

if (isset($browser['browserVersion'])) {
if (!is_string($browser['browserVersion'])) {
if (isset($browser['os'])) {
if (!is_string($browser['os'])) {
throw new InvalidArgumentException(
'Array element "browserVersion" is not a string.'
'Array element "os" is not a string.'
);
}

$driver->setBrowserVersion($browser['browserVersion']);
$driver->setOs($browser['os']);
$this->browserName .= " ".$browser['os'];
}

if (isset($browser['jobName'])) {
Expand Down

0 comments on commit e12662a

Please sign in to comment.