/** * Creates a new Role from parsed response body. * * @param array $parsed The parsed response body in array representation. * * @return Role */ public static function create($parsed) { $role = new Role(); $roleName = Utilities::tryGetValue($parsed, Resources::XTAG_ROLE_NAME); $osVersion = Utilities::tryGetValue($parsed, Resources::XTAG_OS_VERSION); $role->setOsVersion($osVersion); $role->setRoleName($roleName); return $role; }
/** * @covers WindowsAzure\ServiceManagement\Models\Role::setOsVersion * @covers WindowsAzure\ServiceManagement\Models\Role::getOsVersion */ public function testSetOsVersion() { // Setup $expected = 'osversion'; $role = new Role(); // Test $role->setOsVersion($expected); // Assert $this->assertEquals($expected, $role->getOsVersion()); }