public function testResponseCanBeCreatedFromData()
 {
     $key = 'key';
     $value = 'value';
     $response = JobProcessed::fromData(array('results' => array($key => $value)));
     $this->assertInstanceOf(JobProcessed::CLASS, $response);
     $this->assertEquals($value, $response->getResult($key));
 }
 /**
  * @param BlitlineJobProcessedResponse|array $response
  * @return BlitlineJobProcessedResponse
  */
 protected function getJobProcessedResponse($response)
 {
     if (!$response instanceof BlitlineJobProcessedResponse) {
         if (!is_array($response)) {
             throw new Exception\ProcessingFailedException('Invalid response; expected array or Detail\\Blitline\\Response\\JobProcessed object');
         }
         try {
             $response = BlitlineJobProcessedResponse::fromData($response);
         } catch (\Exception $e) {
             throw new Exception\ProcessingFailedException(sprintf('Processing failed after response data have been received: %s', $e->getMessage()), 0, $e);
         }
     }
     return $response;
 }