/**
  * @depends testSetMimeTypeSetsPropertyAsString
  */
 public function testGetMimeTypeReturnsPropertyValue()
 {
     $this->renditionData->setMimeType('foo');
     $this->assertSame('foo', $this->renditionData->getMimeType());
 }
 public function testConvertRenditionsConvertsArrayToRenditionObjects()
 {
     $expectedRendition1 = new RenditionData();
     $expectedRendition1->setStreamId('workspace://SpacesStore/8b49dd01-56bb-4980-b161-1249ac93eb72');
     $expectedRendition1->setHeight(100);
     $expectedRendition1->setWidth(100);
     $expectedRendition1->setLength(539);
     $expectedRendition1->setKind('doclib');
     $expectedRendition1->setMimeType('image/png');
     $expectedRendition1->setRenditionDocumentId('workspace://SpacesStore/8b49dd01-56bb-4980-b161-1249ac93eb73');
     $expectedRendition1->setTitle('title');
     $expectedRendition1->setExtensions($this->cmisExtensionsDummy);
     $expectedRendition2 = new RenditionData();
     $expectedRendition2->setStreamId('workspace://SpacesStore/8b49dd01-56bb-4980-b161-1249ac93eb74');
     $expectedRendition2->setHeight(100);
     $expectedRendition2->setWidth(100);
     $expectedRendition2->setLength(539);
     $expectedRendition2->setKind('doclib');
     $expectedRendition2->setMimeType('image/png');
     $expectedRendition2->setRenditionDocumentId('workspace://SpacesStore/8b49dd01-56bb-4980-b161-1249ac93eb75');
     $expectedRendition2->setTitle('title2');
     $expectedRendition2->setExtensions($this->cmisExtensionsDummy);
     $getObjectResponse = $this->getResponseFixtureContentAsArray('Cmis/v1.1/BrowserBinding/getObject-response.log');
     $result = $this->jsonConverter->convertRenditions($getObjectResponse[JSONConstants::JSON_OBJECT_RENDITIONS]);
     $this->assertEquals(array($expectedRendition1, $expectedRendition2), $result);
     return $result;
 }
 /**
  * Convert given input data to a RenditionData object
  *
  * @param array|null $data
  * @return null|RenditionData
  */
 public function convertRendition(array $data = null)
 {
     if (empty($data)) {
         return null;
     }
     $rendition = new RenditionData();
     if (isset($data[JSONConstants::JSON_RENDITION_HEIGHT])) {
         $rendition->setHeight((int) $data[JSONConstants::JSON_RENDITION_HEIGHT]);
     }
     if (isset($data[JSONConstants::JSON_RENDITION_KIND])) {
         $rendition->setKind((string) $data[JSONConstants::JSON_RENDITION_KIND]);
     }
     if (isset($data[JSONConstants::JSON_RENDITION_LENGTH])) {
         $rendition->setLength((int) $data[JSONConstants::JSON_RENDITION_LENGTH]);
     }
     if (isset($data[JSONConstants::JSON_RENDITION_MIMETYPE])) {
         $rendition->setMimeType((string) $data[JSONConstants::JSON_RENDITION_MIMETYPE]);
     }
     if (isset($data[JSONConstants::JSON_RENDITION_DOCUMENT_ID])) {
         $rendition->setRenditionDocumentId((string) $data[JSONConstants::JSON_RENDITION_DOCUMENT_ID]);
     }
     if (isset($data[JSONConstants::JSON_RENDITION_STREAM_ID])) {
         $rendition->setStreamId((string) $data[JSONConstants::JSON_RENDITION_STREAM_ID]);
     }
     if (isset($data[JSONConstants::JSON_RENDITION_TITLE])) {
         $rendition->setTitle((string) $data[JSONConstants::JSON_RENDITION_TITLE]);
     }
     if (isset($data[JSONConstants::JSON_RENDITION_WIDTH])) {
         $rendition->setWidth((int) $data[JSONConstants::JSON_RENDITION_WIDTH]);
     }
     $rendition->setExtensions($this->convertExtension($data, JSONConstants::getRenditionKeys()));
     return $rendition;
 }