diff --git a/composer.json b/composer.json index 06a2b49..ab755bc 100644 --- a/composer.json +++ b/composer.json @@ -30,13 +30,12 @@ "toflar/psr6-symfony-http-cache-store": "^2.2 || ^3.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.0", "ibexa/ci-scripts": "^0.2@dev", - "ibexa/code-style": "^1.0", + "ibexa/code-style": "~2.0.0", "ibexa/doctrine-schema": "~5.0.x-dev", "matthiasnoback/symfony-dependency-injection-test": "^4.3", "phpspec/phpspec": "^7.1", - "phpunit/phpunit": "^8.5", + "phpunit/phpunit": "^9.6", "symfony/phpunit-bridge": "^5.1" }, "autoload": { @@ -70,6 +69,7 @@ } }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": false } } diff --git a/src/bundle/AppCache.php b/src/bundle/AppCache.php index 7becfcc..26af836 100644 --- a/src/bundle/AppCache.php +++ b/src/bundle/AppCache.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\HttpCache; use FOS\HttpCache\SymfonyCache\CacheInvalidation; diff --git a/src/bundle/Controller/InvalidateTokenController.php b/src/bundle/Controller/InvalidateTokenController.php index 29f1009..37d9aba 100644 --- a/src/bundle/Controller/InvalidateTokenController.php +++ b/src/bundle/Controller/InvalidateTokenController.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\HttpCache\Controller; use FOS\HttpCache\ResponseTagger; diff --git a/src/bundle/DependencyInjection/Compiler/DriverPass.php b/src/bundle/DependencyInjection/Compiler/DriverPass.php index bd3295d..50e388e 100644 --- a/src/bundle/DependencyInjection/Compiler/DriverPass.php +++ b/src/bundle/DependencyInjection/Compiler/DriverPass.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\HttpCache\DependencyInjection\Compiler; use Ibexa\Contracts\HttpCache\Handler\ContentTagInterface; diff --git a/src/bundle/DependencyInjection/Compiler/KernelPass.php b/src/bundle/DependencyInjection/Compiler/KernelPass.php index 84b9c3b..7bede9a 100644 --- a/src/bundle/DependencyInjection/Compiler/KernelPass.php +++ b/src/bundle/DependencyInjection/Compiler/KernelPass.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\HttpCache\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; diff --git a/src/bundle/DependencyInjection/Compiler/ResponseTaggersPass.php b/src/bundle/DependencyInjection/Compiler/ResponseTaggersPass.php index 9af0c2b..0741b31 100644 --- a/src/bundle/DependencyInjection/Compiler/ResponseTaggersPass.php +++ b/src/bundle/DependencyInjection/Compiler/ResponseTaggersPass.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\HttpCache\DependencyInjection\Compiler; use Ibexa\HttpCache\ResponseTagger\Delegator\DispatcherTagger; diff --git a/src/bundle/DependencyInjection/Compiler/VarnishCachePass.php b/src/bundle/DependencyInjection/Compiler/VarnishCachePass.php index ff5a28f..5e699fe 100644 --- a/src/bundle/DependencyInjection/Compiler/VarnishCachePass.php +++ b/src/bundle/DependencyInjection/Compiler/VarnishCachePass.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\HttpCache\DependencyInjection\Compiler; use InvalidArgumentException; diff --git a/src/bundle/DependencyInjection/ConfigResolver/HttpCacheConfigParser.php b/src/bundle/DependencyInjection/ConfigResolver/HttpCacheConfigParser.php index fd38f83..fca28e7 100644 --- a/src/bundle/DependencyInjection/ConfigResolver/HttpCacheConfigParser.php +++ b/src/bundle/DependencyInjection/ConfigResolver/HttpCacheConfigParser.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\HttpCache\DependencyInjection\ConfigResolver; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ParserInterface; diff --git a/src/bundle/DependencyInjection/Configuration.php b/src/bundle/DependencyInjection/Configuration.php index a9544d3..a195422 100644 --- a/src/bundle/DependencyInjection/Configuration.php +++ b/src/bundle/DependencyInjection/Configuration.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\HttpCache\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; diff --git a/src/bundle/DependencyInjection/IbexaHttpCacheExtension.php b/src/bundle/DependencyInjection/IbexaHttpCacheExtension.php index 821b90d..b67e334 100644 --- a/src/bundle/DependencyInjection/IbexaHttpCacheExtension.php +++ b/src/bundle/DependencyInjection/IbexaHttpCacheExtension.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\HttpCache\DependencyInjection; use FOS\HttpCache\TagHeaderFormatter\TagHeaderFormatter; diff --git a/src/bundle/IbexaHttpCacheBundle.php b/src/bundle/IbexaHttpCacheBundle.php index 21d581b..7cb54ec 100644 --- a/src/bundle/IbexaHttpCacheBundle.php +++ b/src/bundle/IbexaHttpCacheBundle.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Bundle\HttpCache; use Ibexa\Bundle\HttpCache\DependencyInjection\Compiler\DriverPass; diff --git a/src/contracts/Handler/ContentTagInterface.php b/src/contracts/Handler/ContentTagInterface.php index c7f1c86..5ad048d 100644 --- a/src/contracts/Handler/ContentTagInterface.php +++ b/src/contracts/Handler/ContentTagInterface.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Contracts\HttpCache\Handler; interface ContentTagInterface diff --git a/src/contracts/PurgeClient/PurgeClientInterface.php b/src/contracts/PurgeClient/PurgeClientInterface.php index 6bb85cb..4f14983 100644 --- a/src/contracts/PurgeClient/PurgeClientInterface.php +++ b/src/contracts/PurgeClient/PurgeClientInterface.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Contracts\HttpCache\PurgeClient; /** diff --git a/src/contracts/ResponseTagger/ResponseTagger.php b/src/contracts/ResponseTagger/ResponseTagger.php index f8d8c41..143e855 100644 --- a/src/contracts/ResponseTagger/ResponseTagger.php +++ b/src/contracts/ResponseTagger/ResponseTagger.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Contracts\HttpCache\ResponseTagger; /** diff --git a/src/lib/ContextProvider/RoleIdentify.php b/src/lib/ContextProvider/RoleIdentify.php index 387f410..db591f7 100644 --- a/src/lib/ContextProvider/RoleIdentify.php +++ b/src/lib/ContextProvider/RoleIdentify.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\ContextProvider; use FOS\HttpCache\UserContext\ContextProvider; diff --git a/src/lib/EventListener/ConditionallyRemoveVaryHeaderListener.php b/src/lib/EventListener/ConditionallyRemoveVaryHeaderListener.php index e385a14..0b20c05 100644 --- a/src/lib/EventListener/ConditionallyRemoveVaryHeaderListener.php +++ b/src/lib/EventListener/ConditionallyRemoveVaryHeaderListener.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\EventListener; use Symfony\Component\EventDispatcher\EventSubscriberInterface; diff --git a/src/lib/EventSubscriber/HiddenLocationExceptionSubscriber.php b/src/lib/EventSubscriber/HiddenLocationExceptionSubscriber.php index a5483bf..e80f106 100644 --- a/src/lib/EventSubscriber/HiddenLocationExceptionSubscriber.php +++ b/src/lib/EventSubscriber/HiddenLocationExceptionSubscriber.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\EventSubscriber; use Ibexa\Core\MVC\Exception\HiddenLocationException; diff --git a/src/lib/EventSubscriber/HttpCacheResponseSubscriber.php b/src/lib/EventSubscriber/HttpCacheResponseSubscriber.php index 23b0eb1..9e89e21 100644 --- a/src/lib/EventSubscriber/HttpCacheResponseSubscriber.php +++ b/src/lib/EventSubscriber/HttpCacheResponseSubscriber.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\EventSubscriber; use Ibexa\Contracts\HttpCache\ResponseTagger\ResponseTagger; diff --git a/src/lib/EventSubscriber/RestKernelViewSubscriber.php b/src/lib/EventSubscriber/RestKernelViewSubscriber.php index e0cff2e..98abf72 100644 --- a/src/lib/EventSubscriber/RestKernelViewSubscriber.php +++ b/src/lib/EventSubscriber/RestKernelViewSubscriber.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\EventSubscriber; use FOS\HttpCache\ResponseTagger; diff --git a/src/lib/EventSubscriber/UserContextSubscriber.php b/src/lib/EventSubscriber/UserContextSubscriber.php index 3647cc0..09db11b 100644 --- a/src/lib/EventSubscriber/UserContextSubscriber.php +++ b/src/lib/EventSubscriber/UserContextSubscriber.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\EventSubscriber; use FOS\HttpCache\TagHeaderFormatter\TagHeaderFormatter; diff --git a/src/lib/EventSubscriber/XLocationIdResponseSubscriber.php b/src/lib/EventSubscriber/XLocationIdResponseSubscriber.php index 3eb6a19..ed88497 100644 --- a/src/lib/EventSubscriber/XLocationIdResponseSubscriber.php +++ b/src/lib/EventSubscriber/XLocationIdResponseSubscriber.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\EventSubscriber; use FOS\HttpCache\ResponseTagger; diff --git a/src/lib/Handler/TagHandler.php b/src/lib/Handler/TagHandler.php index b399153..4dee668 100644 --- a/src/lib/Handler/TagHandler.php +++ b/src/lib/Handler/TagHandler.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\Handler; use FOS\HttpCacheBundle\Http\SymfonyResponseTagger; diff --git a/src/lib/Proxy/UserContextListener.php b/src/lib/Proxy/UserContextListener.php index 8b86d72..d025bbd 100644 --- a/src/lib/Proxy/UserContextListener.php +++ b/src/lib/Proxy/UserContextListener.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\Proxy; use FOS\HttpCache\SymfonyCache\UserContextListener as BaseUserContextListener; diff --git a/src/lib/PurgeClient/LocalPurgeClient.php b/src/lib/PurgeClient/LocalPurgeClient.php index 3f53e90..9ff7441 100644 --- a/src/lib/PurgeClient/LocalPurgeClient.php +++ b/src/lib/PurgeClient/LocalPurgeClient.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\PurgeClient; use Ibexa\Contracts\HttpCache\PurgeClient\PurgeClientInterface; diff --git a/src/lib/PurgeClient/RepositoryPrefixDecorator.php b/src/lib/PurgeClient/RepositoryPrefixDecorator.php index 48ca5a3..d9970ff 100644 --- a/src/lib/PurgeClient/RepositoryPrefixDecorator.php +++ b/src/lib/PurgeClient/RepositoryPrefixDecorator.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\PurgeClient; use Ibexa\Contracts\HttpCache\PurgeClient\PurgeClientInterface; diff --git a/src/lib/PurgeClient/VarnishPurgeClient.php b/src/lib/PurgeClient/VarnishPurgeClient.php index bcd91c7..0248ea6 100644 --- a/src/lib/PurgeClient/VarnishPurgeClient.php +++ b/src/lib/PurgeClient/VarnishPurgeClient.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\PurgeClient; use FOS\HttpCacheBundle\CacheManager; diff --git a/src/lib/RepositoryTagPrefix.php b/src/lib/RepositoryTagPrefix.php index 8c39f53..73a56ad 100644 --- a/src/lib/RepositoryTagPrefix.php +++ b/src/lib/RepositoryTagPrefix.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/lib/ResponseConfigurator/ResponseCacheConfigurator.php b/src/lib/ResponseConfigurator/ResponseCacheConfigurator.php index 4a377ae..9511250 100644 --- a/src/lib/ResponseConfigurator/ResponseCacheConfigurator.php +++ b/src/lib/ResponseConfigurator/ResponseCacheConfigurator.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\ResponseConfigurator; use Symfony\Component\HttpFoundation\Response; diff --git a/src/lib/ResponseTagger/Delegator/ContentValueViewTagger.php b/src/lib/ResponseTagger/Delegator/ContentValueViewTagger.php index be45b4a..a5b7322 100644 --- a/src/lib/ResponseTagger/Delegator/ContentValueViewTagger.php +++ b/src/lib/ResponseTagger/Delegator/ContentValueViewTagger.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\ResponseTagger\Delegator; use Ibexa\Contracts\Core\Repository\Values\Content\Content; diff --git a/src/lib/ResponseTagger/Delegator/DispatcherTagger.php b/src/lib/ResponseTagger/Delegator/DispatcherTagger.php index 47ab42f..d564ed1 100644 --- a/src/lib/ResponseTagger/Delegator/DispatcherTagger.php +++ b/src/lib/ResponseTagger/Delegator/DispatcherTagger.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\ResponseTagger\Delegator; use Ibexa\Contracts\HttpCache\ResponseTagger\ResponseTagger; diff --git a/src/lib/ResponseTagger/Delegator/LocationValueViewTagger.php b/src/lib/ResponseTagger/Delegator/LocationValueViewTagger.php index 5f81749..6593519 100644 --- a/src/lib/ResponseTagger/Delegator/LocationValueViewTagger.php +++ b/src/lib/ResponseTagger/Delegator/LocationValueViewTagger.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\ResponseTagger\Delegator; use Ibexa\Contracts\Core\Repository\Values\Content\Location; diff --git a/src/lib/ResponseTagger/Value/AbstractValueTagger.php b/src/lib/ResponseTagger/Value/AbstractValueTagger.php index 6c3ead8..44ba30d 100644 --- a/src/lib/ResponseTagger/Value/AbstractValueTagger.php +++ b/src/lib/ResponseTagger/Value/AbstractValueTagger.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\ResponseTagger\Value; use FOS\HttpCache\ResponseTagger as FosResponseTagger; diff --git a/src/lib/ResponseTagger/Value/ContentInfoTagger.php b/src/lib/ResponseTagger/Value/ContentInfoTagger.php index f29a743..a712758 100644 --- a/src/lib/ResponseTagger/Value/ContentInfoTagger.php +++ b/src/lib/ResponseTagger/Value/ContentInfoTagger.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\ResponseTagger\Value; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/lib/ResponseTagger/Value/LocationTagger.php b/src/lib/ResponseTagger/Value/LocationTagger.php index 8b1b653..75aea05 100644 --- a/src/lib/ResponseTagger/Value/LocationTagger.php +++ b/src/lib/ResponseTagger/Value/LocationTagger.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\ResponseTagger\Value; use Ibexa\Contracts\Core\Repository\Values\Content\Location; diff --git a/src/lib/Twig/ContentTaggingExtension.php b/src/lib/Twig/ContentTaggingExtension.php index 75ff531..09af5bd 100644 --- a/src/lib/Twig/ContentTaggingExtension.php +++ b/src/lib/Twig/ContentTaggingExtension.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\HttpCache\Twig; use Ibexa\Contracts\Core\Repository\Values\Content\Location; diff --git a/tests/bundle/EventListener/ConditionallyRemoveVaryHeaderListenerTest.php b/tests/bundle/EventListener/ConditionallyRemoveVaryHeaderListenerTest.php index 0a32912..ed435e1 100644 --- a/tests/bundle/EventListener/ConditionallyRemoveVaryHeaderListenerTest.php +++ b/tests/bundle/EventListener/ConditionallyRemoveVaryHeaderListenerTest.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Tests\Bundle\HttpCache\EventListener; use Ibexa\HttpCache\EventListener\ConditionallyRemoveVaryHeaderListener; diff --git a/tests/lib/ContextProvider/RoleIdentifyTest.php b/tests/lib/ContextProvider/RoleIdentifyTest.php index e874d7c..49f1c6d 100644 --- a/tests/lib/ContextProvider/RoleIdentifyTest.php +++ b/tests/lib/ContextProvider/RoleIdentifyTest.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Tests\HttpCache\ContextProvider; use FOS\HttpCache\UserContext\UserContext; @@ -46,7 +47,7 @@ protected function setUp(): void $this->roleServiceMock = $this->createMock(RoleService::class); $this->repositoryMock - ->expects($this->any()) + ->expects(self::any()) ->method('getRoleService') ->willReturn($this->roleServiceMock); } @@ -63,7 +64,7 @@ public function testSetIdentity() ->willReturn($userReference); $this->repositoryMock - ->expects($this->any()) + ->expects(self::any()) ->method('getPermissionResolver') ->willReturn($permissionResolver); @@ -118,12 +119,12 @@ public function testSetIdentity() ]; $this->roleServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('getRoleAssignmentsForUser') ->with($user, true) ->willReturn($returnedRoleAssignments); - $this->assertSame([], $userContext->getParameters()); + self::assertSame([], $userContext->getParameters()); $contextProvider = new RoleIdentify( $this->repositoryMock, $permissionResolver, @@ -131,12 +132,12 @@ public function testSetIdentity() ); $contextProvider->updateUserContext($userContext); $userContextParams = $userContext->getParameters(); - $this->assertArrayHasKey('roleIdList', $userContextParams); - $this->assertSame([$roleId1, $roleId2, $roleId3], $userContextParams['roleIdList']); - $this->assertArrayHasKey('roleLimitationList', $userContextParams); + self::assertArrayHasKey('roleIdList', $userContextParams); + self::assertSame([$roleId1, $roleId2, $roleId3], $userContextParams['roleIdList']); + self::assertArrayHasKey('roleLimitationList', $userContextParams); $limitationIdentifierForRole2 = \get_class($limitationForRole2); $limitationIdentifierForRole3 = \get_class($limitationForRole3); - $this->assertSame( + self::assertSame( [ "$roleId2-$limitationIdentifierForRole2" => ['/1/2', '/1/2/43'], "$roleId3-$limitationIdentifierForRole3" => ['foo', 'bar'], @@ -168,7 +169,7 @@ private function generateLimitationMock(array $properties = []) ->setConstructorArgs([$properties]) ->getMockForAbstractClass(); $limitationMock - ->expects($this->any()) + ->expects(self::any()) ->method('getIdentifier') ->willReturn(\get_class($limitationMock)); diff --git a/tests/lib/PurgeClient/LocalPurgeClientTest.php b/tests/lib/PurgeClient/LocalPurgeClientTest.php index 42926bd..c2400fe 100644 --- a/tests/lib/PurgeClient/LocalPurgeClientTest.php +++ b/tests/lib/PurgeClient/LocalPurgeClientTest.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Tests\HttpCache\PurgeClient; use Ibexa\HttpCache\PurgeClient\LocalPurgeClient; @@ -31,7 +32,7 @@ static function ($id) { ); $this->store - ->expects($this->once()) + ->expects(self::once()) ->method('invalidateTags') ->with($keys); diff --git a/tests/lib/PurgeClient/RepositoryPrefixDecoratorTest.php b/tests/lib/PurgeClient/RepositoryPrefixDecoratorTest.php index 8e857ec..787fce1 100644 --- a/tests/lib/PurgeClient/RepositoryPrefixDecoratorTest.php +++ b/tests/lib/PurgeClient/RepositoryPrefixDecoratorTest.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Tests\HttpCache\PurgeClient; use Ibexa\Contracts\HttpCache\PurgeClient\PurgeClientInterface; @@ -47,12 +48,12 @@ protected function tearDown(): void public function testPurge() { $this->purgeClientMock - ->expects($this->once()) + ->expects(self::once()) ->method('purge') - ->with($this->equalTo(['l123', 'c44', 'ez-all'])); + ->with(self::equalTo(['l123', 'c44', 'ez-all'])); $this->tagPrefixMock - ->expects($this->once()) + ->expects(self::once()) ->method('getRepositoryPrefix') ->willReturn(''); @@ -62,12 +63,12 @@ public function testPurge() public function testPurgeWithPrefix() { $this->purgeClientMock - ->expects($this->once()) + ->expects(self::once()) ->method('purge') - ->with($this->equalTo(['0l123', '0c44', '0ez-all'])); + ->with(self::equalTo(['0l123', '0c44', '0ez-all'])); $this->tagPrefixMock - ->expects($this->once()) + ->expects(self::once()) ->method('getRepositoryPrefix') ->willReturn('0'); @@ -77,11 +78,11 @@ public function testPurgeWithPrefix() public function testPurgeAll() { $this->purgeClientMock - ->expects($this->once()) + ->expects(self::once()) ->method('purgeAll'); $this->tagPrefixMock - ->expects($this->never()) + ->expects(self::never()) ->method('getRepositoryPrefix'); $this->prefixDecorator->purgeAll(); diff --git a/tests/lib/PurgeClient/VarnishPurgeClientTest.php b/tests/lib/PurgeClient/VarnishPurgeClientTest.php index bf99ac0..033791a 100644 --- a/tests/lib/PurgeClient/VarnishPurgeClientTest.php +++ b/tests/lib/PurgeClient/VarnishPurgeClientTest.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace Ibexa\Tests\HttpCache\PurgeClient; use FOS\HttpCache\ProxyClient\ProxyClient; @@ -42,7 +43,7 @@ protected function setUp(): void public function testPurgeNoLocationIds() { $this->cacheManager - ->expects($this->never()) + ->expects(self::never()) ->method('invalidate'); $this->purgeClient->purge([]); @@ -61,7 +62,7 @@ static function ($id) { ); $this->cacheManager - ->expects($this->once()) + ->expects(self::once()) ->method('invalidateTags') ->with($keys); @@ -80,7 +81,7 @@ public function purgeTestProvider() public function testPurgeAll() { $this->cacheManager - ->expects($this->once()) + ->expects(self::once()) ->method('invalidateTags') ->with(['ez-all']);