/** * @covers WindowsAzure\ServiceManagement\Models\GetDeploymentOptions::setSlot * @covers WindowsAzure\ServiceManagement\Models\GetDeploymentOptions::getSlot */ public function testSetSlot() { // Setup $expected = 'production'; $options = new GetDeploymentOptions(); // Test $options->setSlot($expected); // Assert $this->assertEquals($expected, $options->getSlot()); }
public function deleteDeployment($name, $slot = null) { $options = new GetDeploymentOptions(); $options->setSlot(is_null($slot) ? $this->defaultSlot : $slot); $result = $this->restProxy->deleteDeployment($name, $options); $this->blockUntilAsyncSucceed($result); }
/** * @covers WindowsAzure\ServiceManagement\ServiceManagementRestProxy::walkUpgradeDomain * @covers WindowsAzure\ServiceManagement\ServiceManagementRestProxy::_getDeploymentPath * @covers WindowsAzure\ServiceManagement\ServiceManagementRestProxy::_getPath * @covers WindowsAzure\ServiceManagement\ServiceManagementRestProxy::_createRequestXml * @covers WindowsAzure\ServiceManagement\Models\AsynchronousOperationResult::create * @group Deployment */ public function testWalkUpgradeDomain() { // Setup $name = $this->getTestName(); $this->createDeployment($name); $mode = Mode::MANUAL; $configuration = $this->complexConfiguration; $packageUrl = TestResources::complexPackageUrl(); $label = base64_encode($name . 'upgraded'); $force = true; $options = new UpgradeDeploymentOptions(); $options->setDeploymentName($name); $expectedInstancesCount = 4; $result = $this->restProxy->upgradeDeployment($name, $mode, $packageUrl, $configuration, $label, $force, $options); // Block until the upgrade is done. $this->blockUntilAsyncSucceed($result); // Test $result = $this->restProxy->walkUpgradeDomain($name, 0, $options); // Block until the walk upgrade is done. $this->blockUntilAsyncSucceed($result); // Assert $options = new GetDeploymentOptions(); $options->setSlot(DeploymentSlot::PRODUCTION); $result = $this->restProxy->getDeployment($name, $options); $deployment = $result->getDeployment(); $this->assertCount($expectedInstancesCount, $deployment->getRoleInstanceList()); }