diff --git a/PHPWebDriver/WebDriverBase.php b/PHPWebDriver/WebDriverBase.php index f037dcd98..589f29047 100644 --- a/PHPWebDriver/WebDriverBase.php +++ b/PHPWebDriver/WebDriverBase.php @@ -129,7 +129,7 @@ protected function curl($http_method, } $url = sprintf('%s%s', $this->url, $command); - if ($params && (is_int($params) || is_string($params))) { + if (is_int($params) || is_string($params)) { $url .= '/' . $params; } diff --git a/test/EqualsTest.php b/test/EqualsTest.php new file mode 100644 index 000000000..a3f92176e --- /dev/null +++ b/test/EqualsTest.php @@ -0,0 +1,78 @@ +raiseError('Could not fork child process.'); + } elseif (self::$pid == 0) { + $webserver = &new LocalWebServer('127.0.0.1', $port); + $webserver->_driver->setDebugMode(false); + $webserver->documentRoot = dirname(__FILE__) . '/../www'; + $webserver->start(); + } else { + // the parent process does not have to do anything + } + } + } + + public function setUp() { + $driver = new PHPWebDriver_WebDriver(); + + $this->session = $driver->session(); + + $this->session->open("http://127.0.0.1:" . self::$port . "/equals.html"); + } + + public function tearDown() { + $this->session->close(); + } + + public static function tearDownAfterClass() { + posix_kill(self::$pid, SIGKILL); + } + + /** + * @group equals + */ + public function testEquals() { + $id = 'title'; + + $e1 = $this->session->element(PHPWebDriver_WebDriverBy::ID, $id); + $e2 = $this->session->element(PHPWebDriver_WebDriverBy::ID, $id); + + $this->assertTrue($e1->equals($e2->getID())); + } +} diff --git a/www/equals.html b/www/equals.html new file mode 100644 index 000000000..b3804b537 --- /dev/null +++ b/www/equals.html @@ -0,0 +1,7 @@ + + + + +
Title
+ +