Browse files

fixed conditions CS

  • Loading branch information...
1 parent d6d2782 commit 59cd4d22f1d914d172ff6cbca69a019afde6b16a @everzet everzet committed Dec 21, 2011
Showing with 10 additions and 11 deletions.
  1. +10 −10 src/Behat/Mink/Driver/Selenium2Driver.php
  2. +0 −1 tests/Behat/Mink/Driver/Selenium2DriverTest.php
View
20 src/Behat/Mink/Driver/Selenium2Driver.php
@@ -84,7 +84,7 @@ protected function setBrowserName($browserName = 'firefox')
*/
public function setDesiredCapabilities($desiredCapabilities = null)
{
- if ( $desiredCapabilities === null ) {
+ if ($desiredCapabilities === null) {
$desiredCapabilities = self::getDefaultCapabilities();
}
$this->desiredCapabilities = $desiredCapabilities;
@@ -116,7 +116,7 @@ protected static function getDefaultCapabilities()
protected function withSyn()
{
$hasSyn = $this->wdSession->execute(array('script'=>'return typeof window["Syn"]!=="undefined"', 'args'=>array()));
- if ( !$hasSyn ) {
+ if (!$hasSyn) {
$synJs = file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Selenium2' . DIRECTORY_SEPARATOR . 'syn.js');
$this->wdSession->execute(array('script'=>$synJs, 'args'=>array()));
}
@@ -132,7 +132,7 @@ protected function withSyn()
*/
protected static function charToOptions($event, $char, $modifier=null)
{
- if ( is_numeric($char) ) {
+ if (is_numeric($char)) {
$ord = $char;
$char = chr($char);
} else {
@@ -142,7 +142,7 @@ protected static function charToOptions($event, $char, $modifier=null)
'keyCode' => $ord,
'charCode' => $ord
);
- if ( $modifier ) {
+ if ($modifier) {
$options[$modifier.'Key'] = 1;
}
$json = json_encode($options);
@@ -183,7 +183,7 @@ public function setSession(Session $session)
public function start()
{
$this->wdSession = $this->webDriver->session($this->browserName, $this->desiredCapabilities);
- if ( !$this->wdSession ) {
+ if (!$this->wdSession) {
throw new DriverException('Could not connect to a Selenium 2 / WebDriver server');
}
$this->started = true;
@@ -204,7 +204,7 @@ public function isStarted()
*/
public function stop()
{
- if ( !$this->wdSession ) {
+ if (!$this->wdSession) {
throw new DriverException('Could not connect to a Selenium 2 / WebDriver server');
}
$this->started = false;
@@ -304,7 +304,7 @@ public function getResponseHeaders()
*/
public function setCookie($name, $value = null)
{
- if ( $value !== null ) {
+ if ($value !== null) {
$cookieArray = array(
'name' => $name,
'value' => (string) $value,
@@ -327,7 +327,7 @@ public function getCookie($name)
{
$cookies = $this->wdSession->getAllCookies();
foreach ( $cookies as $cookie ) {
- if ( $cookie['name'] === $name ) {
+ if ($cookie['name'] === $name) {
return $cookie['value'];
}
}
@@ -368,7 +368,7 @@ public function find($xpath)
foreach ( $nodes as $i => $node ) {
$elements[] = new NodeElement(sprintf('(%s)[%d]', $xpath, $i+1), $this->session);
}
- if ( !empty($elements) ) {
+ if (!empty($elements)) {
return $elements;
}
}
@@ -423,7 +423,7 @@ public function getHtml($xpath)
public function getAttribute($xpath, $attr)
{
$attribute = $this->wdSession->element('xpath', $xpath)->attribute($attr);
- if ( $attribute !== '' ) {
+ if ($attribute !== '') {
return $attribute;
}
}
View
1 tests/Behat/Mink/Driver/Selenium2DriverTest.php
@@ -33,5 +33,4 @@ public function testOtherMouseEvents()
$clicker->mouseOver();
$this->assertEquals('mouse overed', $clicker->getText());
}
-
}

0 comments on commit 59cd4d2

Please sign in to comment.