/** * @covers WindowsAzure\ServiceManagement\Models\GetDeploymentResult::setDeployment * @covers WindowsAzure\ServiceManagement\Models\GetDeploymentResult::getDeployment */ public function testSetDeployment() { // Setup $expected = new Deployment(); $result = new GetDeploymentResult(); // Test $result->setDeployment($expected); // Assert $this->assertEquals($expected, $result->getDeployment()); }
/** * Returns configuration information, status, and system properties for a * deployment. * * The getDeployment API can be used to retrieve information for a specific * deployment or for all deployments in the staging or production environment. * If you want to retrieve information about a specific deployment, you must * first get the unique name for the deployment. This unique name is part of the * response when you make a request to get all deployments in an environment. * * @param string $name The hosted service name. * @param GetDeploymentOptions $options The optional parameters. * * @return GetDeploymentResult * * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee460804.aspx */ public function getDeployment($name, $options) { Validate::isString($name, 'name'); Validate::notNullOrEmpty($name, 'name'); Validate::notNullOrEmpty($options, 'options'); $context = new HttpCallContext(); $path = $this->_getDeploymentPath($name, $options); $context->setMethod(Resources::HTTP_GET); $context->setPath($path); $context->addStatusCode(Resources::STATUS_OK); $response = $this->sendContext($context); $parsed = $this->dataSerializer->unserialize($response->getBody()); return GetDeploymentResult::create($parsed); }