public function setUp() { $bootstrap = parse_ini_file(dirname(__FILE__) . '/test.properties'); $this->jc = new JasperClient($bootstrap['hostname'], $bootstrap['port'], $bootstrap['admin_username'], $bootstrap['admin_password'], $bootstrap['base_url'], $bootstrap['admin_org']); $this->newUser = JasperTestUtils::createUser(); $this->newRole = new Role('NOT_A_REAL_ROLE', 'organization_1'); $this->jc->putUsers($this->newUser); }
public function setUp() { $bootstrap = parse_ini_file(dirname(__FILE__) . '/test.properties'); $this->jc = new JasperClient($bootstrap['hostname'], $bootstrap['port'], $bootstrap['admin_username'], $bootstrap['admin_password'], $bootstrap['base_url'], $bootstrap['admin_org']); $this->newUser = JasperTestUtils::createUser(); $this->attr = new Attribute('Gender', 'Robot'); $this->attr2 = new Attribute('Favorite Beer', 'Anchor Steam'); $this->attrArr = array($this->attr, $this->attr2); // $this->jc->putUsers($this->newUser); }
/** * Checks delRole() by actually deleting a Role from User. */ public function testRevokingARole_actuallyRevokesARole() { $user = JasperTestUtils::createUser(); $role = new Role('ROLE_DEMO', null, 'false'); $user->addRole($role); $this->jc->putUsers($user); $createdUser = $this->jc->getUsers($user->getUsername()); $createdUser = $createdUser[0]; $this->assertEquals(count($user->getRoles()), count($createdUser->getRoles())); $user->delRole($role); $this->jc->postUser($user); $updatedUser = $this->jc->getUsers($user->getUsername()); $updatedUser = $updatedUser[0]; $this->jc->deleteUser($user); $this->assertEquals(count($user->getRoles()), count($updatedUser->getRoles())); $this->assertEquals(count($createdUser->getRoles()) - 1, count($updatedUser->getRoles())); }