aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-12-12 12:39:31 +0100
committerLukas Reschke <lukas@owncloud.com>2014-12-12 12:39:31 +0100
commit26b0a89874dc1a3279471b9fbf35420d63fd45dd (patch)
treee55673d02368bfbfcec18142332131f9fe6b19f3 /tests
parentd0716d2c7df9d150a2705a517efcde8855a51f51 (diff)
downloadnextcloud-server-26b0a89874dc1a3279471b9fbf35420d63fd45dd.tar.gz
nextcloud-server-26b0a89874dc1a3279471b9fbf35420d63fd45dd.zip
Add test for user without backend
Diffstat (limited to 'tests')
-rw-r--r--tests/settings/controller/userscontrollertest.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/settings/controller/userscontrollertest.php b/tests/settings/controller/userscontrollertest.php
index 42d91c7731a..78b855fd3f1 100644
--- a/tests/settings/controller/userscontrollertest.php
+++ b/tests/settings/controller/userscontrollertest.php
@@ -228,6 +228,22 @@ class UsersControllerTest extends \Test\TestCase {
$this->assertEquals($expectedResponse, $response);
}
+ public function testIndexWithBackendNoUser() {
+ $this->container['UserManager']
+ ->expects($this->once())
+ ->method('getBackends')
+ ->will($this->returnValue([new \OC_User_Dummy(), new \OC_User_Database()]));
+ $this->container['UserManager']
+ ->expects($this->once())
+ ->method('search')
+ ->with('')
+ ->will($this->returnValue([]));
+
+ $expectedResponse = new DataResponse([]);
+ $response = $this->usersController->index(0, 10, '','', 'OC_User_Dummy');
+ $this->assertEquals($expectedResponse, $response);
+ }
+
/**
* TODO: Since the function uses the static OC_Subadmin class it can't be mocked
* to test for subadmins. Thus the test always assumes you have admin permissions...