diff --git a/src/Session.php b/src/Session.php index 5a1c72149..b58ed5252 100644 --- a/src/Session.php +++ b/src/Session.php @@ -12,7 +12,6 @@ use Behat\Mink\Driver\DriverInterface; use Behat\Mink\Element\ElementFinder; -use Behat\Mink\Selector\SelectorsHandler; use Behat\Mink\Element\DocumentElement; /** @@ -24,7 +23,6 @@ class Session { private $driver; private $page; - private $selectorsHandler; /** * @var Element\ElementFinder @@ -34,24 +32,18 @@ class Session /** * Initializes session. * - * @param DriverInterface $driver - * @param SelectorsHandler|null $selectorsHandler - * @param ElementFinder|null $elementFinder + * @param DriverInterface $driver + * @param ElementFinder|null $elementFinder */ - public function __construct(DriverInterface $driver, SelectorsHandler $selectorsHandler = null, ElementFinder $elementFinder = null) + public function __construct(DriverInterface $driver, ElementFinder $elementFinder = null) { - if (null === $selectorsHandler) { - $selectorsHandler = new SelectorsHandler(); - } - if (null === $elementFinder) { - $elementFinder = new ElementFinder($driver, $selectorsHandler); + $elementFinder = new ElementFinder($driver); } - $this->driver = $driver; - $this->selectorsHandler = $selectorsHandler; - $this->elementFinder = $elementFinder; - $this->page = new DocumentElement($driver, $elementFinder); + $this->driver = $driver; + $this->elementFinder = $elementFinder; + $this->page = new DocumentElement($driver, $elementFinder); } /** @@ -133,16 +125,6 @@ public function getPage() return $this->page; } - /** - * Returns selectors handler. - * - * @return SelectorsHandler - */ - public function getSelectorsHandler() - { - return $this->selectorsHandler; - } - /** * Visit specified URL. * diff --git a/tests/SessionTest.php b/tests/SessionTest.php index 3e0104a71..91b98e855 100644 --- a/tests/SessionTest.php +++ b/tests/SessionTest.php @@ -10,7 +10,6 @@ class SessionTest extends \PHPUnit_Framework_TestCase * @var \PHPUnit_Framework_MockObject_MockObject */ private $driver; - private $selectorsHandler; /** * Session. @@ -22,8 +21,7 @@ class SessionTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->driver = $this->getMockBuilder('Behat\Mink\Driver\DriverInterface')->getMock(); - $this->selectorsHandler = $this->getMockBuilder('Behat\Mink\Selector\SelectorsHandler')->getMock(); - $this->session = new Session($this->driver, $this->selectorsHandler); + $this->session = new Session($this->driver); } public function testGetDriver() @@ -36,16 +34,11 @@ public function testGetPage() $this->assertInstanceOf('Behat\Mink\Element\DocumentElement', $this->session->getPage()); } - public function testGetSelectorsHandler() - { - $this->assertSame($this->selectorsHandler, $this->session->getSelectorsHandler()); - } - public function testInstantiateWithoutOptionalDeps() { - $session = new Session($this->driver); + new Session($this->driver); - $this->assertInstanceOf('Behat\Mink\Selector\SelectorsHandler', $session->getSelectorsHandler()); + $this->assertTrue(true, 'The instantiation should work.'); } public function testIsStarted()