Skip to content

Commit 2a9c96b

Browse files
committed
Merge pull request #97 from stof/mink_17
Updated the driver to use findElementsXpaths for Mink 1.7
2 parents 384c50d + 675588f commit 2a9c96b

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
"require": {
1818
"php": ">=5.3.1",
19-
"behat/mink": "~1.6@dev",
19+
"behat/mink": "~1.7@dev",
2020
"symfony/browser-kit": "~2.0",
2121
"symfony/dom-crawler": "~2.0"
2222
},

src/BrowserKitDriver.php

+2-13
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010

1111
namespace Behat\Mink\Driver;
1212

13-
use Behat\Mink\Element\NodeElement;
1413
use Behat\Mink\Exception\DriverException;
1514
use Behat\Mink\Exception\UnsupportedDriverActionException;
16-
use Behat\Mink\Session;
1715
use Symfony\Component\BrowserKit\Client;
1816
use Symfony\Component\BrowserKit\Cookie;
1917
use Symfony\Component\BrowserKit\Request;
@@ -36,7 +34,6 @@
3634
*/
3735
class BrowserKitDriver extends CoreDriver
3836
{
39-
private $session;
4037
private $client;
4138

4239
/**
@@ -74,14 +71,6 @@ public function getClient()
7471
return $this->client;
7572
}
7673

77-
/**
78-
* {@inheritdoc}
79-
*/
80-
public function setSession(Session $session)
81-
{
82-
$this->session = $session;
83-
}
84-
8574
/**
8675
* Tells driver to remove hostname from URL.
8776
*
@@ -345,13 +334,13 @@ public function getContent()
345334
/**
346335
* {@inheritdoc}
347336
*/
348-
public function find($xpath)
337+
public function findElementXpaths($xpath)
349338
{
350339
$nodes = $this->getCrawler()->filterXPath($xpath);
351340

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

357346
return $elements;

0 commit comments

Comments
 (0)