/**
  * @covers WindowsAzure\Blob\Models\ListBlobBlocksResult::setContentType
  * @covers WindowsAzure\Blob\Models\ListBlobBlocksResult::getContentType
  */
 public function testSetContentType()
 {
     // Setup
     $expected = '0x8CAFB82EFF70C46';
     $result = new ListBlobBlocksResult();
     $result->setContentType($expected);
     // Test
     $result->setContentType($expected);
     // Assert
     $this->assertEquals($expected, $result->getContentType());
 }
Пример #2
0
 /**
  * Creates ListBlobBlocksResult from given response headers and parsed body
  * 
  * @param array $headers HTTP response headers
  * @param array $parsed  HTTP response body in array representation
  * 
  * @return ListBlobBlocksResult
  */
 public static function create($headers, $parsed)
 {
     $result = new ListBlobBlocksResult();
     $clean = array_change_key_case($headers);
     $result->setETag(Utilities::tryGetValue($clean, Resources::ETAG));
     $date = Utilities::tryGetValue($clean, Resources::LAST_MODIFIED);
     if (!is_null($date)) {
         $date = Utilities::rfc1123ToDateTime($date);
         $result->setLastModified($date);
     }
     $result->setContentLength(intval(Utilities::tryGetValue($clean, Resources::X_MS_BLOB_CONTENT_LENGTH)));
     $result->setContentType(Utilities::tryGetValue($clean, Resources::CONTENT_TYPE));
     $result->_uncommittedBlocks = self::_getEntries($parsed, 'UncommittedBlocks');
     $result->_committedBlocks = self::_getEntries($parsed, 'CommittedBlocks');
     return $result;
 }