/** * @covers WindowsAzure\Blob\Models\GetBlobPropertiesResult::getProperties */ public function testGetProperties() { // Setup $properties = new GetBlobPropertiesResult(); $expected = new BlobProperties(); $properties->setProperties($expected); // Test $actual = $properties->getProperties(); // Assert $this->assertEquals($expected, $actual); }
/** * Creates GetBlobPropertiesResult from headers array. * * @param array $headers The HTTP response headers array. * * @return GetBlobPropertiesResult */ private function _getBlobPropertiesResultFromResponse($headers) { $result = new GetBlobPropertiesResult(); $properties = new BlobProperties(); $d = $headers[Resources::LAST_MODIFIED]; $bType = $headers[Resources::X_MS_BLOB_TYPE]; $cLength = intval($headers[Resources::CONTENT_LENGTH]); $lStatus = Utilities::tryGetValue($headers, Resources::X_MS_LEASE_STATUS); $cType = Utilities::tryGetValue($headers, Resources::CONTENT_TYPE); $cMD5 = Utilities::tryGetValue($headers, Resources::CONTENT_MD5); $cEncoding = Utilities::tryGetValue($headers, Resources::CONTENT_ENCODING); $cLanguage = Utilities::tryGetValue($headers, Resources::CONTENT_LANGUAGE); $cControl = Utilities::tryGetValue($headers, Resources::CACHE_CONTROL); $etag = $headers[Resources::ETAG]; $metadata = $this->getMetadataArray($headers); if (array_key_exists(Resources::X_MS_BLOB_SEQUENCE_NUMBER, $headers)) { $sNumber = intval($headers[Resources::X_MS_BLOB_SEQUENCE_NUMBER]); $properties->setSequenceNumber($sNumber); } $properties->setBlobType($bType); $properties->setCacheControl($cControl); $properties->setContentEncoding($cEncoding); $properties->setContentLanguage($cLanguage); $properties->setContentLength($cLength); $properties->setContentMD5($cMD5); $properties->setContentType($cType); $properties->setETag($etag); $properties->setLastModified(Utilities::rfc1123ToDateTime($d)); $properties->setLeaseStatus($lStatus); $result->setProperties($properties); $result->setMetadata($metadata); return $result; }