public static function setUpBeforeClass() { $adminUsername = getenv('jasmin_admin_username') ?: 'jcliadmin'; $adminPassword = getenv('jasmin_admin_password') ?: 'jclipwd'; $adminHost = getenv('jasmin_admin_host') ?: '127.0.0.1'; $adminPort = getenv('jasmin_admin_port') ?: 8990; self::$telnetConnector = JasminConnector::init($adminUsername, $adminPassword, $adminHost, $adminPort); $groupManager = new \JasminWeb\Jasmin\Group(self::$telnetConnector); $groupManager->setId('test_new_one'); $groupManager->delete(); $groupManager->setId('test_exist'); $groupManager->save(); $userManager = new \JasminWeb\Jasmin\User(self::$telnetConnector); $userManager->setId('test_not_exist'); $userManager->delete(); $userManager->setId('test_new_one'); $userManager->delete(); $userManager->setId('test_exist'); $userManager->delete(); $userManager->setId('test_exist'); $userManager->attributes['username'] = '******'; $userManager->attributes['password'] = '******'; $userManager->attributes['gid'] = 'test_exist'; $userManager->add(); }
public function testAddNewOne() { $manager = new \JasminWeb\Jasmin\Group(self::$telnetConnector); $this->assertFalse($manager->checkExist('test_new_one')); $manager->setId('test_new_one'); $this->assertTrue($manager->save()); $this->assertTrue($manager->checkExist('test_new_one')); $this->assertTrue($manager->delete()); $this->assertFalse($manager->checkExist('test_new_one')); }