diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2017-04-26 12:37:48 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-04-29 00:59:09 -0300 |
commit | 668fe7df51e097a762d9f03e0329a06d0751cd78 (patch) | |
tree | 5d4cb3e398e6cfee2122af5838db617a6c7c62a2 /tests | |
parent | 8f5f26c88d53b13a9ea7e5d9fe531decf0356879 (diff) | |
download | nextcloud-server-668fe7df51e097a762d9f03e0329a06d0751cd78.tar.gz nextcloud-server-668fe7df51e097a762d9f03e0329a06d0751cd78.zip |
UserManager can now count disabled users
Users page takes advantage of that
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/User/ManagerTest.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/lib/User/ManagerTest.php b/tests/lib/User/ManagerTest.php index aaee64f1863..cf725aae671 100644 --- a/tests/lib/User/ManagerTest.php +++ b/tests/lib/User/ManagerTest.php @@ -510,6 +510,31 @@ class ManagerTest extends TestCase { $this->assertEquals(7 + 16, $users); } + public function testCountUsersOnlyDisabled() { + $manager = \OC::$server->getUserManager(); + // count other users in the db before adding our own + $countBefore = $manager->countDisabledUsers(); + + //Add test users + $user1 = $manager->createUser('testdisabledcount1', 'testdisabledcount1'); + + $user2 = $manager->createUser('testdisabledcount2', 'testdisabledcount2'); + $user2->setEnabled(false); + + $user3 = $manager->createUser('testdisabledcount3', 'testdisabledcount3'); + + $user4 = $manager->createUser('testdisabledcount4', 'testdisabledcount4'); + $user4->setEnabled(false); + + $this->assertEquals($countBefore + 2, $manager->countDisabledUsers()); + + //cleanup + $user1->delete(); + $user2->delete(); + $user3->delete(); + $user4->delete(); + } + public function testCountUsersOnlySeen() { $manager = \OC::$server->getUserManager(); // count other users in the db before adding our own |