public function testExceptionWhileRenderingString()
 {
     $driver = $this->getMock('Behat\\Mink\\Driver\\DriverInterface');
     $driver->expects($this->any())->method('getContent')->will($this->throwException(new \Exception('Broken page')));
     $exception = new ExpectationException('Expectation failure', $driver);
     $this->assertEquals('Expectation failure', $exception->__toString());
 }
 public function testExceptionWhileRenderingString()
 {
     $session = $this->getSessionMock();
     $session->expects($this->any())->method('getPage')->will($this->throwException(new \Exception('Broken page')));
     $exception = new ExpectationException('Expectation failure', $session);
     $this->assertEquals('Expectation failure', $exception->__toString());
 }