/** * Initializes new CloudSubscription object using the provided parameters. * * @param string $subscriptionId The Windows Azure subscription id. * @param string $certificatePath The registered certificate. */ public function __construct($subscriptionId, $certificatePath) { $config = new Configuration(); $config->setProperty(ServiceManagementSettings::SUBSCRIPTION_ID, $subscriptionId); $config->setProperty(ServiceManagementSettings::CERTIFICATE_PATH, $certificatePath); $config->setProperty(ServiceManagementSettings::URI, Resources::SERVICE_MANAGEMENT_URL); $this->_proxy = ServiceManagementService::create($config); }
/** * @covers WindowsAzure\ServiceManagement\ServiceManagementService::create */ public function testCreateWithConfig() { // Setup $config = new Configuration(); $config->setProperty(ServiceManagementSettings::SUBSCRIPTION_ID, '1234-45432'); $config->setProperty(ServiceManagementSettings::CERTIFICATE_PATH, '1234'); $config->setProperty(ServiceManagementSettings::URI, Resources::SERVICE_MANAGEMENT_URL); // Test $servicemanagementRestProxy = ServiceManagementService::create($config); // Assert $this->assertInstanceOf('WindowsAzure\\ServiceManagement\\Internal\\IServiceManagement', $servicemanagementRestProxy); }
public function __construct() { $config = new Configuration(); $config->setProperty(ServiceManagementSettings::SUBSCRIPTION_ID, TestResources::serviceManagementSubscriptionId()); $config->setProperty(ServiceManagementSettings::URI, Resources::SERVICE_MANAGEMENT_URL); $config->setProperty(ServiceManagementSettings::CERTIFICATE_PATH, TestResources::serviceManagementCertificatePath()); $serviceManagementRestProxy = ServiceManagementService::create($config); parent::__construct($config, $serviceManagementRestProxy); $this->createdStorageServices = array(); $this->createdAffinityGroups = array(); $this->storageCount = count($this->restProxy->listStorageServices()->getStorageServices()); $this->affinityGroupCount = count($this->restProxy->listAffinityGroups()->getAffinityGroups()); }