/** * @group legacy */ public function testConstructWithSession() { $driver = $this->getMock('Behat\\Mink\\Driver\\DriverInterface'); $session = $this->getMockBuilder('Behat\\Mink\\Session')->disableOriginalConstructor()->getMock(); $session->expects($this->any())->method('getDriver')->will($this->returnValue($driver)); $exception = new ElementNotFoundException($session); $this->assertEquals('Tag not found.', $exception->getMessage()); }
/** * @dataProvider provideExceptionMessage */ public function testBuildMessage($message, $type, $selector = null, $locator = null) { $session = $this->getMockBuilder('Behat\\Mink\\Session')->disableOriginalConstructor()->getMock(); $exception = new ElementNotFoundException($session, $type, $selector, $locator); $this->assertEquals($message, $exception->getMessage()); }