diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-12-05 23:31:21 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-01-08 09:21:22 +0100 |
commit | f657ded6ec93de95eec33e19f3d6d528aa397f2d (patch) | |
tree | af3b6349511987f5d982b79e5e3cc06a0cea6d81 /apps/user_ldap | |
parent | 1068b860ff8cfabedee78f86d9655e8c0c206170 (diff) | |
download | nextcloud-server-f657ded6ec93de95eec33e19f3d6d528aa397f2d.tar.gz nextcloud-server-f657ded6ec93de95eec33e19f3d6d528aa397f2d.zip |
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>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/tests/User_LDAPTest.php | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php index 3b473cc8de4..e4a105b2bd6 100644 --- a/apps/user_ldap/tests/User_LDAPTest.php +++ b/apps/user_ldap/tests/User_LDAPTest.php @@ -586,64 +586,6 @@ class User_LDAPTest extends TestCase { $this->assertTrue($result); } - public function testUserExistsPublicAPIForDeleted() { - $backend = new UserLDAP($this->access, $this->config, $this->notificationManager, $this->session, $this->pluginManager); - $this->prepareMockForUserExists(); - \OC_User::useBackend($backend); - - $mapper = $this->createMock(UserMapping::class); - $mapper->expects($this->any()) - ->method('getUUIDByDN') - ->with('dnOfFormerUser,dc=test') - ->willReturn('45673458748'); - - $this->access->expects($this->any()) - ->method('readAttribute') - ->will($this->returnCallback(function($dn) { - if($dn === 'dnOfRoland,dc=test') { - return array(); - } - return false; - })); - $this->access->expects($this->any()) - ->method('getUserMapper') - ->willReturn($mapper); - $this->access->expects($this->once()) - ->method('getUserDnByUuid') - ->willThrowException(new \Exception()); - - $user = $this->createMock(User::class); - $user->expects($this->any()) - ->method('getDN') - ->willReturn('dnOfFormerUser,dc=test'); - - $this->userManager->expects($this->atLeastOnce()) - ->method('get') - ->willReturn($user); - - //test for deleted user – always returns true as long as we have the user in DB - $this->assertTrue(\OC::$server->getUserManager()->userExists('formerUser')); - } - - public function testUserExistsPublicAPIForNeverExisting() { - $backend = new UserLDAP($this->access, $this->config, $this->notificationManager, $this->session, $this->pluginManager); - $this->prepareMockForUserExists(); - \OC_User::useBackend($backend); - - $this->access->expects($this->any()) - ->method('readAttribute') - ->will($this->returnCallback(function($dn) { - if($dn === 'dnOfRoland,dc=test') { - return array(); - } - return false; - })); - - //test for never-existing user - $result = \OC::$server->getUserManager()->userExists('mallory'); - $this->assertFalse($result); - } - public function testDeleteUserExisting() { $backend = new UserLDAP($this->access, $this->config, $this->notificationManager, $this->session, $this->pluginManager); |