/**
  * @covers WindowsAzure\Common\Models\GetServicePropertiesResult::setValue
  */
 public function testSetValue()
 {
     // Setup
     $result = new GetServicePropertiesResult();
     $expected = ServiceProperties::create(TestResources::getServicePropertiesSample());
     // Test
     $result->setValue($expected);
     // Assert
     $this->assertEquals($expected, $result->getValue());
 }
 /**
  * @covers WindowsAzure\Common\Models\ServiceProperties::toXml
  */
 public function testToXml()
 {
     // Setup
     $properties = ServiceProperties::create(TestResources::getServicePropertiesSample());
     $xmlSerializer = new XmlSerializer();
     // Test
     $actual = $properties->toXml($xmlSerializer);
     // Assert
     $actualParsed = Utilities::unserialize($actual);
     $actualProperties = GetServicePropertiesResult::create($actualParsed);
     $this->assertEquals($actualProperties->getValue(), $properties);
 }
Beispiel #3
0
 /**
  * Gets the properties of the Blob service.
  * 
  * @param Models\BlobServiceOptions $options The optional parameters.
  * 
  * @return WindowsAzure\Common\Models\GetServicePropertiesResult
  * 
  * @see http://msdn.microsoft.com/en-us/library/windowsazure/hh452239.aspx
  */
 public function getServiceProperties($options = null)
 {
     $method = Resources::HTTP_GET;
     $headers = array();
     $queryParams = array();
     $postParams = array();
     $path = Resources::EMPTY_STRING;
     $statusCode = Resources::STATUS_OK;
     if (is_null($options)) {
         $options = new BlobServiceOptions();
     }
     $this->addOptionalQueryParam($queryParams, Resources::QP_TIMEOUT, $options->getTimeout());
     $this->addOptionalQueryParam($queryParams, Resources::QP_REST_TYPE, 'service');
     $this->addOptionalQueryParam($queryParams, Resources::QP_COMP, 'properties');
     $response = $this->send($method, $headers, $queryParams, $postParams, $path, $statusCode);
     $parsed = $this->dataSerializer->unserialize($response->getBody());
     return GetServicePropertiesResult::create($parsed);
 }
 /**
  * Gets the properties of the Table service.
  * 
  * @param Models\TableServiceOptions $options optional table service options.
  * 
  * @return WindowsAzure\Common\Models\GetServicePropertiesResult
  * 
  * @see http://msdn.microsoft.com/en-us/library/windowsazure/hh452238.aspx
  */
 public function getServiceProperties($options = null)
 {
     if (is_null($options)) {
         $options = new TableServiceOptions();
     }
     $context = new HttpCallContext();
     $timeout = $options->getTimeout();
     $context->setMethod(Resources::HTTP_GET);
     $context->addOptionalQueryParameter(Resources::QP_REST_TYPE, 'service');
     $context->addOptionalQueryParameter(Resources::QP_COMP, 'properties');
     $context->addOptionalQueryParameter(Resources::QP_TIMEOUT, $timeout);
     $context->addStatusCode(Resources::STATUS_OK);
     $response = $this->sendContext($context);
     $parsed = $this->dataSerializer->unserialize($response->getBody());
     return GetServicePropertiesResult::create($parsed);
 }