aboutsummaryrefslogtreecommitdiffstats
path: root/tests/settings
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2016-02-09 17:37:13 +0100
committerArthur Schiwon <blizzz@owncloud.com>2016-02-09 17:37:13 +0100
commitef7846f7bd075fbd28ab59edeab3cc2fd0d8f524 (patch)
tree5b234d23b472c1d8c786b797ad8fbb957151e407 /tests/settings
parent3a796d1e1533febc63a2719816815b47f2065e82 (diff)
downloadnextcloud-server-ef7846f7bd075fbd28ab59edeab3cc2fd0d8f524.tar.gz
nextcloud-server-ef7846f7bd075fbd28ab59edeab3cc2fd0d8f524.zip
fix tests
Diffstat (limited to 'tests/settings')
-rw-r--r--tests/settings/controller/userscontrollertest.php80
1 files changed, 51 insertions, 29 deletions
diff --git a/tests/settings/controller/userscontrollertest.php b/tests/settings/controller/userscontrollertest.php
index 38fc1ee6102..947540fa67b 100644
--- a/tests/settings/controller/userscontrollertest.php
+++ b/tests/settings/controller/userscontrollertest.php
@@ -86,7 +86,7 @@ class UsersControllerTest extends \Test\TestCase {
$foo = $this->getMockBuilder('\OC\User\User')
->disableOriginalConstructor()->getMock();
$foo
- ->expects($this->exactly(3))
+ ->expects($this->exactly(2))
->method('getUID')
->will($this->returnValue('foo'));
$foo
@@ -98,6 +98,10 @@ class UsersControllerTest extends \Test\TestCase {
->method('getEMailAddress')
->will($this->returnValue('foo@bar.com'));
$foo
+ ->expects($this->once())
+ ->method('getQuota')
+ ->will($this->returnValue('1024'));
+ $foo
->method('getLastLogin')
->will($this->returnValue(500));
$foo
@@ -110,7 +114,7 @@ class UsersControllerTest extends \Test\TestCase {
$admin = $this->getMockBuilder('\OC\User\User')
->disableOriginalConstructor()->getMock();
$admin
- ->expects($this->exactly(3))
+ ->expects($this->exactly(2))
->method('getUID')
->will($this->returnValue('admin'));
$admin
@@ -123,6 +127,10 @@ class UsersControllerTest extends \Test\TestCase {
->will($this->returnValue('admin@bar.com'));
$admin
->expects($this->once())
+ ->method('getQuota')
+ ->will($this->returnValue('404'));
+ $admin
+ ->expects($this->once())
->method('getLastLogin')
->will($this->returnValue(12));
$admin
@@ -136,7 +144,7 @@ class UsersControllerTest extends \Test\TestCase {
$bar = $this->getMockBuilder('\OC\User\User')
->disableOriginalConstructor()->getMock();
$bar
- ->expects($this->exactly(3))
+ ->expects($this->exactly(2))
->method('getUID')
->will($this->returnValue('bar'));
$bar
@@ -148,6 +156,10 @@ class UsersControllerTest extends \Test\TestCase {
->method('getEMailAddress')
->will($this->returnValue('bar@dummy.com'));
$bar
+ ->expects($this->once())
+ ->method('getQuota')
+ ->will($this->returnValue('2323'));
+ $bar
->method('getLastLogin')
->will($this->returnValue(3999));
$bar
@@ -182,12 +194,6 @@ class UsersControllerTest extends \Test\TestCase {
->method('get')
->with('bar')
->will($this->returnValue($bar));
- $this->container['Config']
- ->expects($this->exactly(3))
- ->method('getUserValue')
- ->will($this->onConsecutiveCalls(1024,
- 404,
- 2323));
$subadmin = $this->getMockBuilder('\OC\SubAdmin')
->disableOriginalConstructor()
@@ -272,7 +278,7 @@ class UsersControllerTest extends \Test\TestCase {
$foo = $this->getMockBuilder('\OC\User\User')
->disableOriginalConstructor()->getMock();
$foo
- ->expects($this->exactly(3))
+ ->expects($this->exactly(2))
->method('getUID')
->will($this->returnValue('foo'));
$foo
@@ -284,6 +290,10 @@ class UsersControllerTest extends \Test\TestCase {
->method('getEMailAddress')
->will($this->returnValue('foo@bar.com'));
$foo
+ ->expects($this->once())
+ ->method('getQuota')
+ ->will($this->returnValue('1024'));
+ $foo
->method('getLastLogin')
->will($this->returnValue(500));
$foo
@@ -296,7 +306,7 @@ class UsersControllerTest extends \Test\TestCase {
$admin = $this->getMockBuilder('\OC\User\User')
->disableOriginalConstructor()->getMock();
$admin
- ->expects($this->exactly(3))
+ ->expects($this->exactly(2))
->method('getUID')
->will($this->returnValue('admin'));
$admin
@@ -309,6 +319,10 @@ class UsersControllerTest extends \Test\TestCase {
->will($this->returnValue('admin@bar.com'));
$admin
->expects($this->once())
+ ->method('getQuota')
+ ->will($this->returnValue('404'));
+ $admin
+ ->expects($this->once())
->method('getLastLogin')
->will($this->returnValue(12));
$admin
@@ -322,7 +336,7 @@ class UsersControllerTest extends \Test\TestCase {
$bar = $this->getMockBuilder('\OC\User\User')
->disableOriginalConstructor()->getMock();
$bar
- ->expects($this->exactly(3))
+ ->expects($this->exactly(2))
->method('getUID')
->will($this->returnValue('bar'));
$bar
@@ -334,6 +348,10 @@ class UsersControllerTest extends \Test\TestCase {
->method('getEMailAddress')
->will($this->returnValue('bar@dummy.com'));
$bar
+ ->expects($this->once())
+ ->method('getQuota')
+ ->will($this->returnValue('2323'));
+ $bar
->method('getLastLogin')
->will($this->returnValue(3999));
$bar
@@ -377,14 +395,6 @@ class UsersControllerTest extends \Test\TestCase {
->method('get')
->with('admin')
->will($this->returnValue($admin));
- $this->container['Config']
- ->expects($this->exactly(3))
- ->method('getUserValue')
- ->will($this->onConsecutiveCalls(
- 2323,
- 1024,
- 404
- ));
$subgroup1 = $this->getMockBuilder('\OCP\IGroup')
->disableOriginalConstructor()
@@ -472,7 +482,7 @@ class UsersControllerTest extends \Test\TestCase {
$foo = $this->getMockBuilder('\OC\User\User')
->disableOriginalConstructor()->getMock();
$foo
- ->expects($this->exactly(3))
+ ->expects($this->exactly(2))
->method('getUID')
->will($this->returnValue('foo'));
$foo
@@ -484,6 +494,10 @@ class UsersControllerTest extends \Test\TestCase {
->method('getEMailAddress')
->will($this->returnValue('foo@bar.com'));
$foo
+ ->expects($this->once())
+ ->method('getQuota')
+ ->will($this->returnValue('1024'));
+ $foo
->method('getLastLogin')
->will($this->returnValue(500));
$foo
@@ -496,7 +510,7 @@ class UsersControllerTest extends \Test\TestCase {
$admin = $this->getMockBuilder('\OC\User\User')
->disableOriginalConstructor()->getMock();
$admin
- ->expects($this->exactly(3))
+ ->expects($this->exactly(2))
->method('getUID')
->will($this->returnValue('admin'));
$admin
@@ -509,6 +523,10 @@ class UsersControllerTest extends \Test\TestCase {
->will($this->returnValue('admin@bar.com'));
$admin
->expects($this->once())
+ ->method('getQuota')
+ ->will($this->returnValue('404'));
+ $admin
+ ->expects($this->once())
->method('getLastLogin')
->will($this->returnValue(12));
$admin
@@ -522,7 +540,7 @@ class UsersControllerTest extends \Test\TestCase {
$bar = $this->getMockBuilder('\OC\User\User')
->disableOriginalConstructor()->getMock();
$bar
- ->expects($this->exactly(3))
+ ->expects($this->exactly(2))
->method('getUID')
->will($this->returnValue('bar'));
$bar
@@ -534,6 +552,10 @@ class UsersControllerTest extends \Test\TestCase {
->method('getEMailAddress')
->will($this->returnValue('bar@dummy.com'));
$bar
+ ->expects($this->once())
+ ->method('getQuota')
+ ->will($this->returnValue('2323'));
+ $bar
->method('getLastLogin')
->will($this->returnValue(3999));
$bar
@@ -553,10 +575,6 @@ class UsersControllerTest extends \Test\TestCase {
->expects($this->exactly(3))
->method('getUserGroupIds')
->will($this->onConsecutiveCalls(array('Users', 'Support'), array('admins', 'Support'), array('External Users')));
- $this->container['Config']
- ->expects($this->exactly(3))
- ->method('getUserValue')
- ->will($this->onConsecutiveCalls(1024, 404, 2323));
$subadmin = $this->getMockBuilder('\OC\SubAdmin')
->disableOriginalConstructor()
@@ -622,7 +640,7 @@ class UsersControllerTest extends \Test\TestCase {
$user = $this->getMockBuilder('\OC\User\User')
->disableOriginalConstructor()->getMock();
$user
- ->expects($this->exactly(3))
+ ->expects($this->exactly(2))
->method('getUID')
->will($this->returnValue('foo'));
$user
@@ -634,6 +652,10 @@ class UsersControllerTest extends \Test\TestCase {
->method('getEMailAddress')
->will($this->returnValue(null));
$user
+ ->expects($this->once())
+ ->method('getQuota')
+ ->will($this->returnValue('none'));
+ $user
->method('getLastLogin')
->will($this->returnValue(500));
$user
@@ -674,7 +696,7 @@ class UsersControllerTest extends \Test\TestCase {
'displayname' => 'M. Foo',
'groups' => null,
'subadmin' => array(),
- 'quota' => null,
+ 'quota' => 'none',
'storageLocation' => '/home/foo',
'lastLogin' => 500000,
'backend' => 'OC_User_Database',