/** * @covers WindowsAzure\ServiceManagement\Models\Location::setName * @covers WindowsAzure\ServiceManagement\Models\Location::getName */ public function testSetName() { // Setup $Location = new Location(); $expected = 'Name'; // Test $Location->setName($expected); // Assert $this->assertEquals($expected, $Location->getName()); }
/** * Creates new ListLocationsResult from parsed response body. * * @param array $parsed The parsed response body. * * @return ListLocationsResult */ public static function create($parsed) { $result = new ListLocationsResult(); $result->_locations = array(); $entries = array(); if (!empty($parsed)) { $entries = Utilities::getArray($parsed[Resources::XTAG_LOCATION]); } foreach ($entries as $value) { $location = new Location(); $location->setName(Utilities::tryGetValue($value, Resources::XTAG_NAME)); $location->setDisplayName(Utilities::tryGetValue($value, Resources::XTAG_DISPLAY_NAME)); $result->_locations[] = $location; } return $result; }