diff options
Diffstat (limited to 'tests/lib/Share20/ManagerTest.php')
-rw-r--r-- | tests/lib/Share20/ManagerTest.php | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php index e46e019c6ed..96bebc196f6 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -123,9 +123,9 @@ class ManagerTest extends \Test\TestCase { $this->l10nFactory = $this->createMock(IFactory::class); $this->l = $this->createMock(IL10N::class); $this->l->method('t') - ->willReturnCallback(function($text, $parameters = []) { - return vsprintf($text, $parameters); - }); + ->willReturnCallback(function ($text, $parameters = []) { + return vsprintf($text, $parameters); + }); $this->factory = new DummyFactory(\OC::$server); @@ -233,7 +233,7 @@ class ManagerTest extends \Test\TestCase { ->method('dispatch') ->with( 'OCP\Share::preUnshare', - $this->callBack(function(GenericEvent $e) use ($share) { + $this->callBack(function (GenericEvent $e) use ($share) { return $e->getSubject() === $share; }) ); @@ -241,7 +241,7 @@ class ManagerTest extends \Test\TestCase { ->method('dispatch') ->with( 'OCP\Share::postUnshare', - $this->callBack(function(GenericEvent $e) use ($share) { + $this->callBack(function (GenericEvent $e) use ($share) { return $e->getSubject() === $share && $e->getArgument('deletedShares') === [$share]; }) @@ -279,7 +279,7 @@ class ManagerTest extends \Test\TestCase { ->method('dispatch') ->with( 'OCP\Share::preUnshare', - $this->callBack(function(GenericEvent $e) use ($share) { + $this->callBack(function (GenericEvent $e) use ($share) { return $e->getSubject() === $share; }) ); @@ -287,7 +287,7 @@ class ManagerTest extends \Test\TestCase { ->method('dispatch') ->with( 'OCP\Share::postUnshare', - $this->callBack(function(GenericEvent $e) use ($share) { + $this->callBack(function (GenericEvent $e) use ($share) { return $e->getSubject() === $share && $e->getArgument('deletedShares') === [$share]; }) @@ -348,7 +348,7 @@ class ManagerTest extends \Test\TestCase { ->method('dispatch') ->with( 'OCP\Share::preUnshare', - $this->callBack(function(GenericEvent $e) use ($share1) { + $this->callBack(function (GenericEvent $e) use ($share1) { return $e->getSubject() === $share1; }) ); @@ -356,7 +356,7 @@ class ManagerTest extends \Test\TestCase { ->method('dispatch') ->with( 'OCP\Share::postUnshare', - $this->callBack(function(GenericEvent $e) use ($share1, $share2, $share3) { + $this->callBack(function (GenericEvent $e) use ($share1, $share2, $share3) { return $e->getSubject() === $share1 && $e->getArgument('deletedShares') === [$share3, $share2, $share1]; }) @@ -391,7 +391,7 @@ class ManagerTest extends \Test\TestCase { ->method('dispatch') ->with( 'OCP\Share::postUnshareFromSelf', - $this->callBack(function(GenericEvent $e) use ($share) { + $this->callBack(function (GenericEvent $e) use ($share) { return $e->getSubject() === $share; }) ); @@ -423,7 +423,7 @@ class ManagerTest extends \Test\TestCase { $this->defaultProvider ->expects($this->exactly(4)) ->method('getChildren') - ->willReturnCallback(function($_share) use ($share, $shares) { + ->willReturnCallback(function ($_share) use ($share, $shares) { if ($_share === $share) { return $shares; } @@ -492,7 +492,7 @@ class ManagerTest extends \Test\TestCase { public function testVerifyPasswordNull() { $this->config->method('getAppValue')->willReturnMap([ - ['core', 'shareapi_enforce_links_password', 'no', 'no'], + ['core', 'shareapi_enforce_links_password', 'no', 'no'], ]); $result = self::invokePrivate($this->manager, 'verifyPassword', [null]); @@ -501,11 +501,11 @@ class ManagerTest extends \Test\TestCase { public function testVerifyPasswordHook() { $this->config->method('getAppValue')->willReturnMap([ - ['core', 'shareapi_enforce_links_password', 'no', 'no'], + ['core', 'shareapi_enforce_links_password', 'no', 'no'], ]); $this->eventDispatcher->expects($this->once())->method('dispatch') - ->willReturnCallback(function(Event $event) { + ->willReturnCallback(function (Event $event) { $this->assertInstanceOf(ValidatePasswordPolicyEvent::class, $event); /** @var ValidatePasswordPolicyEvent $event */ $this->assertSame('password', $event->getPassword()); @@ -522,11 +522,11 @@ class ManagerTest extends \Test\TestCase { $this->expectExceptionMessage('password not accepted'); $this->config->method('getAppValue')->willReturnMap([ - ['core', 'shareapi_enforce_links_password', 'no', 'no'], + ['core', 'shareapi_enforce_links_password', 'no', 'no'], ]); $this->eventDispatcher->expects($this->once())->method('dispatch') - ->willReturnCallback(function(Event $event) { + ->willReturnCallback(function (Event $event) { $this->assertInstanceOf(ValidatePasswordPolicyEvent::class, $event); /** @var ValidatePasswordPolicyEvent $event */ $this->assertSame('password', $event->getPassword()); @@ -1096,7 +1096,7 @@ class ManagerTest extends \Test\TestCase { } - public function testUserCreateChecksIdenticalPathSharedViaGroup() { + public function testUserCreateChecksIdenticalPathSharedViaGroup() { $this->expectException(\Exception::class); $this->expectExceptionMessage('Path is already shared with this user'); @@ -1137,7 +1137,7 @@ class ManagerTest extends \Test\TestCase { self::invokePrivate($this->manager, 'userCreateChecks', [$share]); } - public function testUserCreateChecksIdenticalPathSharedViaDeletedGroup() { + public function testUserCreateChecksIdenticalPathSharedViaDeletedGroup() { $share = $this->manager->newShare(); $sharedWith = $this->createMock(IUser::class); @@ -1773,7 +1773,7 @@ class ManagerTest extends \Test\TestCase { ->expects($this->once()) ->method('create') ->with($share) - ->willReturnCallback(function(Share $share) { + ->willReturnCallback(function (Share $share) { return $share->setId(42); }); @@ -1782,7 +1782,7 @@ class ManagerTest extends \Test\TestCase { ->method('dispatch') ->with( $this->equalTo('OCP\Share::preShare'), - $this->callback(function(GenericEvent $e) use ($path, $date) { + $this->callback(function (GenericEvent $e) use ($path, $date) { /** @var IShare $share */ $share = $e->getSubject(); @@ -1801,7 +1801,7 @@ class ManagerTest extends \Test\TestCase { ->method('dispatch') ->with( $this->equalTo('OCP\Share::postShare'), - $this->callback(function(GenericEvent $e) use ($path, $date) { + $this->callback(function (GenericEvent $e) use ($path, $date) { /** @var IShare $share */ $share = $e->getSubject(); @@ -1882,7 +1882,7 @@ class ManagerTest extends \Test\TestCase { ->expects($this->once()) ->method('create') ->with($share) - ->willReturnCallback(function(Share $share) { + ->willReturnCallback(function (Share $share) { return $share->setId(42); }); @@ -1891,7 +1891,7 @@ class ManagerTest extends \Test\TestCase { ->method('dispatch') ->with( $this->equalTo('OCP\Share::preShare'), - $this->callback(function(GenericEvent $e) use ($path) { + $this->callback(function (GenericEvent $e) use ($path) { /** @var IShare $share */ $share = $e->getSubject(); @@ -1910,7 +1910,7 @@ class ManagerTest extends \Test\TestCase { ->method('dispatch') ->with( $this->equalTo('OCP\Share::postShare'), - $this->callback(function(GenericEvent $e) use ($path) { + $this->callback(function (GenericEvent $e) use ($path) { /** @var IShare $share */ $share = $e->getSubject(); @@ -1993,7 +1993,7 @@ class ManagerTest extends \Test\TestCase { ->with( $this->equalTo('OCP\Share::preShare'), $this->isInstanceOf(GenericEvent::class) - )->willReturnCallback(function($name, GenericEvent $e) { + )->willReturnCallback(function ($name, GenericEvent $e) { $e->setArgument('error', 'I won\'t let you share!'); $e->stopPropagation(); } @@ -2145,7 +2145,7 @@ class ManagerTest extends \Test\TestCase { */ $this->defaultProvider ->method('getSharesBy') - ->willReturnCallback(function($uid, $type, $node, $reshares, $limit, $offset) use (&$shares2) { + ->willReturnCallback(function ($uid, $type, $node, $reshares, $limit, $offset) use (&$shares2) { return array_slice($shares2, $offset, $limit); }); @@ -2153,7 +2153,7 @@ class ManagerTest extends \Test\TestCase { * Simulate the deleteShare call. */ $manager->method('deleteShare') - ->willReturnCallback(function($share) use (&$shares2) { + ->willReturnCallback(function ($share) use (&$shares2) { for($i = 0; $i < count($shares2); $i++) { if ($shares2[$i]->getId() === $share->getId()) { array_splice($shares2, $i, 1); @@ -2255,7 +2255,7 @@ class ManagerTest extends \Test\TestCase { $factory->expects($this->any()) ->method('getProviderForType') - ->willReturnCallback(function($shareType) use ($roomShareProvider) { + ->willReturnCallback(function ($shareType) use ($roomShareProvider) { if ($shareType !== \OCP\Share::SHARE_TYPE_ROOM) { throw new Exception\ProviderException(); } @@ -2410,8 +2410,8 @@ class ManagerTest extends \Test\TestCase { ->expects($this->at(1)) ->method('getAppValue') ->willReturnMap([ - ['core', 'shareapi_allow_public_upload', 'yes', 'no'], - ]); + ['core', 'shareapi_allow_public_upload', 'yes', 'no'], + ]); $this->defaultProvider->expects($this->once()) ->method('getShareByToken') @@ -2464,7 +2464,7 @@ class ManagerTest extends \Test\TestCase { ->setPassword('passwordHash'); $this->hasher->method('verify')->with('password', 'passwordHash', '') - ->willReturnCallback(function($pass, $hash, &$newHash) { + ->willReturnCallback(function ($pass, $hash, &$newHash) { $newHash = 'newHash'; return true; @@ -3741,12 +3741,12 @@ class ManagerTest extends \Test\TestCase { $share4 = $this->createMock(IShare::class); $this->defaultProvider->method('getAllShares') - ->willReturnCallback(function() use ($share1, $share2) { + ->willReturnCallback(function () use ($share1, $share2) { yield $share1; yield $share2; }); $extraProvider->method('getAllShares') - ->willReturnCallback(function() use ($share3, $share4) { + ->willReturnCallback(function () use ($share3, $share4) { yield $share3; yield $share4; }); |