diff options
Diffstat (limited to 'tests/lib/group/manager.php')
-rw-r--r-- | tests/lib/group/manager.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/lib/group/manager.php b/tests/lib/group/manager.php index 76996a2b9bb..e3e2a96e46d 100644 --- a/tests/lib/group/manager.php +++ b/tests/lib/group/manager.php @@ -846,4 +846,26 @@ class Manager extends \Test\TestCase { $groups = $manager->getUserGroups($user1); $this->assertEquals(array(), $groups); } + + public function testGetUserIdGroups() { + /** + * @var \PHPUnit_Framework_MockObject_MockObject | \OC_Group_Backend $backend + */ + $backend = $this->getMock('\OC_Group_Database'); + $backend->expects($this->any()) + ->method('getUserGroups') + ->with('user1') + ->will($this->returnValue(null)); + + /** + * @var \OC\User\Manager $userManager + */ + $userManager = $this->getMock('\OC\User\Manager'); + $manager = new \OC\Group\Manager($userManager); + $manager->addBackend($backend); + + $groups = $manager->getUserIdGroups('user1'); + $this->assertEquals([], $groups); + } + } |