コード例 #1
0
 /**
  * @covers WindowsAzure\ServiceManagement\Models\ServiceProperties::setUrl
  * @covers WindowsAzure\ServiceManagement\Models\ServiceProperties::getUrl
  */
 public function testSetUrl()
 {
     // Setup
     $service = new ServiceProperties();
     $expected = 'Url';
     // Test
     $service->setUrl($expected);
     // Assert
     $this->assertEquals($expected, $service->getUrl());
 }
コード例 #2
0
 /**
  * Creates new ListStorageServicesResult from parsed response body.
  * 
  * @param array $parsed The parsed response body.
  * 
  * @return ListStorageServicesResult
  */
 public static function create($parsed)
 {
     $result = new ListStorageServicesResult();
     $result->_storageServices = array();
     $entries = Utilities::tryGetArray(Resources::XTAG_STORAGE_SERVICE, $parsed);
     foreach ($entries as $value) {
         $properties = new ServiceProperties();
         $properties->setServiceName(Utilities::tryGetValue($value, Resources::XTAG_SERVICE_NAME));
         $properties->setUrl(Utilities::tryGetValue($value, Resources::XTAG_URL));
         $result->_storageServices[] = $properties;
     }
     return $result;
 }
コード例 #3
0
 /**
  * Creates GetAffinityGroupPropertiesResult from parsed response into array.
  * 
  * @param array $parsed The parsed HTTP response body.
  * 
  * @return GetAffinityGroupPropertiesResult 
  */
 public static function create($parsed)
 {
     $result = new GetAffinityGroupPropertiesResult();
     $hostedServices = Utilities::tryGetArray(Resources::XTAG_HOSTED_SERVICES, $parsed);
     $storageServices = Utilities::tryGetArray(Resources::XTAG_STORAGE_SERVICES, $parsed);
     $result->_affinityGroup = new AffinityGroup($parsed);
     foreach ($hostedServices as $value) {
         $service = new ServiceProperties();
         $service->setServiceName(Utilities::tryGetValue($value, Resources::XTAG_SERVICE_NAME));
         $service->setUrl(Utilities::tryGetValue($value, Resources::XTAG_URL));
         $result->_hostedServices[] = $service;
     }
     foreach ($storageServices as $value) {
         $service = new ServiceProperties();
         $service->setServiceName(Utilities::tryGetValue($value, Resources::XTAG_SERVICE_NAME));
         $service->setUrl(Utilities::tryGetValue($value, Resources::XTAG_URL));
         $result->_storageServices[] = $service;
     }
     return $result;
 }