getMock('Behat\Mink\Driver\DriverInterface'), new \Exception('Something failed')); $this->assertEquals('Something failed', $exception->getMessage()); } public function testExceptionToString() { $driver = $this->getMock('Behat\Mink\Driver\DriverInterface'); $driver->expects($this->any()) ->method('getStatusCode') ->will($this->returnValue(200)); $driver->expects($this->any()) ->method('getCurrentUrl') ->will($this->returnValue('http://localhost/test')); $html = "
Test
\n"; $driver->expects($this->any()) ->method('getContent') ->will($this->returnValue($html)); $expected = <<<'TXT' Expectation failure +--[ HTTP/1.1 200 | http://localhost/test | %s ] | | |Test
| | TXT; $expected = sprintf($expected.' ', get_class($driver)); $exception = new ExpectationException('Expectation failure', $driver); $this->assertEquals($expected, $exception->__toString()); } public function testBigContent() { $driver = $this->getMock('Behat\Mink\Driver\DriverInterface'); $driver->expects($this->any()) ->method('getStatusCode') ->will($this->returnValue(200)); $driver->expects($this->any()) ->method('getCurrentUrl') ->will($this->returnValue('http://localhost/test')); $body = str_repeat('a', 1001 - strlen('')); $html = sprintf("