/** * @covers WindowsAzure\ServiceManagement\Models\ServiceProperties::setServiceName * @covers WindowsAzure\ServiceManagement\Models\ServiceProperties::getServiceName */ public function testSetServiceName() { // Setup $service = new ServiceProperties(); $expected = 'ServiceName'; // Test $service->setServiceName($expected); // Assert $this->assertEquals($expected, $service->getServiceName()); }
/** * 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; }
/** * 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; }