userManager = \OC::$server->getUserManager(); $this->groupManager = \OC::$server->getGroupManager(); $this->groupManager->createGroup('admin'); } /** * Generates a temp user * @param int $num number of users to generate * @return IUser[]|IUser */ protected function generateUsers($num = 1) { $users = []; for ($i = 0; $i < $num; $i++) { $user = $this->userManager->createUser($this->getUniqueID(), 'password'); $this->users[] = $user; $users[] = $user; } return count($users) == 1 ? reset($users) : $users; } protected function tearDown(): void { foreach ($this->users as $user) { $user->delete(); } $this->groupManager->get('admin')->delete(); parent::tearDown(); } }