private function checkDataFormat(DataFormatInterface $dataFormat) { $mimeTypes = $dataFormat->getMimeTypes(); if (!is_array($mimeTypes) || $mimeTypes === array()) { throw new \UnexpectedValueException('Data format must returns array of supported mime types'); } }
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); }