client = new TestClient(); } public function testGetClient() { $this->assertSame($this->client, $this->getDriver()->getClient()); } /** * @expectedException \Behat\Mink\Exception\DriverException * @expectedExceptionMessage Unable to access the response before visiting a page */ public function testGetResponseHeaderWithoutVisit() { $this->getDriver()->getResponseHeaders(); } /** * @expectedException \Behat\Mink\Exception\DriverException * @expectedExceptionMessage Unable to access the response content before visiting a page */ public function testFindWithoutVisit() { $this->getDriver()->find('//html'); } /** * @expectedException \Behat\Mink\Exception\DriverException * @expectedExceptionMessage Unable to access the request before visiting a page */ public function testGetCurrentUrlWithoutVisit() { $this->getDriver()->getCurrentUrl(); } /** * @expectedException \Behat\Mink\Exception\DriverException * @expectedExceptionMessage The selected node has an invalid form attribute (foo) */ public function testNotMatchingHtml5FormId() { $html = <<<'HTML'
HTML; $this->client->setNextResponse(new Response($html)); $driver = $this->getDriver(); $driver->visit('/index.php'); $driver->setValue('//input[./@name="test"]', 'bar'); } /** * @expectedException \Behat\Mink\Exception\DriverException * @expectedExceptionMessage The selected node has an invalid form attribute (foo) */ public function testInvalidHtml5FormId() { $html = <<<'HTML' HTML; $this->client->setNextResponse(new Response($html)); $driver = $this->getDriver(); $driver->visit('/index.php'); $driver->setValue('//input[./@name="test"]', 'bar'); } /** * @expectedException \Behat\Mink\Exception\DriverException * @expectedExceptionMessage The selected node does not have a form ancestor. */ public function testManipulateInputWithoutForm() { $html = <<<'HTML'