Permalink
Browse files

adding support for avoid-proxy sauce capability

  • Loading branch information...
1 parent 767ddf3 commit ae668917466996537803f7c49b127b1d84ab6863 @santiycr santiycr committed Aug 9, 2012
@@ -349,6 +349,16 @@ protected function getDriver(array $browser)
$driver->setCustomData($browser['customData']);
}
+ if (isset($browser['avoidProxy'])) {
+ if (!is_bool($browser['avoidProxy'])) {
+ throw new InvalidArgumentException(
+ 'Array element "avoidProxy" is not a boolean.'
+ );
+ }
+
+ $driver->setAvoidProxy($browser['avoidProxy']);
+ }
+
$this->drivers[0] = $driver;
return $driver;
@@ -148,6 +148,11 @@ class PHPUnit_Extensions_SeleniumTestCase_SauceOnDemandTestCase_Driver extends P
protected $customData;
/**
+ * @var object
+ */
+ protected $avoidProxy;
+
+ /**
* @throws RuntimeException
*/
public function __construct()
@@ -270,6 +275,10 @@ public function start()
$data['custom-data'] = $this->customData;
}
+ if ($this->avoidProxy !== NULL) {
+ $data['avoid-proxy'] = $this->avoidProxy;
+ }
+
if (!isset($this->sessionId)) {
$this->sessionId = $this->getString(
'getNewBrowserSession',
@@ -561,6 +570,20 @@ public function setCustomData($customData)
}
/**
+ * @param object $customData
+ * @throws InvalidArgumentException
+ */
+ public function setAvoidProxy($avoidProxy)
+ {
+
+ if (!is_bool($avoidProxy)) {
+ throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'boolean');
+ }
+
+ $this->avoidProxy = $avoidProxy;
+ }
+
+ /**
* Let the monkeypatching begin! Can't believe the default Driver handled
* everything with a stop :S
* Hopefully we'll contribute this back soon
View
@@ -74,7 +74,8 @@ class MultipleTest extends PHPUnit_Extensions_SeleniumTestCase_SauceOnDemandTest
'maxDuration' => 300,
'idleTimeout' => 60,
'build' => 3,
- 'customData' => array('release' => '1.0')
+ 'customData' => array('release' => '1.0'),
+ 'avoidProxy' => true
),
array(
'name' => 'Google Chrome on Windows',

0 comments on commit ae66891

Please sign in to comment.