/**
  * @covers WindowsAzure\Blob\Models\GetContainerPropertiesResult::setETag
  */
 public function testSetETag()
 {
     // Setup
     $properties = new GetContainerPropertiesResult();
     $expected = '0x8CACB9BD7C6B1B2';
     // Test
     $properties->setETag($expected);
     // Assert
     $actual = $properties->getETag();
     $this->assertEquals($expected, $actual);
 }
Пример #2
0
 /**
  * Helper method for getContainerProperties and getContainerMetadata.
  * 
  * @param string                    $container The container name.
  * @param Models\BlobServiceOptions $options   The optional parameters.
  * @param string                    $operation The operation string. Should be
  * 'metadata' to get metadata.
  * 
  * @return Models\GetContainerPropertiesResult
  */
 private function _getContainerPropertiesImpl($container, $options = null, $operation = null)
 {
     Validate::isString($container, 'container');
     $method = Resources::HTTP_GET;
     $headers = array();
     $queryParams = array();
     $postParams = array();
     $path = $container;
     $statusCode = Resources::STATUS_OK;
     if (is_null($options)) {
         $options = new BlobServiceOptions();
     }
     $this->addOptionalQueryParam($queryParams, Resources::QP_REST_TYPE, 'container');
     $this->addOptionalQueryParam($queryParams, Resources::QP_COMP, $operation);
     $this->addOptionalQueryParam($queryParams, Resources::QP_TIMEOUT, $options->getTimeout());
     $response = $this->send($method, $headers, $queryParams, $postParams, $path, $statusCode);
     $result = new GetContainerPropertiesResult();
     $metadata = $this->getMetadataArray($response->getHeader());
     $date = $response->getHeader(Resources::LAST_MODIFIED);
     $date = Utilities::rfc1123ToDateTime($date);
     $result->setETag($response->getHeader(Resources::ETAG));
     $result->setMetadata($metadata);
     $result->setLastModified($date);
     return $result;
 }