mapping = new UserMapping(\OC::$server->getDatabaseConnection()); $this->mapping->clear(); $this->access->setUserMapper($this->mapping); $this->backend = new User_LDAP($this->access, \OC::$server->getNotificationManager(), \OC::$server->get(UserPluginManager::class), \OC::$server->get(LoggerInterface::class), \OC::$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();