Skip to content

Commit

Permalink
Merge pull request #97 from stof/mink_17
Browse files Browse the repository at this point in the history
Updated the driver to use findElementsXpaths for Mink 1.7
  • Loading branch information
stof committed Feb 5, 2015
2 parents 384c50d + 675588f commit 2a9c96b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

"require": {
"php": ">=5.3.1",
"behat/mink": "~1.6@dev",
"behat/mink": "~1.7@dev",
"symfony/browser-kit": "~2.0",
"symfony/dom-crawler": "~2.0"
},
Expand Down
15 changes: 2 additions & 13 deletions src/BrowserKitDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@

namespace Behat\Mink\Driver;

use Behat\Mink\Element\NodeElement;
use Behat\Mink\Exception\DriverException;
use Behat\Mink\Exception\UnsupportedDriverActionException;
use Behat\Mink\Session;
use Symfony\Component\BrowserKit\Client;
use Symfony\Component\BrowserKit\Cookie;
use Symfony\Component\BrowserKit\Request;
Expand All @@ -36,7 +34,6 @@
*/
class BrowserKitDriver extends CoreDriver
{
private $session;
private $client;

/**
Expand Down Expand Up @@ -74,14 +71,6 @@ public function getClient()
return $this->client;
}

/**
* {@inheritdoc}
*/
public function setSession(Session $session)
{
$this->session = $session;
}

/**
* Tells driver to remove hostname from URL.
*
Expand Down Expand Up @@ -345,13 +334,13 @@ public function getContent()
/**
* {@inheritdoc}
*/
public function find($xpath)
public function findElementXpaths($xpath)
{
$nodes = $this->getCrawler()->filterXPath($xpath);

$elements = array();
foreach ($nodes as $i => $node) {
$elements[] = new NodeElement(sprintf('(%s)[%d]', $xpath, $i + 1), $this->session);
$elements[] = sprintf('(%s)[%d]', $xpath, $i + 1);
}

return $elements;
Expand Down

0 comments on commit 2a9c96b

Please sign in to comment.