diff options
Diffstat (limited to 'apps/files_sharing/tests')
8 files changed, 29 insertions, 29 deletions
diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php index 654ca3b450b..b8d5a21a739 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -108,7 +108,7 @@ class ApiTest extends TestCase { private function createOCS($userId) { $l = $this->getMockBuilder(IL10N::class)->getMock(); $l->method('t') - ->willReturnCallback(function($text, $parameters = []) { + ->willReturnCallback(function ($text, $parameters = []) { return vsprintf($text, $parameters); }); $config = $this->createMock(IConfig::class); diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php index 3f82675fedf..577f574f8ed 100644 --- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php @@ -123,7 +123,7 @@ class ShareAPIControllerTest extends TestCase { $this->l = $this->createMock(IL10N::class); $this->l->method('t') - ->willReturnCallback(function($text, $parameters = []) { + ->willReturnCallback(function ($text, $parameters = []) { return vsprintf($text, $parameters); }); $this->config = $this->createMock(IConfig::class); @@ -180,7 +180,7 @@ class ShareAPIControllerTest extends TestCase { $this->shareManager ->expects($this->exactly(5)) ->method('getShareById') - ->willReturnCallback(function($id) { + ->willReturnCallback(function ($id) { if ($id === 'ocinternal:42' || $id === 'ocRoomShare:42' || $id === 'ocFederatedSharing:42' || $id === 'ocCircleShare:42' || $id === 'ocMailShare:42') { throw new \OCP\Share\Exceptions\ShareNotFound(); } else { @@ -1341,7 +1341,7 @@ class ShareAPIControllerTest extends TestCase { $ocs->method('formatShare') ->willReturnCallback( - function($share) { + function ($share) { return [ 'id' => $share->getId(), 'share_type' => $share->getShareType() @@ -1361,7 +1361,7 @@ class ShareAPIControllerTest extends TestCase { $this->shareManager ->method('getSharesBy') ->willReturnCallback( - function($user, $shareType, $node) use ($shares) { + function ($user, $shareType, $node) use ($shares) { if (!isset($shares[$node->getName()]) || !isset($shares[$node->getName()][$shareType])) { return []; } @@ -1380,7 +1380,7 @@ class ShareAPIControllerTest extends TestCase { $this->groupManager ->method('isInGroup') ->willReturnCallback( - function($user, $group) { + function ($user, $group) { return $group === 'currentUserGroup'; } ); diff --git a/apps/files_sharing/tests/Controller/ShareControllerTest.php b/apps/files_sharing/tests/Controller/ShareControllerTest.php index 240a0c7faad..a43c050634b 100644 --- a/apps/files_sharing/tests/Controller/ShareControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareControllerTest.php @@ -284,7 +284,7 @@ class ShareControllerTest extends \Test\TestCase { ->with('core', 'shareapi_public_link_disclaimertext', null) ->willReturn('My disclaimer text'); - $this->userManager->method('get')->willReturnCallback(function(string $uid) use ($owner, $initiator) { + $this->userManager->method('get')->willReturnCallback(function (string $uid) use ($owner, $initiator) { if ($uid === 'ownerUID') { return $owner; } @@ -298,14 +298,14 @@ class ShareControllerTest extends \Test\TestCase { ->method('dispatch') ->with( 'OCA\Files_Sharing::loadAdditionalScripts', - $this->callback(function($event) use ($share) { + $this->callback(function ($event) use ($share) { return $event->getArgument('share') === $share; }) ); $this->l10n->expects($this->any()) ->method('t') - ->willReturnCallback(function($text, $parameters) { + ->willReturnCallback(function ($text, $parameters) { return vsprintf($text, $parameters); }); @@ -432,7 +432,7 @@ class ShareControllerTest extends \Test\TestCase { ->with('core', 'shareapi_public_link_disclaimertext', null) ->willReturn('My disclaimer text'); - $this->userManager->method('get')->willReturnCallback(function(string $uid) use ($owner, $initiator) { + $this->userManager->method('get')->willReturnCallback(function (string $uid) use ($owner, $initiator) { if ($uid === 'ownerUID') { return $owner; } @@ -446,14 +446,14 @@ class ShareControllerTest extends \Test\TestCase { ->method('dispatch') ->with( 'OCA\Files_Sharing::loadAdditionalScripts', - $this->callback(function($event) use ($share) { + $this->callback(function ($event) use ($share) { return $event->getArgument('share') === $share; }) ); $this->l10n->expects($this->any()) ->method('t') - ->will($this->returnCallback(function($text, $parameters) { + ->will($this->returnCallback(function ($text, $parameters) { return vsprintf($text, $parameters); })); @@ -583,7 +583,7 @@ class ShareControllerTest extends \Test\TestCase { ->with('core', 'shareapi_public_link_disclaimertext', null) ->willReturn('My disclaimer text'); - $this->userManager->method('get')->willReturnCallback(function(string $uid) use ($owner, $initiator) { + $this->userManager->method('get')->willReturnCallback(function (string $uid) use ($owner, $initiator) { if ($uid === 'ownerUID') { return $owner; } @@ -597,14 +597,14 @@ class ShareControllerTest extends \Test\TestCase { ->method('dispatch') ->with( 'OCA\Files_Sharing::loadAdditionalScripts', - $this->callback(function($event) use ($share) { + $this->callback(function ($event) use ($share) { return $event->getArgument('share') === $share; }) ); $this->l10n->expects($this->any()) ->method('t') - ->willReturnCallback(function($text, $parameters) { + ->willReturnCallback(function ($text, $parameters) { return vsprintf($text, $parameters); }); @@ -712,7 +712,7 @@ class ShareControllerTest extends \Test\TestCase { ->with('token') ->willReturn($share); - $this->userManager->method('get')->willReturnCallback(function(string $uid) use ($owner, $initiator) { + $this->userManager->method('get')->willReturnCallback(function (string $uid) use ($owner, $initiator) { if ($uid === 'ownerUID') { return $owner; } @@ -724,7 +724,7 @@ class ShareControllerTest extends \Test\TestCase { $this->l10n->expects($this->any()) ->method('t') - ->willReturnCallback(function($text, $parameters) { + ->willReturnCallback(function ($text, $parameters) { return vsprintf($text, $parameters); }); @@ -869,7 +869,7 @@ class ShareControllerTest extends \Test\TestCase { ->with('token') ->willReturn($share); - $this->userManager->method('get')->willReturnCallback(function(string $uid) use ($owner, $initiator) { + $this->userManager->method('get')->willReturnCallback(function (string $uid) use ($owner, $initiator) { if ($uid === 'ownerUID') { return $owner; } @@ -910,7 +910,7 @@ class ShareControllerTest extends \Test\TestCase { ->with('token') ->willReturn($share); - $this->userManager->method('get')->willReturnCallback(function(string $uid) use ($owner, $initiator) { + $this->userManager->method('get')->willReturnCallback(function (string $uid) use ($owner, $initiator) { if ($uid === 'ownerUID') { return $owner; } diff --git a/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php index 0f3f53a26f6..7beb4058c4f 100644 --- a/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php @@ -292,7 +292,7 @@ class ShareesAPIControllerTest extends TestCase { $this->shareManager->expects($this->any()) ->method('shareProviderExists') - ->willReturnCallback(function($shareType) use ($emailSharingEnabled) { + ->willReturnCallback(function ($shareType) use ($emailSharingEnabled) { if ($shareType === \OCP\Share::SHARE_TYPE_EMAIL) { return $emailSharingEnabled; } else { diff --git a/apps/files_sharing/tests/EtagPropagationTest.php b/apps/files_sharing/tests/EtagPropagationTest.php index bcab1a92bb8..cb078fdf832 100644 --- a/apps/files_sharing/tests/EtagPropagationTest.php +++ b/apps/files_sharing/tests/EtagPropagationTest.php @@ -456,7 +456,7 @@ class EtagPropagationTest extends PropagationTestCase { $shares = $this->shareManager->getSharesBy(self::TEST_FILES_SHARING_API_USER1, \OCP\Share::SHARE_TYPE_USER, $node); /** @var \OCP\Share\IShare[] $shares */ - $shares = array_filter($shares, function(\OCP\Share\IShare $share) { + $shares = array_filter($shares, function (\OCP\Share\IShare $share) { return $share->getSharedWith() === self::TEST_FILES_SHARING_API_USER2; }); $this->assertCount(1, $shares); diff --git a/apps/files_sharing/tests/External/ManagerTest.php b/apps/files_sharing/tests/External/ManagerTest.php index 5065c88afc7..5a1e8ad14e1 100644 --- a/apps/files_sharing/tests/External/ManagerTest.php +++ b/apps/files_sharing/tests/External/ManagerTest.php @@ -110,7 +110,7 @@ class ManagerTest extends TestCase { ] )->setMethods(['tryOCMEndPoint'])->getMock(); - $this->testMountProvider = new MountProvider(\OC::$server->getDatabaseConnection(), function() { + $this->testMountProvider = new MountProvider(\OC::$server->getDatabaseConnection(), function () { return $this->manager; }, new CloudIdManager()); } diff --git a/apps/files_sharing/tests/MountProviderTest.php b/apps/files_sharing/tests/MountProviderTest.php index 66df03101ac..cd1afb1f6ff 100644 --- a/apps/files_sharing/tests/MountProviderTest.php +++ b/apps/files_sharing/tests/MountProviderTest.php @@ -145,7 +145,7 @@ class MountProviderTest extends \Test\TestCase { ->willReturn($roomShares); $this->shareManager->expects($this->any()) ->method('newShare') - ->willReturnCallback(function() use ($rootFolder, $userManager) { + ->willReturnCallback(function () use ($rootFolder, $userManager) { return new \OC\Share20\Share($rootFolder, $userManager); }); $mounts = $this->provider->getMountsForUser($this->user, $this->loader); @@ -322,10 +322,10 @@ class MountProviderTest extends \Test\TestCase { $rootFolder = $this->createMock(IRootFolder::class); $userManager = $this->createMock(IUserManager::class); - $userShares = array_map(function($shareSpec) { + $userShares = array_map(function ($shareSpec) { return $this->makeMockShare($shareSpec[0], $shareSpec[1], $shareSpec[2], $shareSpec[3], $shareSpec[4]); }, $userShares); - $groupShares = array_map(function($shareSpec) { + $groupShares = array_map(function ($shareSpec) { return $this->makeMockShare($shareSpec[0], $shareSpec[1], $shareSpec[2], $shareSpec[3], $shareSpec[4]); }, $groupShares); @@ -354,7 +354,7 @@ class MountProviderTest extends \Test\TestCase { ->willReturn($roomShares); $this->shareManager->expects($this->any()) ->method('newShare') - ->willReturnCallback(function() use ($rootFolder, $userManager) { + ->willReturnCallback(function () use ($rootFolder, $userManager) { return new \OC\Share20\Share($rootFolder, $userManager); }); diff --git a/apps/files_sharing/tests/SharedMountTest.php b/apps/files_sharing/tests/SharedMountTest.php index d2610020ec2..cda01aacba2 100644 --- a/apps/files_sharing/tests/SharedMountTest.php +++ b/apps/files_sharing/tests/SharedMountTest.php @@ -186,7 +186,7 @@ class SharedMountTest extends TestCase { * share file with a group if a user renames the file the filename should not change * for the other users */ - public function testMoveGroupShare () { + public function testMoveGroupShare() { $testGroup = $this->groupManager->createGroup('testGroup'); $user1 = $this->userManager->get(self::TEST_FILES_SHARING_API_USER1); $user2 = $this->userManager->get(self::TEST_FILES_SHARING_API_USER2); @@ -266,7 +266,7 @@ class SharedMountTest extends TestCase { public function dataPermissionMovedGroupShare() { $data = []; - $powerset = function($permissions) { + $powerset = function ($permissions) { $results = [\OCP\Constants::PERMISSION_READ]; foreach ($permissions as $permission) { @@ -460,7 +460,7 @@ class SharedMountTest extends TestCase { } class DummyTestClassSharedMount extends \OCA\Files_Sharing\SharedMount { - public function __construct($storage, $mountpoint, $arguments = null, $loader = null){ + public function __construct($storage, $mountpoint, $arguments = null, $loader = null) { // noop } |