Skip to content

Commit f657ded

Browse files
blizzzChristophWurst
authored andcommitted
remove superfluous tests
- user_ldap is not exposed to public api, it is always behind ldap_proxy - this is too much for a unit test - integration tests cover userExists implicitly Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent 1068b86 commit f657ded

File tree

1 file changed

+0
-58
lines changed

1 file changed

+0
-58
lines changed

apps/user_ldap/tests/User_LDAPTest.php

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -586,64 +586,6 @@ public function testUserExistsPublicAPI() {
586586
$this->assertTrue($result);
587587
}
588588

589-
public function testUserExistsPublicAPIForDeleted() {
590-
$backend = new UserLDAP($this->access, $this->config, $this->notificationManager, $this->session, $this->pluginManager);
591-
$this->prepareMockForUserExists();
592-
\OC_User::useBackend($backend);
593-
594-
$mapper = $this->createMock(UserMapping::class);
595-
$mapper->expects($this->any())
596-
->method('getUUIDByDN')
597-
->with('dnOfFormerUser,dc=test')
598-
->willReturn('45673458748');
599-
600-
$this->access->expects($this->any())
601-
->method('readAttribute')
602-
->will($this->returnCallback(function($dn) {
603-
if($dn === 'dnOfRoland,dc=test') {
604-
return array();
605-
}
606-
return false;
607-
}));
608-
$this->access->expects($this->any())
609-
->method('getUserMapper')
610-
->willReturn($mapper);
611-
$this->access->expects($this->once())
612-
->method('getUserDnByUuid')
613-
->willThrowException(new \Exception());
614-
615-
$user = $this->createMock(User::class);
616-
$user->expects($this->any())
617-
->method('getDN')
618-
->willReturn('dnOfFormerUser,dc=test');
619-
620-
$this->userManager->expects($this->atLeastOnce())
621-
->method('get')
622-
->willReturn($user);
623-
624-
//test for deleted user – always returns true as long as we have the user in DB
625-
$this->assertTrue(\OC::$server->getUserManager()->userExists('formerUser'));
626-
}
627-
628-
public function testUserExistsPublicAPIForNeverExisting() {
629-
$backend = new UserLDAP($this->access, $this->config, $this->notificationManager, $this->session, $this->pluginManager);
630-
$this->prepareMockForUserExists();
631-
\OC_User::useBackend($backend);
632-
633-
$this->access->expects($this->any())
634-
->method('readAttribute')
635-
->will($this->returnCallback(function($dn) {
636-
if($dn === 'dnOfRoland,dc=test') {
637-
return array();
638-
}
639-
return false;
640-
}));
641-
642-
//test for never-existing user
643-
$result = \OC::$server->getUserManager()->userExists('mallory');
644-
$this->assertFalse($result);
645-
}
646-
647589
public function testDeleteUserExisting() {
648590
$backend = new UserLDAP($this->access, $this->config, $this->notificationManager, $this->session, $this->pluginManager);
649591

0 commit comments

Comments
 (0)