diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-11-05 15:45:58 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-11-05 15:45:58 +0100 |
commit | 1eefc21329e1256989fc50a5fe7597989324e47f (patch) | |
tree | 9cfcf96f01686c51c3d2337384cff7c6a09bfea4 /tests | |
parent | f0d6a47a67b87c544d44ecacf2ba2e9a36659053 (diff) | |
download | nextcloud-server-1eefc21329e1256989fc50a5fe7597989324e47f.tar.gz nextcloud-server-1eefc21329e1256989fc50a5fe7597989324e47f.zip |
Remove confusingly names \OC\User\Manager::delete and fix the automatic cache cleanup instead
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/app.php | 7 | ||||
-rw-r--r-- | tests/lib/user/manager.php | 13 |
2 files changed, 13 insertions, 7 deletions
diff --git a/tests/lib/app.php b/tests/lib/app.php index e538ebec8a0..5bce3b8c3e6 100644 --- a/tests/lib/app.php +++ b/tests/lib/app.php @@ -360,10 +360,7 @@ class Test_App extends PHPUnit_Framework_TestCase { $user1->delete(); $user2->delete(); $user3->delete(); - // clear user cache... - $userManager->delete(self::TEST_USER1); - $userManager->delete(self::TEST_USER2); - $userManager->delete(self::TEST_USER3); + $group1->delete(); $group2->delete(); } @@ -399,8 +396,6 @@ class Test_App extends PHPUnit_Framework_TestCase { \OC_User::setUserId(null); $user1->delete(); - // clear user cache... - $userManager->delete(self::TEST_USER1); } /** diff --git a/tests/lib/user/manager.php b/tests/lib/user/manager.php index fd0931af7e4..15b28e61bd5 100644 --- a/tests/lib/user/manager.php +++ b/tests/lib/user/manager.php @@ -416,6 +416,17 @@ class Manager extends \PHPUnit_Framework_TestCase { $users = array_shift($result); //users from backends shall be summed up - $this->assertEquals(7+16, $users); + $this->assertEquals(7 + 16, $users); + } + + public function testDeleteUser() { + $manager = new \OC\User\Manager(); + $backend = new \OC_User_Dummy(); + + $backend->createUser('foo', 'bar'); + $manager->registerBackend($backend); + $this->assertTrue($manager->userExists('foo')); + $manager->get('foo')->delete(); + $this->assertFalse($manager->userExists('foo')); } } |