Permalink
Browse files

Merge branch 'develop' into selenium2-instaclick-migration

  • Loading branch information...
2 parents d139a5d + 77b249b commit 28e5a4b655032195ccff4fac65b32266bea1ffab @everzet everzet committed May 20, 2012
@@ -72,35 +72,11 @@ public function compile($version, $stability)
->in($this->libPath . '/vendor/fabpot')
->in($this->libPath . '/vendor/facebook')
->in($this->libPath . '/vendor/kriswallsmith')
- ->in($this->libPath . '/vendor/zendframework/zend-uri')
- ->in($this->libPath . '/vendor/zendframework/zend-http')
+ ->in($this->libPath . '/vendor/guzzle')
;
- $files = array(
- $this->libPath . '/vendor/autoload.php',
- $this->libPath . '/vendor/zendframework/zend-registry/php/Zend/Registry.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/Validator.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/AbstractValidator.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/Hostname.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/Ip.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/Hostname/Com.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/Hostname/Jp.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/Hostname/Cn.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/Hostname/Biz.php',
- $this->libPath . '/vendor/zendframework/zend-stdlib/php/Zend/Stdlib/Dispatchable.php',
- $this->libPath . '/vendor/zendframework/zend-stdlib/php/Zend/Stdlib/Message.php',
- $this->libPath . '/vendor/zendframework/zend-stdlib/php/Zend/Stdlib/MessageDescription.php',
- $this->libPath . '/vendor/zendframework/zend-stdlib/php/Zend/Stdlib/RequestDescription.php',
- $this->libPath . '/vendor/zendframework/zend-stdlib/php/Zend/Stdlib/Parameters.php',
- $this->libPath . '/vendor/zendframework/zend-stdlib/php/Zend/Stdlib/ParametersDescription.php',
- $this->libPath . '/vendor/zendframework/zend-stdlib/php/Zend/Stdlib/ResponseDescription.php',
- $this->libPath . '/vendor/zendframework/zend-loader/php/Zend/Loader/PluginClassLoader.php',
- $this->libPath . '/vendor/zendframework/zend-loader/php/Zend/Loader/PluginClassLocator.php',
- $this->libPath . '/vendor/zendframework/zend-loader/php/Zend/Loader/ShortNameLocator.php',
- );
-
$xmlSourceFiles = '';
- foreach (array_merge($files, iterator_to_array($finder)) as $file) {
+ foreach ($finder as $file) {
if (!$file instanceof \SplFileInfo) {
$file = new \SplFileInfo($file);
}
@@ -77,34 +77,10 @@ public function compile($version)
->in($this->libPath . '/vendor/fabpot')
->in($this->libPath . '/vendor/facebook')
->in($this->libPath . '/vendor/kriswallsmith')
- ->in($this->libPath . '/vendor/zendframework/zend-uri')
- ->in($this->libPath . '/vendor/zendframework/zend-http')
+ ->in($this->libPath . '/vendor/guzzle')
;
- $files = array(
- $this->libPath . '/vendor/autoload.php',
- $this->libPath . '/vendor/zendframework/zend-registry/php/Zend/Registry.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/Validator.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/AbstractValidator.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/Hostname.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/Ip.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/Hostname/Com.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/Hostname/Jp.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/Hostname/Cn.php',
- $this->libPath . '/vendor/zendframework/zend-validator/php/Zend/Validator/Hostname/Biz.php',
- $this->libPath . '/vendor/zendframework/zend-stdlib/php/Zend/Stdlib/Dispatchable.php',
- $this->libPath . '/vendor/zendframework/zend-stdlib/php/Zend/Stdlib/Message.php',
- $this->libPath . '/vendor/zendframework/zend-stdlib/php/Zend/Stdlib/MessageDescription.php',
- $this->libPath . '/vendor/zendframework/zend-stdlib/php/Zend/Stdlib/RequestDescription.php',
- $this->libPath . '/vendor/zendframework/zend-stdlib/php/Zend/Stdlib/Parameters.php',
- $this->libPath . '/vendor/zendframework/zend-stdlib/php/Zend/Stdlib/ParametersDescription.php',
- $this->libPath . '/vendor/zendframework/zend-stdlib/php/Zend/Stdlib/ResponseDescription.php',
- $this->libPath . '/vendor/zendframework/zend-loader/php/Zend/Loader/PluginClassLoader.php',
- $this->libPath . '/vendor/zendframework/zend-loader/php/Zend/Loader/PluginClassLocator.php',
- $this->libPath . '/vendor/zendframework/zend-loader/php/Zend/Loader/ShortNameLocator.php',
- );
-
- foreach (array_merge($files, iterator_to_array($finder)) as $file) {
+ foreach ($finder as $file) {
if (!$file instanceof \SplFileInfo) {
$file = new \SplFileInfo($file);
}
@@ -240,7 +240,7 @@ public function setCookie($name, $value = null)
public function getCookie($name)
{
try {
- return $this->evaluateScript(sprintf('_sahi._cookie("%s")', $name));
+ return urldecode($this->evaluateScript(sprintf('_sahi._cookie("%s")', $name)));
} catch (ConnectionException $e) {}
}
@@ -368,7 +368,7 @@ public function getCookie($name)
$cookies = $this->wdSession->getAllCookies();
foreach ($cookies as $cookie) {
if ($cookie['name'] === $name) {
- return $cookie['value'];
+ return urldecode($cookie['value']);
}
}
}
@@ -90,6 +90,21 @@ public function addressMatches($regex)
}
/**
+ * Checks that specified cookie exists
+ *
+ * @param string $name cookie name
+ *
+ * @throws Behat\Mink\Exception\ExpectationException
+ */
+ public function cookieExists($name)
+ {
+ if ($this->session->getCookie($name) === null) {
+ $message = sprintf('Cookie "%s" is not set, but should be.', $name);
+ throw new ExpectationException($message, $this->session);
+ }
+ }
+
+ /**
* Checks that current response code equals to provided one.
*
* @param integer $code
@@ -387,6 +387,20 @@ public function testBasicForm()
$this->assertEquals('Lastname: Kudryashov', $page->find('css', '#last')->getText());
}
+ public function testBasicGetForm()
+ {
+ $this->getSession()->visit($this->pathTo('/basic_get_form.php'));
+
+ $page = $this->getSession()->getPage();
+ $this->assertEquals('Basic Get Form Page', $page->find('css', 'h1')->getText());
+
+ $search = $page->findField('q');
+ $search->setValue('some#query');
+ $page->pressButton('Find');
+
+ $this->assertEquals('some#query', $page->find('css', '#search')->getText());
+ }
+
public function testMultiselect()
{
$this->getSession()->visit($this->pathTo('/multiselect_form.php'));
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
+<head>
+ <title>Basic Get Form</title>
+ <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
+</head>
+<body>
+ <h1>Basic Get Form Page</h1>
+
+ <div id="serach">
+ <?php echo isset($_GET['q']) && $_GET['q'] ? $_GET['q'] : 'No search query' ?>
+ </div>
+
+ <form>
+ <input name="q" value="" type="text" />
+
+ <input type="submit" value="Find" />
+ </form>
+</body>
+</html>
@@ -19,6 +19,6 @@ public function testSelector()
$this->assertEquals('descendant-or-self::h3', $selector->translateToXPath('h3'));
$this->assertEquals('descendant-or-self::h3/span', $selector->translateToXPath('h3 > span'));
- $this->assertEquals("descendant-or-self::h3/*/descendant::*[contains(concat(' ', normalize-space(@class), ' '), ' my_div ')]", $selector->translateToXPath('h3 > .my_div'));
+ $this->assertEquals("descendant-or-self::h3/*[contains(concat(' ', normalize-space(@class), ' '), ' my_div ')]", $selector->translateToXPath('h3 > .my_div'));
}
}
@@ -74,6 +74,29 @@ public function testAddressMatches()
);
}
+ /**
+ * @covers Behat\Mink\WebAssert::cookieExists
+ */
+ public function testCookieExists()
+ {
+ $this->session->
+ expects($this->any())->
+ method('getCookie')->
+ will($this->returnValueMap(
+ array(
+ array('foo', '1'),
+ array('bar', null),
+ )
+ ));
+
+ $this->assertCorrectAssertion('cookieExists', array('foo'));
+ $this->assertWrongAssertion(
+ 'cookieExists', array('bar'),
+ 'Behat\Mink\Exception\ExpectationException',
+ 'Cookie "bar" is not set, but should be.'
+ );
+ }
+
public function testStatusCodeEquals()
{
$this->session

0 comments on commit 28e5a4b

Please sign in to comment.