mapping = new UserMapping(Server::get(IDBConnection::class)); $this->mapping->clear(); $this->access->setUserMapper($this->mapping); $this->backend = new User_LDAP($this->access, Server::get(\OCP\Notification\IManager::class), Server::get(UserPluginManager::class), Server::get(LoggerInterface::class), Server::get(DeletedUsersIndex::class)); } /** * tests fetchUserByLoginName where it is expected that the login name does * not match any LDAP user * * @return bool */ protected function case1() { $result = $this->access->fetchUsersByLoginName('nothere'); return $result === []; } /** * tests fetchUserByLoginName where it is expected that the login name does * match one LDAP user * * @return bool */ protected function case2() { $result = $this->access->fetchUsersByLoginName('alice'); return count($result) === 1; } } /** @var string $host */ /** @var int $port */ /** @var string $adn */ /** @var string $apwd */ /** @var string $bdn */ $test = new IntegrationTestFetchUsersByLoginName($host, $port, $adn, $apwd, $bdn); $test->init(); $test->run();