public function testShouldForwardErrorStringToDataFormat() { $result = new \Exception('Some error string'); $errorString = 'SomeErrorString'; $this->dataFormat->expects($this->once())->method('unserialize')->with($this->equalTo($errorString))->will($this->returnValue($result)); $resultData = $this->object->unserializeError('some method', $errorString); $this->assertEquals($result, $resultData); }