summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/tests
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2016-02-09 18:11:30 +0100
committerArthur Schiwon <blizzz@owncloud.com>2016-02-09 18:11:30 +0100
commitd19c47a381e478a59bb93acd2d75412ea3bfd11e (patch)
tree8f962113a8cc4a00cb4a900d8214c9e08471db77 /apps/user_ldap/tests
parent096115870cbe07eee246166bfbe93a37937d470a (diff)
downloadnextcloud-server-d19c47a381e478a59bb93acd2d75412ea3bfd11e.tar.gz
nextcloud-server-d19c47a381e478a59bb93acd2d75412ea3bfd11e.zip
More fixed tests :)
Diffstat (limited to 'apps/user_ldap/tests')
-rw-r--r--apps/user_ldap/tests/user/user.php64
1 files changed, 36 insertions, 28 deletions
diff --git a/apps/user_ldap/tests/user/user.php b/apps/user_ldap/tests/user/user.php
index 046edf58968..ca8d81a4b79 100644
--- a/apps/user_ldap/tests/user/user.php
+++ b/apps/user_ldap/tests/user/user.php
@@ -210,13 +210,15 @@ class Test_User_User extends \Test\TestCase {
$this->equalTo('myquota'))
->will($this->returnValue(array('42 GB')));
- $config->expects($this->once())
- ->method('setUserValue')
- ->with($this->equalTo('alice'),
- $this->equalTo('files'),
- $this->equalTo('quota'),
- $this->equalTo('42 GB'))
- ->will($this->returnValue(true));
+ $user = $this->getMock('\OCP\IUser');
+ $user->expects($this->once())
+ ->method('setQuota')
+ ->with('42 GB');
+
+ $userMgr->expects($this->once())
+ ->method('get')
+ ->with('alice')
+ ->will($this->returnValue($user));
$uid = 'alice';
$dn = 'uid=alice,dc=foo,dc=bar';
@@ -253,13 +255,15 @@ class Test_User_User extends \Test\TestCase {
$this->equalTo('myquota'))
->will($this->returnValue(false));
- $config->expects($this->once())
- ->method('setUserValue')
- ->with($this->equalTo('alice'),
- $this->equalTo('files'),
- $this->equalTo('quota'),
- $this->equalTo('25 GB'))
- ->will($this->returnValue(true));
+ $user = $this->getMock('\OCP\IUser');
+ $user->expects($this->once())
+ ->method('setQuota')
+ ->with('25 GB');
+
+ $userMgr->expects($this->once())
+ ->method('get')
+ ->with('alice')
+ ->will($this->returnValue($user));
$uid = 'alice';
$dn = 'uid=alice,dc=foo,dc=bar';
@@ -296,13 +300,15 @@ class Test_User_User extends \Test\TestCase {
$this->equalTo('myquota'))
->will($this->returnValue(array('27 GB')));
- $config->expects($this->once())
- ->method('setUserValue')
- ->with($this->equalTo('alice'),
- $this->equalTo('files'),
- $this->equalTo('quota'),
- $this->equalTo('27 GB'))
- ->will($this->returnValue(true));
+ $user = $this->getMock('\OCP\IUser');
+ $user->expects($this->once())
+ ->method('setQuota')
+ ->with('27 GB');
+
+ $userMgr->expects($this->once())
+ ->method('get')
+ ->with('alice')
+ ->will($this->returnValue($user));
$uid = 'alice';
$dn = 'uid=alice,dc=foo,dc=bar';
@@ -408,13 +414,15 @@ class Test_User_User extends \Test\TestCase {
$access->expects($this->never())
->method('readAttribute');
- $config->expects($this->once())
- ->method('setUserValue')
- ->with($this->equalTo('alice'),
- $this->equalTo('files'),
- $this->equalTo('quota'),
- $this->equalTo($readQuota))
- ->will($this->returnValue(true));
+ $user = $this->getMock('\OCP\IUser');
+ $user->expects($this->once())
+ ->method('setQuota')
+ ->with($readQuota);
+
+ $userMgr->expects($this->once())
+ ->method('get')
+ ->with('alice')
+ ->will($this->returnValue($user));
$uid = 'alice';
$dn = 'uid=alice,dc=foo,dc=bar';