aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-12-12 17:25:03 +0100
committerMorris Jobke <hey@morrisjobke.de>2014-12-19 10:17:17 +0100
commit6da33e1ea7bb340e22330941d2a980a1414210b0 (patch)
tree3717d08e21cb02a149ae109f4efeecb83ba582c1 /tests/lib
parent5c6e08213e6ed52517f9f729ae91a2973f09c182 (diff)
downloadnextcloud-server-6da33e1ea7bb340e22330941d2a980a1414210b0.tar.gz
nextcloud-server-6da33e1ea7bb340e22330941d2a980a1414210b0.zip
introduce names for user backends - IUserBackend
* LDAP with multiple servers also proved backendName
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/user/manager.php10
-rw-r--r--tests/lib/user/user.php4
2 files changed, 12 insertions, 2 deletions
diff --git a/tests/lib/user/manager.php b/tests/lib/user/manager.php
index 9cb9374d89f..cc8bcd65896 100644
--- a/tests/lib/user/manager.php
+++ b/tests/lib/user/manager.php
@@ -380,6 +380,10 @@ class Manager extends \Test\TestCase {
->with(\OC_USER_BACKEND_COUNT_USERS)
->will($this->returnValue(true));
+ $backend->expects($this->once())
+ ->method('getBackendName')
+ ->will($this->returnValue('Mock_OC_User_Dummy'));
+
$manager = new \OC\User\Manager();
$manager->registerBackend($backend);
@@ -404,6 +408,9 @@ class Manager extends \Test\TestCase {
->method('implementsActions')
->with(\OC_USER_BACKEND_COUNT_USERS)
->will($this->returnValue(true));
+ $backend1->expects($this->once())
+ ->method('getBackendName')
+ ->will($this->returnValue('Mock_OC_User_Dummy'));
$backend2 = $this->getMock('\OC_User_Dummy');
$backend2->expects($this->once())
@@ -414,6 +421,9 @@ class Manager extends \Test\TestCase {
->method('implementsActions')
->with(\OC_USER_BACKEND_COUNT_USERS)
->will($this->returnValue(true));
+ $backend2->expects($this->once())
+ ->method('getBackendName')
+ ->will($this->returnValue('Mock_OC_User_Dummy'));
$manager = new \OC\User\Manager();
$manager->registerBackend($backend1);
diff --git a/tests/lib/user/user.php b/tests/lib/user/user.php
index e7085182fd6..b1df975b60f 100644
--- a/tests/lib/user/user.php
+++ b/tests/lib/user/user.php
@@ -217,9 +217,9 @@ class User extends \Test\TestCase {
public function testGetBackendClassName() {
$user = new \OC\User\User('foo', new \OC_User_Dummy());
- $this->assertEquals('OC_User_Dummy', $user->getBackendClassName());
+ $this->assertEquals('Dummy', $user->getBackendClassName());
$user = new \OC\User\User('foo', new \OC_User_Database());
- $this->assertEquals('OC_User_Database', $user->getBackendClassName());
+ $this->assertEquals('Database', $user->getBackendClassName());
}
public function testGetHomeNotSupported() {