/** * try to delete an user * */ public function testDeleteUser() { $user = $this->testAddUser(); $this->_backend->deleteUser($user); unset($this->objects['users']['testUser']); $this->setExpectedException('Tinebase_Exception_NotFound'); $this->_backend->getUserById($user, 'Tinebase_Model_FullUser'); }
/** * test deleting groupmembers * */ public function testRemoveGroupMember() { $group = $this->_groupLDAP->getGroupByName('tine20phpunit'); $this->objects['initialAccount']->accountPrimaryGroup = $group->getId(); try { $user = $this->_userLDAP->addUser($this->objects['initialAccount']); } catch (Exception $e) { $user = $this->_userLDAP->getUserByLoginName($this->objects['initialAccount']->accountLoginName); } $this->_groupLDAP->addGroupMember($group, $user); $this->_groupLDAP->removeGroupMember($group, $user); $groupMembers = $this->_groupLDAP->getGroupMembers($group); $this->assertEquals(0, count($groupMembers)); $this->_userLDAP->deleteUser($user); }
/** * Tears down the fixture * This method is called after a test is executed. * * @access protected */ protected function tearDown() { foreach ($this->objects['users'] as $user) { $this->_backend->deleteUser($user); } }