diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2015-04-09 14:03:30 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-04-10 11:08:24 +0200 |
commit | fafecd1c05cebbd983d8c770d36c5d546a83b16b (patch) | |
tree | 4820146c542efbad0727d49783a095903ae82048 /apps/user_ldap/tests/user_ldap.php | |
parent | 1427ea78d40bbfdc54d7ce603a96232b11f5a405 (diff) | |
download | nextcloud-server-fafecd1c05cebbd983d8c770d36c5d546a83b16b.tar.gz nextcloud-server-fafecd1c05cebbd983d8c770d36c5d546a83b16b.zip |
fix cherrypicking
Diffstat (limited to 'apps/user_ldap/tests/user_ldap.php')
-rw-r--r-- | apps/user_ldap/tests/user_ldap.php | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/apps/user_ldap/tests/user_ldap.php b/apps/user_ldap/tests/user_ldap.php index 9b4da00a3a7..53229e2d64a 100644 --- a/apps/user_ldap/tests/user_ldap.php +++ b/apps/user_ldap/tests/user_ldap.php @@ -435,7 +435,7 @@ class Test_User_Ldap_Direct extends \Test\TestCase { */ public function testUserExistsForDeleted() { $access = $this->getAccessMock(); - $backend = new UserLDAP($access); + $backend = new UserLDAP($access, $this->getMock('\OCP\IConfig')); $this->prepareMockForUserExists($access); $access->expects($this->any()) @@ -453,7 +453,7 @@ class Test_User_Ldap_Direct extends \Test\TestCase { public function testUserExistsForNeverExisting() { $access = $this->getAccessMock(); - $backend = new UserLDAP($access); + $backend = new UserLDAP($access, $this->getMock('\OCP\IConfig')); $this->prepareMockForUserExists($access); $access->expects($this->any()) @@ -495,7 +495,7 @@ class Test_User_Ldap_Direct extends \Test\TestCase { */ public function testUserExistsPublicAPIForDeleted() { $access = $this->getAccessMock(); - $backend = new UserLDAP($access); + $backend = new UserLDAP($access, $this->getMock('\OCP\IConfig')); $this->prepareMockForUserExists($access); \OC_User::useBackend($backend); @@ -514,7 +514,7 @@ class Test_User_Ldap_Direct extends \Test\TestCase { public function testUserExistsPublicAPIForNeverExisting() { $access = $this->getAccessMock(); - $backend = new UserLDAP($access); + $backend = new UserLDAP($access, $this->getMock('\OCP\IConfig')); $this->prepareMockForUserExists($access); \OC_User::useBackend($backend); @@ -571,19 +571,15 @@ class Test_User_Ldap_Direct extends \Test\TestCase { } })); - $datadir = '/my/data/dir'; - $config->expects($this->once()) - ->method('getSystemValue') - ->will($this->returnValue($datadir)); - //absolut path $result = $backend->getHome('gunslinger'); $this->assertEquals('/tmp/rolandshome/', $result); } - public function testGetHomeDatadirRelative() { + public function testGetHomeRelative() { $access = $this->getAccessMock(); - $backend = new UserLDAP($access); + $config = $this->getMock('\OCP\IConfig'); + $backend = new UserLDAP($access, $config); $this->prepareMockForUserExists($access); $access->connection->expects($this->any()) @@ -610,9 +606,12 @@ class Test_User_Ldap_Direct extends \Test\TestCase { } })); //datadir-relativ path + $datadir = '/my/data/dir'; + $config->expects($this->once()) + ->method('getSystemValue') + ->will($this->returnValue($datadir)); + $result = $backend->getHome('ladyofshadows'); - $datadir = \OCP\Config::getSystemValue('datadirectory', - \OC::$SERVERROOT.'/data'); $this->assertEquals($datadir.'/susannah/', $result); } @@ -621,7 +620,7 @@ class Test_User_Ldap_Direct extends \Test\TestCase { */ public function testGetHomeNoPath() { $access = $this->getAccessMock(); - $backend = new UserLDAP($access); + $backend = new UserLDAP($access, $this->getMock('\OCP\IConfig')); $this->prepareMockForUserExists($access); $access->connection->expects($this->any()) |