Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-26 00:21:27 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-26 00:21:27 +0300
commit2ee65f177e4f7e09ad2287f14d564e7068d322fb (patch)
tree39075e87ea7927e20e8956824cb7c49bf626b178 /apps/provisioning_api
parent3cf321fdfc4235a87015a9af2f59c63220016c65 (diff)
Use the shorter phpunit syntax for mocked return values
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/provisioning_api')
-rw-r--r--apps/provisioning_api/tests/Controller/GroupsControllerTest.php4
-rw-r--r--apps/provisioning_api/tests/Controller/UsersControllerTest.php718
2 files changed, 361 insertions, 361 deletions
diff --git a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php
index 742f621c6a4..5416e686ee3 100644
--- a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php
+++ b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php
@@ -167,12 +167,12 @@ class GroupsControllerTest extends \Test\TestCase {
$this->subAdminManager
->method('isSubAdminOfGroup')
- ->will($this->returnCallback(function($_user, $_group) use ($user, $group) {
+ ->willReturnCallback(function($_user, $_group) use ($user, $group) {
if ($_user === $user && $_group === $group) {
return true;
}
return false;
- }));
+ });
}
private function useAccountManager() {
diff --git a/apps/provisioning_api/tests/Controller/UsersControllerTest.php b/apps/provisioning_api/tests/Controller/UsersControllerTest.php
index ac2da91005e..05c9506d6ec 100644
--- a/apps/provisioning_api/tests/Controller/UsersControllerTest.php
+++ b/apps/provisioning_api/tests/Controller/UsersControllerTest.php
@@ -141,20 +141,20 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('admin'));
+ ->willReturn('admin');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->userManager
->expects($this->once())
->method('search')
->with('MyCustomSearch')
- ->will($this->returnValue(['Admin' => [], 'Foo' => [], 'Bar' => []]));
+ ->willReturn(['Admin' => [], 'Foo' => [], 'Bar' => []]);
$expected = ['users' => [
'Admin',
@@ -172,45 +172,45 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$firstGroup = $this->getMockBuilder('OCP\IGroup')
->disableOriginalConstructor()
->getMock();
$firstGroup
->expects($this->once())
->method('getGID')
- ->will($this->returnValue('FirstGroup'));
+ ->willReturn('FirstGroup');
$secondGroup = $this->getMockBuilder('OCP\IGroup')
->disableOriginalConstructor()
->getMock();
$secondGroup
->expects($this->once())
->method('getGID')
- ->will($this->returnValue('SecondGroup'));
+ ->willReturn('SecondGroup');
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$subAdminManager
->expects($this->once())
->method('isSubAdmin')
->with($loggedInUser)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$subAdminManager
->expects($this->once())
->method('getSubAdminsGroups')
->with($loggedInUser)
- ->will($this->returnValue([$firstGroup, $secondGroup]));
+ ->willReturn([$firstGroup, $secondGroup]);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->groupManager
->expects($this->any())
->method('displayNamesInGroup')
@@ -234,7 +234,7 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('userExists')
->with('AlreadyExistingUser')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->logger
->expects($this->once())
->method('error')
@@ -245,11 +245,11 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('adminUser'));
+ ->willReturn('adminUser');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
@@ -276,11 +276,11 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('adminUser'));
+ ->willReturn('adminUser');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
@@ -312,11 +312,11 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('adminUser'));
+ ->willReturn('adminUser');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
@@ -329,10 +329,10 @@ class UsersControllerTest extends TestCase {
['ExistingGroup'],
['NonExistingGroup']
)
- ->will($this->returnValueMap([
+ ->willReturnMap([
['ExistingGroup', true],
['NonExistingGroup', false]
- ]));
+ ]);
$this->api->addUser('NewUser', 'pass', '', '', ['ExistingGroup', 'NonExistingGroup']);
}
@@ -342,7 +342,7 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('userExists')
->with('NewUser')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->userManager
->expects($this->once())
->method('createUser')
@@ -357,11 +357,11 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('adminUser'));
+ ->willReturn('adminUser');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
@@ -399,7 +399,7 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('userExists')
->with('NewUser')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->userManager
->expects($this->once())
->method('createUser')
@@ -414,11 +414,11 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('adminUser'));
+ ->willReturn('adminUser');
$this->userSession
->expects($this->any())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
@@ -449,7 +449,7 @@ class UsersControllerTest extends TestCase {
->expects($this->any())
->method('userExists')
->with($this->anything())
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->userManager
->expects($this->once())
->method('createUser')
@@ -464,11 +464,11 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('adminUser'));
+ ->willReturn('adminUser');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
@@ -504,7 +504,7 @@ class UsersControllerTest extends TestCase {
->expects($this->any())
->method('userExists')
->with($this->anything())
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->userManager
->expects($this->never())
->method('createUser');
@@ -514,11 +514,11 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('adminUser'));
+ ->willReturn('adminUser');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
@@ -547,7 +547,7 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('userExists')
->with('NewUser')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->userManager
->expects($this->never())
->method('createUser');
@@ -557,11 +557,11 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('adminUser'));
+ ->willReturn('adminUser');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
@@ -586,11 +586,11 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('adminUser'));
+ ->willReturn('adminUser');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
@@ -646,7 +646,7 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('userExists')
->with('NewUser')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->userManager
->expects($this->once())
->method('createUser')
@@ -666,11 +666,11 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('adminUser'));
+ ->willReturn('adminUser');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
@@ -692,11 +692,11 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('regularUser'));
+ ->willReturn('regularUser');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
@@ -725,11 +725,11 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('regularUser'));
+ ->willReturn('regularUser');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
@@ -774,11 +774,11 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('subAdminUser'));
+ ->willReturn('subAdminUser');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
@@ -823,10 +823,10 @@ class UsersControllerTest extends TestCase {
['ExistingGroup1'],
['ExistingGroup2']
)
- ->will($this->returnValueMap([
+ ->willReturnMap([
['ExistingGroup1', $existingGroup1],
['ExistingGroup2', $existingGroup2]
- ]));
+ ]);
$this->logger
->expects($this->exactly(3))
->method('info')
@@ -868,12 +868,12 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToGet')
- ->will($this->returnValue(null));
+ ->willReturn(null);
$this->api->getUser('UserToGet');
}
@@ -891,7 +891,7 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('admin'));
+ ->willReturn('admin');
$targetUser = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();
@@ -901,17 +901,17 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->exactly(2))
->method('get')
->with('UID')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('admin')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->groupManager
->expects($this->any())
->method('getUserGroups')
@@ -919,7 +919,7 @@ class UsersControllerTest extends TestCase {
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$subAdminManager
->expects($this->once())
->method('getSubAdminsGroups')
@@ -950,17 +950,17 @@ class UsersControllerTest extends TestCase {
->expects($this->at(0))
->method('getUserValue')
->with('UID', 'core', 'enabled', 'true')
- ->will($this->returnValue('true'));
+ ->willReturn('true');
$this->config
->expects($this->at(1))
->method('getUserValue')
->with('UID', 'core', 'lang')
- ->will($this->returnValue('de'));
+ ->willReturn('de');
$this->api
->expects($this->once())
->method('fillStorageInfo')
->with('UID')
- ->will($this->returnValue(['DummyValue']));
+ ->willReturn(['DummyValue']);
$backend = $this->createMock(UserInterface::class);
$backend->expects($this->any())
@@ -970,19 +970,19 @@ class UsersControllerTest extends TestCase {
$targetUser
->expects($this->once())
->method('getDisplayName')
- ->will($this->returnValue('Demo User'));
+ ->willReturn('Demo User');
$targetUser
->expects($this->once())
->method('getHome')
- ->will($this->returnValue('/var/www/newtcloud/data/UID'));
+ ->willReturn('/var/www/newtcloud/data/UID');
$targetUser
->expects($this->once())
->method('getLastLogin')
- ->will($this->returnValue(1521191471));
+ ->willReturn(1521191471);
$targetUser
->expects($this->once())
->method('getBackendClassName')
- ->will($this->returnValue('Database'));
+ ->willReturn('Database');
$targetUser
->expects($this->once())
->method('getBackend')
@@ -990,7 +990,7 @@ class UsersControllerTest extends TestCase {
$targetUser
->expects($this->exactly(6))
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$expected = [
'id' => 'UID',
@@ -1024,7 +1024,7 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$targetUser = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();
@@ -1035,17 +1035,17 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->exactly(2))
->method('get')
->with('UID')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('subadmin')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->groupManager
->expects($this->any())
->method('getUserGroups')
@@ -1057,7 +1057,7 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$subAdminManager
->expects($this->once())
->method('getSubAdminsGroups')
@@ -1065,22 +1065,22 @@ class UsersControllerTest extends TestCase {
$this->groupManager
->expects($this->exactly(2))
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->config
->expects($this->at(0))
->method('getUserValue')
->with('UID', 'core', 'enabled', 'true')
- ->will($this->returnValue('true'));
+ ->willReturn('true');
$this->config
->expects($this->at(1))
->method('getUserValue')
->with('UID', 'core', 'lang')
- ->will($this->returnValue('da'));
+ ->willReturn('da');
$this->api
->expects($this->once())
->method('fillStorageInfo')
->with('UID')
- ->will($this->returnValue(['DummyValue']));
+ ->willReturn(['DummyValue']);
$backend = $this->createMock(UserInterface::class);
$backend->expects($this->any())
@@ -1090,19 +1090,19 @@ class UsersControllerTest extends TestCase {
$targetUser
->expects($this->once())
->method('getDisplayName')
- ->will($this->returnValue('Demo User'));
+ ->willReturn('Demo User');
$targetUser
->expects($this->once())
->method('getHome')
- ->will($this->returnValue('/var/www/newtcloud/data/UID'));
+ ->willReturn('/var/www/newtcloud/data/UID');
$targetUser
->expects($this->once())
->method('getLastLogin')
- ->will($this->returnValue(1521191471));
+ ->willReturn(1521191471);
$targetUser
->expects($this->once())
->method('getBackendClassName')
- ->will($this->returnValue('Database'));
+ ->willReturn('Database');
$targetUser
->expects($this->once())
->method('getBackend')
@@ -1110,7 +1110,7 @@ class UsersControllerTest extends TestCase {
$targetUser
->expects($this->exactly(6))
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->accountManager->expects($this->any())->method('getUser')
->with($targetUser)
->willReturn(
@@ -1159,24 +1159,24 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->exactly(2))
->method('getUID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$targetUser = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToGet')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('subadmin')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()
->getMock();
@@ -1184,11 +1184,11 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->invokePrivate($this->api, 'getUser', ['UserToGet']);
}
@@ -1200,24 +1200,24 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->exactly(2))
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$targetUser = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->exactly(2))
->method('get')
->with('UID')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('UID')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()
->getMock();
@@ -1225,7 +1225,7 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(false));
+ ->willReturn(false);
$subAdminManager
->expects($this->once())
->method('getSubAdminsGroups')
@@ -1233,7 +1233,7 @@ class UsersControllerTest extends TestCase {
$this->groupManager
->expects($this->exactly(2))
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->groupManager
->expects($this->any())
->method('getUserGroups')
@@ -1242,7 +1242,7 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('fillStorageInfo')
->with('UID')
- ->will($this->returnValue(['DummyValue']));
+ ->willReturn(['DummyValue']);
$backend = $this->createMock(UserInterface::class);
$backend->expects($this->atLeastOnce())
@@ -1252,27 +1252,27 @@ class UsersControllerTest extends TestCase {
$targetUser
->expects($this->once())
->method('getDisplayName')
- ->will($this->returnValue('Subadmin User'));
+ ->willReturn('Subadmin User');
$targetUser
->expects($this->once())
->method('getEMailAddress')
- ->will($this->returnValue('subadmin@nextcloud.com'));
+ ->willReturn('subadmin@nextcloud.com');
$targetUser
->expects($this->exactly(6))
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$targetUser
->expects($this->once())
->method('getHome')
- ->will($this->returnValue('/var/www/newtcloud/data/UID'));
+ ->willReturn('/var/www/newtcloud/data/UID');
$targetUser
->expects($this->once())
->method('getLastLogin')
- ->will($this->returnValue(1521191471));
+ ->willReturn(1521191471);
$targetUser
->expects($this->once())
->method('getBackendClassName')
- ->will($this->returnValue('Database'));
+ ->willReturn('Database');
$targetUser
->expects($this->once())
->method('getBackend')
@@ -1281,7 +1281,7 @@ class UsersControllerTest extends TestCase {
->expects($this->at(0))
->method('getUserValue')
->with('UID', 'core', 'lang')
- ->will($this->returnValue('ru'));
+ ->willReturn('ru');
$this->accountManager->expects($this->any())->method('getUser')
->with($targetUser)
->willReturn(
@@ -1324,19 +1324,19 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$targetUser = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToEdit')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$targetUser
->expects($this->once())
->method('setDisplayName')
@@ -1344,7 +1344,7 @@ class UsersControllerTest extends TestCase {
$targetUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->assertEquals([], $this->api->editUser('UserToEdit', 'display', 'NewDisplayName')->getData());
}
@@ -1356,19 +1356,19 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$targetUser = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToEdit')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$targetUser
->expects($this->once())
->method('setEMailAddress')
@@ -1376,7 +1376,7 @@ class UsersControllerTest extends TestCase {
$targetUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->assertEquals([], $this->api->editUser('UserToEdit', 'email', 'demo@nextcloud.com')->getData());
}
@@ -1393,23 +1393,23 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$targetUser = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToEdit')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$targetUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->api->editUser('UserToEdit', 'email', 'demo.org');
}
@@ -1421,23 +1421,23 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$targetUser = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToEdit')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$targetUser
->expects($this->once())
->method('canChangePassword')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$targetUser
->expects($this->once())
->method('setPassword')
@@ -1445,7 +1445,7 @@ class UsersControllerTest extends TestCase {
$targetUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->assertEquals([], $this->api->editUser('UserToEdit', 'password', 'NewPassword')->getData());
}
@@ -1462,23 +1462,23 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$targetUser = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToEdit')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$targetUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->api->editUser('UserToEdit', 'quota', 'NewQuota');
}
@@ -1488,7 +1488,7 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser->expects($this->once())
->method('setQuota')
@@ -1496,21 +1496,21 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToEdit')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->exactly(3))
->method('isAdmin')
->with('UID')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$targetUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->assertEquals([], $this->api->editUser('UserToEdit', 'quota', '3042824')->getData());
}
@@ -1526,26 +1526,26 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToEdit')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->exactly(3))
->method('isAdmin')
->with('UID')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$targetUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->api->editUser('UserToEdit', 'quota', 'ABC');
}
@@ -1555,7 +1555,7 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('admin'));
+ ->willReturn('admin');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser->expects($this->once())
->method('setQuota')
@@ -1563,28 +1563,28 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToEdit')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('admin')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()
->getMock();
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$targetUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->assertEquals([], $this->api->editUser('UserToEdit', 'quota', '3042824')->getData());
}
@@ -1605,7 +1605,7 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UserToEdit'));
+ ->willReturn('UserToEdit');
$targetUser = $this->createMock(IUser::class);
$this->config->expects($this->once())
->method('setUserValue')
@@ -1613,21 +1613,21 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToEdit')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->atLeastOnce())
->method('isAdmin')
->with('UserToEdit')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$targetUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UserToEdit'));
+ ->willReturn('UserToEdit');
$this->assertEquals([], $this->api->editUser('UserToEdit', 'language', 'de')->getData());
}
@@ -1656,28 +1656,28 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UserToEdit'));
+ ->willReturn('UserToEdit');
$targetUser = $this->createMock(IUser::class);
$this->config->expects($this->never())
->method('setUserValue');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToEdit')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->atLeastOnce())
->method('isAdmin')
->with('UserToEdit')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$targetUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UserToEdit'));
+ ->willReturn('UserToEdit');
$this->assertEquals([], $this->api->editUser('UserToEdit', 'language', 'de')->getData());
}
@@ -1692,7 +1692,7 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('admin'));
+ ->willReturn('admin');
$targetUser = $this->createMock(IUser::class);
$this->config->expects($this->once())
->method('setUserValue')
@@ -1700,26 +1700,26 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToEdit')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('admin')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$subAdminManager = $this->createMock(SubAdmin::class);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$targetUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UserToEdit'));
+ ->willReturn('UserToEdit');
$this->assertEquals([], $this->api->editUser('UserToEdit', 'language', 'de')->getData());
}
@@ -1739,33 +1739,33 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('admin'));
+ ->willReturn('admin');
$targetUser = $this->createMock(IUser::class);
$this->config->expects($this->never())
->method('setUserValue');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToEdit')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('admin')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$subAdminManager = $this->createMock(SubAdmin::class);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$targetUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UserToEdit'));
+ ->willReturn('UserToEdit');
$this->assertEquals([], $this->api->editUser('UserToEdit', 'language', 'ru')->getData());
}
@@ -1775,7 +1775,7 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser->expects($this->once())
->method('setQuota')
@@ -1783,12 +1783,12 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToEdit')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()
->getMock();
@@ -1796,15 +1796,15 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$targetUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->assertEquals([], $this->api->editUser('UserToEdit', 'quota', '3042824')->getData());
}
@@ -1818,17 +1818,17 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToEdit')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()
->getMock();
@@ -1836,15 +1836,15 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$targetUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->api->editUser('UserToEdit', 'quota', 'value');
}
@@ -1858,16 +1858,16 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UserToEdit'));
+ ->willReturn('UserToEdit');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToDelete')
- ->will($this->returnValue(null));
+ ->willReturn(null);
$this->api->deleteUser('UserToDelete');
}
@@ -1881,21 +1881,21 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToDelete')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->api->deleteUser('UserToDelete');
}
@@ -1905,30 +1905,30 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('admin'));
+ ->willReturn('admin');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToDelete')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('admin')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$targetUser
->expects($this->once())
->method('delete')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->assertEquals([], $this->api->deleteUser('UserToDelete')->getData());
}
@@ -1942,30 +1942,30 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('admin'));
+ ->willReturn('admin');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToDelete')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('admin')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$targetUser
->expects($this->once())
->method('delete')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->api->deleteUser('UserToDelete');
}
@@ -1975,41 +1975,41 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToDelete')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('subadmin')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$subAdminManager
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$targetUser
->expects($this->once())
->method('delete')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->assertEquals([], $this->api->deleteUser('UserToDelete')->getData());
}
@@ -2023,41 +2023,41 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToDelete')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('subadmin')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$subAdminManager
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$targetUser
->expects($this->once())
->method('delete')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->api->deleteUser('UserToDelete');
}
@@ -2071,37 +2071,37 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('UID'));
+ ->willReturn('UID');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToDelete')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('subadmin')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$subAdminManager
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->api->deleteUser('UserToDelete');
}
@@ -2115,7 +2115,7 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->api->getUsersGroups('UserToLookup');
}
@@ -2125,26 +2125,26 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('UserToLookup'));
+ ->willReturn('UserToLookup');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('UserToLookup'));
+ ->willReturn('UserToLookup');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToLookup')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('getUserGroupIds')
->with($targetUser)
- ->will($this->returnValue(['DummyValue']));
+ ->willReturn(['DummyValue']);
$this->assertEquals(['groups' => ['DummyValue']], $this->api->getUsersGroups('UserToLookup')->getData());
}
@@ -2154,31 +2154,31 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->exactly(2))
->method('getUID')
- ->will($this->returnValue('admin'));
+ ->willReturn('admin');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('UserToLookup'));
+ ->willReturn('UserToLookup');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToLookup')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('getUserGroupIds')
->with($targetUser)
- ->will($this->returnValue(['DummyValue']));
+ ->willReturn(['DummyValue']);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('admin')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->assertEquals(['groups' => ['DummyValue']], $this->api->getUsersGroups('UserToLookup')->getData());
}
@@ -2188,57 +2188,57 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->exactly(2))
->method('getUID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('UserToLookup'));
+ ->willReturn('UserToLookup');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToLookup')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('subadmin')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$subAdminManager
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$group1 = $this->getMockBuilder('\OCP\IGroup')->disableOriginalConstructor()->getMock();
$group1
->expects($this->any())
->method('getGID')
- ->will($this->returnValue('Group1'));
+ ->willReturn('Group1');
$group2 = $this->getMockBuilder('\OCP\IGroup')->disableOriginalConstructor()->getMock();
$group2
->expects($this->any())
->method('getGID')
- ->will($this->returnValue('Group2'));
+ ->willReturn('Group2');
$subAdminManager
->expects($this->once())
->method('getSubAdminsGroups')
->with($loggedInUser)
- ->will($this->returnValue([$group1, $group2]));
+ ->willReturn([$group1, $group2]);
$this->groupManager
->expects($this->any())
->method('getUserGroupIds')
->with($targetUser)
- ->will($this->returnValue(['Group1']));
+ ->willReturn(['Group1']);
$this->assertEquals(['groups' => ['Group1']], $this->api->getUsersGroups('UserToLookup')->getData());
}
@@ -2252,42 +2252,42 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->exactly(2))
->method('getUID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('UserToLookup'));
+ ->willReturn('UserToLookup');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToLookup')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('subadmin')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$subAdminManager
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->groupManager
->expects($this->any())
->method('getUserGroupIds')
->with($targetUser)
- ->will($this->returnValue(['Group1']));
+ ->willReturn(['Group1']);
$this->api->getUsersGroups('UserToLookup');
}
@@ -2470,7 +2470,7 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->api->removeFromGroup('TargetUser', '');
}
@@ -2484,7 +2484,7 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->api->removeFromGroup('TargetUser', '');
}
@@ -2498,12 +2498,12 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('get')
->with('TargetGroup')
- ->will($this->returnValue(null));
+ ->willReturn(null);
$this->api->removeFromGroup('TargetUser', 'TargetGroup');
}
@@ -2518,17 +2518,17 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('get')
->with('TargetGroup')
- ->will($this->returnValue($targetGroup));
+ ->willReturn($targetGroup);
$this->userManager
->expects($this->once())
->method('get')
->with('TargetUser')
- ->will($this->returnValue(null));
+ ->willReturn(null);
$this->api->removeFromGroup('TargetUser', 'TargetGroup');
}
@@ -2542,34 +2542,34 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('unauthorizedUser'));
+ ->willReturn('unauthorizedUser');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetGroup = $this->getMockBuilder('\OCP\IGroup')->disableOriginalConstructor()->getMock();
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('get')
->with('TargetGroup')
- ->will($this->returnValue($targetGroup));
+ ->willReturn($targetGroup);
$this->userManager
->expects($this->once())
->method('get')
->with('TargetUser')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('unauthorizedUser')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->api->removeFromGroup('TargetUser', 'TargetGroup');
}
@@ -2584,42 +2584,42 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('admin'));
+ ->willReturn('admin');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('admin'));
+ ->willReturn('admin');
$targetGroup = $this->getMockBuilder('\OCP\IGroup')->disableOriginalConstructor()->getMock();
$targetGroup
->expects($this->once())
->method('getGID')
- ->will($this->returnValue('admin'));
+ ->willReturn('admin');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('get')
->with('admin')
- ->will($this->returnValue($targetGroup));
+ ->willReturn($targetGroup);
$this->userManager
->expects($this->once())
->method('get')
->with('Admin')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->groupManager
->expects($this->any())
->method('isAdmin')
->with('admin')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->api->removeFromGroup('Admin', 'admin');
}
@@ -2634,47 +2634,47 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetUser
->expects($this->once())
->method('getUID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$targetGroup = $this->getMockBuilder('\OCP\IGroup')->disableOriginalConstructor()->getMock();
$targetGroup
->expects($this->any())
->method('getGID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('get')
->with('subadmin')
- ->will($this->returnValue($targetGroup));
+ ->willReturn($targetGroup);
$this->userManager
->expects($this->once())
->method('get')
->with('SubAdmin')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$subAdminManager
->expects($this->once())
->method('isSubAdminOfGroup')
->with($loggedInUser, $targetGroup)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->groupManager
->expects($this->any())
->method('isAdmin')
->with('subadmin')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->api->removeFromGroup('SubAdmin', 'subadmin');
}
@@ -2689,49 +2689,49 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetGroup = $this->getMockBuilder('\OCP\IGroup')->disableOriginalConstructor()->getMock();
$targetGroup
->expects($this->any())
->method('getGID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('get')
->with('subadmin')
- ->will($this->returnValue($targetGroup));
+ ->willReturn($targetGroup);
$this->userManager
->expects($this->once())
->method('get')
->with('AnotherUser')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$subAdminManager
->expects($this->once())
->method('isSubAdminOfGroup')
->with($loggedInUser, $targetGroup)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$subAdminManager
->expects($this->once())
->method('getSubAdminsGroups')
->with($loggedInUser)
- ->will($this->returnValue([$targetGroup]));
+ ->willReturn([$targetGroup]);
$this->groupManager
->expects($this->any())
->method('isAdmin')
->with('subadmin')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->groupManager
->expects($this->once())
->method('getUserGroupIds')
@@ -2746,34 +2746,34 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->any())
->method('getUID')
- ->will($this->returnValue('admin'));
+ ->willReturn('admin');
$targetUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$targetGroup = $this->getMockBuilder('\OCP\IGroup')->disableOriginalConstructor()->getMock();
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('get')
->with('admin')
- ->will($this->returnValue($targetGroup));
+ ->willReturn($targetGroup);
$this->userManager
->expects($this->once())
->method('get')
->with('AnotherUser')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->groupManager
->expects($this->any())
->method('isAdmin')
->with('admin')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$targetGroup
->expects($this->once())
->method('removeUser')
@@ -2792,7 +2792,7 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('get')
->with('NotExistingUser')
- ->will($this->returnValue(null));
+ ->willReturn(null);
$this->api->addSubAdmin('NotExistingUser', '');
}
@@ -2809,12 +2809,12 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('get')
->with('ExistingUser')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('get')
->with('NotExistingGroup')
- ->will($this->returnValue(null));
+ ->willReturn(null);
$this->api->addSubAdmin('ExistingUser', 'NotExistingGroup');
}
@@ -2830,17 +2830,17 @@ class UsersControllerTest extends TestCase {
$targetGroup
->expects($this->once())
->method('getGID')
- ->will($this->returnValue('admin'));
+ ->willReturn('admin');
$this->userManager
->expects($this->once())
->method('get')
->with('ExistingUser')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('get')
->with('ADmiN')
- ->will($this->returnValue($targetGroup));
+ ->willReturn($targetGroup);
$this->api->addSubAdmin('ExistingUser', 'ADmiN');
}
@@ -2852,23 +2852,23 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('get')
->with('ExistingUser')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('get')
->with('TargetGroup')
- ->will($this->returnValue($targetGroup));
+ ->willReturn($targetGroup);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$subAdminManager
->expects($this->once())
->method('isSubAdminOfGroup')
->with($targetUser, $targetGroup)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->assertEquals([], $this->api->addSubAdmin('ExistingUser', 'TargetGroup')->getData());
}
@@ -2880,28 +2880,28 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('get')
->with('ExistingUser')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('get')
->with('TargetGroup')
- ->will($this->returnValue($targetGroup));
+ ->willReturn($targetGroup);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$subAdminManager
->expects($this->once())
->method('isSubAdminOfGroup')
->with($targetUser, $targetGroup)
- ->will($this->returnValue(false));
+ ->willReturn(false);
$subAdminManager
->expects($this->once())
->method('createSubAdmin')
->with($targetUser, $targetGroup)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->assertEquals([], $this->api->addSubAdmin('ExistingUser', 'TargetGroup')->getData());
}
@@ -2916,7 +2916,7 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('get')
->with('NotExistingUser')
- ->will($this->returnValue(null));
+ ->willReturn(null);
$this->api->removeSubAdmin('NotExistingUser', 'GroupToDeleteFrom');
}
@@ -2932,12 +2932,12 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('get')
->with('ExistingUser')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('get')
->with('GroupToDeleteFrom')
- ->will($this->returnValue(null));
+ ->willReturn(null);
$this->api->removeSubAdmin('ExistingUser', 'GroupToDeleteFrom');
}
@@ -2955,23 +2955,23 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('get')
->with('ExistingUser')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('get')
->with('GroupToDeleteFrom')
- ->will($this->returnValue($targetGroup));
+ ->willReturn($targetGroup);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$subAdminManager
->expects($this->once())
->method('isSubAdminOfGroup')
->with($targetUser, $targetGroup)
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->api->removeSubAdmin('ExistingUser', 'GroupToDeleteFrom');
}
@@ -2983,28 +2983,28 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('get')
->with('ExistingUser')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('get')
->with('GroupToDeleteFrom')
- ->will($this->returnValue($targetGroup));
+ ->willReturn($targetGroup);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$subAdminManager
->expects($this->once())
->method('isSubAdminOfGroup')
->with($targetUser, $targetGroup)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$subAdminManager
->expects($this->once())
->method('deleteSubAdmin')
->with($targetUser, $targetGroup)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->assertEquals([], $this->api->removeSubAdmin('ExistingUser', 'GroupToDeleteFrom')->getData());
}
@@ -3019,7 +3019,7 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('get')
->with('RequestedUser')
- ->will($this->returnValue(null));
+ ->willReturn(null);
$this->api->getUserSubAdminGroups('RequestedUser');
}
@@ -3030,23 +3030,23 @@ class UsersControllerTest extends TestCase {
$targetGroup
->expects($this->once())
->method('getGID')
- ->will($this->returnValue('TargetGroup'));
+ ->willReturn('TargetGroup');
$this->userManager
->expects($this->once())
->method('get')
->with('RequestedUser')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()->getMock();
$subAdminManager
->expects($this->once())
->method('getSubAdminsGroups')
->with($targetUser)
- ->will($this->returnValue([$targetGroup]));
+ ->willReturn([$targetGroup]);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->assertEquals(['TargetGroup'], $this->api->getUserSubAdminGroups('RequestedUser')->getData());
}
@@ -3060,20 +3060,20 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('get')
->with('RequestedUser')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$loggedInUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$loggedInUser
->expects($this->exactly(2))
->method('getUID')
- ->will($this->returnValue('admin'));
+ ->willReturn('admin');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->assertEquals([], $this->api->enableUser('RequestedUser')->getData());
}
@@ -3087,20 +3087,20 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('get')
->with('RequestedUser')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$loggedInUser = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$loggedInUser
->expects($this->exactly(2))
->method('getUID')
- ->will($this->returnValue('admin'));
+ ->willReturn('admin');
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->assertEquals([], $this->api->disableUser('RequestedUser')->getData());
}
@@ -3225,7 +3225,7 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('get')
->with('NotExistingUser')
- ->will($this->returnValue(null));
+ ->willReturn(null);
$this->api->resendWelcomeMessage('NotExistingUser');
}
@@ -3241,24 +3241,24 @@ class UsersControllerTest extends TestCase {
$loggedInUser
->expects($this->exactly(1))
->method('getUID')
- ->will($this->returnValue('subadmin'));
+ ->willReturn('subadmin');
$targetUser = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToGet')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$this->groupManager
->expects($this->once())
->method('isAdmin')
->with('subadmin')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()
->getMock();
@@ -3266,11 +3266,11 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$this->api->resendWelcomeMessage('UserToGet');
}
@@ -3290,12 +3290,12 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToGet')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()
->getMock();
@@ -3303,15 +3303,15 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$targetUser
->expects($this->once())
->method('getEmailAddress')
- ->will($this->returnValue(''));
+ ->willReturn('');
$this->api->resendWelcomeMessage('UserToGet');
}
@@ -3331,12 +3331,12 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToGet')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()
->getMock();
@@ -3344,15 +3344,15 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$targetUser
->expects($this->once())
->method('getEmailAddress')
- ->will($this->returnValue(null));
+ ->willReturn(null);
$this->api->resendWelcomeMessage('UserToGet');
}
@@ -3370,12 +3370,12 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToGet')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()
->getMock();
@@ -3383,15 +3383,15 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$targetUser
->expects($this->once())
->method('getEmailAddress')
- ->will($this->returnValue('abc@example.org'));
+ ->willReturn('abc@example.org');
$emailTemplate = $this->createMock(IEMailTemplate::class);
$this->newUserMailHelper
->expects($this->at(0))
@@ -3418,12 +3418,12 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToGet')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()
->getMock();
@@ -3431,15 +3431,15 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$targetUser
->expects($this->once())
->method('getEmailAddress')
- ->will($this->returnValue('abc@example.org'));
+ ->willReturn('abc@example.org');
$l10n = $this->getMockBuilder(IL10N::class)
->disableOriginalConstructor()
->getMock();
@@ -3474,12 +3474,12 @@ class UsersControllerTest extends TestCase {
$this->userSession
->expects($this->once())
->method('getUser')
- ->will($this->returnValue($loggedInUser));
+ ->willReturn($loggedInUser);
$this->userManager
->expects($this->once())
->method('get')
->with('UserToGet')
- ->will($this->returnValue($targetUser));
+ ->willReturn($targetUser);
$subAdminManager = $this->getMockBuilder('OC\SubAdmin')
->disableOriginalConstructor()
->getMock();
@@ -3487,15 +3487,15 @@ class UsersControllerTest extends TestCase {
->expects($this->once())
->method('isUserAccessible')
->with($loggedInUser, $targetUser)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->groupManager
->expects($this->once())
->method('getSubAdmin')
- ->will($this->returnValue($subAdminManager));
+ ->willReturn($subAdminManager);
$targetUser
->expects($this->once())
->method('getEmailAddress')
- ->will($this->returnValue('abc@example.org'));
+ ->willReturn('abc@example.org');
$emailTemplate = $this->createMock(IEMailTemplate::class);
$this->newUserMailHelper
->expects($this->at(0))