diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-12-19 09:51:18 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-12-19 09:51:18 +0100 |
commit | 995f01fa2aaaa92a883a75d9d2ecc1673e7fb573 (patch) | |
tree | 4e531621610c78dd8660b498e91e06876b0f889e /tests | |
parent | 587bdd9a74d06ddfedf9a7deae4c38047582b817 (diff) | |
parent | 5913af8a72e384f8fee89501b3a297b70460c1e0 (diff) | |
download | nextcloud-server-995f01fa2aaaa92a883a75d9d2ecc1673e7fb573.tar.gz nextcloud-server-995f01fa2aaaa92a883a75d9d2ecc1673e7fb573.zip |
Merge pull request #12921 from owncloud/user-mail-user-management
Mail address of users is now changable in the user management
Diffstat (limited to 'tests')
-rw-r--r-- | tests/settings/controller/userscontrollertest.php | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/tests/settings/controller/userscontrollertest.php b/tests/settings/controller/userscontrollertest.php index 207943c4c87..41622737027 100644 --- a/tests/settings/controller/userscontrollertest.php +++ b/tests/settings/controller/userscontrollertest.php @@ -67,7 +67,7 @@ class UsersControllerTest extends \Test\TestCase { $foo = $this->getMockBuilder('\OC\User\User') ->disableOriginalConstructor()->getMock(); $foo - ->expects($this->exactly(3)) + ->expects($this->exactly(4)) ->method('getUID') ->will($this->returnValue('foo')); $foo @@ -87,7 +87,7 @@ class UsersControllerTest extends \Test\TestCase { $admin = $this->getMockBuilder('\OC\User\User') ->disableOriginalConstructor()->getMock(); $admin - ->expects($this->exactly(3)) + ->expects($this->exactly(4)) ->method('getUID') ->will($this->returnValue('admin')); $admin @@ -109,7 +109,7 @@ class UsersControllerTest extends \Test\TestCase { $bar = $this->getMockBuilder('\OC\User\User') ->disableOriginalConstructor()->getMock(); $bar - ->expects($this->exactly(3)) + ->expects($this->exactly(4)) ->method('getUID') ->will($this->returnValue('bar')); $bar @@ -151,9 +151,11 @@ class UsersControllerTest extends \Test\TestCase { ->with('bar') ->will($this->returnValue($bar)); $this->container['Config'] - ->expects($this->exactly(3)) + ->expects($this->exactly(6)) ->method('getUserValue') - ->will($this->onConsecutiveCalls(1024, 404, 2323)); + ->will($this->onConsecutiveCalls(1024, 'foo@bar.com', + 404, 'admin@bar.com', + 2323, 'bar@dummy.com')); $expectedResponse = new DataResponse( array( @@ -165,7 +167,8 @@ class UsersControllerTest extends \Test\TestCase { 'quota' => 1024, 'storageLocation' => '/home/foo', 'lastLogin' => 500, - 'backend' => 'OC_User_Database' + 'backend' => 'OC_User_Database', + 'email' => 'foo@bar.com' ), 1 => array( 'name' => 'admin', @@ -175,7 +178,8 @@ class UsersControllerTest extends \Test\TestCase { 'quota' => 404, 'storageLocation' => '/home/admin', 'lastLogin' => 12, - 'backend' => 'OC_User_Dummy' + 'backend' => 'OC_User_Dummy', + 'email' => 'admin@bar.com' ), 2 => array( 'name' => 'bar', @@ -185,7 +189,8 @@ class UsersControllerTest extends \Test\TestCase { 'quota' => 2323, 'storageLocation' => '/home/bar', 'lastLogin' => 3999, - 'backend' => 'OC_User_Dummy' + 'backend' => 'OC_User_Dummy', + 'email' => 'bar@dummy.com' ), ) ); @@ -197,7 +202,7 @@ class UsersControllerTest extends \Test\TestCase { $user = $this->getMockBuilder('\OC\User\User') ->disableOriginalConstructor()->getMock(); $user - ->expects($this->exactly(3)) + ->expects($this->exactly(4)) ->method('getUID') ->will($this->returnValue('foo')); $user @@ -241,7 +246,8 @@ class UsersControllerTest extends \Test\TestCase { 'quota' => null, 'storageLocation' => '/home/foo', 'lastLogin' => 500, - 'backend' => 'OC_User_Database' + 'backend' => 'OC_User_Database', + 'email' => null ) ) ); @@ -276,6 +282,9 @@ class UsersControllerTest extends \Test\TestCase { ->method('getHome') ->will($this->returnValue('/home/user')); $user + ->method('getUID') + ->will($this->returnValue('foo')); + $user ->expects($this->once()) ->method('getBackendClassName') ->will($this->returnValue('bar')); @@ -288,10 +297,15 @@ class UsersControllerTest extends \Test\TestCase { $expectedResponse = new DataResponse( array( - 'username' => 'foo', + 'name' => 'foo', 'groups' => null, 'storageLocation' => '/home/user', - 'backend' => 'bar' + 'backend' => 'bar', + 'lastLogin' => null, + 'displayname' => null, + 'quota' => null, + 'subadmin' => array(), + 'email' => null ), Http::STATUS_CREATED ); @@ -313,6 +327,9 @@ class UsersControllerTest extends \Test\TestCase { ->method('getHome') ->will($this->returnValue('/home/user')); $user + ->method('getUID') + ->will($this->returnValue('foo')); + $user ->expects($this->once()) ->method('getBackendClassName') ->will($this->returnValue('bar')); @@ -350,10 +367,15 @@ class UsersControllerTest extends \Test\TestCase { $expectedResponse = new DataResponse( array( - 'username' => 'foo', + 'name' => 'foo', 'groups' => array('NewGroup', 'ExistingGroup'), 'storageLocation' => '/home/user', - 'backend' => 'bar' + 'backend' => 'bar', + 'lastLogin' => null, + 'displayname' => null, + 'quota' => null, + 'subadmin' => array(), + 'email' => null ), Http::STATUS_CREATED ); |