diff --git a/composer.json b/composer.json index 9a73ae54e5..6aaa6966cb 100644 --- a/composer.json +++ b/composer.json @@ -65,13 +65,13 @@ "behat/behat": "^3.6.1", "friends-of-behat/mink-extension": "^2.4", "ibexa/ci-scripts": "^0.2@dev", - "ibexa/code-style": "^1.0", + "ibexa/code-style": "~2.0.0", "jenner/simple_fork": "^1.2", "matthiasnoback/symfony-dependency-injection-test": "^4.1", "phpstan/phpstan": "^1.2", "phpstan/phpstan-phpunit": "^1.3", "phpstan/phpstan-symfony": "^1.3", - "phpunit/phpunit": "^8.2", + "phpunit/phpunit": "^9.6", "symfony/phpunit-bridge": "^5.1", "symfony/proxy-manager-bridge": "^5.3", "symfony/runtime": "^5.3.0" diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index de6fdc4d7c..8945354fb5 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -8205,11 +8205,6 @@ parameters: count: 1 path: src/lib/Base/Exceptions/InvalidArgumentType.php - - - message: "#^Access to an undefined property Ibexa\\\\Core\\\\Base\\\\Exceptions\\\\LimitationValidationException\\:\\:\\$validationErrors\\.$#" - count: 1 - path: src/lib/Base/Exceptions/LimitationValidationException.php - - message: "#^Method Ibexa\\\\Core\\\\Base\\\\Exceptions\\\\LimitationValidationException\\:\\:addParameter\\(\\) has no return type specified\\.$#" count: 1 @@ -24015,11 +24010,6 @@ parameters: count: 1 path: tests/bundle/Core/DependencyInjection/Configuration/Parser/ImageTest.php - - - message: "#^Access to an undefined property Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\DependencyInjection\\\\Configuration\\\\Parser\\\\LanguagesTest\\:\\:\\$minimalConfig\\.$#" - count: 1 - path: tests/bundle/Core/DependencyInjection/Configuration/Parser/LanguagesTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\DependencyInjection\\\\Configuration\\\\Parser\\\\LanguagesTest\\:\\:getMinimalConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -24531,10 +24521,15 @@ parameters: path: tests/bundle/Core/DependencyInjection/IbexaCoreExtensionTest.php - - message: "#^Parameter \\#2 \\$array of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) expects array\\|ArrayAccess, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" + message: "#^Parameter \\#2 \\$array of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) expects array\\|ArrayAccess, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" count: 2 path: tests/bundle/Core/DependencyInjection/IbexaCoreExtensionTest.php + - + message: "#^Parameter \\#2 \\$haystack of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertContains\\(\\) expects iterable, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" + count: 1 + path: tests/bundle/Core/DependencyInjection/IbexaCoreExtensionTest.php + - message: "#^Property Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\DependencyInjection\\\\IbexaCoreExtensionTest\\:\\:\\$minimalConfig has no type specified\\.$#" count: 1 @@ -24985,11 +24980,6 @@ parameters: count: 1 path: tests/bundle/Core/EventListener/RequestEventListenerTest.php - - - message: "#^Access to an undefined property Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\EventListener\\\\RoutingListenerTest\\:\\:\\$container\\.$#" - count: 1 - path: tests/bundle/Core/EventListener/RoutingListenerTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\EventListener\\\\RoutingListenerTest\\:\\:testGetSubscribedEvents\\(\\) has no return type specified\\.$#" count: 1 @@ -25040,11 +25030,6 @@ parameters: count: 1 path: tests/bundle/Core/EventListener/SessionInitByPostListenerTest.php - - - message: "#^Access to an undefined property Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\EventListener\\\\SessionSetDynamicNameListenerTest\\:\\:\\$session\\.$#" - count: 1 - path: tests/bundle/Core/EventListener/SessionSetDynamicNameListenerTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\EventListener\\\\SessionSetDynamicNameListenerTest\\:\\:onSiteAccessMatchProvider\\(\\) has no return type specified\\.$#" count: 1 @@ -25290,6 +25275,11 @@ parameters: count: 1 path: tests/bundle/Core/EventSubscriber/TrustedHeaderClientIpEventSubscriberTest.php + - + message: "#^Method Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\EventSubscriber\\\\TrustedHeaderClientIpEventSubscriberTest\\:\\:__construct\\(\\) has parameter \\$name with no type specified\\.$#" + count: 1 + path: tests/bundle/Core/EventSubscriber/TrustedHeaderClientIpEventSubscriberTest.php + - message: "#^Method Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\EventSubscriber\\\\TrustedHeaderClientIpEventSubscriberTest\\:\\:getTrustedHeaderEventSubscriberTestData\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -26175,11 +26165,6 @@ parameters: count: 1 path: tests/bundle/Core/Routing/JsRouting/ExposedRoutesExtractorTest.php - - - message: "#^Access to an undefined property Ibexa\\\\Tests\\\\Bundle\\\\Core\\\\Routing\\\\UrlAliasRouterTest\\:\\:\\$container\\.$#" - count: 1 - path: tests/bundle/Core/Routing/UrlAliasRouterTest.php - - message: "#^Call to an undefined method Ibexa\\\\Core\\\\MVC\\\\Symfony\\\\Routing\\\\UrlAliasRouter\\:\\:setConfigResolver\\(\\)\\.$#" count: 1 @@ -35471,7 +35456,7 @@ parameters: path: tests/integration/Core/Repository/Regression/EZP20018ObjectStateTest.php - - message: "#^Parameter \\#1 \\$expectedCount of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertCount\\(\\) expects int, int\\|null given\\.$#" + message: "#^Parameter \\#1 \\$expectedCount of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertCount\\(\\) expects int, int\\|null given\\.$#" count: 2 path: tests/integration/Core/Repository/Regression/EZP20018ObjectStateTest.php @@ -38090,11 +38075,6 @@ parameters: count: 1 path: tests/integration/Core/Repository/SearchServiceTest.php - - - message: "#^Parameter \\#1 \\$expectedCount of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertCount\\(\\) expects int, int\\|null given\\.$#" - count: 1 - path: tests/integration/Core/Repository/SearchServiceTest.php - - message: "#^Parameter \\#1 \\$parentLocationId of method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\LocationService\\:\\:newLocationCreateStruct\\(\\) expects int, int\\|null given\\.$#" count: 1 @@ -45645,11 +45625,6 @@ parameters: count: 1 path: tests/lib/Limitation/ParentContentTypeLimitationTypeTest.php - - - message: "#^Method PHPUnit\\\\Framework\\\\TestCase\\:\\:once\\(\\) invoked with 1 parameter, 0 required\\.$#" - count: 1 - path: tests/lib/Limitation/ParentContentTypeLimitationTypeTest.php - - message: "#^Access to an undefined property Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\ValueObject\\:\\:\\$id\\.$#" count: 1 @@ -49240,11 +49215,6 @@ parameters: count: 1 path: tests/lib/Pagination/LocationSearchHitAdapterTest.php - - - message: "#^Access to an undefined property Symfony\\\\Component\\\\Cache\\\\CacheItem\\:\\:\\$defaultLifetime\\.$#" - count: 1 - path: tests/lib/Persistence/Cache/AbstractBaseHandlerTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Persistence\\\\Cache\\\\AbstractBaseHandlerTest\\:\\:getCacheItem\\(\\) has parameter \\$key with no type specified\\.$#" count: 1 @@ -49520,16 +49490,6 @@ parameters: count: 3 path: tests/lib/Persistence/Cache/AbstractInMemoryCacheHandlerTest.php - - - message: "#^Access to an undefined property Symfony\\\\Component\\\\Cache\\\\CacheItem\\:\\:\\$defaultLifetime\\.$#" - count: 1 - path: tests/lib/Persistence/Cache/Adapter/InMemoryClearingProxyAdapterTest.php - - - - message: "#^Access to an undefined property Symfony\\\\Component\\\\Cache\\\\CacheItem\\:\\:\\$prevTags\\.$#" - count: 1 - path: tests/lib/Persistence/Cache/Adapter/InMemoryClearingProxyAdapterTest.php - - message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Persistence\\\\Cache\\\\Adapter\\\\InMemoryClearingProxyAdapterTest\\:\\:arrayAsGenerator\\(\\) has parameter \\$array with no value type specified in iterable type array\\.$#" count: 1 @@ -56206,17 +56166,17 @@ parameters: path: tests/lib/Repository/ContentValidator/ContentValidatorStrategyTest.php - - message: "#^Method class@anonymous/tests/lib/Repository/ContentValidator/ContentValidatorStrategyTest\\.php\\:87\\:\\:__construct\\(\\) has parameter \\$validationReturn with no value type specified in iterable type array\\.$#" + message: "#^Method class@anonymous/tests/lib/Repository/ContentValidator/ContentValidatorStrategyTest\\.php\\:88\\:\\:__construct\\(\\) has parameter \\$validationReturn with no value type specified in iterable type array\\.$#" count: 1 path: tests/lib/Repository/ContentValidator/ContentValidatorStrategyTest.php - - message: "#^Method class@anonymous/tests/lib/Repository/ContentValidator/ContentValidatorStrategyTest\\.php\\:87\\:\\:validate\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + message: "#^Method class@anonymous/tests/lib/Repository/ContentValidator/ContentValidatorStrategyTest\\.php\\:88\\:\\:validate\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" count: 1 path: tests/lib/Repository/ContentValidator/ContentValidatorStrategyTest.php - - message: "#^Property class@anonymous/tests/lib/Repository/ContentValidator/ContentValidatorStrategyTest\\.php\\:87\\:\\:\\$validationReturn type has no value type specified in iterable type array\\.$#" + message: "#^Property class@anonymous/tests/lib/Repository/ContentValidator/ContentValidatorStrategyTest\\.php\\:88\\:\\:\\$validationReturn type has no value type specified in iterable type array\\.$#" count: 1 path: tests/lib/Repository/ContentValidator/ContentValidatorStrategyTest.php diff --git a/phpunit.xml b/phpunit.xml index f8d8d30045..1df5de3e95 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -24,13 +24,13 @@ tests/bundle/Debug - tests/bundle/Installer + tests/bundle/RepositoryInstaller tests/bundle/IO - tests/bundle/LegacySearchEngineBundle + tests/bundle/LegacySearchEngine diff --git a/src/bundle/Core/ApiLoader/CacheFactory.php b/src/bundle/Core/ApiLoader/CacheFactory.php index a01c686542..76c64e8313 100644 --- a/src/bundle/Core/ApiLoader/CacheFactory.php +++ b/src/bundle/Core/ApiLoader/CacheFactory.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\Core\ApiLoader; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/bundle/Core/ApiLoader/Exception/InvalidRepositoryException.php b/src/bundle/Core/ApiLoader/Exception/InvalidRepositoryException.php index 3b4941d068..d210cb1f9a 100644 --- a/src/bundle/Core/ApiLoader/Exception/InvalidRepositoryException.php +++ b/src/bundle/Core/ApiLoader/Exception/InvalidRepositoryException.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\Core\ApiLoader\Exception; use InvalidArgumentException; diff --git a/src/bundle/Core/ApiLoader/Exception/InvalidSearchEngine.php b/src/bundle/Core/ApiLoader/Exception/InvalidSearchEngine.php index 9ef5d897e5..0188c33f0c 100644 --- a/src/bundle/Core/ApiLoader/Exception/InvalidSearchEngine.php +++ b/src/bundle/Core/ApiLoader/Exception/InvalidSearchEngine.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\Core\ApiLoader\Exception; use InvalidArgumentException; diff --git a/src/bundle/Core/ApiLoader/Exception/InvalidSearchEngineIndexer.php b/src/bundle/Core/ApiLoader/Exception/InvalidSearchEngineIndexer.php index 2f4c23bdf6..13918a4424 100644 --- a/src/bundle/Core/ApiLoader/Exception/InvalidSearchEngineIndexer.php +++ b/src/bundle/Core/ApiLoader/Exception/InvalidSearchEngineIndexer.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\Core\ApiLoader\Exception; use InvalidArgumentException; diff --git a/src/bundle/Core/ApiLoader/Exception/InvalidStorageEngine.php b/src/bundle/Core/ApiLoader/Exception/InvalidStorageEngine.php index da452291ee..89936af64b 100644 --- a/src/bundle/Core/ApiLoader/Exception/InvalidStorageEngine.php +++ b/src/bundle/Core/ApiLoader/Exception/InvalidStorageEngine.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\Core\ApiLoader\Exception; use InvalidArgumentException; diff --git a/src/bundle/Core/ApiLoader/RepositoryConfigurationProvider.php b/src/bundle/Core/ApiLoader/RepositoryConfigurationProvider.php index ed7b577b8f..681bef61a6 100644 --- a/src/bundle/Core/ApiLoader/RepositoryConfigurationProvider.php +++ b/src/bundle/Core/ApiLoader/RepositoryConfigurationProvider.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\Core\ApiLoader; use Ibexa\Bundle\Core\ApiLoader\Exception\InvalidRepositoryException; diff --git a/src/bundle/Core/ApiLoader/RepositoryFactory.php b/src/bundle/Core/ApiLoader/RepositoryFactory.php index 2d2ac159fd..41c1de89c2 100644 --- a/src/bundle/Core/ApiLoader/RepositoryFactory.php +++ b/src/bundle/Core/ApiLoader/RepositoryFactory.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\Core\ApiLoader; use Ibexa\Contracts\Core\Persistence\Filter\Content\Handler as ContentFilteringHandler; diff --git a/src/bundle/Core/ApiLoader/SearchEngineFactory.php b/src/bundle/Core/ApiLoader/SearchEngineFactory.php index 75d29fe433..adf691b794 100644 --- a/src/bundle/Core/ApiLoader/SearchEngineFactory.php +++ b/src/bundle/Core/ApiLoader/SearchEngineFactory.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\Core\ApiLoader; use Ibexa\Bundle\Core\ApiLoader\Exception\InvalidSearchEngine; diff --git a/src/bundle/Core/ApiLoader/SearchEngineIndexerFactory.php b/src/bundle/Core/ApiLoader/SearchEngineIndexerFactory.php index a0190e3e02..4996de1dee 100644 --- a/src/bundle/Core/ApiLoader/SearchEngineIndexerFactory.php +++ b/src/bundle/Core/ApiLoader/SearchEngineIndexerFactory.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\Core\ApiLoader; use Ibexa\Bundle\Core\ApiLoader\Exception\InvalidSearchEngine; diff --git a/src/bundle/Core/ApiLoader/StorageConnectionFactory.php b/src/bundle/Core/ApiLoader/StorageConnectionFactory.php index 365ab589b9..911664983f 100644 --- a/src/bundle/Core/ApiLoader/StorageConnectionFactory.php +++ b/src/bundle/Core/ApiLoader/StorageConnectionFactory.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\Core\ApiLoader; use InvalidArgumentException; diff --git a/src/bundle/Core/ApiLoader/StorageEngineFactory.php b/src/bundle/Core/ApiLoader/StorageEngineFactory.php index b856747531..0e2ed665d2 100644 --- a/src/bundle/Core/ApiLoader/StorageEngineFactory.php +++ b/src/bundle/Core/ApiLoader/StorageEngineFactory.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\Core\ApiLoader; use Ibexa\Bundle\Core\ApiLoader\Exception\InvalidStorageEngine; diff --git a/src/bundle/Core/Command/CleanupVersionsCommand.php b/src/bundle/Core/Command/CleanupVersionsCommand.php index 82d3bb0a33..73d73faa25 100644 --- a/src/bundle/Core/Command/CleanupVersionsCommand.php +++ b/src/bundle/Core/Command/CleanupVersionsCommand.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\Core\Command; use Doctrine\DBAL\Connection; diff --git a/src/bundle/Core/Command/CopySubtreeCommand.php b/src/bundle/Core/Command/CopySubtreeCommand.php index 5e65b57873..5cea94a657 100644 --- a/src/bundle/Core/Command/CopySubtreeCommand.php +++ b/src/bundle/Core/Command/CopySubtreeCommand.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\Core\Command; use Ibexa\Contracts\Core\Repository\ContentTypeService; diff --git a/src/bundle/Core/Command/DebugConfigResolverCommand.php b/src/bundle/Core/Command/DebugConfigResolverCommand.php index 42f8d11dae..ba4cba3929 100644 --- a/src/bundle/Core/Command/DebugConfigResolverCommand.php +++ b/src/bundle/Core/Command/DebugConfigResolverCommand.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\Core\Command; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/bundle/Core/Command/DeleteContentTranslationCommand.php b/src/bundle/Core/Command/DeleteContentTranslationCommand.php index a1bd2bac3b..9752bfd09e 100644 --- a/src/bundle/Core/Command/DeleteContentTranslationCommand.php +++ b/src/bundle/Core/Command/DeleteContentTranslationCommand.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\Core\Command; use Exception; diff --git a/src/bundle/Core/Command/RegenerateUrlAliasesCommand.php b/src/bundle/Core/Command/RegenerateUrlAliasesCommand.php index b65cef4e45..6fbbaedc83 100644 --- a/src/bundle/Core/Command/RegenerateUrlAliasesCommand.php +++ b/src/bundle/Core/Command/RegenerateUrlAliasesCommand.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\Core\Command; use Exception; diff --git a/src/bundle/Core/Command/ReindexCommand.php b/src/bundle/Core/Command/ReindexCommand.php index bd8d6cc246..704a1d3dfe 100644 --- a/src/bundle/Core/Command/ReindexCommand.php +++ b/src/bundle/Core/Command/ReindexCommand.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\Core\Command; use function count; diff --git a/src/bundle/Core/Converter/ContentParamConverter.php b/src/bundle/Core/Converter/ContentParamConverter.php index 3742773eca..a517c30c3d 100644 --- a/src/bundle/Core/Converter/ContentParamConverter.php +++ b/src/bundle/Core/Converter/ContentParamConverter.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\Core\Converter; use Ibexa\Contracts\Core\Repository\ContentService; diff --git a/src/bundle/Core/Converter/LocationParamConverter.php b/src/bundle/Core/Converter/LocationParamConverter.php index 8bcbc9e053..4669c25af9 100644 --- a/src/bundle/Core/Converter/LocationParamConverter.php +++ b/src/bundle/Core/Converter/LocationParamConverter.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\Core\Converter; use Ibexa\Contracts\Core\Repository\LocationService; diff --git a/src/bundle/Core/Converter/RepositoryParamConverter.php b/src/bundle/Core/Converter/RepositoryParamConverter.php index a18e341bff..875345b69d 100644 --- a/src/bundle/Core/Converter/RepositoryParamConverter.php +++ b/src/bundle/Core/Converter/RepositoryParamConverter.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\Core\Converter; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; diff --git a/src/bundle/Core/DependencyInjection/Compiler/BinaryContentDownloadPass.php b/src/bundle/Core/DependencyInjection/Compiler/BinaryContentDownloadPass.php index 2ca0180814..b47dc795f6 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/BinaryContentDownloadPass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/BinaryContentDownloadPass.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\Core\DependencyInjection\Compiler; use Ibexa\Core\FieldType\BinaryFile\BinaryFileStorage; diff --git a/src/bundle/Core/DependencyInjection/Compiler/ChainConfigResolverPass.php b/src/bundle/Core/DependencyInjection/Compiler/ChainConfigResolverPass.php index 244965652e..0fd2280c12 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/ChainConfigResolverPass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/ChainConfigResolverPass.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ChainConfigResolver; diff --git a/src/bundle/Core/DependencyInjection/Compiler/ChainRoutingPass.php b/src/bundle/Core/DependencyInjection/Compiler/ChainRoutingPass.php index a92d9b9d4e..18c3dda701 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/ChainRoutingPass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/ChainRoutingPass.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\Core\DependencyInjection\Compiler; use Ibexa\Core\MVC\Symfony\Routing\ChainRouter; diff --git a/src/bundle/Core/DependencyInjection/Compiler/ConsoleCacheWarmupPass.php b/src/bundle/Core/DependencyInjection/Compiler/ConsoleCacheWarmupPass.php index 28c53a6532..4681ed2fc1 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/ConsoleCacheWarmupPass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/ConsoleCacheWarmupPass.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\Core\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; diff --git a/src/bundle/Core/DependencyInjection/Compiler/FieldTypeParameterProviderRegistryPass.php b/src/bundle/Core/DependencyInjection/Compiler/FieldTypeParameterProviderRegistryPass.php index d43ac8fdb3..b07da6d610 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/FieldTypeParameterProviderRegistryPass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/FieldTypeParameterProviderRegistryPass.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\Core\DependencyInjection\Compiler; use Ibexa\Core\MVC\Symfony\FieldType\View\ParameterProviderRegistry; diff --git a/src/bundle/Core/DependencyInjection/Compiler/FragmentPass.php b/src/bundle/Core/DependencyInjection/Compiler/FragmentPass.php index 286d5d23b0..066c50e2c4 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/FragmentPass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/FragmentPass.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\Fragment\DecoratedFragmentRenderer; diff --git a/src/bundle/Core/DependencyInjection/Compiler/ImaginePass.php b/src/bundle/Core/DependencyInjection/Compiler/ImaginePass.php index 07902794cb..719ad2c8f1 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/ImaginePass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/ImaginePass.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\Imagine\Filter\FilterConfiguration; diff --git a/src/bundle/Core/DependencyInjection/Compiler/PlaceholderProviderPass.php b/src/bundle/Core/DependencyInjection/Compiler/PlaceholderProviderPass.php index 20fbe8aeab..21c7dcafb7 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/PlaceholderProviderPass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/PlaceholderProviderPass.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\Imagine\PlaceholderProviderRegistry; diff --git a/src/bundle/Core/DependencyInjection/Compiler/RegisterSearchEngineIndexerPass.php b/src/bundle/Core/DependencyInjection/Compiler/RegisterSearchEngineIndexerPass.php index d6a3235ac7..4707a69ee8 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/RegisterSearchEngineIndexerPass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/RegisterSearchEngineIndexerPass.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\ApiLoader\SearchEngineIndexerFactory; diff --git a/src/bundle/Core/DependencyInjection/Compiler/RegisterSearchEnginePass.php b/src/bundle/Core/DependencyInjection/Compiler/RegisterSearchEnginePass.php index 2e3df7eb34..383dd14753 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/RegisterSearchEnginePass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/RegisterSearchEnginePass.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\ApiLoader\SearchEngineFactory; diff --git a/src/bundle/Core/DependencyInjection/Compiler/RegisterStorageEnginePass.php b/src/bundle/Core/DependencyInjection/Compiler/RegisterStorageEnginePass.php index 5daf4d41ae..2306ba17c7 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/RegisterStorageEnginePass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/RegisterStorageEnginePass.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\ApiLoader\StorageEngineFactory; diff --git a/src/bundle/Core/DependencyInjection/Compiler/RouterPass.php b/src/bundle/Core/DependencyInjection/Compiler/RouterPass.php index d18fba635a..937c809ad9 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/RouterPass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/RouterPass.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\Routing\DefaultRouter; diff --git a/src/bundle/Core/DependencyInjection/Compiler/SecurityPass.php b/src/bundle/Core/DependencyInjection/Compiler/SecurityPass.php index 5cd9ed7008..d2110b64c5 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/SecurityPass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/SecurityPass.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\Core\DependencyInjection\Compiler; use Ibexa\Contracts\Core\Repository\PermissionResolver; diff --git a/src/bundle/Core/DependencyInjection/Compiler/SlugConverterConfigurationPass.php b/src/bundle/Core/DependencyInjection/Compiler/SlugConverterConfigurationPass.php index de299def82..77bc0d2d20 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/SlugConverterConfigurationPass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/SlugConverterConfigurationPass.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\Core\DependencyInjection\Compiler; use Ibexa\Core\Persistence\Legacy\Content\UrlAlias\SlugConverter; diff --git a/src/bundle/Core/DependencyInjection/Compiler/StorageConnectionPass.php b/src/bundle/Core/DependencyInjection/Compiler/StorageConnectionPass.php index 58f655155d..afd4ecdd12 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/StorageConnectionPass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/StorageConnectionPass.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\Core\DependencyInjection\Compiler; use LogicException; diff --git a/src/bundle/Core/DependencyInjection/Compiler/TranslationCollectorPass.php b/src/bundle/Core/DependencyInjection/Compiler/TranslationCollectorPass.php index 5274e55c11..1342765abb 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/TranslationCollectorPass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/TranslationCollectorPass.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\Translation\GlobCollector; diff --git a/src/bundle/Core/DependencyInjection/Compiler/URLHandlerPass.php b/src/bundle/Core/DependencyInjection/Compiler/URLHandlerPass.php index 5e54a9cd27..2f98d59c6b 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/URLHandlerPass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/URLHandlerPass.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\URLChecker\URLHandlerRegistry; diff --git a/src/bundle/Core/DependencyInjection/Compiler/ViewProvidersPass.php b/src/bundle/Core/DependencyInjection/Compiler/ViewProvidersPass.php index 99a9c8b557..468cdca1ea 100644 --- a/src/bundle/Core/DependencyInjection/Compiler/ViewProvidersPass.php +++ b/src/bundle/Core/DependencyInjection/Compiler/ViewProvidersPass.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\EventListener\ConfigScopeListener; diff --git a/src/bundle/Core/DependencyInjection/Configuration.php b/src/bundle/Core/DependencyInjection/Configuration.php index 4b859f673b..25e2ad74db 100644 --- a/src/bundle/Core/DependencyInjection/Configuration.php +++ b/src/bundle/Core/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\Core\DependencyInjection; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ParserInterface; diff --git a/src/bundle/Core/DependencyInjection/Configuration/AbstractParser.php b/src/bundle/Core/DependencyInjection/Configuration/AbstractParser.php index 33d0210a1e..2f3b712ac6 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/AbstractParser.php +++ b/src/bundle/Core/DependencyInjection/Configuration/AbstractParser.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\Core\DependencyInjection\Configuration; use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface; diff --git a/src/bundle/Core/DependencyInjection/Configuration/ChainConfigResolver.php b/src/bundle/Core/DependencyInjection/Configuration/ChainConfigResolver.php index fe6175e4b0..e158f93593 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/ChainConfigResolver.php +++ b/src/bundle/Core/DependencyInjection/Configuration/ChainConfigResolver.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\Core\DependencyInjection\Configuration; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingParser.php b/src/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingParser.php index e58d33375a..0d7c6be371 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingParser.php +++ b/src/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingParser.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\Core\DependencyInjection\Configuration\ComplexSettings; use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\DynamicSettingParser; diff --git a/src/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingParserInterface.php b/src/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingParserInterface.php index 93425374c0..785b33399a 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingParserInterface.php +++ b/src/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingParserInterface.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\Core\DependencyInjection\Configuration\ComplexSettings; use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\DynamicSettingParserInterface; diff --git a/src/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingValueResolver.php b/src/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingValueResolver.php index 2a3b3f57c1..67fb6f3609 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingValueResolver.php +++ b/src/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingValueResolver.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\Core\DependencyInjection\Configuration\ComplexSettings; /** diff --git a/src/bundle/Core/DependencyInjection/Configuration/ConfigBuilderInterface.php b/src/bundle/Core/DependencyInjection/Configuration/ConfigBuilderInterface.php index 01231b0ec3..594b64ad60 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/ConfigBuilderInterface.php +++ b/src/bundle/Core/DependencyInjection/Configuration/ConfigBuilderInterface.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\Core\DependencyInjection\Configuration; use Symfony\Component\Config\Resource\ResourceInterface; diff --git a/src/bundle/Core/DependencyInjection/Configuration/ConfigParser.php b/src/bundle/Core/DependencyInjection/Configuration/ConfigParser.php index d963217279..2cec92863e 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/ConfigParser.php +++ b/src/bundle/Core/DependencyInjection/Configuration/ConfigParser.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\Core\DependencyInjection\Configuration; use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface; diff --git a/src/bundle/Core/DependencyInjection/Configuration/ConfigResolver.php b/src/bundle/Core/DependencyInjection/Configuration/ConfigResolver.php index 09e6c64263..ceeb68163b 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/ConfigResolver.php +++ b/src/bundle/Core/DependencyInjection/Configuration/ConfigResolver.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\Core\DependencyInjection\Configuration; use Ibexa\Core\MVC\Exception\ParameterNotFoundException; diff --git a/src/bundle/Core/DependencyInjection/Configuration/ContainerConfigBuilder.php b/src/bundle/Core/DependencyInjection/Configuration/ContainerConfigBuilder.php index 6c0d0e7b90..70638c80c9 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/ContainerConfigBuilder.php +++ b/src/bundle/Core/DependencyInjection/Configuration/ContainerConfigBuilder.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\Core\DependencyInjection\Configuration; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/src/bundle/Core/DependencyInjection/Configuration/FieldTypeParserInterface.php b/src/bundle/Core/DependencyInjection/Configuration/FieldTypeParserInterface.php index 6c9df96c8d..97d0068e8e 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/FieldTypeParserInterface.php +++ b/src/bundle/Core/DependencyInjection/Configuration/FieldTypeParserInterface.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\Core\DependencyInjection\Configuration; use Symfony\Component\Config\Definition\Builder\NodeBuilder; diff --git a/src/bundle/Core/DependencyInjection/Configuration/Parser/AbstractFieldTypeParser.php b/src/bundle/Core/DependencyInjection/Configuration/Parser/AbstractFieldTypeParser.php index c7d80ed798..537437eb25 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Parser/AbstractFieldTypeParser.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Parser/AbstractFieldTypeParser.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\AbstractParser; diff --git a/src/bundle/Core/DependencyInjection/Configuration/Parser/Common.php b/src/bundle/Core/DependencyInjection/Configuration/Parser/Common.php index 803c2a5ba7..f444a97fec 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Parser/Common.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Parser/Common.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\AbstractParser; diff --git a/src/bundle/Core/DependencyInjection/Configuration/Parser/Content.php b/src/bundle/Core/DependencyInjection/Configuration/Parser/Content.php index 64ee5b8773..21547fa6de 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Parser/Content.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Parser/Content.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\AbstractParser; diff --git a/src/bundle/Core/DependencyInjection/Configuration/Parser/ContentView.php b/src/bundle/Core/DependencyInjection/Configuration/Parser/ContentView.php index 365ee5164c..85792b8b15 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Parser/ContentView.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Parser/ContentView.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\Core\DependencyInjection\Configuration\Parser; class ContentView extends View diff --git a/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldDefinitionEditTemplates.php b/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldDefinitionEditTemplates.php index 103e502e20..ce3a7d5837 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldDefinitionEditTemplates.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldDefinitionEditTemplates.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\Core\DependencyInjection\Configuration\Parser; class FieldDefinitionEditTemplates extends Templates diff --git a/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldDefinitionSettingsTemplates.php b/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldDefinitionSettingsTemplates.php index e8d5932a82..390576d71e 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldDefinitionSettingsTemplates.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldDefinitionSettingsTemplates.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\Core\DependencyInjection\Configuration\Parser; class FieldDefinitionSettingsTemplates extends Templates diff --git a/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldEditTemplates.php b/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldEditTemplates.php index 1b82c4dc94..666d8910ac 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldEditTemplates.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldEditTemplates.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\Core\DependencyInjection\Configuration\Parser; class FieldEditTemplates extends Templates diff --git a/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldTemplates.php b/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldTemplates.php index 8c796d684b..e4d4c65c64 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldTemplates.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Parser/FieldTemplates.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\Core\DependencyInjection\Configuration\Parser; class FieldTemplates extends Templates diff --git a/src/bundle/Core/DependencyInjection/Configuration/Parser/IO.php b/src/bundle/Core/DependencyInjection/Configuration/Parser/IO.php index 1717c667a5..5412989ea8 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Parser/IO.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Parser/IO.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\AbstractParser; diff --git a/src/bundle/Core/DependencyInjection/Configuration/Parser/Image.php b/src/bundle/Core/DependencyInjection/Configuration/Parser/Image.php index 26972e3829..c509fda7e2 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Parser/Image.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Parser/Image.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\AbstractParser; diff --git a/src/bundle/Core/DependencyInjection/Configuration/Parser/Languages.php b/src/bundle/Core/DependencyInjection/Configuration/Parser/Languages.php index 7d87316b26..a0193499ae 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Parser/Languages.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Parser/Languages.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\AbstractParser; diff --git a/src/bundle/Core/DependencyInjection/Configuration/Parser/LocationView.php b/src/bundle/Core/DependencyInjection/Configuration/Parser/LocationView.php index 6d8a1ea37d..c39ec2f7fe 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Parser/LocationView.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Parser/LocationView.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ConfigResolver; diff --git a/src/bundle/Core/DependencyInjection/Configuration/Parser/Templates.php b/src/bundle/Core/DependencyInjection/Configuration/Parser/Templates.php index 6d5274d8ee..84297411ca 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Parser/Templates.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Parser/Templates.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\AbstractParser; diff --git a/src/bundle/Core/DependencyInjection/Configuration/Parser/UrlChecker.php b/src/bundle/Core/DependencyInjection/Configuration/Parser/UrlChecker.php index 99836f93df..ba9bfdf03f 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Parser/UrlChecker.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Parser/UrlChecker.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\AbstractParser; diff --git a/src/bundle/Core/DependencyInjection/Configuration/Parser/View.php b/src/bundle/Core/DependencyInjection/Configuration/Parser/View.php index 6cb2f70dd1..0cbb977aeb 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Parser/View.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Parser/View.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\AbstractParser; diff --git a/src/bundle/Core/DependencyInjection/Configuration/ParserInterface.php b/src/bundle/Core/DependencyInjection/Configuration/ParserInterface.php index 96cccb2e60..e172062d15 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/ParserInterface.php +++ b/src/bundle/Core/DependencyInjection/Configuration/ParserInterface.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\Core\DependencyInjection\Configuration; use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\HookableConfigurationMapperInterface; diff --git a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/Configuration.php b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/Configuration.php index ede48e5bc3..4306a3fa78 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/Configuration.php +++ b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/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\Core\DependencyInjection\Configuration\SiteAccessAware; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; diff --git a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ConfigurationMapperInterface.php b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ConfigurationMapperInterface.php index 7196a1c948..b285bb3927 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ConfigurationMapperInterface.php +++ b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ConfigurationMapperInterface.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\Core\DependencyInjection\Configuration\SiteAccessAware; /** diff --git a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ConfigurationProcessor.php b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ConfigurationProcessor.php index 64b0bae3a6..0e725689aa 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ConfigurationProcessor.php +++ b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ConfigurationProcessor.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\Core\DependencyInjection\Configuration\SiteAccessAware; use InvalidArgumentException; diff --git a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/Contextualizer.php b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/Contextualizer.php index 2aa708bced..c0ad0f2d0a 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/Contextualizer.php +++ b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/Contextualizer.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\Core\DependencyInjection\Configuration\SiteAccessAware; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ConfigResolver; diff --git a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ContextualizerInterface.php b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ContextualizerInterface.php index 901799759b..ea9e20e494 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ContextualizerInterface.php +++ b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ContextualizerInterface.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\Core\DependencyInjection\Configuration\SiteAccessAware; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/DynamicSettingParser.php b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/DynamicSettingParser.php index 4c26f6048c..325350f93f 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/DynamicSettingParser.php +++ b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/DynamicSettingParser.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\Core\DependencyInjection\Configuration\SiteAccessAware; use OutOfBoundsException; diff --git a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/DynamicSettingParserInterface.php b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/DynamicSettingParserInterface.php index cc5d4e8f98..57a67d900d 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/DynamicSettingParserInterface.php +++ b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/DynamicSettingParserInterface.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\Core\DependencyInjection\Configuration\SiteAccessAware; /** diff --git a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/HookableConfigurationMapperInterface.php b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/HookableConfigurationMapperInterface.php index 9f6ffd935f..302401823c 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/HookableConfigurationMapperInterface.php +++ b/src/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/HookableConfigurationMapperInterface.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\Core\DependencyInjection\Configuration\SiteAccessAware; /** diff --git a/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollector.php b/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollector.php index 4752c522d8..c470209adb 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollector.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollector.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\Core\DependencyInjection\Configuration\Suggestion\Collector; use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\ConfigSuggestion; diff --git a/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollectorAwareInterface.php b/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollectorAwareInterface.php index 63ed004eb2..79eabdb74a 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollectorAwareInterface.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollectorAwareInterface.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\Core\DependencyInjection\Configuration\Suggestion\Collector; interface SuggestionCollectorAwareInterface diff --git a/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollectorInterface.php b/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollectorInterface.php index c278e123fc..4238a92411 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollectorInterface.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollectorInterface.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\Core\DependencyInjection\Configuration\Suggestion\Collector; use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\ConfigSuggestion; diff --git a/src/bundle/Core/DependencyInjection/Configuration/Suggestion/ConfigSuggestion.php b/src/bundle/Core/DependencyInjection/Configuration/Suggestion/ConfigSuggestion.php index 0ed806dca0..9e6fce39fd 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Suggestion/ConfigSuggestion.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Suggestion/ConfigSuggestion.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\Core\DependencyInjection\Configuration\Suggestion; /** diff --git a/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Formatter/SuggestionFormatterInterface.php b/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Formatter/SuggestionFormatterInterface.php index eb3f1ef795..953126247d 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Formatter/SuggestionFormatterInterface.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Formatter/SuggestionFormatterInterface.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\Core\DependencyInjection\Configuration\Suggestion\Formatter; use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\ConfigSuggestion; diff --git a/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Formatter/YamlSuggestionFormatter.php b/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Formatter/YamlSuggestionFormatter.php index 7b007bc6b5..8b4fcd3bac 100644 --- a/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Formatter/YamlSuggestionFormatter.php +++ b/src/bundle/Core/DependencyInjection/Configuration/Suggestion/Formatter/YamlSuggestionFormatter.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\Core\DependencyInjection\Configuration\Suggestion\Formatter; use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\ConfigSuggestion; diff --git a/src/bundle/Core/DependencyInjection/Security/HttpBasicFactory.php b/src/bundle/Core/DependencyInjection/Security/HttpBasicFactory.php index ee4170d6ce..6062a7e5f5 100644 --- a/src/bundle/Core/DependencyInjection/Security/HttpBasicFactory.php +++ b/src/bundle/Core/DependencyInjection/Security/HttpBasicFactory.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\Core\DependencyInjection\Security; use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\HttpBasicFactory as BaseHttpBasicFactory; diff --git a/src/bundle/Core/DependencyInjection/Security/PolicyProvider/PoliciesConfigBuilder.php b/src/bundle/Core/DependencyInjection/Security/PolicyProvider/PoliciesConfigBuilder.php index a81e201004..f23c4026a6 100644 --- a/src/bundle/Core/DependencyInjection/Security/PolicyProvider/PoliciesConfigBuilder.php +++ b/src/bundle/Core/DependencyInjection/Security/PolicyProvider/PoliciesConfigBuilder.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\Core\DependencyInjection\Security\PolicyProvider; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ContainerConfigBuilder; diff --git a/src/bundle/Core/DependencyInjection/Security/PolicyProvider/PolicyProviderInterface.php b/src/bundle/Core/DependencyInjection/Security/PolicyProvider/PolicyProviderInterface.php index 1307863012..e8333bbc47 100644 --- a/src/bundle/Core/DependencyInjection/Security/PolicyProvider/PolicyProviderInterface.php +++ b/src/bundle/Core/DependencyInjection/Security/PolicyProvider/PolicyProviderInterface.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\Core\DependencyInjection\Security\PolicyProvider; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ConfigBuilderInterface; diff --git a/src/bundle/Core/DependencyInjection/Security/PolicyProvider/RepositoryPolicyProvider.php b/src/bundle/Core/DependencyInjection/Security/PolicyProvider/RepositoryPolicyProvider.php index ede1ed3f7a..22e116f3b9 100644 --- a/src/bundle/Core/DependencyInjection/Security/PolicyProvider/RepositoryPolicyProvider.php +++ b/src/bundle/Core/DependencyInjection/Security/PolicyProvider/RepositoryPolicyProvider.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\Core\DependencyInjection\Security\PolicyProvider; /** diff --git a/src/bundle/Core/DependencyInjection/Security/PolicyProvider/YamlPolicyProvider.php b/src/bundle/Core/DependencyInjection/Security/PolicyProvider/YamlPolicyProvider.php index f9caa6d375..0eff6a5941 100644 --- a/src/bundle/Core/DependencyInjection/Security/PolicyProvider/YamlPolicyProvider.php +++ b/src/bundle/Core/DependencyInjection/Security/PolicyProvider/YamlPolicyProvider.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\Core\DependencyInjection\Security\PolicyProvider; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ConfigBuilderInterface; diff --git a/src/bundle/Core/EventListener/BackgroundIndexingTerminateListener.php b/src/bundle/Core/EventListener/BackgroundIndexingTerminateListener.php index 1cefdf70fb..d7ca44970e 100644 --- a/src/bundle/Core/EventListener/BackgroundIndexingTerminateListener.php +++ b/src/bundle/Core/EventListener/BackgroundIndexingTerminateListener.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\Core\EventListener; use Ibexa\Contracts\Core\Persistence\Content\ContentInfo; diff --git a/src/bundle/Core/EventListener/CacheViewResponseListener.php b/src/bundle/Core/EventListener/CacheViewResponseListener.php index 6cd55df609..ac298147c9 100644 --- a/src/bundle/Core/EventListener/CacheViewResponseListener.php +++ b/src/bundle/Core/EventListener/CacheViewResponseListener.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\Core\EventListener; use Ibexa\Contracts\Core\Repository\Values\Content\Location; diff --git a/src/bundle/Core/EventListener/ConfigScopeListener.php b/src/bundle/Core/EventListener/ConfigScopeListener.php index b9fab21cd1..a97e3ba92f 100644 --- a/src/bundle/Core/EventListener/ConfigScopeListener.php +++ b/src/bundle/Core/EventListener/ConfigScopeListener.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\Core\EventListener; use Ibexa\Contracts\Core\MVC\EventSubscriber\ConfigScopeChangeSubscriber; diff --git a/src/bundle/Core/EventListener/ConsoleCommandListener.php b/src/bundle/Core/EventListener/ConsoleCommandListener.php index 86454f7ac8..484be6e007 100644 --- a/src/bundle/Core/EventListener/ConsoleCommandListener.php +++ b/src/bundle/Core/EventListener/ConsoleCommandListener.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\Core\EventListener; use Ibexa\Core\MVC\Exception\InvalidSiteAccessException; diff --git a/src/bundle/Core/EventListener/ContentDownloadRouteReferenceListener.php b/src/bundle/Core/EventListener/ContentDownloadRouteReferenceListener.php index 1f9a4d3ddb..1cb9c69039 100644 --- a/src/bundle/Core/EventListener/ContentDownloadRouteReferenceListener.php +++ b/src/bundle/Core/EventListener/ContentDownloadRouteReferenceListener.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\Core\EventListener; use Ibexa\Contracts\Core\Repository\Values\Content\Content; diff --git a/src/bundle/Core/EventListener/ExceptionListener.php b/src/bundle/Core/EventListener/ExceptionListener.php index 78fb4b00d8..7e1c322f83 100644 --- a/src/bundle/Core/EventListener/ExceptionListener.php +++ b/src/bundle/Core/EventListener/ExceptionListener.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\Core\EventListener; use Exception; diff --git a/src/bundle/Core/EventListener/IndexRequestListener.php b/src/bundle/Core/EventListener/IndexRequestListener.php index 90b9a55587..6fcf98714a 100644 --- a/src/bundle/Core/EventListener/IndexRequestListener.php +++ b/src/bundle/Core/EventListener/IndexRequestListener.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\Core\EventListener; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/bundle/Core/EventListener/LocaleListener.php b/src/bundle/Core/EventListener/LocaleListener.php index ee5c62b397..738bc08f11 100644 --- a/src/bundle/Core/EventListener/LocaleListener.php +++ b/src/bundle/Core/EventListener/LocaleListener.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\Core\EventListener; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/bundle/Core/EventListener/OriginalRequestListener.php b/src/bundle/Core/EventListener/OriginalRequestListener.php index 82843293c1..952353fe93 100644 --- a/src/bundle/Core/EventListener/OriginalRequestListener.php +++ b/src/bundle/Core/EventListener/OriginalRequestListener.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\Core\EventListener; use Symfony\Component\EventDispatcher\EventSubscriberInterface; diff --git a/src/bundle/Core/EventListener/PreviewRequestListener.php b/src/bundle/Core/EventListener/PreviewRequestListener.php index 2b095fef55..a60de5483d 100644 --- a/src/bundle/Core/EventListener/PreviewRequestListener.php +++ b/src/bundle/Core/EventListener/PreviewRequestListener.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\Core\EventListener; use Ibexa\Core\MVC\Symfony\Controller\Content\PreviewController; diff --git a/src/bundle/Core/EventListener/RejectExplicitFrontControllerRequestsListener.php b/src/bundle/Core/EventListener/RejectExplicitFrontControllerRequestsListener.php index c58754c543..e9c5c71060 100644 --- a/src/bundle/Core/EventListener/RejectExplicitFrontControllerRequestsListener.php +++ b/src/bundle/Core/EventListener/RejectExplicitFrontControllerRequestsListener.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\Core\EventListener; use Symfony\Component\EventDispatcher\EventSubscriberInterface; diff --git a/src/bundle/Core/EventListener/RequestEventListener.php b/src/bundle/Core/EventListener/RequestEventListener.php index 1e49692d2c..4085d8b889 100644 --- a/src/bundle/Core/EventListener/RequestEventListener.php +++ b/src/bundle/Core/EventListener/RequestEventListener.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\Core\EventListener; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/bundle/Core/EventListener/RoutingListener.php b/src/bundle/Core/EventListener/RoutingListener.php index b9a5774fad..68794f91c7 100644 --- a/src/bundle/Core/EventListener/RoutingListener.php +++ b/src/bundle/Core/EventListener/RoutingListener.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\Core\EventListener; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/bundle/Core/EventListener/SessionInitByPostListener.php b/src/bundle/Core/EventListener/SessionInitByPostListener.php index f4f9e92a08..02f4703583 100644 --- a/src/bundle/Core/EventListener/SessionInitByPostListener.php +++ b/src/bundle/Core/EventListener/SessionInitByPostListener.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\Core\EventListener; use Ibexa\Core\MVC\Symfony\Event\PostSiteAccessMatchEvent; diff --git a/src/bundle/Core/EventListener/SessionSetDynamicNameListener.php b/src/bundle/Core/EventListener/SessionSetDynamicNameListener.php index bda86b016f..90b8e0af18 100644 --- a/src/bundle/Core/EventListener/SessionSetDynamicNameListener.php +++ b/src/bundle/Core/EventListener/SessionSetDynamicNameListener.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\Core\EventListener; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/bundle/Core/EventListener/SiteAccessListener.php b/src/bundle/Core/EventListener/SiteAccessListener.php index e35ca05a29..5c067d473d 100644 --- a/src/bundle/Core/EventListener/SiteAccessListener.php +++ b/src/bundle/Core/EventListener/SiteAccessListener.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\Core\EventListener; use Ibexa\Core\MVC\Symfony\Event\PostSiteAccessMatchEvent; diff --git a/src/bundle/Core/EventListener/ViewControllerListener.php b/src/bundle/Core/EventListener/ViewControllerListener.php index 2d4169263d..ec42bfc18f 100644 --- a/src/bundle/Core/EventListener/ViewControllerListener.php +++ b/src/bundle/Core/EventListener/ViewControllerListener.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\Core\EventListener; use Ibexa\Contracts\Core\Event\View\PostBuildViewEvent; diff --git a/src/bundle/Core/EventListener/ViewRendererListener.php b/src/bundle/Core/EventListener/ViewRendererListener.php index 27cafda9cb..83f24b1034 100644 --- a/src/bundle/Core/EventListener/ViewRendererListener.php +++ b/src/bundle/Core/EventListener/ViewRendererListener.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\Core\EventListener; use Ibexa\Core\MVC\Symfony\View\Renderer as ViewRenderer; diff --git a/src/bundle/Core/EventSubscriber/CrowdinRequestLocaleSubscriber.php b/src/bundle/Core/EventSubscriber/CrowdinRequestLocaleSubscriber.php index c6e6e39ea6..986a2d92f3 100644 --- a/src/bundle/Core/EventSubscriber/CrowdinRequestLocaleSubscriber.php +++ b/src/bundle/Core/EventSubscriber/CrowdinRequestLocaleSubscriber.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\Core\EventSubscriber; use Symfony\Component\EventDispatcher\EventSubscriberInterface; diff --git a/src/bundle/Core/Features/Context/BasicContentContext.php b/src/bundle/Core/Features/Context/BasicContentContext.php index 46100998a6..25eddd6e0b 100644 --- a/src/bundle/Core/Features/Context/BasicContentContext.php +++ b/src/bundle/Core/Features/Context/BasicContentContext.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\Core\Features\Context; use Behat\Behat\Context\Context; diff --git a/src/bundle/Core/Features/Context/ConsoleContext.php b/src/bundle/Core/Features/Context/ConsoleContext.php index 1bb0cfc1e9..7e0921259d 100644 --- a/src/bundle/Core/Features/Context/ConsoleContext.php +++ b/src/bundle/Core/Features/Context/ConsoleContext.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\Core\Features\Context; use Behat\Behat\Context\Context; diff --git a/src/bundle/Core/Features/Context/ContentContext.php b/src/bundle/Core/Features/Context/ContentContext.php index 3202babf06..e404b4f9ec 100644 --- a/src/bundle/Core/Features/Context/ContentContext.php +++ b/src/bundle/Core/Features/Context/ContentContext.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\Core\Features\Context; use Behat\Behat\Context\Context; diff --git a/src/bundle/Core/Features/Context/ContentPreviewContext.php b/src/bundle/Core/Features/Context/ContentPreviewContext.php index f4bb0678bb..dfd9c9c7f1 100644 --- a/src/bundle/Core/Features/Context/ContentPreviewContext.php +++ b/src/bundle/Core/Features/Context/ContentPreviewContext.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\Core\Features\Context; use Behat\Behat\Hook\Scope\BeforeScenarioScope; diff --git a/src/bundle/Core/Features/Context/ContentTypeContext.php b/src/bundle/Core/Features/Context/ContentTypeContext.php index e67fb58664..ebb6600a07 100644 --- a/src/bundle/Core/Features/Context/ContentTypeContext.php +++ b/src/bundle/Core/Features/Context/ContentTypeContext.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\Core\Features\Context; use Behat\Behat\Context\Context; diff --git a/src/bundle/Core/Features/Context/ExceptionContext.php b/src/bundle/Core/Features/Context/ExceptionContext.php index 18043fb104..c6ec93b2d6 100644 --- a/src/bundle/Core/Features/Context/ExceptionContext.php +++ b/src/bundle/Core/Features/Context/ExceptionContext.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\Core\Features\Context; use Behat\Behat\Context\Context; diff --git a/src/bundle/Core/Features/Context/FieldTypeContext.php b/src/bundle/Core/Features/Context/FieldTypeContext.php index 9ce8cd3b85..8f45e517ed 100644 --- a/src/bundle/Core/Features/Context/FieldTypeContext.php +++ b/src/bundle/Core/Features/Context/FieldTypeContext.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\Core\Features\Context; use Behat\Behat\Context\Context; diff --git a/src/bundle/Core/Features/Context/QueryControllerContext.php b/src/bundle/Core/Features/Context/QueryControllerContext.php index 225ef2210c..c356ae5199 100644 --- a/src/bundle/Core/Features/Context/QueryControllerContext.php +++ b/src/bundle/Core/Features/Context/QueryControllerContext.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\Core\Features\Context; use Behat\MinkExtension\Context\RawMinkContext; diff --git a/src/bundle/Core/Features/Context/RoleContext.php b/src/bundle/Core/Features/Context/RoleContext.php index 526215d06f..e870a5e8fe 100644 --- a/src/bundle/Core/Features/Context/RoleContext.php +++ b/src/bundle/Core/Features/Context/RoleContext.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\Core\Features\Context; use Behat\Behat\Context\Context; diff --git a/src/bundle/Core/Features/Context/UserContext.php b/src/bundle/Core/Features/Context/UserContext.php index e239bcf462..b50de7f76a 100644 --- a/src/bundle/Core/Features/Context/UserContext.php +++ b/src/bundle/Core/Features/Context/UserContext.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\Core\Features\Context; use Behat\Behat\Context\Context; @@ -69,6 +70,7 @@ public function searchUserByLogin($username, $parentGroupId = null) return $user; } } + // user not found in $parentGroupId return null; } @@ -319,6 +321,7 @@ public function createPasswordHash($login, $password, $type) /* PASSWORD_HASH_PLAINTEXT */ return $password; } + /* PASSWORD_HASH_MD5_PASSWORD (1) */ return md5($password); } @@ -416,6 +419,7 @@ public function iHaveTheFollowingUsers(TableNode $table) /** * @Given a User with name :username already exists + * * @Then User with name :username exists * * Checks that user ':username' exists. diff --git a/src/bundle/Core/Features/Context/YamlConfigurationContext.php b/src/bundle/Core/Features/Context/YamlConfigurationContext.php index 7526fec88b..523073019c 100644 --- a/src/bundle/Core/Features/Context/YamlConfigurationContext.php +++ b/src/bundle/Core/Features/Context/YamlConfigurationContext.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\Core\Features\Context; use Behat\Behat\Context\Context; diff --git a/src/bundle/Core/Fragment/DecoratedFragmentRenderer.php b/src/bundle/Core/Fragment/DecoratedFragmentRenderer.php index cf7acadec9..e9c30242c1 100644 --- a/src/bundle/Core/Fragment/DecoratedFragmentRenderer.php +++ b/src/bundle/Core/Fragment/DecoratedFragmentRenderer.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\Core\Fragment; use Ibexa\Core\MVC\Symfony\SiteAccess; diff --git a/src/bundle/Core/Fragment/FragmentListenerFactory.php b/src/bundle/Core/Fragment/FragmentListenerFactory.php index bb1c53b647..605fa025f9 100644 --- a/src/bundle/Core/Fragment/FragmentListenerFactory.php +++ b/src/bundle/Core/Fragment/FragmentListenerFactory.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\Core\Fragment; use Ibexa\Core\MVC\Symfony\RequestStackAware; diff --git a/src/bundle/Core/Fragment/InlineFragmentRenderer.php b/src/bundle/Core/Fragment/InlineFragmentRenderer.php index d47bc11a1e..af79884745 100644 --- a/src/bundle/Core/Fragment/InlineFragmentRenderer.php +++ b/src/bundle/Core/Fragment/InlineFragmentRenderer.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\Core\Fragment; use Ibexa\Core\MVC\Symfony\SiteAccess; diff --git a/src/bundle/Core/IbexaCoreBundle.php b/src/bundle/Core/IbexaCoreBundle.php index be9b0ab962..1f5a94220e 100644 --- a/src/bundle/Core/IbexaCoreBundle.php +++ b/src/bundle/Core/IbexaCoreBundle.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\Core; use Ibexa\Bundle\Core\DependencyInjection\Compiler\BinaryContentDownloadPass; diff --git a/src/bundle/Core/Imagine/AliasCleaner.php b/src/bundle/Core/Imagine/AliasCleaner.php index 9873da912d..a4e272cc1d 100644 --- a/src/bundle/Core/Imagine/AliasCleaner.php +++ b/src/bundle/Core/Imagine/AliasCleaner.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\Core\Imagine; use Ibexa\Core\FieldType\Image\AliasCleanerInterface; diff --git a/src/bundle/Core/Imagine/AliasGenerator.php b/src/bundle/Core/Imagine/AliasGenerator.php index 77ddc22bca..7e99bb7779 100644 --- a/src/bundle/Core/Imagine/AliasGenerator.php +++ b/src/bundle/Core/Imagine/AliasGenerator.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\Core\Imagine; use Ibexa\Contracts\Core\FieldType\Value; diff --git a/src/bundle/Core/Imagine/BinaryLoader.php b/src/bundle/Core/Imagine/BinaryLoader.php index 1c40589515..d9b278ed41 100644 --- a/src/bundle/Core/Imagine/BinaryLoader.php +++ b/src/bundle/Core/Imagine/BinaryLoader.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\Core\Imagine; use Exception; diff --git a/src/bundle/Core/Imagine/Cache/AliasGeneratorDecorator.php b/src/bundle/Core/Imagine/Cache/AliasGeneratorDecorator.php index 4beef2de61..171e1a4e9e 100644 --- a/src/bundle/Core/Imagine/Cache/AliasGeneratorDecorator.php +++ b/src/bundle/Core/Imagine/Cache/AliasGeneratorDecorator.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\Core\Imagine\Cache; use Ibexa\Contracts\Core\Repository\Values\Content\Field; diff --git a/src/bundle/Core/Imagine/Cache/Resolver/ProxyResolver.php b/src/bundle/Core/Imagine/Cache/Resolver/ProxyResolver.php index 08ba10db5d..60fb75fc2d 100644 --- a/src/bundle/Core/Imagine/Cache/Resolver/ProxyResolver.php +++ b/src/bundle/Core/Imagine/Cache/Resolver/ProxyResolver.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\Core\Imagine\Cache\Resolver; use Liip\ImagineBundle\Imagine\Cache\Resolver\ProxyResolver as ImagineProxyResolver; diff --git a/src/bundle/Core/Imagine/Cache/Resolver/RelativeResolver.php b/src/bundle/Core/Imagine/Cache/Resolver/RelativeResolver.php index 4b2796fa79..735ccdb7fd 100644 --- a/src/bundle/Core/Imagine/Cache/Resolver/RelativeResolver.php +++ b/src/bundle/Core/Imagine/Cache/Resolver/RelativeResolver.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\Core\Imagine\Cache\Resolver; use Liip\ImagineBundle\Imagine\Cache\Resolver\ProxyResolver as ImagineProxyResolver; diff --git a/src/bundle/Core/Imagine/Cache/ResolverFactory.php b/src/bundle/Core/Imagine/Cache/ResolverFactory.php index b7f79d7c50..a70fb803de 100644 --- a/src/bundle/Core/Imagine/Cache/ResolverFactory.php +++ b/src/bundle/Core/Imagine/Cache/ResolverFactory.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\Core\Imagine\Cache; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/bundle/Core/Imagine/Filter/AbstractFilter.php b/src/bundle/Core/Imagine/Filter/AbstractFilter.php index ea3e38d24d..b3c9ee2550 100644 --- a/src/bundle/Core/Imagine/Filter/AbstractFilter.php +++ b/src/bundle/Core/Imagine/Filter/AbstractFilter.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\Core\Imagine\Filter; /** diff --git a/src/bundle/Core/Imagine/Filter/FilterConfiguration.php b/src/bundle/Core/Imagine/Filter/FilterConfiguration.php index 1d99af786b..2e6eaa4013 100644 --- a/src/bundle/Core/Imagine/Filter/FilterConfiguration.php +++ b/src/bundle/Core/Imagine/Filter/FilterConfiguration.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\Core\Imagine\Filter; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/bundle/Core/Imagine/Filter/FilterInterface.php b/src/bundle/Core/Imagine/Filter/FilterInterface.php index be74b2a81c..e20ca2ab6c 100644 --- a/src/bundle/Core/Imagine/Filter/FilterInterface.php +++ b/src/bundle/Core/Imagine/Filter/FilterInterface.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\Core\Imagine\Filter; use Imagine\Filter\FilterInterface as BaseFilterInterface; diff --git a/src/bundle/Core/Imagine/Filter/Gmagick/ReduceNoiseFilter.php b/src/bundle/Core/Imagine/Filter/Gmagick/ReduceNoiseFilter.php index 1e826b4d9c..7a34a3b214 100644 --- a/src/bundle/Core/Imagine/Filter/Gmagick/ReduceNoiseFilter.php +++ b/src/bundle/Core/Imagine/Filter/Gmagick/ReduceNoiseFilter.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\Core\Imagine\Filter\Gmagick; use Ibexa\Bundle\Core\Imagine\Filter\AbstractFilter; diff --git a/src/bundle/Core/Imagine/Filter/Gmagick/SwirlFilter.php b/src/bundle/Core/Imagine/Filter/Gmagick/SwirlFilter.php index d5dcfe01a2..1004430024 100644 --- a/src/bundle/Core/Imagine/Filter/Gmagick/SwirlFilter.php +++ b/src/bundle/Core/Imagine/Filter/Gmagick/SwirlFilter.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\Core\Imagine\Filter\Gmagick; use Ibexa\Bundle\Core\Imagine\Filter\AbstractFilter; diff --git a/src/bundle/Core/Imagine/Filter/Imagick/ReduceNoiseFilter.php b/src/bundle/Core/Imagine/Filter/Imagick/ReduceNoiseFilter.php index fb931f71e8..a4e4b4a494 100644 --- a/src/bundle/Core/Imagine/Filter/Imagick/ReduceNoiseFilter.php +++ b/src/bundle/Core/Imagine/Filter/Imagick/ReduceNoiseFilter.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\Core\Imagine\Filter\Imagick; use Ibexa\Bundle\Core\Imagine\Filter\AbstractFilter; diff --git a/src/bundle/Core/Imagine/Filter/Imagick/SwirlFilter.php b/src/bundle/Core/Imagine/Filter/Imagick/SwirlFilter.php index 67b4306797..793daae3ae 100644 --- a/src/bundle/Core/Imagine/Filter/Imagick/SwirlFilter.php +++ b/src/bundle/Core/Imagine/Filter/Imagick/SwirlFilter.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\Core\Imagine\Filter\Imagick; use Ibexa\Bundle\Core\Imagine\Filter\AbstractFilter; diff --git a/src/bundle/Core/Imagine/Filter/Loader/BorderFilterLoader.php b/src/bundle/Core/Imagine/Filter/Loader/BorderFilterLoader.php index c30e8a07c0..edd3f73641 100644 --- a/src/bundle/Core/Imagine/Filter/Loader/BorderFilterLoader.php +++ b/src/bundle/Core/Imagine/Filter/Loader/BorderFilterLoader.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\Core\Imagine\Filter\Loader; use Imagine\Exception\InvalidArgumentException; diff --git a/src/bundle/Core/Imagine/Filter/Loader/CropFilterLoader.php b/src/bundle/Core/Imagine/Filter/Loader/CropFilterLoader.php index 014cfd7852..58af50df60 100644 --- a/src/bundle/Core/Imagine/Filter/Loader/CropFilterLoader.php +++ b/src/bundle/Core/Imagine/Filter/Loader/CropFilterLoader.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\Core\Imagine\Filter\Loader; use Imagine\Exception\InvalidArgumentException; diff --git a/src/bundle/Core/Imagine/Filter/Loader/FilterLoaderWrapped.php b/src/bundle/Core/Imagine/Filter/Loader/FilterLoaderWrapped.php index 366ccce2fc..e75a9250be 100644 --- a/src/bundle/Core/Imagine/Filter/Loader/FilterLoaderWrapped.php +++ b/src/bundle/Core/Imagine/Filter/Loader/FilterLoaderWrapped.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\Core\Imagine\Filter\Loader; use Liip\ImagineBundle\Imagine\Filter\Loader\LoaderInterface; diff --git a/src/bundle/Core/Imagine/Filter/Loader/GrayscaleFilterLoader.php b/src/bundle/Core/Imagine/Filter/Loader/GrayscaleFilterLoader.php index 6e49081cfa..cdc8f61f59 100644 --- a/src/bundle/Core/Imagine/Filter/Loader/GrayscaleFilterLoader.php +++ b/src/bundle/Core/Imagine/Filter/Loader/GrayscaleFilterLoader.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\Core\Imagine\Filter\Loader; use Imagine\Image\ImageInterface; diff --git a/src/bundle/Core/Imagine/Filter/Loader/ReduceNoiseFilterLoader.php b/src/bundle/Core/Imagine/Filter/Loader/ReduceNoiseFilterLoader.php index 25364fa509..d544d17070 100644 --- a/src/bundle/Core/Imagine/Filter/Loader/ReduceNoiseFilterLoader.php +++ b/src/bundle/Core/Imagine/Filter/Loader/ReduceNoiseFilterLoader.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\Core\Imagine\Filter\Loader; use Ibexa\Bundle\Core\Imagine\Filter\FilterInterface; diff --git a/src/bundle/Core/Imagine/Filter/Loader/ScaleDownOnlyFilterLoader.php b/src/bundle/Core/Imagine/Filter/Loader/ScaleDownOnlyFilterLoader.php index a52a014e4d..f7274704c8 100644 --- a/src/bundle/Core/Imagine/Filter/Loader/ScaleDownOnlyFilterLoader.php +++ b/src/bundle/Core/Imagine/Filter/Loader/ScaleDownOnlyFilterLoader.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\Core\Imagine\Filter\Loader; use Imagine\Exception\InvalidArgumentException; diff --git a/src/bundle/Core/Imagine/Filter/Loader/ScaleExactFilterLoader.php b/src/bundle/Core/Imagine/Filter/Loader/ScaleExactFilterLoader.php index cdf73e4f54..3f6d43330d 100644 --- a/src/bundle/Core/Imagine/Filter/Loader/ScaleExactFilterLoader.php +++ b/src/bundle/Core/Imagine/Filter/Loader/ScaleExactFilterLoader.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\Core\Imagine\Filter\Loader; use Imagine\Exception\InvalidArgumentException; diff --git a/src/bundle/Core/Imagine/Filter/Loader/ScaleFilterLoader.php b/src/bundle/Core/Imagine/Filter/Loader/ScaleFilterLoader.php index 8800a23858..d8cbb21b2d 100644 --- a/src/bundle/Core/Imagine/Filter/Loader/ScaleFilterLoader.php +++ b/src/bundle/Core/Imagine/Filter/Loader/ScaleFilterLoader.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\Core\Imagine\Filter\Loader; use Imagine\Exception\InvalidArgumentException; diff --git a/src/bundle/Core/Imagine/Filter/Loader/ScaleHeightDownOnlyFilterLoader.php b/src/bundle/Core/Imagine/Filter/Loader/ScaleHeightDownOnlyFilterLoader.php index d92486330b..0baae5a879 100644 --- a/src/bundle/Core/Imagine/Filter/Loader/ScaleHeightDownOnlyFilterLoader.php +++ b/src/bundle/Core/Imagine/Filter/Loader/ScaleHeightDownOnlyFilterLoader.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\Core\Imagine\Filter\Loader; use Imagine\Exception\InvalidArgumentException; diff --git a/src/bundle/Core/Imagine/Filter/Loader/ScaleHeightFilterLoader.php b/src/bundle/Core/Imagine/Filter/Loader/ScaleHeightFilterLoader.php index c45029b62d..09bd4ddf41 100644 --- a/src/bundle/Core/Imagine/Filter/Loader/ScaleHeightFilterLoader.php +++ b/src/bundle/Core/Imagine/Filter/Loader/ScaleHeightFilterLoader.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\Core\Imagine\Filter\Loader; use Imagine\Exception\InvalidArgumentException; diff --git a/src/bundle/Core/Imagine/Filter/Loader/ScalePercentFilterLoader.php b/src/bundle/Core/Imagine/Filter/Loader/ScalePercentFilterLoader.php index 30d47e6565..61a0600f2f 100644 --- a/src/bundle/Core/Imagine/Filter/Loader/ScalePercentFilterLoader.php +++ b/src/bundle/Core/Imagine/Filter/Loader/ScalePercentFilterLoader.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\Core\Imagine\Filter\Loader; use Imagine\Exception\InvalidArgumentException; diff --git a/src/bundle/Core/Imagine/Filter/Loader/ScaleWidthDownOnlyFilterLoader.php b/src/bundle/Core/Imagine/Filter/Loader/ScaleWidthDownOnlyFilterLoader.php index 36ce89b184..9dc6d66434 100644 --- a/src/bundle/Core/Imagine/Filter/Loader/ScaleWidthDownOnlyFilterLoader.php +++ b/src/bundle/Core/Imagine/Filter/Loader/ScaleWidthDownOnlyFilterLoader.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\Core\Imagine\Filter\Loader; use Imagine\Exception\InvalidArgumentException; diff --git a/src/bundle/Core/Imagine/Filter/Loader/ScaleWidthFilterLoader.php b/src/bundle/Core/Imagine/Filter/Loader/ScaleWidthFilterLoader.php index c07ce2a4d7..ce1a2e5eb8 100644 --- a/src/bundle/Core/Imagine/Filter/Loader/ScaleWidthFilterLoader.php +++ b/src/bundle/Core/Imagine/Filter/Loader/ScaleWidthFilterLoader.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\Core\Imagine\Filter\Loader; use Imagine\Exception\InvalidArgumentException; diff --git a/src/bundle/Core/Imagine/Filter/Loader/SwirlFilterLoader.php b/src/bundle/Core/Imagine/Filter/Loader/SwirlFilterLoader.php index ac00c75cc6..c312ac55a1 100644 --- a/src/bundle/Core/Imagine/Filter/Loader/SwirlFilterLoader.php +++ b/src/bundle/Core/Imagine/Filter/Loader/SwirlFilterLoader.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\Core\Imagine\Filter\Loader; use Ibexa\Bundle\Core\Imagine\Filter\FilterInterface; diff --git a/src/bundle/Core/Imagine/Filter/UnsupportedFilter.php b/src/bundle/Core/Imagine/Filter/UnsupportedFilter.php index b5801c1b58..357f4b7a45 100644 --- a/src/bundle/Core/Imagine/Filter/UnsupportedFilter.php +++ b/src/bundle/Core/Imagine/Filter/UnsupportedFilter.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\Core\Imagine\Filter; use Imagine\Exception\NotSupportedException; diff --git a/src/bundle/Core/Imagine/IORepositoryResolver.php b/src/bundle/Core/Imagine/IORepositoryResolver.php index a70715421c..2e78515154 100644 --- a/src/bundle/Core/Imagine/IORepositoryResolver.php +++ b/src/bundle/Core/Imagine/IORepositoryResolver.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\Core\Imagine; use Ibexa\Bundle\Core\Variation\PathResolver; diff --git a/src/bundle/Core/Imagine/PlaceholderAliasGenerator.php b/src/bundle/Core/Imagine/PlaceholderAliasGenerator.php index 6bdb880aa5..d92543a6be 100644 --- a/src/bundle/Core/Imagine/PlaceholderAliasGenerator.php +++ b/src/bundle/Core/Imagine/PlaceholderAliasGenerator.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\Core\Imagine; use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException as APIInvalidArgumentException; diff --git a/src/bundle/Core/Imagine/PlaceholderAliasGeneratorConfigurator.php b/src/bundle/Core/Imagine/PlaceholderAliasGeneratorConfigurator.php index 3148e7382f..ee228a68db 100644 --- a/src/bundle/Core/Imagine/PlaceholderAliasGeneratorConfigurator.php +++ b/src/bundle/Core/Imagine/PlaceholderAliasGeneratorConfigurator.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\Core\Imagine; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/bundle/Core/Imagine/PlaceholderProvider.php b/src/bundle/Core/Imagine/PlaceholderProvider.php index 59ed1eed02..5628c38823 100644 --- a/src/bundle/Core/Imagine/PlaceholderProvider.php +++ b/src/bundle/Core/Imagine/PlaceholderProvider.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\Core\Imagine; use Ibexa\Core\FieldType\Image\Value as ImageValue; diff --git a/src/bundle/Core/Imagine/PlaceholderProvider/GenericProvider.php b/src/bundle/Core/Imagine/PlaceholderProvider/GenericProvider.php index 2be35b5ae4..07d8df192e 100644 --- a/src/bundle/Core/Imagine/PlaceholderProvider/GenericProvider.php +++ b/src/bundle/Core/Imagine/PlaceholderProvider/GenericProvider.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\Core\Imagine\PlaceholderProvider; use Ibexa\Bundle\Core\Imagine\PlaceholderProvider; diff --git a/src/bundle/Core/Imagine/PlaceholderProvider/RemoteProvider.php b/src/bundle/Core/Imagine/PlaceholderProvider/RemoteProvider.php index f85ad9d29e..a5c065d80e 100644 --- a/src/bundle/Core/Imagine/PlaceholderProvider/RemoteProvider.php +++ b/src/bundle/Core/Imagine/PlaceholderProvider/RemoteProvider.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\Core\Imagine\PlaceholderProvider; use Ibexa\Bundle\Core\Imagine\PlaceholderProvider; diff --git a/src/bundle/Core/Imagine/PlaceholderProviderRegistry.php b/src/bundle/Core/Imagine/PlaceholderProviderRegistry.php index 7935234de6..2a434276e7 100644 --- a/src/bundle/Core/Imagine/PlaceholderProviderRegistry.php +++ b/src/bundle/Core/Imagine/PlaceholderProviderRegistry.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\Core\Imagine; use InvalidArgumentException; diff --git a/src/bundle/Core/Imagine/Variation/ImagineAwareAliasGenerator.php b/src/bundle/Core/Imagine/Variation/ImagineAwareAliasGenerator.php index b861eda957..99fd010a1f 100644 --- a/src/bundle/Core/Imagine/Variation/ImagineAwareAliasGenerator.php +++ b/src/bundle/Core/Imagine/Variation/ImagineAwareAliasGenerator.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\Core\Imagine\Variation; use Ibexa\Bundle\Core\Imagine\IORepositoryResolver; diff --git a/src/bundle/Core/Imagine/VariationPathGenerator.php b/src/bundle/Core/Imagine/VariationPathGenerator.php index 1c6decc7ac..5d12bf0aeb 100644 --- a/src/bundle/Core/Imagine/VariationPathGenerator.php +++ b/src/bundle/Core/Imagine/VariationPathGenerator.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\Core\Imagine; use Ibexa\Contracts\Core\Variation\VariationPathGenerator as VariationPathGeneratorContract; diff --git a/src/bundle/Core/Imagine/VariationPathGenerator/AliasDirectoryVariationPathGenerator.php b/src/bundle/Core/Imagine/VariationPathGenerator/AliasDirectoryVariationPathGenerator.php index 3b30f66d35..2ccae432f6 100644 --- a/src/bundle/Core/Imagine/VariationPathGenerator/AliasDirectoryVariationPathGenerator.php +++ b/src/bundle/Core/Imagine/VariationPathGenerator/AliasDirectoryVariationPathGenerator.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\Core\Imagine\VariationPathGenerator; use Ibexa\Contracts\Core\Variation\VariationPathGenerator; diff --git a/src/bundle/Core/Imagine/VariationPathGenerator/OriginalDirectoryVariationPathGenerator.php b/src/bundle/Core/Imagine/VariationPathGenerator/OriginalDirectoryVariationPathGenerator.php index 630d7a9f08..de05a6240e 100644 --- a/src/bundle/Core/Imagine/VariationPathGenerator/OriginalDirectoryVariationPathGenerator.php +++ b/src/bundle/Core/Imagine/VariationPathGenerator/OriginalDirectoryVariationPathGenerator.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\Core\Imagine\VariationPathGenerator; use Ibexa\Contracts\Core\Variation\VariationPathGenerator; diff --git a/src/bundle/Core/Imagine/VariationPurger/IOVariationPurger.php b/src/bundle/Core/Imagine/VariationPurger/IOVariationPurger.php index 73393f4afe..7d6bc5849d 100644 --- a/src/bundle/Core/Imagine/VariationPurger/IOVariationPurger.php +++ b/src/bundle/Core/Imagine/VariationPurger/IOVariationPurger.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\Core\Imagine\VariationPurger; use Ibexa\Bundle\Core\Imagine\Cache\AliasGeneratorDecorator; diff --git a/src/bundle/Core/Imagine/VariationPurger/ImageFileList.php b/src/bundle/Core/Imagine/VariationPurger/ImageFileList.php index d3b609e938..38c86ddafa 100644 --- a/src/bundle/Core/Imagine/VariationPurger/ImageFileList.php +++ b/src/bundle/Core/Imagine/VariationPurger/ImageFileList.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\Core\Imagine\VariationPurger; use Countable; diff --git a/src/bundle/Core/Imagine/VariationPurger/ImageFileRowReader.php b/src/bundle/Core/Imagine/VariationPurger/ImageFileRowReader.php index cf8b031ee1..d9edadf084 100644 --- a/src/bundle/Core/Imagine/VariationPurger/ImageFileRowReader.php +++ b/src/bundle/Core/Imagine/VariationPurger/ImageFileRowReader.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\Core\Imagine\VariationPurger; /** diff --git a/src/bundle/Core/Imagine/VariationPurger/ImageFileVariationPurger.php b/src/bundle/Core/Imagine/VariationPurger/ImageFileVariationPurger.php index 081a029deb..51fe1d944e 100644 --- a/src/bundle/Core/Imagine/VariationPurger/ImageFileVariationPurger.php +++ b/src/bundle/Core/Imagine/VariationPurger/ImageFileVariationPurger.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\Core\Imagine\VariationPurger; use Ibexa\Contracts\Core\Variation\VariationPathGenerator; diff --git a/src/bundle/Core/Imagine/VariationPurger/LegacyStorageImageFileList.php b/src/bundle/Core/Imagine/VariationPurger/LegacyStorageImageFileList.php index ab959e6327..f8960fc965 100644 --- a/src/bundle/Core/Imagine/VariationPurger/LegacyStorageImageFileList.php +++ b/src/bundle/Core/Imagine/VariationPurger/LegacyStorageImageFileList.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\Core\Imagine\VariationPurger; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/bundle/Core/Imagine/VariationPurger/LegacyStorageImageFileRowReader.php b/src/bundle/Core/Imagine/VariationPurger/LegacyStorageImageFileRowReader.php index 37194de053..d0c26e19e6 100644 --- a/src/bundle/Core/Imagine/VariationPurger/LegacyStorageImageFileRowReader.php +++ b/src/bundle/Core/Imagine/VariationPurger/LegacyStorageImageFileRowReader.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\Core\Imagine\VariationPurger; use Doctrine\DBAL\Connection; diff --git a/src/bundle/Core/Matcher/ServiceAwareMatcherFactory.php b/src/bundle/Core/Matcher/ServiceAwareMatcherFactory.php index 8c6d749f5e..872af03779 100644 --- a/src/bundle/Core/Matcher/ServiceAwareMatcherFactory.php +++ b/src/bundle/Core/Matcher/ServiceAwareMatcherFactory.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\Core\Matcher; use Ibexa\Contracts\Core\MVC\View\ViewMatcherRegistryInterface; diff --git a/src/bundle/Core/Routing/DefaultRouter.php b/src/bundle/Core/Routing/DefaultRouter.php index 209869e2fa..f8a8ebecc4 100644 --- a/src/bundle/Core/Routing/DefaultRouter.php +++ b/src/bundle/Core/Routing/DefaultRouter.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\Core\Routing; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/bundle/Core/Routing/JsRouting/ExposedRoutesExtractor.php b/src/bundle/Core/Routing/JsRouting/ExposedRoutesExtractor.php index deaf1baf62..48eb33d7fc 100644 --- a/src/bundle/Core/Routing/JsRouting/ExposedRoutesExtractor.php +++ b/src/bundle/Core/Routing/JsRouting/ExposedRoutesExtractor.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\Core\Routing\JsRouting; use FOS\JsRoutingBundle\Extractor\ExposedRoutesExtractorInterface; diff --git a/src/bundle/Core/Routing/UrlAliasRouter.php b/src/bundle/Core/Routing/UrlAliasRouter.php index bbc42258e8..cd1a9d910b 100644 --- a/src/bundle/Core/Routing/UrlAliasRouter.php +++ b/src/bundle/Core/Routing/UrlAliasRouter.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\Core\Routing; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/bundle/Core/Session/Handler/NativeSessionHandler.php b/src/bundle/Core/Session/Handler/NativeSessionHandler.php index c60e14e099..efbfcff48c 100644 --- a/src/bundle/Core/Session/Handler/NativeSessionHandler.php +++ b/src/bundle/Core/Session/Handler/NativeSessionHandler.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\Core\Session\Handler; /** diff --git a/src/bundle/Core/SiteAccess/LanguageResolver.php b/src/bundle/Core/SiteAccess/LanguageResolver.php index a22db5f3e4..196cd0888f 100644 --- a/src/bundle/Core/SiteAccess/LanguageResolver.php +++ b/src/bundle/Core/SiteAccess/LanguageResolver.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\Core\SiteAccess; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/bundle/Core/SiteAccess/Matcher.php b/src/bundle/Core/SiteAccess/Matcher.php index eed312fa5a..4ee5cf3c44 100644 --- a/src/bundle/Core/SiteAccess/Matcher.php +++ b/src/bundle/Core/SiteAccess/Matcher.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\Core\SiteAccess; use Ibexa\Core\MVC\Symfony\SiteAccess\Matcher as BaseMatcher; diff --git a/src/bundle/Core/SiteAccess/MatcherBuilder.php b/src/bundle/Core/SiteAccess/MatcherBuilder.php index 9f86e1d234..9d230ef008 100644 --- a/src/bundle/Core/SiteAccess/MatcherBuilder.php +++ b/src/bundle/Core/SiteAccess/MatcherBuilder.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\Core\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/bundle/Core/SiteAccess/SiteAccessConfigurationFilter.php b/src/bundle/Core/SiteAccess/SiteAccessConfigurationFilter.php index d07f0e142e..c3aae28912 100644 --- a/src/bundle/Core/SiteAccess/SiteAccessConfigurationFilter.php +++ b/src/bundle/Core/SiteAccess/SiteAccessConfigurationFilter.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\Core\SiteAccess; /** diff --git a/src/bundle/Core/Translation/Collector.php b/src/bundle/Core/Translation/Collector.php index 0794c08562..e006148460 100644 --- a/src/bundle/Core/Translation/Collector.php +++ b/src/bundle/Core/Translation/Collector.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\Core\Translation; /** diff --git a/src/bundle/Core/Translation/GlobCollector.php b/src/bundle/Core/Translation/GlobCollector.php index f9fc3a6362..5d3f783bf3 100644 --- a/src/bundle/Core/Translation/GlobCollector.php +++ b/src/bundle/Core/Translation/GlobCollector.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\Core\Translation; use const DIRECTORY_SEPARATOR; diff --git a/src/bundle/Core/URLChecker/Handler/AbstractConfigResolverBasedURLHandler.php b/src/bundle/Core/URLChecker/Handler/AbstractConfigResolverBasedURLHandler.php index ba5c363ddd..20f98a2b5d 100644 --- a/src/bundle/Core/URLChecker/Handler/AbstractConfigResolverBasedURLHandler.php +++ b/src/bundle/Core/URLChecker/Handler/AbstractConfigResolverBasedURLHandler.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\Core\URLChecker\Handler; use Ibexa\Contracts\Core\Repository\URLService; diff --git a/src/bundle/Core/URLChecker/Handler/AbstractURLHandler.php b/src/bundle/Core/URLChecker/Handler/AbstractURLHandler.php index 101c198353..9725f02b9a 100644 --- a/src/bundle/Core/URLChecker/Handler/AbstractURLHandler.php +++ b/src/bundle/Core/URLChecker/Handler/AbstractURLHandler.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\Core\URLChecker\Handler; use DateTime; diff --git a/src/bundle/Core/URLChecker/Handler/HTTPHandler.php b/src/bundle/Core/URLChecker/Handler/HTTPHandler.php index 12977be304..4ce062cdcc 100644 --- a/src/bundle/Core/URLChecker/Handler/HTTPHandler.php +++ b/src/bundle/Core/URLChecker/Handler/HTTPHandler.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\Core\URLChecker\Handler; use Ibexa\Contracts\Core\Repository\Values\URL\URL; diff --git a/src/bundle/Core/URLChecker/Handler/MailToHandler.php b/src/bundle/Core/URLChecker/Handler/MailToHandler.php index b112be2406..038247be60 100644 --- a/src/bundle/Core/URLChecker/Handler/MailToHandler.php +++ b/src/bundle/Core/URLChecker/Handler/MailToHandler.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\Core\URLChecker\Handler; use Ibexa\Contracts\Core\Repository\URLService; diff --git a/src/bundle/Core/URLChecker/URLChecker.php b/src/bundle/Core/URLChecker/URLChecker.php index 055949fb52..bc0329e5b3 100644 --- a/src/bundle/Core/URLChecker/URLChecker.php +++ b/src/bundle/Core/URLChecker/URLChecker.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\Core\URLChecker; use Ibexa\Contracts\Core\Repository\URLService as URLServiceInterface; diff --git a/src/bundle/Core/URLChecker/URLCheckerInterface.php b/src/bundle/Core/URLChecker/URLCheckerInterface.php index b5a0353144..2b99771c8a 100644 --- a/src/bundle/Core/URLChecker/URLCheckerInterface.php +++ b/src/bundle/Core/URLChecker/URLCheckerInterface.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\Core\URLChecker; use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; diff --git a/src/bundle/Core/URLChecker/URLHandlerInterface.php b/src/bundle/Core/URLChecker/URLHandlerInterface.php index 82d3af6c9b..5f0759a238 100644 --- a/src/bundle/Core/URLChecker/URLHandlerInterface.php +++ b/src/bundle/Core/URLChecker/URLHandlerInterface.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\Core\URLChecker; interface URLHandlerInterface diff --git a/src/bundle/Core/URLChecker/URLHandlerRegistry.php b/src/bundle/Core/URLChecker/URLHandlerRegistry.php index fbc72b0e56..f20158b310 100644 --- a/src/bundle/Core/URLChecker/URLHandlerRegistry.php +++ b/src/bundle/Core/URLChecker/URLHandlerRegistry.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\Core\URLChecker; use InvalidArgumentException; diff --git a/src/bundle/Core/URLChecker/URLHandlerRegistryInterface.php b/src/bundle/Core/URLChecker/URLHandlerRegistryInterface.php index e919451f18..8f4bc5d5d1 100644 --- a/src/bundle/Core/URLChecker/URLHandlerRegistryInterface.php +++ b/src/bundle/Core/URLChecker/URLHandlerRegistryInterface.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\Core\URLChecker; interface URLHandlerRegistryInterface diff --git a/src/bundle/Core/Variation/PathResolver.php b/src/bundle/Core/Variation/PathResolver.php index e2098fc548..6ce750b772 100644 --- a/src/bundle/Core/Variation/PathResolver.php +++ b/src/bundle/Core/Variation/PathResolver.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\Core\Variation; use Ibexa\Contracts\Core\Variation\VariationPathGenerator; diff --git a/src/bundle/Core/Variation/VariationHandlerResolver.php b/src/bundle/Core/Variation/VariationHandlerResolver.php index c220c64b95..357ade4b1b 100644 --- a/src/bundle/Core/Variation/VariationHandlerResolver.php +++ b/src/bundle/Core/Variation/VariationHandlerResolver.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\Core\Variation; use Ibexa\Contracts\Core\Repository\Values\Content\Field; diff --git a/src/bundle/Core/View/Manager.php b/src/bundle/Core/View/Manager.php index 3fd98d84c6..c309cb8633 100644 --- a/src/bundle/Core/View/Manager.php +++ b/src/bundle/Core/View/Manager.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\Core\View; use Ibexa\Core\MVC\Symfony\SiteAccess; diff --git a/src/bundle/Core/View/Provider/Configured.php b/src/bundle/Core/View/Provider/Configured.php index 09cacbd760..05dbf49b18 100644 --- a/src/bundle/Core/View/Provider/Configured.php +++ b/src/bundle/Core/View/Provider/Configured.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\Core\View\Provider; use Ibexa\Core\MVC\Symfony\SiteAccess; diff --git a/src/bundle/Debug/Collector/IbexaCoreCollector.php b/src/bundle/Debug/Collector/IbexaCoreCollector.php index 29e029366f..5c7e1f4754 100644 --- a/src/bundle/Debug/Collector/IbexaCoreCollector.php +++ b/src/bundle/Debug/Collector/IbexaCoreCollector.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\Debug\Collector; use InvalidArgumentException; diff --git a/src/bundle/Debug/Collector/PersistenceCacheCollector.php b/src/bundle/Debug/Collector/PersistenceCacheCollector.php index c81df9f417..3d519fcc9c 100644 --- a/src/bundle/Debug/Collector/PersistenceCacheCollector.php +++ b/src/bundle/Debug/Collector/PersistenceCacheCollector.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\Debug\Collector; use Ibexa\Core\Persistence\Cache\PersistenceLogger; diff --git a/src/bundle/Debug/Collector/SiteAccessCollector.php b/src/bundle/Debug/Collector/SiteAccessCollector.php index 6ccd04b427..d25698bd5c 100644 --- a/src/bundle/Debug/Collector/SiteAccessCollector.php +++ b/src/bundle/Debug/Collector/SiteAccessCollector.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\Debug\Collector; use Ibexa\Core\MVC\Symfony\SiteAccess; diff --git a/src/bundle/Debug/DependencyInjection/Compiler/DataCollectorPass.php b/src/bundle/Debug/DependencyInjection/Compiler/DataCollectorPass.php index f5fceeaedc..b2fd21ae6e 100644 --- a/src/bundle/Debug/DependencyInjection/Compiler/DataCollectorPass.php +++ b/src/bundle/Debug/DependencyInjection/Compiler/DataCollectorPass.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\Debug\DependencyInjection\Compiler; use Ibexa\Bundle\Debug\Collector\IbexaCoreCollector; diff --git a/src/bundle/Debug/DependencyInjection/IbexaDebugExtension.php b/src/bundle/Debug/DependencyInjection/IbexaDebugExtension.php index 418e4a6974..7e64eeab6b 100644 --- a/src/bundle/Debug/DependencyInjection/IbexaDebugExtension.php +++ b/src/bundle/Debug/DependencyInjection/IbexaDebugExtension.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\Debug\DependencyInjection; use Symfony\Component\Config\FileLocator; @@ -13,6 +14,7 @@ /** * @internal + * * @final */ class IbexaDebugExtension extends Extension diff --git a/src/bundle/Debug/IbexaDebugBundle.php b/src/bundle/Debug/IbexaDebugBundle.php index eeca1ebdee..b70822b426 100644 --- a/src/bundle/Debug/IbexaDebugBundle.php +++ b/src/bundle/Debug/IbexaDebugBundle.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\Debug; use Ibexa\Bundle\Debug\DependencyInjection\Compiler\DataCollectorPass; diff --git a/src/bundle/IO/ApiLoader/HandlerRegistry.php b/src/bundle/IO/ApiLoader/HandlerRegistry.php index 3e568928fb..0a28f5a5b0 100644 --- a/src/bundle/IO/ApiLoader/HandlerRegistry.php +++ b/src/bundle/IO/ApiLoader/HandlerRegistry.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\IO\ApiLoader; use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; diff --git a/src/bundle/IO/BinaryStreamResponse.php b/src/bundle/IO/BinaryStreamResponse.php index d1f0638f0a..d4f12ed1ea 100644 --- a/src/bundle/IO/BinaryStreamResponse.php +++ b/src/bundle/IO/BinaryStreamResponse.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\IO; use DateTime; diff --git a/src/bundle/IO/Command/MigrateFilesCommand.php b/src/bundle/IO/Command/MigrateFilesCommand.php index 213369d40f..302290eedb 100644 --- a/src/bundle/IO/Command/MigrateFilesCommand.php +++ b/src/bundle/IO/Command/MigrateFilesCommand.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\IO\Command; use Ibexa\Bundle\Core\Command\BackwardCompatibleCommand; diff --git a/src/bundle/IO/DependencyInjection/Compiler/IOConfigurationPass.php b/src/bundle/IO/DependencyInjection/Compiler/IOConfigurationPass.php index 097b94c782..e79b9d3862 100644 --- a/src/bundle/IO/DependencyInjection/Compiler/IOConfigurationPass.php +++ b/src/bundle/IO/DependencyInjection/Compiler/IOConfigurationPass.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\IO\DependencyInjection\Compiler; use ArrayObject; diff --git a/src/bundle/IO/DependencyInjection/Compiler/MigrationFileListerPass.php b/src/bundle/IO/DependencyInjection/Compiler/MigrationFileListerPass.php index 2f5908cd97..5ba4111631 100644 --- a/src/bundle/IO/DependencyInjection/Compiler/MigrationFileListerPass.php +++ b/src/bundle/IO/DependencyInjection/Compiler/MigrationFileListerPass.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\IO\DependencyInjection\Compiler; use Ibexa\Bundle\IO\Migration\FileListerRegistry\ConfigurableRegistry; diff --git a/src/bundle/IO/DependencyInjection/Configuration.php b/src/bundle/IO/DependencyInjection/Configuration.php index 0d599ad820..b23bbe78cd 100644 --- a/src/bundle/IO/DependencyInjection/Configuration.php +++ b/src/bundle/IO/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\IO\DependencyInjection; use ArrayObject; diff --git a/src/bundle/IO/DependencyInjection/ConfigurationFactory.php b/src/bundle/IO/DependencyInjection/ConfigurationFactory.php index 8feeda29de..a27c08549e 100644 --- a/src/bundle/IO/DependencyInjection/ConfigurationFactory.php +++ b/src/bundle/IO/DependencyInjection/ConfigurationFactory.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\IO\DependencyInjection; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; diff --git a/src/bundle/IO/DependencyInjection/ConfigurationFactory/BinarydataHandler/Flysystem.php b/src/bundle/IO/DependencyInjection/ConfigurationFactory/BinarydataHandler/Flysystem.php index f463dfddf1..8be748b5cb 100644 --- a/src/bundle/IO/DependencyInjection/ConfigurationFactory/BinarydataHandler/Flysystem.php +++ b/src/bundle/IO/DependencyInjection/ConfigurationFactory/BinarydataHandler/Flysystem.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\IO\DependencyInjection\ConfigurationFactory\BinarydataHandler; use Ibexa\Bundle\IO\DependencyInjection\ConfigurationFactory\Flysystem as BaseFactory; diff --git a/src/bundle/IO/DependencyInjection/ConfigurationFactory/Flysystem.php b/src/bundle/IO/DependencyInjection/ConfigurationFactory/Flysystem.php index b3bf3e5a21..095b97b385 100644 --- a/src/bundle/IO/DependencyInjection/ConfigurationFactory/Flysystem.php +++ b/src/bundle/IO/DependencyInjection/ConfigurationFactory/Flysystem.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\IO\DependencyInjection\ConfigurationFactory; use Ibexa\Bundle\IO\DependencyInjection\ConfigurationFactory; diff --git a/src/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/Flysystem.php b/src/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/Flysystem.php index b31246e49f..793573b001 100644 --- a/src/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/Flysystem.php +++ b/src/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/Flysystem.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\IO\DependencyInjection\ConfigurationFactory\MetadataHandler; use Ibexa\Bundle\IO\DependencyInjection\ConfigurationFactory\Flysystem as BaseFactory; diff --git a/src/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/LegacyDFSCluster.php b/src/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/LegacyDFSCluster.php index 7cc59c160e..bea2c9a959 100644 --- a/src/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/LegacyDFSCluster.php +++ b/src/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/LegacyDFSCluster.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\IO\DependencyInjection\ConfigurationFactory\MetadataHandler; use Ibexa\Bundle\IO\DependencyInjection\ConfigurationFactory; diff --git a/src/bundle/IO/DependencyInjection/IbexaIOExtension.php b/src/bundle/IO/DependencyInjection/IbexaIOExtension.php index 5a558db932..fe1987fee2 100644 --- a/src/bundle/IO/DependencyInjection/IbexaIOExtension.php +++ b/src/bundle/IO/DependencyInjection/IbexaIOExtension.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\IO\DependencyInjection; use ArrayObject; diff --git a/src/bundle/IO/EventListener/StreamFileListener.php b/src/bundle/IO/EventListener/StreamFileListener.php index 19adcca341..1b04344b49 100644 --- a/src/bundle/IO/EventListener/StreamFileListener.php +++ b/src/bundle/IO/EventListener/StreamFileListener.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\IO\EventListener; use Ibexa\Bundle\IO\BinaryStreamResponse; diff --git a/src/bundle/IO/IbexaIOBundle.php b/src/bundle/IO/IbexaIOBundle.php index 4a526cb9ed..d43611bf0b 100644 --- a/src/bundle/IO/IbexaIOBundle.php +++ b/src/bundle/IO/IbexaIOBundle.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\IO; use Ibexa\Bundle\IO\DependencyInjection\Compiler; diff --git a/src/bundle/IO/Migration/FileLister/BinaryFileLister.php b/src/bundle/IO/Migration/FileLister/BinaryFileLister.php index f002b171c8..f995e6fd13 100644 --- a/src/bundle/IO/Migration/FileLister/BinaryFileLister.php +++ b/src/bundle/IO/Migration/FileLister/BinaryFileLister.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\IO\Migration\FileLister; use Ibexa\Bundle\IO\ApiLoader\HandlerRegistry; diff --git a/src/bundle/IO/Migration/FileLister/FileIterator/LegacyStorageFileIterator.php b/src/bundle/IO/Migration/FileLister/FileIterator/LegacyStorageFileIterator.php index 57ec109144..dad0222b7d 100644 --- a/src/bundle/IO/Migration/FileLister/FileIterator/LegacyStorageFileIterator.php +++ b/src/bundle/IO/Migration/FileLister/FileIterator/LegacyStorageFileIterator.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\IO\Migration\FileLister\FileIterator; use Ibexa\Bundle\IO\Migration\FileLister\FileIteratorInterface; diff --git a/src/bundle/IO/Migration/FileLister/FileIteratorInterface.php b/src/bundle/IO/Migration/FileLister/FileIteratorInterface.php index 5e377135c0..55c3d9909f 100644 --- a/src/bundle/IO/Migration/FileLister/FileIteratorInterface.php +++ b/src/bundle/IO/Migration/FileLister/FileIteratorInterface.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\IO\Migration\FileLister; use Countable; diff --git a/src/bundle/IO/Migration/FileLister/FileRowReader/LegacyStorageBinaryFileRowReader.php b/src/bundle/IO/Migration/FileLister/FileRowReader/LegacyStorageBinaryFileRowReader.php index 6c3aef52dc..ce48f347ce 100644 --- a/src/bundle/IO/Migration/FileLister/FileRowReader/LegacyStorageBinaryFileRowReader.php +++ b/src/bundle/IO/Migration/FileLister/FileRowReader/LegacyStorageBinaryFileRowReader.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\IO\Migration\FileLister\FileRowReader; final class LegacyStorageBinaryFileRowReader extends LegacyStorageFileRowReader diff --git a/src/bundle/IO/Migration/FileLister/FileRowReader/LegacyStorageFileRowReader.php b/src/bundle/IO/Migration/FileLister/FileRowReader/LegacyStorageFileRowReader.php index 95613290f7..a264ef8bf4 100644 --- a/src/bundle/IO/Migration/FileLister/FileRowReader/LegacyStorageFileRowReader.php +++ b/src/bundle/IO/Migration/FileLister/FileRowReader/LegacyStorageFileRowReader.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\IO\Migration\FileLister\FileRowReader; use Doctrine\DBAL\Connection; diff --git a/src/bundle/IO/Migration/FileLister/FileRowReader/LegacyStorageMediaFileRowReader.php b/src/bundle/IO/Migration/FileLister/FileRowReader/LegacyStorageMediaFileRowReader.php index 32f86fc676..40dd049303 100644 --- a/src/bundle/IO/Migration/FileLister/FileRowReader/LegacyStorageMediaFileRowReader.php +++ b/src/bundle/IO/Migration/FileLister/FileRowReader/LegacyStorageMediaFileRowReader.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\IO\Migration\FileLister\FileRowReader; final class LegacyStorageMediaFileRowReader extends LegacyStorageFileRowReader diff --git a/src/bundle/IO/Migration/FileLister/FileRowReaderInterface.php b/src/bundle/IO/Migration/FileLister/FileRowReaderInterface.php index 0e740dfa79..412fb986ce 100644 --- a/src/bundle/IO/Migration/FileLister/FileRowReaderInterface.php +++ b/src/bundle/IO/Migration/FileLister/FileRowReaderInterface.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\IO\Migration\FileLister; /** diff --git a/src/bundle/IO/Migration/FileLister/ImageFileLister.php b/src/bundle/IO/Migration/FileLister/ImageFileLister.php index 5129e863f1..4c0d724647 100644 --- a/src/bundle/IO/Migration/FileLister/ImageFileLister.php +++ b/src/bundle/IO/Migration/FileLister/ImageFileLister.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\IO\Migration\FileLister; use Ibexa\Bundle\IO\ApiLoader\HandlerRegistry; diff --git a/src/bundle/IO/Migration/FileListerInterface.php b/src/bundle/IO/Migration/FileListerInterface.php index cbeba6e165..54d9fa04dc 100644 --- a/src/bundle/IO/Migration/FileListerInterface.php +++ b/src/bundle/IO/Migration/FileListerInterface.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\IO\Migration; interface FileListerInterface extends MigrationHandlerInterface diff --git a/src/bundle/IO/Migration/FileListerRegistry.php b/src/bundle/IO/Migration/FileListerRegistry.php index 3df10ef60c..f447893ebb 100644 --- a/src/bundle/IO/Migration/FileListerRegistry.php +++ b/src/bundle/IO/Migration/FileListerRegistry.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\IO\Migration; /** diff --git a/src/bundle/IO/Migration/FileListerRegistry/ConfigurableRegistry.php b/src/bundle/IO/Migration/FileListerRegistry/ConfigurableRegistry.php index 3b99c25ca7..e912e74b19 100644 --- a/src/bundle/IO/Migration/FileListerRegistry/ConfigurableRegistry.php +++ b/src/bundle/IO/Migration/FileListerRegistry/ConfigurableRegistry.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\IO\Migration\FileListerRegistry; use Ibexa\Bundle\IO\Migration\FileListerRegistry; diff --git a/src/bundle/IO/Migration/FileMigrator/FileMigrator.php b/src/bundle/IO/Migration/FileMigrator/FileMigrator.php index fec473538c..5567336310 100644 --- a/src/bundle/IO/Migration/FileMigrator/FileMigrator.php +++ b/src/bundle/IO/Migration/FileMigrator/FileMigrator.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\IO\Migration\FileMigrator; use Ibexa\Bundle\IO\Migration\FileMigratorInterface; diff --git a/src/bundle/IO/Migration/FileMigratorInterface.php b/src/bundle/IO/Migration/FileMigratorInterface.php index b84c57bcf7..245e9d70a3 100644 --- a/src/bundle/IO/Migration/FileMigratorInterface.php +++ b/src/bundle/IO/Migration/FileMigratorInterface.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\IO\Migration; use Ibexa\Contracts\Core\IO\BinaryFile; diff --git a/src/bundle/IO/Migration/MigrationHandler.php b/src/bundle/IO/Migration/MigrationHandler.php index d59eed0b88..87d48be12e 100644 --- a/src/bundle/IO/Migration/MigrationHandler.php +++ b/src/bundle/IO/Migration/MigrationHandler.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\IO\Migration; use Ibexa\Bundle\IO\ApiLoader\HandlerRegistry; diff --git a/src/bundle/IO/Migration/MigrationHandlerInterface.php b/src/bundle/IO/Migration/MigrationHandlerInterface.php index 793a715c98..6dc64f422d 100644 --- a/src/bundle/IO/Migration/MigrationHandlerInterface.php +++ b/src/bundle/IO/Migration/MigrationHandlerInterface.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\IO\Migration; interface MigrationHandlerInterface diff --git a/src/bundle/LegacySearchEngine/ApiLoader/ConnectionFactory.php b/src/bundle/LegacySearchEngine/ApiLoader/ConnectionFactory.php index be802fe2b7..46f23aa720 100644 --- a/src/bundle/LegacySearchEngine/ApiLoader/ConnectionFactory.php +++ b/src/bundle/LegacySearchEngine/ApiLoader/ConnectionFactory.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\LegacySearchEngine\ApiLoader; use Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider; diff --git a/src/bundle/LegacySearchEngine/DependencyInjection/IbexaLegacySearchEngineExtension.php b/src/bundle/LegacySearchEngine/DependencyInjection/IbexaLegacySearchEngineExtension.php index 0f7f47aecb..f5d745bb2e 100644 --- a/src/bundle/LegacySearchEngine/DependencyInjection/IbexaLegacySearchEngineExtension.php +++ b/src/bundle/LegacySearchEngine/DependencyInjection/IbexaLegacySearchEngineExtension.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\LegacySearchEngine\DependencyInjection; use Symfony\Component\Config\FileLocator; diff --git a/src/bundle/LegacySearchEngine/IbexaLegacySearchEngineBundle.php b/src/bundle/LegacySearchEngine/IbexaLegacySearchEngineBundle.php index 2110f94a71..bea1756337 100644 --- a/src/bundle/LegacySearchEngine/IbexaLegacySearchEngineBundle.php +++ b/src/bundle/LegacySearchEngine/IbexaLegacySearchEngineBundle.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\LegacySearchEngine; use Ibexa\Core\Base\Container\Compiler\Search\FieldRegistryPass; diff --git a/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php b/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php index 0011d9d37c..55e7123ab1 100644 --- a/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php +++ b/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.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\RepositoryInstaller\Command; use Doctrine\DBAL\Connection; @@ -88,7 +89,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $schemaManager = $this->connection->getSchemaManager(); if (!empty($schemaManager->listTables())) { $io = new SymfonyStyle($input, $output); - if (!$io->confirm('Running this command will delete data in all Ibexa generated tables. Continue?', )) { + if (!$io->confirm('Running this command will delete data in all Ibexa generated tables. Continue?')) { return 0; } } diff --git a/src/bundle/RepositoryInstaller/Command/ValidatePasswordHashesCommand.php b/src/bundle/RepositoryInstaller/Command/ValidatePasswordHashesCommand.php index 74db9309c6..faba75b0e1 100644 --- a/src/bundle/RepositoryInstaller/Command/ValidatePasswordHashesCommand.php +++ b/src/bundle/RepositoryInstaller/Command/ValidatePasswordHashesCommand.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\RepositoryInstaller\Command; use Ibexa\Bundle\Core\Command\BackwardCompatibleCommand; diff --git a/src/bundle/RepositoryInstaller/DependencyInjection/Compiler/InstallerTagPass.php b/src/bundle/RepositoryInstaller/DependencyInjection/Compiler/InstallerTagPass.php index cf0df72c3e..ef01fcbef5 100644 --- a/src/bundle/RepositoryInstaller/DependencyInjection/Compiler/InstallerTagPass.php +++ b/src/bundle/RepositoryInstaller/DependencyInjection/Compiler/InstallerTagPass.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\RepositoryInstaller\DependencyInjection\Compiler; use Ibexa\Bundle\RepositoryInstaller\Command\InstallPlatformCommand; diff --git a/src/bundle/RepositoryInstaller/DependencyInjection/IbexaRepositoryInstallerExtension.php b/src/bundle/RepositoryInstaller/DependencyInjection/IbexaRepositoryInstallerExtension.php index 87f8cfd728..dae6b66a7e 100644 --- a/src/bundle/RepositoryInstaller/DependencyInjection/IbexaRepositoryInstallerExtension.php +++ b/src/bundle/RepositoryInstaller/DependencyInjection/IbexaRepositoryInstallerExtension.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\RepositoryInstaller\DependencyInjection; use Symfony\Component\Config\FileLocator; diff --git a/src/bundle/RepositoryInstaller/IbexaRepositoryInstallerBundle.php b/src/bundle/RepositoryInstaller/IbexaRepositoryInstallerBundle.php index b5934d8080..497b7c21ad 100644 --- a/src/bundle/RepositoryInstaller/IbexaRepositoryInstallerBundle.php +++ b/src/bundle/RepositoryInstaller/IbexaRepositoryInstallerBundle.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\RepositoryInstaller; use Ibexa\Bundle\DoctrineSchema\DoctrineSchemaBundle; diff --git a/src/bundle/RepositoryInstaller/Installer/DbBasedInstaller.php b/src/bundle/RepositoryInstaller/Installer/DbBasedInstaller.php index 5c343563e4..06a21973b0 100644 --- a/src/bundle/RepositoryInstaller/Installer/DbBasedInstaller.php +++ b/src/bundle/RepositoryInstaller/Installer/DbBasedInstaller.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\RepositoryInstaller\Installer; use Doctrine\DBAL\Connection; diff --git a/src/bundle/RepositoryInstaller/Installer/Installer.php b/src/bundle/RepositoryInstaller/Installer/Installer.php index c9d95c46ed..80640b6a90 100644 --- a/src/bundle/RepositoryInstaller/Installer/Installer.php +++ b/src/bundle/RepositoryInstaller/Installer/Installer.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\RepositoryInstaller\Installer; /** diff --git a/src/contracts/Collection/ArrayList.php b/src/contracts/Collection/ArrayList.php index 4a639645a8..738335b76a 100644 --- a/src/contracts/Collection/ArrayList.php +++ b/src/contracts/Collection/ArrayList.php @@ -14,6 +14,7 @@ * @template TValue * * @template-extends \Ibexa\Contracts\Core\Collection\AbstractInMemoryCollection + * * @template-implements \Ibexa\Contracts\Core\Collection\ListInterface */ class ArrayList extends AbstractInMemoryCollection implements ListInterface diff --git a/src/contracts/Collection/ArrayMap.php b/src/contracts/Collection/ArrayMap.php index 698dc3a0f7..cf7109d7b4 100644 --- a/src/contracts/Collection/ArrayMap.php +++ b/src/contracts/Collection/ArrayMap.php @@ -15,6 +15,7 @@ * @template TValue * * @template-extends \Ibexa\Contracts\Core\Collection\AbstractInMemoryCollection + * * @template-implements \Ibexa\Contracts\Core\Collection\MapInterface */ class ArrayMap extends AbstractInMemoryCollection implements MapInterface diff --git a/src/contracts/Collection/MutableArrayList.php b/src/contracts/Collection/MutableArrayList.php index ef8958c5f4..90d8d201b5 100644 --- a/src/contracts/Collection/MutableArrayList.php +++ b/src/contracts/Collection/MutableArrayList.php @@ -12,6 +12,7 @@ * @template TValue * * @template-extends \Ibexa\Contracts\Core\Collection\ArrayList + * * @template-implements \Ibexa\Contracts\Core\Collection\MutableListInterface */ class MutableArrayList extends ArrayList implements MutableListInterface diff --git a/src/contracts/Collection/MutableArrayMap.php b/src/contracts/Collection/MutableArrayMap.php index 3dbbf96d18..c185e92164 100644 --- a/src/contracts/Collection/MutableArrayMap.php +++ b/src/contracts/Collection/MutableArrayMap.php @@ -13,6 +13,7 @@ * @template TValue * * @template-extends \Ibexa\Contracts\Core\Collection\ArrayMap + * * @template-implements \Ibexa\Contracts\Core\Collection\MutableMapInterface */ class MutableArrayMap extends ArrayMap implements MutableMapInterface diff --git a/src/contracts/Container.php b/src/contracts/Container.php index 0998f158ab..29856c9771 100644 --- a/src/contracts/Container.php +++ b/src/contracts/Container.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\Core; /** diff --git a/src/contracts/FieldType/BinaryBase/PathGenerator.php b/src/contracts/FieldType/BinaryBase/PathGenerator.php index 1b2271c930..db5f9fac26 100644 --- a/src/contracts/FieldType/BinaryBase/PathGenerator.php +++ b/src/contracts/FieldType/BinaryBase/PathGenerator.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\Core\FieldType\BinaryBase; use Ibexa\Contracts\Core\Persistence\Content\Field; diff --git a/src/contracts/FieldType/FieldStorage.php b/src/contracts/FieldType/FieldStorage.php index 73abe9d907..20b15013f3 100644 --- a/src/contracts/FieldType/FieldStorage.php +++ b/src/contracts/FieldType/FieldStorage.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\Core\FieldType; use Ibexa\Contracts\Core\Persistence\Content\Field; diff --git a/src/contracts/FieldType/FieldType.php b/src/contracts/FieldType/FieldType.php index bf037e25aa..350ad241fc 100644 --- a/src/contracts/FieldType/FieldType.php +++ b/src/contracts/FieldType/FieldType.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\Core\FieldType; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/contracts/FieldType/GatewayBasedStorage.php b/src/contracts/FieldType/GatewayBasedStorage.php index 6f3fff0934..93f6f8332d 100644 --- a/src/contracts/FieldType/GatewayBasedStorage.php +++ b/src/contracts/FieldType/GatewayBasedStorage.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\Core\FieldType; use Ibexa\Contracts\Core\Persistence\Content\Field; @@ -20,12 +21,14 @@ abstract class GatewayBasedStorage implements FieldStorage * Field Type External Storage Gateway. * * @var \Ibexa\Contracts\Core\FieldType\StorageGatewayInterface + * * @phpstan-var T */ protected $gateway; /** * @param \Ibexa\Contracts\Core\FieldType\StorageGatewayInterface $gateway + * * @phpstan-param T $gateway */ public function __construct(StorageGatewayInterface $gateway) diff --git a/src/contracts/FieldType/Indexable.php b/src/contracts/FieldType/Indexable.php index 1229d34279..4bc7eda331 100644 --- a/src/contracts/FieldType/Indexable.php +++ b/src/contracts/FieldType/Indexable.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\Core\FieldType; use Ibexa\Contracts\Core\Persistence\Content\Field; diff --git a/src/contracts/FieldType/StorageGateway.php b/src/contracts/FieldType/StorageGateway.php index 07688479ac..5219135508 100644 --- a/src/contracts/FieldType/StorageGateway.php +++ b/src/contracts/FieldType/StorageGateway.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\Core\FieldType; /** diff --git a/src/contracts/FieldType/ValidationError.php b/src/contracts/FieldType/ValidationError.php index 23f1170ce0..a303afc89f 100644 --- a/src/contracts/FieldType/ValidationError.php +++ b/src/contracts/FieldType/ValidationError.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\Core\FieldType; use Ibexa\Contracts\Core\Repository\Translatable; diff --git a/src/contracts/FieldType/Value.php b/src/contracts/FieldType/Value.php index f58deadf24..3a9e92c316 100644 --- a/src/contracts/FieldType/Value.php +++ b/src/contracts/FieldType/Value.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\Core\FieldType; /** diff --git a/src/contracts/HashGenerator.php b/src/contracts/HashGenerator.php index 5b18106647..5aa871674f 100644 --- a/src/contracts/HashGenerator.php +++ b/src/contracts/HashGenerator.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\Core; interface HashGenerator diff --git a/src/contracts/IO/BinaryFile.php b/src/contracts/IO/BinaryFile.php index 5f292d1422..eaec6c39e0 100644 --- a/src/contracts/IO/BinaryFile.php +++ b/src/contracts/IO/BinaryFile.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\Core\IO; /** diff --git a/src/contracts/IO/BinaryFileCreateStruct.php b/src/contracts/IO/BinaryFileCreateStruct.php index 24ce7547ec..cda1528408 100644 --- a/src/contracts/IO/BinaryFileCreateStruct.php +++ b/src/contracts/IO/BinaryFileCreateStruct.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\Core\IO; /** diff --git a/src/contracts/IO/MimeTypeDetector.php b/src/contracts/IO/MimeTypeDetector.php index 8b8c80d419..cda2100fe6 100644 --- a/src/contracts/IO/MimeTypeDetector.php +++ b/src/contracts/IO/MimeTypeDetector.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\Core\IO; interface MimeTypeDetector diff --git a/src/contracts/Limitation/Type.php b/src/contracts/Limitation/Type.php index 27dec76b79..5a65b8d401 100644 --- a/src/contracts/Limitation/Type.php +++ b/src/contracts/Limitation/Type.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\Core\Limitation; use Ibexa\Contracts\Core\Repository\Values\User\Limitation as APILimitationValue; diff --git a/src/contracts/Persistence/Content.php b/src/contracts/Persistence/Content.php index 5e77891c4c..fbcbda583c 100644 --- a/src/contracts/Persistence/Content.php +++ b/src/contracts/Persistence/Content.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\Core\Persistence; /** diff --git a/src/contracts/Persistence/Content/ContentInfo.php b/src/contracts/Persistence/Content/ContentInfo.php index 108a247625..b065220c18 100644 --- a/src/contracts/Persistence/Content/ContentInfo.php +++ b/src/contracts/Persistence/Content/ContentInfo.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/CreateStruct.php b/src/contracts/Persistence/Content/CreateStruct.php index c4eb7f4dd9..11f604020a 100644 --- a/src/contracts/Persistence/Content/CreateStruct.php +++ b/src/contracts/Persistence/Content/CreateStruct.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Field.php b/src/contracts/Persistence/Content/Field.php index 7c45810edd..94f844f868 100644 --- a/src/contracts/Persistence/Content/Field.php +++ b/src/contracts/Persistence/Content/Field.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/FieldTypeConstraints.php b/src/contracts/Persistence/Content/FieldTypeConstraints.php index ad28914353..e4b59f7226 100644 --- a/src/contracts/Persistence/Content/FieldTypeConstraints.php +++ b/src/contracts/Persistence/Content/FieldTypeConstraints.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/FieldValue.php b/src/contracts/Persistence/Content/FieldValue.php index f946b467bf..816229b7fa 100644 --- a/src/contracts/Persistence/Content/FieldValue.php +++ b/src/contracts/Persistence/Content/FieldValue.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Handler.php b/src/contracts/Persistence/Content/Handler.php index 5bfb72ed37..4c2a573bbf 100644 --- a/src/contracts/Persistence/Content/Handler.php +++ b/src/contracts/Persistence/Content/Handler.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\Core\Persistence\Content; // @todo We must verify whether we want to type cast on the "Criterion" interface or abstract class diff --git a/src/contracts/Persistence/Content/Language.php b/src/contracts/Persistence/Content/Language.php index eb80b7a084..47620294b5 100644 --- a/src/contracts/Persistence/Content/Language.php +++ b/src/contracts/Persistence/Content/Language.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Language/CreateStruct.php b/src/contracts/Persistence/Content/Language/CreateStruct.php index c695c265ac..0fd75c6b44 100644 --- a/src/contracts/Persistence/Content/Language/CreateStruct.php +++ b/src/contracts/Persistence/Content/Language/CreateStruct.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\Core\Persistence\Content\Language; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Language/Handler.php b/src/contracts/Persistence/Content/Language/Handler.php index 521adcb940..68e919aa39 100644 --- a/src/contracts/Persistence/Content/Language/Handler.php +++ b/src/contracts/Persistence/Content/Language/Handler.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\Core\Persistence\Content\Language; use Ibexa\Contracts\Core\Persistence\Content\Language; diff --git a/src/contracts/Persistence/Content/LoadStruct.php b/src/contracts/Persistence/Content/LoadStruct.php index 1af40edf9e..fe17b360ca 100644 --- a/src/contracts/Persistence/Content/LoadStruct.php +++ b/src/contracts/Persistence/Content/LoadStruct.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Location.php b/src/contracts/Persistence/Content/Location.php index 381ba567f7..8862c9d8fe 100644 --- a/src/contracts/Persistence/Content/Location.php +++ b/src/contracts/Persistence/Content/Location.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Location/CreateStruct.php b/src/contracts/Persistence/Content/Location/CreateStruct.php index 7d928fb11f..0788dcf6e6 100644 --- a/src/contracts/Persistence/Content/Location/CreateStruct.php +++ b/src/contracts/Persistence/Content/Location/CreateStruct.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\Core\Persistence\Content\Location; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Location/Handler.php b/src/contracts/Persistence/Content/Location/Handler.php index 0fbea26996..8f143ffc7a 100644 --- a/src/contracts/Persistence/Content/Location/Handler.php +++ b/src/contracts/Persistence/Content/Location/Handler.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\Core\Persistence\Content\Location; use Ibexa\Contracts\Core\Persistence\Content\Location; diff --git a/src/contracts/Persistence/Content/Location/Trash/Handler.php b/src/contracts/Persistence/Content/Location/Trash/Handler.php index 99bc01f0d5..e97e3a841c 100644 --- a/src/contracts/Persistence/Content/Location/Trash/Handler.php +++ b/src/contracts/Persistence/Content/Location/Trash/Handler.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\Core\Persistence\Content\Location\Trash; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; diff --git a/src/contracts/Persistence/Content/Location/Trash/TrashResult.php b/src/contracts/Persistence/Content/Location/Trash/TrashResult.php index a5181bcc3a..7eae9c17b2 100644 --- a/src/contracts/Persistence/Content/Location/Trash/TrashResult.php +++ b/src/contracts/Persistence/Content/Location/Trash/TrashResult.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\Core\Persistence\Content\Location\Trash; use ArrayIterator; diff --git a/src/contracts/Persistence/Content/Location/Trashed.php b/src/contracts/Persistence/Content/Location/Trashed.php index e643a31c9e..8688fc6878 100644 --- a/src/contracts/Persistence/Content/Location/Trashed.php +++ b/src/contracts/Persistence/Content/Location/Trashed.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\Core\Persistence\Content\Location; use Ibexa\Contracts\Core\Persistence\Content\Location; diff --git a/src/contracts/Persistence/Content/Location/UpdateStruct.php b/src/contracts/Persistence/Content/Location/UpdateStruct.php index afb3db2a03..7c910d38a3 100644 --- a/src/contracts/Persistence/Content/Location/UpdateStruct.php +++ b/src/contracts/Persistence/Content/Location/UpdateStruct.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\Core\Persistence\Content\Location; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/MetadataUpdateStruct.php b/src/contracts/Persistence/Content/MetadataUpdateStruct.php index 6b19f3a013..40b39ffbad 100644 --- a/src/contracts/Persistence/Content/MetadataUpdateStruct.php +++ b/src/contracts/Persistence/Content/MetadataUpdateStruct.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/ObjectState.php b/src/contracts/Persistence/Content/ObjectState.php index b95d4ffffd..816795d347 100644 --- a/src/contracts/Persistence/Content/ObjectState.php +++ b/src/contracts/Persistence/Content/ObjectState.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/ObjectState/Group.php b/src/contracts/Persistence/Content/ObjectState/Group.php index 1d9c58bb6a..a17bd121e8 100644 --- a/src/contracts/Persistence/Content/ObjectState/Group.php +++ b/src/contracts/Persistence/Content/ObjectState/Group.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\Core\Persistence\Content\ObjectState; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/ObjectState/Handler.php b/src/contracts/Persistence/Content/ObjectState/Handler.php index 48bc70740a..6138e0561f 100644 --- a/src/contracts/Persistence/Content/ObjectState/Handler.php +++ b/src/contracts/Persistence/Content/ObjectState/Handler.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\Core\Persistence\Content\ObjectState; /** diff --git a/src/contracts/Persistence/Content/ObjectState/InputStruct.php b/src/contracts/Persistence/Content/ObjectState/InputStruct.php index ac87663f92..ac95a1f504 100644 --- a/src/contracts/Persistence/Content/ObjectState/InputStruct.php +++ b/src/contracts/Persistence/Content/ObjectState/InputStruct.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\Core\Persistence\Content\ObjectState; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Relation.php b/src/contracts/Persistence/Content/Relation.php index 502c972faa..7418b070d1 100644 --- a/src/contracts/Persistence/Content/Relation.php +++ b/src/contracts/Persistence/Content/Relation.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Relation/CreateStruct.php b/src/contracts/Persistence/Content/Relation/CreateStruct.php index 3c046ffa36..8de92e6625 100644 --- a/src/contracts/Persistence/Content/Relation/CreateStruct.php +++ b/src/contracts/Persistence/Content/Relation/CreateStruct.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\Core\Persistence\Content\Relation; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Section.php b/src/contracts/Persistence/Content/Section.php index ba6a064ca1..c465b9c9c0 100644 --- a/src/contracts/Persistence/Content/Section.php +++ b/src/contracts/Persistence/Content/Section.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Section/Handler.php b/src/contracts/Persistence/Content/Section/Handler.php index 399b174dd7..e263dfab76 100644 --- a/src/contracts/Persistence/Content/Section/Handler.php +++ b/src/contracts/Persistence/Content/Section/Handler.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\Core\Persistence\Content\Section; interface Handler diff --git a/src/contracts/Persistence/Content/Type.php b/src/contracts/Persistence/Content/Type.php index b24c7a6d37..a22dd7ea1e 100644 --- a/src/contracts/Persistence/Content/Type.php +++ b/src/contracts/Persistence/Content/Type.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Type/CreateStruct.php b/src/contracts/Persistence/Content/Type/CreateStruct.php index e86d3a7578..59689e724d 100644 --- a/src/contracts/Persistence/Content/Type/CreateStruct.php +++ b/src/contracts/Persistence/Content/Type/CreateStruct.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\Core\Persistence\Content\Type; use Ibexa\Contracts\Core\Persistence\Content\Location; diff --git a/src/contracts/Persistence/Content/Type/DeleteByParamsStruct.php b/src/contracts/Persistence/Content/Type/DeleteByParamsStruct.php index 69bdfa07e5..90427da0e3 100644 --- a/src/contracts/Persistence/Content/Type/DeleteByParamsStruct.php +++ b/src/contracts/Persistence/Content/Type/DeleteByParamsStruct.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\Core\Persistence\Content\Type; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Type/FieldDefinition.php b/src/contracts/Persistence/Content/Type/FieldDefinition.php index f584ce4434..54ac445bf6 100644 --- a/src/contracts/Persistence/Content/Type/FieldDefinition.php +++ b/src/contracts/Persistence/Content/Type/FieldDefinition.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\Core\Persistence\Content\Type; use Ibexa\Contracts\Core\Persistence\Content\FieldTypeConstraints; diff --git a/src/contracts/Persistence/Content/Type/Group.php b/src/contracts/Persistence/Content/Type/Group.php index fde5eceb8b..689966ef51 100644 --- a/src/contracts/Persistence/Content/Type/Group.php +++ b/src/contracts/Persistence/Content/Type/Group.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\Core\Persistence\Content\Type; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Type/Group/CreateStruct.php b/src/contracts/Persistence/Content/Type/Group/CreateStruct.php index 5f643e6745..d8206876c0 100644 --- a/src/contracts/Persistence/Content/Type/Group/CreateStruct.php +++ b/src/contracts/Persistence/Content/Type/Group/CreateStruct.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\Core\Persistence\Content\Type\Group; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Type/Group/UpdateStruct.php b/src/contracts/Persistence/Content/Type/Group/UpdateStruct.php index e9d93727f6..f745e09fb3 100644 --- a/src/contracts/Persistence/Content/Type/Group/UpdateStruct.php +++ b/src/contracts/Persistence/Content/Type/Group/UpdateStruct.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\Core\Persistence\Content\Type\Group; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/Type/Handler.php b/src/contracts/Persistence/Content/Type/Handler.php index 586d4d3eda..d8f4a40b92 100644 --- a/src/contracts/Persistence/Content/Type/Handler.php +++ b/src/contracts/Persistence/Content/Type/Handler.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\Core\Persistence\Content\Type; use Ibexa\Contracts\Core\Persistence\Content\Type; diff --git a/src/contracts/Persistence/Content/Type/UpdateStruct.php b/src/contracts/Persistence/Content/Type/UpdateStruct.php index 3c6a1783e3..085b06636f 100644 --- a/src/contracts/Persistence/Content/Type/UpdateStruct.php +++ b/src/contracts/Persistence/Content/Type/UpdateStruct.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\Core\Persistence\Content\Type; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/UpdateStruct.php b/src/contracts/Persistence/Content/UpdateStruct.php index a7d0b6e479..6d9a382f49 100644 --- a/src/contracts/Persistence/Content/UpdateStruct.php +++ b/src/contracts/Persistence/Content/UpdateStruct.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/UrlAlias.php b/src/contracts/Persistence/Content/UrlAlias.php index 3d3aa741a4..67397f7b02 100644 --- a/src/contracts/Persistence/Content/UrlAlias.php +++ b/src/contracts/Persistence/Content/UrlAlias.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/UrlAlias/Handler.php b/src/contracts/Persistence/Content/UrlAlias/Handler.php index 1899770d73..eaf439f319 100644 --- a/src/contracts/Persistence/Content/UrlAlias/Handler.php +++ b/src/contracts/Persistence/Content/UrlAlias/Handler.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\Core\Persistence\Content\UrlAlias; /** diff --git a/src/contracts/Persistence/Content/UrlWildcard.php b/src/contracts/Persistence/Content/UrlWildcard.php index 57345165a5..4b46a3f7d1 100644 --- a/src/contracts/Persistence/Content/UrlWildcard.php +++ b/src/contracts/Persistence/Content/UrlWildcard.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/Content/UrlWildcard/Handler.php b/src/contracts/Persistence/Content/UrlWildcard/Handler.php index 5ba68a395f..6ee91415aa 100644 --- a/src/contracts/Persistence/Content/UrlWildcard/Handler.php +++ b/src/contracts/Persistence/Content/UrlWildcard/Handler.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\Core\Persistence\Content\UrlWildcard; use Ibexa\Contracts\Core\Persistence\Content\UrlWildcard; diff --git a/src/contracts/Persistence/Content/VersionInfo.php b/src/contracts/Persistence/Content/VersionInfo.php index edeb285c8d..c2a77fa2fe 100644 --- a/src/contracts/Persistence/Content/VersionInfo.php +++ b/src/contracts/Persistence/Content/VersionInfo.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\Core\Persistence\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/FieldType.php b/src/contracts/Persistence/FieldType.php index 9a24d26389..9f00954d12 100644 --- a/src/contracts/Persistence/FieldType.php +++ b/src/contracts/Persistence/FieldType.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\Core\Persistence; /** diff --git a/src/contracts/Persistence/FieldType/IsEmptyValue.php b/src/contracts/Persistence/FieldType/IsEmptyValue.php index c5f672c299..bb3f21eecb 100644 --- a/src/contracts/Persistence/FieldType/IsEmptyValue.php +++ b/src/contracts/Persistence/FieldType/IsEmptyValue.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\Core\Persistence\FieldType; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/contracts/Persistence/TransactionHandler.php b/src/contracts/Persistence/TransactionHandler.php index 77a4e0614d..d377aecbfa 100644 --- a/src/contracts/Persistence/TransactionHandler.php +++ b/src/contracts/Persistence/TransactionHandler.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\Core\Persistence; /** diff --git a/src/contracts/Persistence/URL/Handler.php b/src/contracts/Persistence/URL/Handler.php index df1f4edfbf..79001ed9eb 100644 --- a/src/contracts/Persistence/URL/Handler.php +++ b/src/contracts/Persistence/URL/Handler.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\Core\Persistence\URL; use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery; diff --git a/src/contracts/Persistence/URL/URL.php b/src/contracts/Persistence/URL/URL.php index b2f8dd3935..4aec2bd608 100644 --- a/src/contracts/Persistence/URL/URL.php +++ b/src/contracts/Persistence/URL/URL.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\Core\Persistence\URL; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/URL/URLUpdateStruct.php b/src/contracts/Persistence/URL/URLUpdateStruct.php index 4df429051d..5858d84dbc 100644 --- a/src/contracts/Persistence/URL/URLUpdateStruct.php +++ b/src/contracts/Persistence/URL/URLUpdateStruct.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\Core\Persistence\URL; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/User.php b/src/contracts/Persistence/User.php index 5e6351d123..2aaa50147a 100644 --- a/src/contracts/Persistence/User.php +++ b/src/contracts/Persistence/User.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\Core\Persistence; class User extends ValueObject diff --git a/src/contracts/Persistence/User/Handler.php b/src/contracts/Persistence/User/Handler.php index e479ef5abe..e822b208e3 100644 --- a/src/contracts/Persistence/User/Handler.php +++ b/src/contracts/Persistence/User/Handler.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\Core\Persistence\User; use Ibexa\Contracts\Core\Persistence\User; diff --git a/src/contracts/Persistence/User/Policy.php b/src/contracts/Persistence/User/Policy.php index fb39e2013f..37f0d73986 100644 --- a/src/contracts/Persistence/User/Policy.php +++ b/src/contracts/Persistence/User/Policy.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\Core\Persistence\User; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/User/Role.php b/src/contracts/Persistence/User/Role.php index 176b188b4f..cb84fb7239 100644 --- a/src/contracts/Persistence/User/Role.php +++ b/src/contracts/Persistence/User/Role.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\Core\Persistence\User; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/User/RoleAssignment.php b/src/contracts/Persistence/User/RoleAssignment.php index 85999780b0..629f088454 100644 --- a/src/contracts/Persistence/User/RoleAssignment.php +++ b/src/contracts/Persistence/User/RoleAssignment.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\Core\Persistence\User; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/User/RoleCreateStruct.php b/src/contracts/Persistence/User/RoleCreateStruct.php index ee0fae508f..628fcc2681 100644 --- a/src/contracts/Persistence/User/RoleCreateStruct.php +++ b/src/contracts/Persistence/User/RoleCreateStruct.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\Core\Persistence\User; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/User/RoleUpdateStruct.php b/src/contracts/Persistence/User/RoleUpdateStruct.php index 5080c86b93..2303710c63 100644 --- a/src/contracts/Persistence/User/RoleUpdateStruct.php +++ b/src/contracts/Persistence/User/RoleUpdateStruct.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\Core\Persistence\User; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/User/UserTokenUpdateStruct.php b/src/contracts/Persistence/User/UserTokenUpdateStruct.php index 771d354362..c870e48184 100644 --- a/src/contracts/Persistence/User/UserTokenUpdateStruct.php +++ b/src/contracts/Persistence/User/UserTokenUpdateStruct.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\Core\Persistence\User; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Persistence/ValueObject.php b/src/contracts/Persistence/ValueObject.php index e577ceb3cd..e49b91807b 100644 --- a/src/contracts/Persistence/ValueObject.php +++ b/src/contracts/Persistence/ValueObject.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\Core\Persistence; use Ibexa\Contracts\Core\Repository\Values\ValueObject as APIValueObject; diff --git a/src/contracts/Repository/LanguageService.php b/src/contracts/Repository/LanguageService.php index bf3b3b574e..b9c0ec4943 100644 --- a/src/contracts/Repository/LanguageService.php +++ b/src/contracts/Repository/LanguageService.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\Core\Repository; use Ibexa\Contracts\Core\Repository\Values\Content\Language; diff --git a/src/contracts/Repository/ObjectStateService.php b/src/contracts/Repository/ObjectStateService.php index 0b1a3f74f7..74f84b2309 100644 --- a/src/contracts/Repository/ObjectStateService.php +++ b/src/contracts/Repository/ObjectStateService.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\Core\Repository; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/contracts/Repository/RoleService.php b/src/contracts/Repository/RoleService.php index 5332b69cc5..e9ccb7b700 100644 --- a/src/contracts/Repository/RoleService.php +++ b/src/contracts/Repository/RoleService.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\Core\Repository; use Ibexa\Contracts\Core\Limitation\Type; diff --git a/src/contracts/Repository/Translatable.php b/src/contracts/Repository/Translatable.php index 68ab807b74..af9780a120 100644 --- a/src/contracts/Repository/Translatable.php +++ b/src/contracts/Repository/Translatable.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\Core\Repository; /** diff --git a/src/contracts/Repository/TranslationService.php b/src/contracts/Repository/TranslationService.php index 51571c1b27..0286701c45 100644 --- a/src/contracts/Repository/TranslationService.php +++ b/src/contracts/Repository/TranslationService.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\Core\Repository; use Ibexa\Contracts\Core\Repository\Values\Translation; diff --git a/src/contracts/Repository/Values/Content/Query/FacetBuilder/DateRangeFacetBuilder.php b/src/contracts/Repository/Values/Content/Query/FacetBuilder/DateRangeFacetBuilder.php index 9cedb17322..bd708e04e4 100644 --- a/src/contracts/Repository/Values/Content/Query/FacetBuilder/DateRangeFacetBuilder.php +++ b/src/contracts/Repository/Values/Content/Query/FacetBuilder/DateRangeFacetBuilder.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\Core\Repository\Values\Content\Query\FacetBuilder; use Ibexa\Contracts\Core\Repository\Values\Content\Query\FacetBuilder; diff --git a/src/contracts/Repository/Values/MultiLanguageDescription.php b/src/contracts/Repository/Values/MultiLanguageDescription.php index d0e030949d..45c86df574 100644 --- a/src/contracts/Repository/Values/MultiLanguageDescription.php +++ b/src/contracts/Repository/Values/MultiLanguageDescription.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\Core\Repository\Values; /** diff --git a/src/contracts/Repository/Values/MultiLanguageName.php b/src/contracts/Repository/Values/MultiLanguageName.php index cfb7e9b5a5..344942d937 100644 --- a/src/contracts/Repository/Values/MultiLanguageName.php +++ b/src/contracts/Repository/Values/MultiLanguageName.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\Core\Repository\Values; /** diff --git a/src/contracts/Repository/Values/Translation/Message.php b/src/contracts/Repository/Values/Translation/Message.php index e53244b335..08c060bb93 100644 --- a/src/contracts/Repository/Values/Translation/Message.php +++ b/src/contracts/Repository/Values/Translation/Message.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\Core\Repository\Values\Translation; use Ibexa\Contracts\Core\Repository\Values\Translation; diff --git a/src/contracts/Repository/Values/Translation/Plural.php b/src/contracts/Repository/Values/Translation/Plural.php index 4285506687..c104068ca8 100644 --- a/src/contracts/Repository/Values/Translation/Plural.php +++ b/src/contracts/Repository/Values/Translation/Plural.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\Core\Repository\Values\Translation; use Ibexa\Contracts\Core\Repository\Values\Translation; diff --git a/src/contracts/Repository/Values/ValueObject.php b/src/contracts/Repository/Values/ValueObject.php index 3aa5b81e76..40195ed9e9 100644 --- a/src/contracts/Repository/Values/ValueObject.php +++ b/src/contracts/Repository/Values/ValueObject.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\Core\Repository\Values; use Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException; diff --git a/src/contracts/Search/Document.php b/src/contracts/Search/Document.php index 8f5ef3acd6..3203d26aca 100644 --- a/src/contracts/Search/Document.php +++ b/src/contracts/Search/Document.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\Core\Search; use Ibexa\Contracts\Core\Repository\Values\ValueObject; diff --git a/src/contracts/Search/Field.php b/src/contracts/Search/Field.php index 54245d2aa6..48e17b58d6 100644 --- a/src/contracts/Search/Field.php +++ b/src/contracts/Search/Field.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\Core\Search; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Search/FieldType.php b/src/contracts/Search/FieldType.php index 5163df332c..c8bb88c0c2 100644 --- a/src/contracts/Search/FieldType.php +++ b/src/contracts/Search/FieldType.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\Core\Search; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/contracts/Search/FieldType/BooleanField.php b/src/contracts/Search/FieldType/BooleanField.php index 60d50e479d..cb82ef1e62 100644 --- a/src/contracts/Search/FieldType/BooleanField.php +++ b/src/contracts/Search/FieldType/BooleanField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/CustomField.php b/src/contracts/Search/FieldType/CustomField.php index 102f598b82..42258e9eff 100644 --- a/src/contracts/Search/FieldType/CustomField.php +++ b/src/contracts/Search/FieldType/CustomField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/DateField.php b/src/contracts/Search/FieldType/DateField.php index dea29d1747..dca1601225 100644 --- a/src/contracts/Search/FieldType/DateField.php +++ b/src/contracts/Search/FieldType/DateField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/DocumentField.php b/src/contracts/Search/FieldType/DocumentField.php index c08c18eb5c..23c79fcc0a 100644 --- a/src/contracts/Search/FieldType/DocumentField.php +++ b/src/contracts/Search/FieldType/DocumentField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/FloatField.php b/src/contracts/Search/FieldType/FloatField.php index 6a4a2c3e19..8bef513295 100644 --- a/src/contracts/Search/FieldType/FloatField.php +++ b/src/contracts/Search/FieldType/FloatField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/FullTextField.php b/src/contracts/Search/FieldType/FullTextField.php index b430603963..28fc3f8216 100644 --- a/src/contracts/Search/FieldType/FullTextField.php +++ b/src/contracts/Search/FieldType/FullTextField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/GeoLocationField.php b/src/contracts/Search/FieldType/GeoLocationField.php index a514d765ca..afa1ec080e 100644 --- a/src/contracts/Search/FieldType/GeoLocationField.php +++ b/src/contracts/Search/FieldType/GeoLocationField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/IdentifierField.php b/src/contracts/Search/FieldType/IdentifierField.php index 552e931c80..341536806a 100644 --- a/src/contracts/Search/FieldType/IdentifierField.php +++ b/src/contracts/Search/FieldType/IdentifierField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/IntegerField.php b/src/contracts/Search/FieldType/IntegerField.php index 115773d8b0..acafba82b1 100644 --- a/src/contracts/Search/FieldType/IntegerField.php +++ b/src/contracts/Search/FieldType/IntegerField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/MultipleBooleanField.php b/src/contracts/Search/FieldType/MultipleBooleanField.php index 48d3b3e796..ae48b4582d 100644 --- a/src/contracts/Search/FieldType/MultipleBooleanField.php +++ b/src/contracts/Search/FieldType/MultipleBooleanField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/MultipleIdentifierField.php b/src/contracts/Search/FieldType/MultipleIdentifierField.php index e3682560bd..55c4ca8d54 100644 --- a/src/contracts/Search/FieldType/MultipleIdentifierField.php +++ b/src/contracts/Search/FieldType/MultipleIdentifierField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/MultipleIntegerField.php b/src/contracts/Search/FieldType/MultipleIntegerField.php index 902389df5e..2430b70850 100644 --- a/src/contracts/Search/FieldType/MultipleIntegerField.php +++ b/src/contracts/Search/FieldType/MultipleIntegerField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/MultipleRemoteIdentifierField.php b/src/contracts/Search/FieldType/MultipleRemoteIdentifierField.php index 0af2eb37c1..c2ae1e4e58 100644 --- a/src/contracts/Search/FieldType/MultipleRemoteIdentifierField.php +++ b/src/contracts/Search/FieldType/MultipleRemoteIdentifierField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/MultipleStringField.php b/src/contracts/Search/FieldType/MultipleStringField.php index 3d8a6bbe8e..04a7f5de5f 100644 --- a/src/contracts/Search/FieldType/MultipleStringField.php +++ b/src/contracts/Search/FieldType/MultipleStringField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/PriceField.php b/src/contracts/Search/FieldType/PriceField.php index 5c446c8a28..7bc53b1d76 100644 --- a/src/contracts/Search/FieldType/PriceField.php +++ b/src/contracts/Search/FieldType/PriceField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/RemoteIdentifierField.php b/src/contracts/Search/FieldType/RemoteIdentifierField.php index 55a9a70133..9f9d74f320 100644 --- a/src/contracts/Search/FieldType/RemoteIdentifierField.php +++ b/src/contracts/Search/FieldType/RemoteIdentifierField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/StringField.php b/src/contracts/Search/FieldType/StringField.php index 5dadd1e2e3..2bfd2f8a7e 100644 --- a/src/contracts/Search/FieldType/StringField.php +++ b/src/contracts/Search/FieldType/StringField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/FieldType/TextField.php b/src/contracts/Search/FieldType/TextField.php index 93c53c8301..7a9853d033 100644 --- a/src/contracts/Search/FieldType/TextField.php +++ b/src/contracts/Search/FieldType/TextField.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\Core\Search\FieldType; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/contracts/Search/Handler.php b/src/contracts/Search/Handler.php index 314377f965..bfd390f14b 100644 --- a/src/contracts/Search/Handler.php +++ b/src/contracts/Search/Handler.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\Core\Search; use Ibexa\Contracts\Core\Persistence\Content; diff --git a/src/contracts/SiteAccess/ConfigResolverInterface.php b/src/contracts/SiteAccess/ConfigResolverInterface.php index c2fb705b54..a478c54e48 100644 --- a/src/contracts/SiteAccess/ConfigResolverInterface.php +++ b/src/contracts/SiteAccess/ConfigResolverInterface.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\Core\SiteAccess; /** diff --git a/src/contracts/Test/IbexaKernelTestTrait.php b/src/contracts/Test/IbexaKernelTestTrait.php index 6b75669022..fb36233104 100644 --- a/src/contracts/Test/IbexaKernelTestTrait.php +++ b/src/contracts/Test/IbexaKernelTestTrait.php @@ -71,6 +71,7 @@ protected static function getFixtures(): iterable /** * @template T of object + * * @phpstan-param class-string $className * * @return T diff --git a/src/contracts/Test/IbexaTestKernelInterface.php b/src/contracts/Test/IbexaTestKernelInterface.php index 55f6e42186..31af73e6ed 100644 --- a/src/contracts/Test/IbexaTestKernelInterface.php +++ b/src/contracts/Test/IbexaTestKernelInterface.php @@ -10,6 +10,7 @@ /** * @internal + * * @experimental */ interface IbexaTestKernelInterface diff --git a/src/contracts/Test/Repository/SetupFactory.php b/src/contracts/Test/Repository/SetupFactory.php index eb2d57f9cb..93a4ef1509 100644 --- a/src/contracts/Test/Repository/SetupFactory.php +++ b/src/contracts/Test/Repository/SetupFactory.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\Core\Test\Repository; /** diff --git a/src/contracts/Test/Repository/SetupFactory/Legacy.php b/src/contracts/Test/Repository/SetupFactory/Legacy.php index d690e77406..bfd6b7068a 100644 --- a/src/contracts/Test/Repository/SetupFactory/Legacy.php +++ b/src/contracts/Test/Repository/SetupFactory/Legacy.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\Core\Test\Repository\SetupFactory; use Doctrine\DBAL\Connection; diff --git a/src/contracts/User/Identity.php b/src/contracts/User/Identity.php index a7fa649160..e516384747 100644 --- a/src/contracts/User/Identity.php +++ b/src/contracts/User/Identity.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\Core\User; /** diff --git a/src/contracts/User/IdentityAware.php b/src/contracts/User/IdentityAware.php index e17bc53d4c..ea72f22f13 100644 --- a/src/contracts/User/IdentityAware.php +++ b/src/contracts/User/IdentityAware.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\Core\User; /** diff --git a/src/contracts/Variation/Values/ImageVariation.php b/src/contracts/Variation/Values/ImageVariation.php index 980808f723..0ffe0efd75 100644 --- a/src/contracts/Variation/Values/ImageVariation.php +++ b/src/contracts/Variation/Values/ImageVariation.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\Core\Variation\Values; /** diff --git a/src/contracts/Variation/Values/Variation.php b/src/contracts/Variation/Values/Variation.php index ec373e1890..e9018002f6 100644 --- a/src/contracts/Variation/Values/Variation.php +++ b/src/contracts/Variation/Values/Variation.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\Core\Variation\Values; use Ibexa\Contracts\Core\Repository\Values\ValueObject; diff --git a/src/contracts/Variation/VariationHandler.php b/src/contracts/Variation/VariationHandler.php index 04a87c04c5..652496c575 100644 --- a/src/contracts/Variation/VariationHandler.php +++ b/src/contracts/Variation/VariationHandler.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\Core\Variation; use Ibexa\Contracts\Core\Repository\Values\Content\Field; diff --git a/src/contracts/Variation/VariationPathGenerator.php b/src/contracts/Variation/VariationPathGenerator.php index b4ce04f8be..07b781e671 100644 --- a/src/contracts/Variation/VariationPathGenerator.php +++ b/src/contracts/Variation/VariationPathGenerator.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\Core\Variation; /** diff --git a/src/contracts/Variation/VariationPurger.php b/src/contracts/Variation/VariationPurger.php index 8cef29a434..a611a2b5c1 100644 --- a/src/contracts/Variation/VariationPurger.php +++ b/src/contracts/Variation/VariationPurger.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\Core\Variation; /** diff --git a/src/lib/Base/Container/ApiLoader/RepositoryFactory.php b/src/lib/Base/Container/ApiLoader/RepositoryFactory.php index c4b1cbb17e..959bb4b10b 100644 --- a/src/lib/Base/Container/ApiLoader/RepositoryFactory.php +++ b/src/lib/Base/Container/ApiLoader/RepositoryFactory.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\Core\Base\Container\ApiLoader; use Ibexa\Contracts\Core\Persistence\Filter\Content\Handler as ContentFilteringHandler; diff --git a/src/lib/Base/Container/Compiler/AbstractFieldTypeBasedPass.php b/src/lib/Base/Container/Compiler/AbstractFieldTypeBasedPass.php index 4a2c3068db..d8f8075318 100644 --- a/src/lib/Base/Container/Compiler/AbstractFieldTypeBasedPass.php +++ b/src/lib/Base/Container/Compiler/AbstractFieldTypeBasedPass.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\Core\Base\Container\Compiler; use LogicException; diff --git a/src/lib/Base/Container/Compiler/FieldTypeRegistryPass.php b/src/lib/Base/Container/Compiler/FieldTypeRegistryPass.php index 955da2ef37..e0a9c5b1ad 100644 --- a/src/lib/Base/Container/Compiler/FieldTypeRegistryPass.php +++ b/src/lib/Base/Container/Compiler/FieldTypeRegistryPass.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\Core\Base\Container\Compiler; use Ibexa\Core\FieldType\FieldTypeRegistry; diff --git a/src/lib/Base/Container/Compiler/Persistence/FieldTypeRegistryPass.php b/src/lib/Base/Container/Compiler/Persistence/FieldTypeRegistryPass.php index ec0e6c617a..fa7a635837 100644 --- a/src/lib/Base/Container/Compiler/Persistence/FieldTypeRegistryPass.php +++ b/src/lib/Base/Container/Compiler/Persistence/FieldTypeRegistryPass.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\Core\Base\Container\Compiler\Persistence; use Ibexa\Core\Base\Container\Compiler\AbstractFieldTypeBasedPass; diff --git a/src/lib/Base/Container/Compiler/Search/AggregateFieldValueMapperPass.php b/src/lib/Base/Container/Compiler/Search/AggregateFieldValueMapperPass.php index fdda21cfac..34bff08dc3 100644 --- a/src/lib/Base/Container/Compiler/Search/AggregateFieldValueMapperPass.php +++ b/src/lib/Base/Container/Compiler/Search/AggregateFieldValueMapperPass.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\Core\Base\Container\Compiler\Search; use Ibexa\Core\Search\Common\FieldValueMapper\Aggregate; diff --git a/src/lib/Base/Container/Compiler/Search/FieldRegistryPass.php b/src/lib/Base/Container/Compiler/Search/FieldRegistryPass.php index a2b81739f6..6c70904c08 100644 --- a/src/lib/Base/Container/Compiler/Search/FieldRegistryPass.php +++ b/src/lib/Base/Container/Compiler/Search/FieldRegistryPass.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\Core\Base\Container\Compiler\Search; use Ibexa\Core\Search\Common\FieldRegistry; diff --git a/src/lib/Base/Container/Compiler/Search/Legacy/CriteriaConverterPass.php b/src/lib/Base/Container/Compiler/Search/Legacy/CriteriaConverterPass.php index f28331e82e..72d6a666df 100644 --- a/src/lib/Base/Container/Compiler/Search/Legacy/CriteriaConverterPass.php +++ b/src/lib/Base/Container/Compiler/Search/Legacy/CriteriaConverterPass.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\Core\Base\Container\Compiler\Search\Legacy; use Ibexa\Core\Persistence\Legacy\URL\Query\CriteriaConverter; diff --git a/src/lib/Base/Container/Compiler/Search/Legacy/CriterionFieldValueHandlerRegistryPass.php b/src/lib/Base/Container/Compiler/Search/Legacy/CriterionFieldValueHandlerRegistryPass.php index 0fe22241d3..56726be00e 100644 --- a/src/lib/Base/Container/Compiler/Search/Legacy/CriterionFieldValueHandlerRegistryPass.php +++ b/src/lib/Base/Container/Compiler/Search/Legacy/CriterionFieldValueHandlerRegistryPass.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\Core\Base\Container\Compiler\Search\Legacy; use Ibexa\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FieldValue\HandlerRegistry; diff --git a/src/lib/Base/Container/Compiler/Search/Legacy/SortClauseConverterPass.php b/src/lib/Base/Container/Compiler/Search/Legacy/SortClauseConverterPass.php index 8de87e3cdd..daf4e4575d 100644 --- a/src/lib/Base/Container/Compiler/Search/Legacy/SortClauseConverterPass.php +++ b/src/lib/Base/Container/Compiler/Search/Legacy/SortClauseConverterPass.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\Core\Base\Container\Compiler\Search\Legacy; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; diff --git a/src/lib/Base/Container/Compiler/Storage/ExternalStorageRegistryPass.php b/src/lib/Base/Container/Compiler/Storage/ExternalStorageRegistryPass.php index 165ec9e1e5..a58750fa69 100644 --- a/src/lib/Base/Container/Compiler/Storage/ExternalStorageRegistryPass.php +++ b/src/lib/Base/Container/Compiler/Storage/ExternalStorageRegistryPass.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\Core\Base\Container\Compiler\Storage; use Ibexa\Core\FieldType\GatewayBasedStorage; diff --git a/src/lib/Base/Container/Compiler/Storage/Legacy/FieldValueConverterRegistryPass.php b/src/lib/Base/Container/Compiler/Storage/Legacy/FieldValueConverterRegistryPass.php index e877da9d60..f14e55410f 100644 --- a/src/lib/Base/Container/Compiler/Storage/Legacy/FieldValueConverterRegistryPass.php +++ b/src/lib/Base/Container/Compiler/Storage/Legacy/FieldValueConverterRegistryPass.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\Core\Base\Container\Compiler\Storage\Legacy; use Ibexa\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry; diff --git a/src/lib/Base/Container/Compiler/Storage/Legacy/RoleLimitationConverterPass.php b/src/lib/Base/Container/Compiler/Storage/Legacy/RoleLimitationConverterPass.php index c78295b118..7fe26d7b60 100644 --- a/src/lib/Base/Container/Compiler/Storage/Legacy/RoleLimitationConverterPass.php +++ b/src/lib/Base/Container/Compiler/Storage/Legacy/RoleLimitationConverterPass.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\Core\Base\Container\Compiler\Storage\Legacy; use Ibexa\Core\Persistence\Legacy\User\Role\LimitationConverter; diff --git a/src/lib/Base/Exceptions/BadStateException.php b/src/lib/Base/Exceptions/BadStateException.php index a4c41bd537..ce76d2c60c 100644 --- a/src/lib/Base/Exceptions/BadStateException.php +++ b/src/lib/Base/Exceptions/BadStateException.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\Core\Base\Exceptions; use Exception; diff --git a/src/lib/Base/Exceptions/ContentFieldValidationException.php b/src/lib/Base/Exceptions/ContentFieldValidationException.php index 0b8091dca4..1e10831293 100644 --- a/src/lib/Base/Exceptions/ContentFieldValidationException.php +++ b/src/lib/Base/Exceptions/ContentFieldValidationException.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\Core\Base\Exceptions; use Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException as APIContentFieldValidationException; diff --git a/src/lib/Base/Exceptions/ContentTypeFieldDefinitionValidationException.php b/src/lib/Base/Exceptions/ContentTypeFieldDefinitionValidationException.php index a2046b4870..22ebf9360d 100644 --- a/src/lib/Base/Exceptions/ContentTypeFieldDefinitionValidationException.php +++ b/src/lib/Base/Exceptions/ContentTypeFieldDefinitionValidationException.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\Core\Base\Exceptions; use Ibexa\Contracts\Core\Repository\Exceptions\ContentTypeFieldDefinitionValidationException as APIContentTypeFieldDefinitionValidationException; diff --git a/src/lib/Base/Exceptions/ContentTypeValidationException.php b/src/lib/Base/Exceptions/ContentTypeValidationException.php index 43f2e768db..220dd1e953 100644 --- a/src/lib/Base/Exceptions/ContentTypeValidationException.php +++ b/src/lib/Base/Exceptions/ContentTypeValidationException.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\Core\Base\Exceptions; use Ibexa\Contracts\Core\Repository\Exceptions\ContentTypeValidationException as APIContentTypeValidationException; diff --git a/src/lib/Base/Exceptions/ContentValidationException.php b/src/lib/Base/Exceptions/ContentValidationException.php index 83ba4aa0c4..7b249f5062 100644 --- a/src/lib/Base/Exceptions/ContentValidationException.php +++ b/src/lib/Base/Exceptions/ContentValidationException.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\Core\Base\Exceptions; use Ibexa\Contracts\Core\Repository\Exceptions\ContentValidationException as APIContentValidationException; diff --git a/src/lib/Base/Exceptions/ForbiddenException.php b/src/lib/Base/Exceptions/ForbiddenException.php index 5f80bab8ff..6e89faa425 100644 --- a/src/lib/Base/Exceptions/ForbiddenException.php +++ b/src/lib/Base/Exceptions/ForbiddenException.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\Core\Base\Exceptions; use Ibexa\Contracts\Core\Repository\Exceptions\ForbiddenException as APIForbiddenException; diff --git a/src/lib/Base/Exceptions/Httpable.php b/src/lib/Base/Exceptions/Httpable.php index 5a8c44f056..97147510b0 100644 --- a/src/lib/Base/Exceptions/Httpable.php +++ b/src/lib/Base/Exceptions/Httpable.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\Core\Base\Exceptions; /** diff --git a/src/lib/Base/Exceptions/InvalidArgumentException.php b/src/lib/Base/Exceptions/InvalidArgumentException.php index 95aafad9cf..4468260384 100644 --- a/src/lib/Base/Exceptions/InvalidArgumentException.php +++ b/src/lib/Base/Exceptions/InvalidArgumentException.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\Core\Base\Exceptions; use Exception; diff --git a/src/lib/Base/Exceptions/InvalidArgumentType.php b/src/lib/Base/Exceptions/InvalidArgumentType.php index 7a4e7799fe..4e95e270e0 100644 --- a/src/lib/Base/Exceptions/InvalidArgumentType.php +++ b/src/lib/Base/Exceptions/InvalidArgumentType.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\Core\Base\Exceptions; use Exception; diff --git a/src/lib/Base/Exceptions/InvalidArgumentValue.php b/src/lib/Base/Exceptions/InvalidArgumentValue.php index 02dad42371..94cfb2ec89 100644 --- a/src/lib/Base/Exceptions/InvalidArgumentValue.php +++ b/src/lib/Base/Exceptions/InvalidArgumentValue.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\Core\Base\Exceptions; use Exception; diff --git a/src/lib/Base/Exceptions/LimitationValidationException.php b/src/lib/Base/Exceptions/LimitationValidationException.php index d16dec73f3..a5af9facb6 100644 --- a/src/lib/Base/Exceptions/LimitationValidationException.php +++ b/src/lib/Base/Exceptions/LimitationValidationException.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\Core\Base\Exceptions; use Ibexa\Contracts\Core\Repository\Exceptions\LimitationValidationException as APILimitationValidationException; @@ -34,7 +35,7 @@ class LimitationValidationException extends APILimitationValidationException imp */ public function __construct(array $errors) { - $this->validationErrors = $errors; + $this->errors = $errors; $this->setMessageTemplate('Limitations did not validate'); parent::__construct($this->getBaseTranslation()); } diff --git a/src/lib/Base/Exceptions/MissingClass.php b/src/lib/Base/Exceptions/MissingClass.php index 76ea1008ad..0209f447b5 100644 --- a/src/lib/Base/Exceptions/MissingClass.php +++ b/src/lib/Base/Exceptions/MissingClass.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\Core\Base\Exceptions; use Exception; diff --git a/src/lib/Base/Exceptions/MissingUserFieldTypeException.php b/src/lib/Base/Exceptions/MissingUserFieldTypeException.php index 495acb4553..caced1bdfa 100644 --- a/src/lib/Base/Exceptions/MissingUserFieldTypeException.php +++ b/src/lib/Base/Exceptions/MissingUserFieldTypeException.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\Core\Base\Exceptions; use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType; diff --git a/src/lib/Base/Exceptions/NotFound/FieldTypeNotFoundException.php b/src/lib/Base/Exceptions/NotFound/FieldTypeNotFoundException.php index 1ea37f1d2b..34c03af440 100644 --- a/src/lib/Base/Exceptions/NotFound/FieldTypeNotFoundException.php +++ b/src/lib/Base/Exceptions/NotFound/FieldTypeNotFoundException.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\Core\Base\Exceptions\NotFound; use Exception; diff --git a/src/lib/Base/Exceptions/NotFound/LimitationNotFoundException.php b/src/lib/Base/Exceptions/NotFound/LimitationNotFoundException.php index 45125f777a..7247127faf 100644 --- a/src/lib/Base/Exceptions/NotFound/LimitationNotFoundException.php +++ b/src/lib/Base/Exceptions/NotFound/LimitationNotFoundException.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\Core\Base\Exceptions\NotFound; use Exception; diff --git a/src/lib/Base/Exceptions/NotFoundException.php b/src/lib/Base/Exceptions/NotFoundException.php index efbd4242e5..298e1d6b07 100644 --- a/src/lib/Base/Exceptions/NotFoundException.php +++ b/src/lib/Base/Exceptions/NotFoundException.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\Core\Base\Exceptions; use Exception; diff --git a/src/lib/Base/Exceptions/UnauthorizedException.php b/src/lib/Base/Exceptions/UnauthorizedException.php index 7b126e35b3..b9152240f7 100644 --- a/src/lib/Base/Exceptions/UnauthorizedException.php +++ b/src/lib/Base/Exceptions/UnauthorizedException.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\Core\Base\Exceptions; use Exception; diff --git a/src/lib/Base/ServiceContainer.php b/src/lib/Base/ServiceContainer.php index 3dc1ae862d..7ee3f742d7 100644 --- a/src/lib/Base/ServiceContainer.php +++ b/src/lib/Base/ServiceContainer.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\Core\Base; use Ibexa\Contracts\Core\Container; diff --git a/src/lib/Base/Translatable.php b/src/lib/Base/Translatable.php index 479d41e9a2..413fb198b6 100644 --- a/src/lib/Base/Translatable.php +++ b/src/lib/Base/Translatable.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\Core\Base; /** diff --git a/src/lib/Base/TranslatableBase.php b/src/lib/Base/TranslatableBase.php index f3f15507e7..7f0ccee7bd 100644 --- a/src/lib/Base/TranslatableBase.php +++ b/src/lib/Base/TranslatableBase.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\Core\Base; /** diff --git a/src/lib/Base/Utils/DeprecationWarner.php b/src/lib/Base/Utils/DeprecationWarner.php index dd4017eaa5..edf7afb7fa 100644 --- a/src/lib/Base/Utils/DeprecationWarner.php +++ b/src/lib/Base/Utils/DeprecationWarner.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\Core\Base\Utils; class DeprecationWarner implements DeprecationWarnerInterface diff --git a/src/lib/Base/Utils/DeprecationWarnerInterface.php b/src/lib/Base/Utils/DeprecationWarnerInterface.php index d99dd903b7..975e24b93b 100644 --- a/src/lib/Base/Utils/DeprecationWarnerInterface.php +++ b/src/lib/Base/Utils/DeprecationWarnerInterface.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\Core\Base\Utils; /** diff --git a/src/lib/FieldType/Author/Author.php b/src/lib/FieldType/Author/Author.php index 51a1bee824..0b07025363 100644 --- a/src/lib/FieldType/Author/Author.php +++ b/src/lib/FieldType/Author/Author.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\Core\FieldType\Author; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/lib/FieldType/Author/AuthorCollection.php b/src/lib/FieldType/Author/AuthorCollection.php index fa78b1a2d5..9b3f303278 100644 --- a/src/lib/FieldType/Author/AuthorCollection.php +++ b/src/lib/FieldType/Author/AuthorCollection.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\Core\FieldType\Author; use ArrayObject; diff --git a/src/lib/FieldType/Author/SearchField.php b/src/lib/FieldType/Author/SearchField.php index 7f63151ac8..89de149205 100644 --- a/src/lib/FieldType/Author/SearchField.php +++ b/src/lib/FieldType/Author/SearchField.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\Core\FieldType\Author; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/Author/Type.php b/src/lib/FieldType/Author/Type.php index 61db3acff0..e4c86e47fd 100644 --- a/src/lib/FieldType/Author/Type.php +++ b/src/lib/FieldType/Author/Type.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\Core\FieldType\Author; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/Author/Value.php b/src/lib/FieldType/Author/Value.php index 1e61cdc12e..1a632420dc 100644 --- a/src/lib/FieldType/Author/Value.php +++ b/src/lib/FieldType/Author/Value.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\Core\FieldType\Author; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/BinaryBase/BinaryBaseStorage.php b/src/lib/FieldType/BinaryBase/BinaryBaseStorage.php index 7817c92801..d70f00c742 100644 --- a/src/lib/FieldType/BinaryBase/BinaryBaseStorage.php +++ b/src/lib/FieldType/BinaryBase/BinaryBaseStorage.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\Core\FieldType\BinaryBase; use Ibexa\Contracts\Core\FieldType\BinaryBase\PathGenerator; diff --git a/src/lib/FieldType/BinaryBase/BinaryBaseStorage/Gateway.php b/src/lib/FieldType/BinaryBase/BinaryBaseStorage/Gateway.php index ade24ff438..e1943ca20d 100644 --- a/src/lib/FieldType/BinaryBase/BinaryBaseStorage/Gateway.php +++ b/src/lib/FieldType/BinaryBase/BinaryBaseStorage/Gateway.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\Core\FieldType\BinaryBase\BinaryBaseStorage; use Ibexa\Contracts\Core\FieldType\StorageGateway; diff --git a/src/lib/FieldType/BinaryBase/BinaryBaseStorage/Gateway/DoctrineStorage.php b/src/lib/FieldType/BinaryBase/BinaryBaseStorage/Gateway/DoctrineStorage.php index bd34223549..1721be5de1 100644 --- a/src/lib/FieldType/BinaryBase/BinaryBaseStorage/Gateway/DoctrineStorage.php +++ b/src/lib/FieldType/BinaryBase/BinaryBaseStorage/Gateway/DoctrineStorage.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\Core\FieldType\BinaryBase\BinaryBaseStorage\Gateway; use Doctrine\DBAL\Connection; diff --git a/src/lib/FieldType/BinaryBase/PathGenerator/LegacyPathGenerator.php b/src/lib/FieldType/BinaryBase/PathGenerator/LegacyPathGenerator.php index 221228d294..a4e59598fd 100644 --- a/src/lib/FieldType/BinaryBase/PathGenerator/LegacyPathGenerator.php +++ b/src/lib/FieldType/BinaryBase/PathGenerator/LegacyPathGenerator.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\Core\FieldType\BinaryBase\PathGenerator; use Ibexa\Contracts\Core\FieldType\BinaryBase\PathGenerator; diff --git a/src/lib/FieldType/BinaryBase/Type.php b/src/lib/FieldType/BinaryBase/Type.php index fa9b750b16..784e2b2444 100644 --- a/src/lib/FieldType/BinaryBase/Type.php +++ b/src/lib/FieldType/BinaryBase/Type.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\Core\FieldType\BinaryBase; use Ibexa\Contracts\Core\FieldType\BinaryBase\RouteAwarePathGenerator; diff --git a/src/lib/FieldType/BinaryBase/Value.php b/src/lib/FieldType/BinaryBase/Value.php index e3b1608e9f..af1021053f 100644 --- a/src/lib/FieldType/BinaryBase/Value.php +++ b/src/lib/FieldType/BinaryBase/Value.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\Core\FieldType\BinaryBase; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/BinaryFile/BinaryFileStorage.php b/src/lib/FieldType/BinaryFile/BinaryFileStorage.php index 5657a5d967..fe75e3780c 100644 --- a/src/lib/FieldType/BinaryFile/BinaryFileStorage.php +++ b/src/lib/FieldType/BinaryFile/BinaryFileStorage.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\Core\FieldType\BinaryFile; use Ibexa\Core\FieldType\BinaryBase\BinaryBaseStorage; diff --git a/src/lib/FieldType/BinaryFile/BinaryFileStorage/Gateway/DoctrineStorage.php b/src/lib/FieldType/BinaryFile/BinaryFileStorage/Gateway/DoctrineStorage.php index 9cd3e48f20..6a41c09565 100644 --- a/src/lib/FieldType/BinaryFile/BinaryFileStorage/Gateway/DoctrineStorage.php +++ b/src/lib/FieldType/BinaryFile/BinaryFileStorage/Gateway/DoctrineStorage.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\Core\FieldType\BinaryFile\BinaryFileStorage\Gateway; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/FieldType/BinaryFile/SearchField.php b/src/lib/FieldType/BinaryFile/SearchField.php index 0d58746314..f705b1d013 100644 --- a/src/lib/FieldType/BinaryFile/SearchField.php +++ b/src/lib/FieldType/BinaryFile/SearchField.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\Core\FieldType\BinaryFile; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/BinaryFile/Type.php b/src/lib/FieldType/BinaryFile/Type.php index c14a35e070..5ca184c593 100644 --- a/src/lib/FieldType/BinaryFile/Type.php +++ b/src/lib/FieldType/BinaryFile/Type.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\Core\FieldType\BinaryFile; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/BinaryFile/Value.php b/src/lib/FieldType/BinaryFile/Value.php index a92c6329b3..0e045aa33e 100644 --- a/src/lib/FieldType/BinaryFile/Value.php +++ b/src/lib/FieldType/BinaryFile/Value.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\Core\FieldType\BinaryFile; use Ibexa\Core\FieldType\BinaryBase\Value as BaseValue; diff --git a/src/lib/FieldType/Checkbox/SearchField.php b/src/lib/FieldType/Checkbox/SearchField.php index 1b1a427844..1f0fb0834b 100644 --- a/src/lib/FieldType/Checkbox/SearchField.php +++ b/src/lib/FieldType/Checkbox/SearchField.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\Core\FieldType\Checkbox; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/Checkbox/Type.php b/src/lib/FieldType/Checkbox/Type.php index c0971f6bc2..b0d6a14c6e 100644 --- a/src/lib/FieldType/Checkbox/Type.php +++ b/src/lib/FieldType/Checkbox/Type.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\Core\FieldType\Checkbox; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/Checkbox/Value.php b/src/lib/FieldType/Checkbox/Value.php index 016e95d513..e1de171cf0 100644 --- a/src/lib/FieldType/Checkbox/Value.php +++ b/src/lib/FieldType/Checkbox/Value.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\Core\FieldType\Checkbox; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/Country/Exception/InvalidValue.php b/src/lib/FieldType/Country/Exception/InvalidValue.php index 5a7f714e06..feeb5a9e7c 100644 --- a/src/lib/FieldType/Country/Exception/InvalidValue.php +++ b/src/lib/FieldType/Country/Exception/InvalidValue.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\Core\FieldType\Country\Exception; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/src/lib/FieldType/Country/SearchField.php b/src/lib/FieldType/Country/SearchField.php index e773e16d67..5c38c4d126 100644 --- a/src/lib/FieldType/Country/SearchField.php +++ b/src/lib/FieldType/Country/SearchField.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\Core\FieldType\Country; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/Country/Type.php b/src/lib/FieldType/Country/Type.php index 7bb257ad38..cca3abadb7 100644 --- a/src/lib/FieldType/Country/Type.php +++ b/src/lib/FieldType/Country/Type.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\Core\FieldType\Country; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/Country/Value.php b/src/lib/FieldType/Country/Value.php index a032be5477..35917cf7ae 100644 --- a/src/lib/FieldType/Country/Value.php +++ b/src/lib/FieldType/Country/Value.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\Core\FieldType\Country; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/Date/SearchField.php b/src/lib/FieldType/Date/SearchField.php index 0e8eeeb513..7189af1a8d 100644 --- a/src/lib/FieldType/Date/SearchField.php +++ b/src/lib/FieldType/Date/SearchField.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\Core\FieldType\Date; use DateTime; diff --git a/src/lib/FieldType/Date/Type.php b/src/lib/FieldType/Date/Type.php index 4af0fa813c..923e067327 100644 --- a/src/lib/FieldType/Date/Type.php +++ b/src/lib/FieldType/Date/Type.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\Core\FieldType\Date; use DateTime; diff --git a/src/lib/FieldType/Date/Value.php b/src/lib/FieldType/Date/Value.php index 126fbee346..22216e273d 100644 --- a/src/lib/FieldType/Date/Value.php +++ b/src/lib/FieldType/Date/Value.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\Core\FieldType\Date; use DateTime; diff --git a/src/lib/FieldType/DateAndTime/SearchField.php b/src/lib/FieldType/DateAndTime/SearchField.php index 55274cc62e..5b466bf1ed 100644 --- a/src/lib/FieldType/DateAndTime/SearchField.php +++ b/src/lib/FieldType/DateAndTime/SearchField.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\Core\FieldType\DateAndTime; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/DateAndTime/Type.php b/src/lib/FieldType/DateAndTime/Type.php index 0303719a76..40bd2378f6 100644 --- a/src/lib/FieldType/DateAndTime/Type.php +++ b/src/lib/FieldType/DateAndTime/Type.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\Core\FieldType\DateAndTime; use DateInterval; diff --git a/src/lib/FieldType/DateAndTime/Value.php b/src/lib/FieldType/DateAndTime/Value.php index a13959c054..776896a682 100644 --- a/src/lib/FieldType/DateAndTime/Value.php +++ b/src/lib/FieldType/DateAndTime/Value.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\Core\FieldType\DateAndTime; use DateTime; diff --git a/src/lib/FieldType/EmailAddress/SearchField.php b/src/lib/FieldType/EmailAddress/SearchField.php index 328e3f3fd9..289e7f3efa 100644 --- a/src/lib/FieldType/EmailAddress/SearchField.php +++ b/src/lib/FieldType/EmailAddress/SearchField.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\Core\FieldType\EmailAddress; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/EmailAddress/Type.php b/src/lib/FieldType/EmailAddress/Type.php index 0880c8bfb8..8a26254247 100644 --- a/src/lib/FieldType/EmailAddress/Type.php +++ b/src/lib/FieldType/EmailAddress/Type.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\Core\FieldType\EmailAddress; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/EmailAddress/Value.php b/src/lib/FieldType/EmailAddress/Value.php index ef3e029f7b..efca47f24c 100644 --- a/src/lib/FieldType/EmailAddress/Value.php +++ b/src/lib/FieldType/EmailAddress/Value.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\Core\FieldType\EmailAddress; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/FieldSettings.php b/src/lib/FieldType/FieldSettings.php index 083fb576e7..c35208b650 100644 --- a/src/lib/FieldType/FieldSettings.php +++ b/src/lib/FieldType/FieldSettings.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\Core\FieldType; use ArrayObject; diff --git a/src/lib/FieldType/FieldType.php b/src/lib/FieldType/FieldType.php index 6d6395c92d..dfe18ba471 100644 --- a/src/lib/FieldType/FieldType.php +++ b/src/lib/FieldType/FieldType.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\Comparable; diff --git a/src/lib/FieldType/FieldTypeRegistry.php b/src/lib/FieldType/FieldTypeRegistry.php index 1b463bbe63..7d0cbfe05d 100644 --- a/src/lib/FieldType/FieldTypeRegistry.php +++ b/src/lib/FieldType/FieldTypeRegistry.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\FieldType as SPIFieldType; diff --git a/src/lib/FieldType/Float/SearchField.php b/src/lib/FieldType/Float/SearchField.php index 7d8b535d03..73be5b540a 100644 --- a/src/lib/FieldType/Float/SearchField.php +++ b/src/lib/FieldType/Float/SearchField.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\Core\FieldType\Float; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/Float/Type.php b/src/lib/FieldType/Float/Type.php index a8e2a3001b..38b4412f2e 100644 --- a/src/lib/FieldType/Float/Type.php +++ b/src/lib/FieldType/Float/Type.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\Core\FieldType\Float; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/Float/Value.php b/src/lib/FieldType/Float/Value.php index d2aa2707ff..4e0e976d2b 100644 --- a/src/lib/FieldType/Float/Value.php +++ b/src/lib/FieldType/Float/Value.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\Core\FieldType\Float; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/GatewayBasedStorage.php b/src/lib/FieldType/GatewayBasedStorage.php index 4b0a43efeb..e97b1dd34f 100644 --- a/src/lib/FieldType/GatewayBasedStorage.php +++ b/src/lib/FieldType/GatewayBasedStorage.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\FieldStorage; diff --git a/src/lib/FieldType/Handler.php b/src/lib/FieldType/Handler.php index edac92ce1f..ed705303fa 100644 --- a/src/lib/FieldType/Handler.php +++ b/src/lib/FieldType/Handler.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\Core\FieldType; /** diff --git a/src/lib/FieldType/ISBN/SearchField.php b/src/lib/FieldType/ISBN/SearchField.php index 155f5054e3..67b4fb06ba 100644 --- a/src/lib/FieldType/ISBN/SearchField.php +++ b/src/lib/FieldType/ISBN/SearchField.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\Core\FieldType\ISBN; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/ISBN/Type.php b/src/lib/FieldType/ISBN/Type.php index 18de50fd9b..c5cd544355 100644 --- a/src/lib/FieldType/ISBN/Type.php +++ b/src/lib/FieldType/ISBN/Type.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\Core\FieldType\ISBN; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/ISBN/Value.php b/src/lib/FieldType/ISBN/Value.php index ecf41c3dfe..54ee69bc47 100644 --- a/src/lib/FieldType/ISBN/Value.php +++ b/src/lib/FieldType/ISBN/Value.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\Core\FieldType\ISBN; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/Image/AliasCleanerInterface.php b/src/lib/FieldType/Image/AliasCleanerInterface.php index a0a094b9cb..22392f6907 100644 --- a/src/lib/FieldType/Image/AliasCleanerInterface.php +++ b/src/lib/FieldType/Image/AliasCleanerInterface.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\Core\FieldType\Image; /** diff --git a/src/lib/FieldType/Image/IO/Legacy.php b/src/lib/FieldType/Image/IO/Legacy.php index 957dd7a704..b440f514d3 100644 --- a/src/lib/FieldType/Image/IO/Legacy.php +++ b/src/lib/FieldType/Image/IO/Legacy.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\Core\FieldType\Image\IO; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/src/lib/FieldType/Image/IO/OptionsProvider.php b/src/lib/FieldType/Image/IO/OptionsProvider.php index fdc8eca1cc..4d7b8bdac1 100644 --- a/src/lib/FieldType/Image/IO/OptionsProvider.php +++ b/src/lib/FieldType/Image/IO/OptionsProvider.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\Core\FieldType\Image\IO; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/lib/FieldType/Image/ImageStorage.php b/src/lib/FieldType/Image/ImageStorage.php index 60d1236a73..87bc4a6955 100644 --- a/src/lib/FieldType/Image/ImageStorage.php +++ b/src/lib/FieldType/Image/ImageStorage.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\Core\FieldType\Image; use Ibexa\Contracts\Core\FieldType\GatewayBasedStorage; diff --git a/src/lib/FieldType/Image/ImageStorage/Gateway.php b/src/lib/FieldType/Image/ImageStorage/Gateway.php index 2c8138cb7c..eb6cdba213 100644 --- a/src/lib/FieldType/Image/ImageStorage/Gateway.php +++ b/src/lib/FieldType/Image/ImageStorage/Gateway.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\Core\FieldType\Image\ImageStorage; use Ibexa\Contracts\Core\FieldType\StorageGateway; diff --git a/src/lib/FieldType/Image/ImageStorage/Gateway/DoctrineStorage.php b/src/lib/FieldType/Image/ImageStorage/Gateway/DoctrineStorage.php index de2ab8e21b..6a5dda82a1 100644 --- a/src/lib/FieldType/Image/ImageStorage/Gateway/DoctrineStorage.php +++ b/src/lib/FieldType/Image/ImageStorage/Gateway/DoctrineStorage.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\Core\FieldType\Image\ImageStorage\Gateway; use Doctrine\DBAL\Connection; diff --git a/src/lib/FieldType/Image/PathGenerator.php b/src/lib/FieldType/Image/PathGenerator.php index 7fa9e7a78b..9b9cd6b7ac 100644 --- a/src/lib/FieldType/Image/PathGenerator.php +++ b/src/lib/FieldType/Image/PathGenerator.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\Core\FieldType\Image; abstract class PathGenerator diff --git a/src/lib/FieldType/Image/PathGenerator/LegacyPathGenerator.php b/src/lib/FieldType/Image/PathGenerator/LegacyPathGenerator.php index 6b6acba1b1..a415fcc8c9 100644 --- a/src/lib/FieldType/Image/PathGenerator/LegacyPathGenerator.php +++ b/src/lib/FieldType/Image/PathGenerator/LegacyPathGenerator.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\Core\FieldType\Image\PathGenerator; use Ibexa\Core\FieldType\Image\PathGenerator; diff --git a/src/lib/FieldType/Image/SearchField.php b/src/lib/FieldType/Image/SearchField.php index cce5068a1e..78de5cab1d 100644 --- a/src/lib/FieldType/Image/SearchField.php +++ b/src/lib/FieldType/Image/SearchField.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\Core\FieldType\Image; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/Image/Type.php b/src/lib/FieldType/Image/Type.php index 6bf4531614..9f90635e2d 100644 --- a/src/lib/FieldType/Image/Type.php +++ b/src/lib/FieldType/Image/Type.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\Core\FieldType\Image; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/Image/Value.php b/src/lib/FieldType/Image/Value.php index f8cf5645df..9ae04bb388 100644 --- a/src/lib/FieldType/Image/Value.php +++ b/src/lib/FieldType/Image/Value.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\Core\FieldType\Image; use Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException; diff --git a/src/lib/FieldType/Integer/SearchField.php b/src/lib/FieldType/Integer/SearchField.php index ae96902227..ebbbe0251b 100644 --- a/src/lib/FieldType/Integer/SearchField.php +++ b/src/lib/FieldType/Integer/SearchField.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\Core\FieldType\Integer; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/Integer/Type.php b/src/lib/FieldType/Integer/Type.php index 495b787944..c89f1ae3d1 100644 --- a/src/lib/FieldType/Integer/Type.php +++ b/src/lib/FieldType/Integer/Type.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\Core\FieldType\Integer; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/Integer/Value.php b/src/lib/FieldType/Integer/Value.php index 5d04f25e7b..e2c59bd604 100644 --- a/src/lib/FieldType/Integer/Value.php +++ b/src/lib/FieldType/Integer/Value.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\Core\FieldType\Integer; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/Keyword/KeywordStorage.php b/src/lib/FieldType/Keyword/KeywordStorage.php index 2a9418fcd0..1185ba568a 100644 --- a/src/lib/FieldType/Keyword/KeywordStorage.php +++ b/src/lib/FieldType/Keyword/KeywordStorage.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\Core\FieldType\Keyword; use Ibexa\Contracts\Core\FieldType\GatewayBasedStorage; diff --git a/src/lib/FieldType/Keyword/KeywordStorage/Gateway.php b/src/lib/FieldType/Keyword/KeywordStorage/Gateway.php index 4685d94453..e38d58370e 100644 --- a/src/lib/FieldType/Keyword/KeywordStorage/Gateway.php +++ b/src/lib/FieldType/Keyword/KeywordStorage/Gateway.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\Core\FieldType\Keyword\KeywordStorage; use Ibexa\Contracts\Core\FieldType\StorageGateway; diff --git a/src/lib/FieldType/Keyword/KeywordStorage/Gateway/DoctrineStorage.php b/src/lib/FieldType/Keyword/KeywordStorage/Gateway/DoctrineStorage.php index 797a5090ce..e6293f2cb5 100644 --- a/src/lib/FieldType/Keyword/KeywordStorage/Gateway/DoctrineStorage.php +++ b/src/lib/FieldType/Keyword/KeywordStorage/Gateway/DoctrineStorage.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\Core\FieldType\Keyword\KeywordStorage\Gateway; use Doctrine\DBAL\Connection; diff --git a/src/lib/FieldType/Keyword/SearchField.php b/src/lib/FieldType/Keyword/SearchField.php index f162de1c07..40478c1ae3 100644 --- a/src/lib/FieldType/Keyword/SearchField.php +++ b/src/lib/FieldType/Keyword/SearchField.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\Core\FieldType\Keyword; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/Keyword/Type.php b/src/lib/FieldType/Keyword/Type.php index 6ef4f2e24a..35652c7449 100644 --- a/src/lib/FieldType/Keyword/Type.php +++ b/src/lib/FieldType/Keyword/Type.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\Core\FieldType\Keyword; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/Keyword/Value.php b/src/lib/FieldType/Keyword/Value.php index e3e73df0aa..126425d15a 100644 --- a/src/lib/FieldType/Keyword/Value.php +++ b/src/lib/FieldType/Keyword/Value.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\Core\FieldType\Keyword; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/MapLocation/MapLocationStorage.php b/src/lib/FieldType/MapLocation/MapLocationStorage.php index 7d3485e5ff..29163b2e26 100644 --- a/src/lib/FieldType/MapLocation/MapLocationStorage.php +++ b/src/lib/FieldType/MapLocation/MapLocationStorage.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\Core\FieldType\MapLocation; use Ibexa\Contracts\Core\FieldType\GatewayBasedStorage; diff --git a/src/lib/FieldType/MapLocation/MapLocationStorage/Gateway.php b/src/lib/FieldType/MapLocation/MapLocationStorage/Gateway.php index 06c3a8f93a..03eb94edb5 100644 --- a/src/lib/FieldType/MapLocation/MapLocationStorage/Gateway.php +++ b/src/lib/FieldType/MapLocation/MapLocationStorage/Gateway.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\Core\FieldType\MapLocation\MapLocationStorage; use Ibexa\Contracts\Core\FieldType\StorageGateway; diff --git a/src/lib/FieldType/MapLocation/MapLocationStorage/Gateway/DoctrineStorage.php b/src/lib/FieldType/MapLocation/MapLocationStorage/Gateway/DoctrineStorage.php index ddc8e0213b..7b88427758 100644 --- a/src/lib/FieldType/MapLocation/MapLocationStorage/Gateway/DoctrineStorage.php +++ b/src/lib/FieldType/MapLocation/MapLocationStorage/Gateway/DoctrineStorage.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\Core\FieldType\MapLocation\MapLocationStorage\Gateway; use Doctrine\DBAL\Connection; diff --git a/src/lib/FieldType/MapLocation/SearchField.php b/src/lib/FieldType/MapLocation/SearchField.php index 69760c4603..14aa363909 100644 --- a/src/lib/FieldType/MapLocation/SearchField.php +++ b/src/lib/FieldType/MapLocation/SearchField.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\Core\FieldType\MapLocation; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/MapLocation/Type.php b/src/lib/FieldType/MapLocation/Type.php index f6a6ca12f9..1ae6233ba0 100644 --- a/src/lib/FieldType/MapLocation/Type.php +++ b/src/lib/FieldType/MapLocation/Type.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\Core\FieldType\MapLocation; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/MapLocation/Value.php b/src/lib/FieldType/MapLocation/Value.php index 0e8f92da01..d621b1bcf9 100644 --- a/src/lib/FieldType/MapLocation/Value.php +++ b/src/lib/FieldType/MapLocation/Value.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\Core\FieldType\MapLocation; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/Media/MediaStorage.php b/src/lib/FieldType/Media/MediaStorage.php index 069751a68b..edbe3e7029 100644 --- a/src/lib/FieldType/Media/MediaStorage.php +++ b/src/lib/FieldType/Media/MediaStorage.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\Core\FieldType\Media; use Ibexa\Core\FieldType\BinaryBase\BinaryBaseStorage; diff --git a/src/lib/FieldType/Media/MediaStorage/Gateway/DoctrineStorage.php b/src/lib/FieldType/Media/MediaStorage/Gateway/DoctrineStorage.php index f207ed802b..45c84c8ebc 100644 --- a/src/lib/FieldType/Media/MediaStorage/Gateway/DoctrineStorage.php +++ b/src/lib/FieldType/Media/MediaStorage/Gateway/DoctrineStorage.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\Core\FieldType\Media\MediaStorage\Gateway; use Doctrine\DBAL\ParameterType; diff --git a/src/lib/FieldType/Media/SearchField.php b/src/lib/FieldType/Media/SearchField.php index 17c4bd233e..e606ecf2db 100644 --- a/src/lib/FieldType/Media/SearchField.php +++ b/src/lib/FieldType/Media/SearchField.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\Core\FieldType\Media; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/Media/Type.php b/src/lib/FieldType/Media/Type.php index c416bf0cd7..0be65a70eb 100644 --- a/src/lib/FieldType/Media/Type.php +++ b/src/lib/FieldType/Media/Type.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\Core\FieldType\Media; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/Media/Value.php b/src/lib/FieldType/Media/Value.php index 87583b6018..d876e1010e 100644 --- a/src/lib/FieldType/Media/Value.php +++ b/src/lib/FieldType/Media/Value.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\Core\FieldType\Media; use Ibexa\Core\FieldType\BinaryBase\Value as BaseValue; diff --git a/src/lib/FieldType/Null/Type.php b/src/lib/FieldType/Null/Type.php index ce9f30e31c..f1db6f0def 100644 --- a/src/lib/FieldType/Null/Type.php +++ b/src/lib/FieldType/Null/Type.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\Core\FieldType\Null; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/Null/Value.php b/src/lib/FieldType/Null/Value.php index d307001cf1..dac36e7cd1 100644 --- a/src/lib/FieldType/Null/Value.php +++ b/src/lib/FieldType/Null/Value.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\Core\FieldType\Null; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/NullStorage.php b/src/lib/FieldType/NullStorage.php index 4fc7d87fe1..7a2d745be9 100644 --- a/src/lib/FieldType/NullStorage.php +++ b/src/lib/FieldType/NullStorage.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\FieldStorage; diff --git a/src/lib/FieldType/Relation/SearchField.php b/src/lib/FieldType/Relation/SearchField.php index ef7c84a706..1dbca6075d 100644 --- a/src/lib/FieldType/Relation/SearchField.php +++ b/src/lib/FieldType/Relation/SearchField.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\Core\FieldType\Relation; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/Relation/Type.php b/src/lib/FieldType/Relation/Type.php index 90dc13f508..2ac83793c0 100644 --- a/src/lib/FieldType/Relation/Type.php +++ b/src/lib/FieldType/Relation/Type.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\Core\FieldType\Relation; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/Relation/Value.php b/src/lib/FieldType/Relation/Value.php index 3a0abe0e0c..8d17fee54c 100644 --- a/src/lib/FieldType/Relation/Value.php +++ b/src/lib/FieldType/Relation/Value.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\Core\FieldType\Relation; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/RelationList/SearchField.php b/src/lib/FieldType/RelationList/SearchField.php index 5251215d63..bff8716996 100644 --- a/src/lib/FieldType/RelationList/SearchField.php +++ b/src/lib/FieldType/RelationList/SearchField.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\Core\FieldType\RelationList; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/RelationList/Type.php b/src/lib/FieldType/RelationList/Type.php index abc34b59a1..752dd9a080 100644 --- a/src/lib/FieldType/RelationList/Type.php +++ b/src/lib/FieldType/RelationList/Type.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\Core\FieldType\RelationList; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/RelationList/Value.php b/src/lib/FieldType/RelationList/Value.php index 023d9ffd76..a7fea0fd29 100644 --- a/src/lib/FieldType/RelationList/Value.php +++ b/src/lib/FieldType/RelationList/Value.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\Core\FieldType\RelationList; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/Selection/SearchField.php b/src/lib/FieldType/Selection/SearchField.php index de52b0a262..8e6f06d86b 100644 --- a/src/lib/FieldType/Selection/SearchField.php +++ b/src/lib/FieldType/Selection/SearchField.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\Core\FieldType\Selection; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/Selection/Type.php b/src/lib/FieldType/Selection/Type.php index cfb091bf2a..9480a77399 100644 --- a/src/lib/FieldType/Selection/Type.php +++ b/src/lib/FieldType/Selection/Type.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\Core\FieldType\Selection; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/Selection/Value.php b/src/lib/FieldType/Selection/Value.php index 455321d44b..fbbd1666cc 100644 --- a/src/lib/FieldType/Selection/Value.php +++ b/src/lib/FieldType/Selection/Value.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\Core\FieldType\Selection; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/StorageGateway.php b/src/lib/FieldType/StorageGateway.php index 4c696fb96c..55599777cb 100644 --- a/src/lib/FieldType/StorageGateway.php +++ b/src/lib/FieldType/StorageGateway.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\StorageGateway as SPIStorageGateway; diff --git a/src/lib/FieldType/TextBlock/SearchField.php b/src/lib/FieldType/TextBlock/SearchField.php index 2bfde7dc89..3dac6110ed 100644 --- a/src/lib/FieldType/TextBlock/SearchField.php +++ b/src/lib/FieldType/TextBlock/SearchField.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\Core\FieldType\TextBlock; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/TextBlock/Type.php b/src/lib/FieldType/TextBlock/Type.php index a9184cabb2..45e742b2a3 100644 --- a/src/lib/FieldType/TextBlock/Type.php +++ b/src/lib/FieldType/TextBlock/Type.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\Core\FieldType\TextBlock; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/TextBlock/Value.php b/src/lib/FieldType/TextBlock/Value.php index edf9a30463..fcdb54de29 100644 --- a/src/lib/FieldType/TextBlock/Value.php +++ b/src/lib/FieldType/TextBlock/Value.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\Core\FieldType\TextBlock; use Ibexa\Core\FieldType\TextLine\Value as TextLineValue; diff --git a/src/lib/FieldType/TextLine/SearchField.php b/src/lib/FieldType/TextLine/SearchField.php index 679cc55414..0c80f3bb45 100644 --- a/src/lib/FieldType/TextLine/SearchField.php +++ b/src/lib/FieldType/TextLine/SearchField.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\Core\FieldType\TextLine; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/TextLine/Type.php b/src/lib/FieldType/TextLine/Type.php index 465de19244..f8c6c98d19 100644 --- a/src/lib/FieldType/TextLine/Type.php +++ b/src/lib/FieldType/TextLine/Type.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\Core\FieldType\TextLine; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/TextLine/Value.php b/src/lib/FieldType/TextLine/Value.php index 5425a88237..8574995650 100644 --- a/src/lib/FieldType/TextLine/Value.php +++ b/src/lib/FieldType/TextLine/Value.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\Core\FieldType\TextLine; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/Time/SearchField.php b/src/lib/FieldType/Time/SearchField.php index d7b750bbc5..dd317adb55 100644 --- a/src/lib/FieldType/Time/SearchField.php +++ b/src/lib/FieldType/Time/SearchField.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\Core\FieldType\Time; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/Time/Type.php b/src/lib/FieldType/Time/Type.php index ec78fecd9a..43f0b03c0b 100644 --- a/src/lib/FieldType/Time/Type.php +++ b/src/lib/FieldType/Time/Type.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\Core\FieldType\Time; use DateTime; diff --git a/src/lib/FieldType/Time/Value.php b/src/lib/FieldType/Time/Value.php index fec0f4c929..1b25435481 100644 --- a/src/lib/FieldType/Time/Value.php +++ b/src/lib/FieldType/Time/Value.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\Core\FieldType\Time; use DateTime; diff --git a/src/lib/FieldType/Unindexed.php b/src/lib/FieldType/Unindexed.php index 30fde7f162..267ce0798e 100644 --- a/src/lib/FieldType/Unindexed.php +++ b/src/lib/FieldType/Unindexed.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/Url/SearchField.php b/src/lib/FieldType/Url/SearchField.php index c2a1e39066..96bfe2108d 100644 --- a/src/lib/FieldType/Url/SearchField.php +++ b/src/lib/FieldType/Url/SearchField.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\Core\FieldType\Url; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/FieldType/Url/Type.php b/src/lib/FieldType/Url/Type.php index 6650a591f1..bce00c6a31 100644 --- a/src/lib/FieldType/Url/Type.php +++ b/src/lib/FieldType/Url/Type.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\Core\FieldType\Url; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/src/lib/FieldType/Url/UrlStorage.php b/src/lib/FieldType/Url/UrlStorage.php index ff448030e2..cc000db3e1 100644 --- a/src/lib/FieldType/Url/UrlStorage.php +++ b/src/lib/FieldType/Url/UrlStorage.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\Core\FieldType\Url; use Ibexa\Contracts\Core\FieldType\GatewayBasedStorage; diff --git a/src/lib/FieldType/Url/UrlStorage/Gateway.php b/src/lib/FieldType/Url/UrlStorage/Gateway.php index 679ab0dbd5..487e5aec90 100644 --- a/src/lib/FieldType/Url/UrlStorage/Gateway.php +++ b/src/lib/FieldType/Url/UrlStorage/Gateway.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\Core\FieldType\Url\UrlStorage; use Ibexa\Contracts\Core\FieldType\StorageGateway; diff --git a/src/lib/FieldType/Url/UrlStorage/Gateway/DoctrineStorage.php b/src/lib/FieldType/Url/UrlStorage/Gateway/DoctrineStorage.php index aa832435b0..27cc2bd281 100644 --- a/src/lib/FieldType/Url/UrlStorage/Gateway/DoctrineStorage.php +++ b/src/lib/FieldType/Url/UrlStorage/Gateway/DoctrineStorage.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\Core\FieldType\Url\UrlStorage\Gateway; use Doctrine\DBAL\Connection; diff --git a/src/lib/FieldType/Url/Value.php b/src/lib/FieldType/Url/Value.php index 5f234fc0d7..7bad6b6d9d 100644 --- a/src/lib/FieldType/Url/Value.php +++ b/src/lib/FieldType/Url/Value.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\Core\FieldType\Url; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/User/Type.php b/src/lib/FieldType/User/Type.php index 97d9611bee..426aacac2e 100644 --- a/src/lib/FieldType/User/Type.php +++ b/src/lib/FieldType/User/Type.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\Core\FieldType\User; use DateTimeImmutable; diff --git a/src/lib/FieldType/User/UserStorage.php b/src/lib/FieldType/User/UserStorage.php index d682e5bac0..00a7c61041 100644 --- a/src/lib/FieldType/User/UserStorage.php +++ b/src/lib/FieldType/User/UserStorage.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\Core\FieldType\User; use Ibexa\Contracts\Core\FieldType\GatewayBasedStorage; diff --git a/src/lib/FieldType/User/UserStorage/Gateway.php b/src/lib/FieldType/User/UserStorage/Gateway.php index 0d6218c621..124b302ec6 100644 --- a/src/lib/FieldType/User/UserStorage/Gateway.php +++ b/src/lib/FieldType/User/UserStorage/Gateway.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\Core\FieldType\User\UserStorage; use Ibexa\Contracts\Core\FieldType\StorageGateway; diff --git a/src/lib/FieldType/User/UserStorage/Gateway/DoctrineStorage.php b/src/lib/FieldType/User/UserStorage/Gateway/DoctrineStorage.php index dbdc432915..cf054a4177 100644 --- a/src/lib/FieldType/User/UserStorage/Gateway/DoctrineStorage.php +++ b/src/lib/FieldType/User/UserStorage/Gateway/DoctrineStorage.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\Core\FieldType\User\UserStorage\Gateway; use Doctrine\DBAL\Connection; diff --git a/src/lib/FieldType/User/Value.php b/src/lib/FieldType/User/Value.php index e5b83f1109..473117a1ed 100644 --- a/src/lib/FieldType/User/Value.php +++ b/src/lib/FieldType/User/Value.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\Core\FieldType\User; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/src/lib/FieldType/ValidationError.php b/src/lib/FieldType/ValidationError.php index 3faa82714b..1cf02925d4 100644 --- a/src/lib/FieldType/ValidationError.php +++ b/src/lib/FieldType/ValidationError.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\ValidationError as ValidationErrorInterface; diff --git a/src/lib/FieldType/Validator.php b/src/lib/FieldType/Validator.php index 2832efcf24..18e5ebfa3b 100644 --- a/src/lib/FieldType/Validator.php +++ b/src/lib/FieldType/Validator.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\Core\FieldType; use Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException as PropertyNotFound; diff --git a/src/lib/FieldType/Validator/EmailAddressValidator.php b/src/lib/FieldType/Validator/EmailAddressValidator.php index 2deff8a00e..4b3d2de6a3 100644 --- a/src/lib/FieldType/Validator/EmailAddressValidator.php +++ b/src/lib/FieldType/Validator/EmailAddressValidator.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\Core\FieldType\Validator; use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinition; diff --git a/src/lib/FieldType/Validator/FileExtensionBlackListValidator.php b/src/lib/FieldType/Validator/FileExtensionBlackListValidator.php index 510d5d2ee9..7c9fe25c55 100644 --- a/src/lib/FieldType/Validator/FileExtensionBlackListValidator.php +++ b/src/lib/FieldType/Validator/FileExtensionBlackListValidator.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\Core\FieldType\Validator; use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinition; diff --git a/src/lib/FieldType/Validator/FileSizeValidator.php b/src/lib/FieldType/Validator/FileSizeValidator.php index 3fd2f5ef77..339a6ad698 100644 --- a/src/lib/FieldType/Validator/FileSizeValidator.php +++ b/src/lib/FieldType/Validator/FileSizeValidator.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\Core\FieldType\Validator; use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinition; diff --git a/src/lib/FieldType/Validator/FloatValueValidator.php b/src/lib/FieldType/Validator/FloatValueValidator.php index 1fb4013611..d7b7206688 100644 --- a/src/lib/FieldType/Validator/FloatValueValidator.php +++ b/src/lib/FieldType/Validator/FloatValueValidator.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\Core\FieldType\Validator; use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinition; diff --git a/src/lib/FieldType/Validator/ImageValidator.php b/src/lib/FieldType/Validator/ImageValidator.php index ae57f81f4a..5ba56f359f 100644 --- a/src/lib/FieldType/Validator/ImageValidator.php +++ b/src/lib/FieldType/Validator/ImageValidator.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\Core\FieldType\Validator; use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinition; diff --git a/src/lib/FieldType/Validator/IntegerValueValidator.php b/src/lib/FieldType/Validator/IntegerValueValidator.php index 3a69d22a47..1aff6c779e 100644 --- a/src/lib/FieldType/Validator/IntegerValueValidator.php +++ b/src/lib/FieldType/Validator/IntegerValueValidator.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\Core\FieldType\Validator; use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinition; diff --git a/src/lib/FieldType/Validator/StringLengthValidator.php b/src/lib/FieldType/Validator/StringLengthValidator.php index 23ffd68f32..75c2a45e56 100644 --- a/src/lib/FieldType/Validator/StringLengthValidator.php +++ b/src/lib/FieldType/Validator/StringLengthValidator.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\Core\FieldType\Validator; use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinition; diff --git a/src/lib/FieldType/Value.php b/src/lib/FieldType/Value.php index a57338a6e2..e09b29cab8 100644 --- a/src/lib/FieldType/Value.php +++ b/src/lib/FieldType/Value.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\Value as ValueInterface; diff --git a/src/lib/Helper/ContentInfoLocationLoader.php b/src/lib/Helper/ContentInfoLocationLoader.php index ba4d2f110d..d5205d5640 100644 --- a/src/lib/Helper/ContentInfoLocationLoader.php +++ b/src/lib/Helper/ContentInfoLocationLoader.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\Core\Helper; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/lib/Helper/ContentInfoLocationLoader/SudoMainLocationLoader.php b/src/lib/Helper/ContentInfoLocationLoader/SudoMainLocationLoader.php index 50dd5a3418..e54d50e1a9 100644 --- a/src/lib/Helper/ContentInfoLocationLoader/SudoMainLocationLoader.php +++ b/src/lib/Helper/ContentInfoLocationLoader/SudoMainLocationLoader.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\Core\Helper\ContentInfoLocationLoader; use Exception; diff --git a/src/lib/Helper/ContentPreviewHelper.php b/src/lib/Helper/ContentPreviewHelper.php index ae32cedc11..d5c1694e95 100644 --- a/src/lib/Helper/ContentPreviewHelper.php +++ b/src/lib/Helper/ContentPreviewHelper.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\Core\Helper; use Ibexa\Contracts\Core\Repository\Values\Content\Content; diff --git a/src/lib/Helper/FieldHelper.php b/src/lib/Helper/FieldHelper.php index c628846c11..b701f5b197 100644 --- a/src/lib/Helper/FieldHelper.php +++ b/src/lib/Helper/FieldHelper.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\Core\Helper; use Ibexa\Contracts\Core\Repository\ContentTypeService; diff --git a/src/lib/Helper/FieldsGroups/ArrayTranslatorFieldsGroupsList.php b/src/lib/Helper/FieldsGroups/ArrayTranslatorFieldsGroupsList.php index 3343fd4bd7..a88afe75a1 100644 --- a/src/lib/Helper/FieldsGroups/ArrayTranslatorFieldsGroupsList.php +++ b/src/lib/Helper/FieldsGroups/ArrayTranslatorFieldsGroupsList.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\Core\Helper\FieldsGroups; use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinition; diff --git a/src/lib/Helper/FieldsGroups/FieldsGroupsList.php b/src/lib/Helper/FieldsGroups/FieldsGroupsList.php index be128c0906..4e349a51cc 100644 --- a/src/lib/Helper/FieldsGroups/FieldsGroupsList.php +++ b/src/lib/Helper/FieldsGroups/FieldsGroupsList.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\Core\Helper\FieldsGroups; use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinition; diff --git a/src/lib/Helper/FieldsGroups/RepositoryConfigFieldsGroupsListFactory.php b/src/lib/Helper/FieldsGroups/RepositoryConfigFieldsGroupsListFactory.php index dad8611d2d..815fa4dcd7 100644 --- a/src/lib/Helper/FieldsGroups/RepositoryConfigFieldsGroupsListFactory.php +++ b/src/lib/Helper/FieldsGroups/RepositoryConfigFieldsGroupsListFactory.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\Core\Helper\FieldsGroups; use Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider; diff --git a/src/lib/Helper/PreviewLocationProvider.php b/src/lib/Helper/PreviewLocationProvider.php index 7d3bd6b662..5c2a515c23 100644 --- a/src/lib/Helper/PreviewLocationProvider.php +++ b/src/lib/Helper/PreviewLocationProvider.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\Core\Helper; use Ibexa\Contracts\Core\Persistence\Content\Location\Handler as PersistenceLocationHandler; diff --git a/src/lib/Helper/TranslationHelper.php b/src/lib/Helper/TranslationHelper.php index 7942a5a710..23484d7c6f 100644 --- a/src/lib/Helper/TranslationHelper.php +++ b/src/lib/Helper/TranslationHelper.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\Core\Helper; use Ibexa\Contracts\Core\Repository\ContentService; diff --git a/src/lib/IO/Exception/BinaryFileNotFoundException.php b/src/lib/IO/Exception/BinaryFileNotFoundException.php index 10ac691b25..fca6c6b7b4 100644 --- a/src/lib/IO/Exception/BinaryFileNotFoundException.php +++ b/src/lib/IO/Exception/BinaryFileNotFoundException.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\Core\IO\Exception; use Exception; diff --git a/src/lib/IO/Exception/IOException.php b/src/lib/IO/Exception/IOException.php index d9d04e826b..374d5e26a3 100644 --- a/src/lib/IO/Exception/IOException.php +++ b/src/lib/IO/Exception/IOException.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\Core\IO\Exception; use Exception; diff --git a/src/lib/IO/Exception/InvalidBinaryAbsolutePathException.php b/src/lib/IO/Exception/InvalidBinaryAbsolutePathException.php index 4748b88708..1ebb8c8e7a 100644 --- a/src/lib/IO/Exception/InvalidBinaryAbsolutePathException.php +++ b/src/lib/IO/Exception/InvalidBinaryAbsolutePathException.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\Core\IO\Exception; use Exception; diff --git a/src/lib/IO/Exception/InvalidBinaryFileIdException.php b/src/lib/IO/Exception/InvalidBinaryFileIdException.php index 1e660c7368..215ca49fb5 100644 --- a/src/lib/IO/Exception/InvalidBinaryFileIdException.php +++ b/src/lib/IO/Exception/InvalidBinaryFileIdException.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\Core\IO\Exception; use Ibexa\Core\Base\Exceptions\InvalidArgumentValue; diff --git a/src/lib/IO/Exception/InvalidBinaryPrefixException.php b/src/lib/IO/Exception/InvalidBinaryPrefixException.php index e7232f722f..423f8294ea 100644 --- a/src/lib/IO/Exception/InvalidBinaryPrefixException.php +++ b/src/lib/IO/Exception/InvalidBinaryPrefixException.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\Core\IO\Exception; use Exception; diff --git a/src/lib/IO/Flysystem/PathPrefixer/PathPrefixerInterface.php b/src/lib/IO/Flysystem/PathPrefixer/PathPrefixerInterface.php index bb3e2ee778..a82e928c2a 100644 --- a/src/lib/IO/Flysystem/PathPrefixer/PathPrefixerInterface.php +++ b/src/lib/IO/Flysystem/PathPrefixer/PathPrefixerInterface.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\Core\IO\Flysystem\PathPrefixer; /** diff --git a/src/lib/IO/IOBinarydataHandler.php b/src/lib/IO/IOBinarydataHandler.php index 36d07baf8d..4b5cf4207d 100644 --- a/src/lib/IO/IOBinarydataHandler.php +++ b/src/lib/IO/IOBinarydataHandler.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\Core\IO; use Ibexa\Contracts\Core\IO\BinaryFileCreateStruct; diff --git a/src/lib/IO/IOBinarydataHandler/Flysystem.php b/src/lib/IO/IOBinarydataHandler/Flysystem.php index 596b9c6988..5274a5bc1a 100644 --- a/src/lib/IO/IOBinarydataHandler/Flysystem.php +++ b/src/lib/IO/IOBinarydataHandler/Flysystem.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\Core\IO\IOBinarydataHandler; use Ibexa\Contracts\Core\IO\BinaryFileCreateStruct; diff --git a/src/lib/IO/IOBinarydataHandler/SiteAccessDependentBinaryDataHandler.php b/src/lib/IO/IOBinarydataHandler/SiteAccessDependentBinaryDataHandler.php index f1c70d8818..581092828f 100644 --- a/src/lib/IO/IOBinarydataHandler/SiteAccessDependentBinaryDataHandler.php +++ b/src/lib/IO/IOBinarydataHandler/SiteAccessDependentBinaryDataHandler.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\Core\IO\IOBinarydataHandler; use Ibexa\Bundle\IO\ApiLoader\HandlerRegistry; diff --git a/src/lib/IO/IOBinarydataHandler/SiteAccessDependentMetadataHandler.php b/src/lib/IO/IOBinarydataHandler/SiteAccessDependentMetadataHandler.php index 577dda4049..665c64a46f 100644 --- a/src/lib/IO/IOBinarydataHandler/SiteAccessDependentMetadataHandler.php +++ b/src/lib/IO/IOBinarydataHandler/SiteAccessDependentMetadataHandler.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\Core\IO\IOBinarydataHandler; use Ibexa\Bundle\IO\ApiLoader\HandlerRegistry; diff --git a/src/lib/IO/IOMetadataHandler.php b/src/lib/IO/IOMetadataHandler.php index 29f549d6cc..657fd7c401 100644 --- a/src/lib/IO/IOMetadataHandler.php +++ b/src/lib/IO/IOMetadataHandler.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\Core\IO; use Ibexa\Contracts\Core\IO\BinaryFileCreateStruct; diff --git a/src/lib/IO/IOMetadataHandler/Flysystem.php b/src/lib/IO/IOMetadataHandler/Flysystem.php index f294f5b74e..2c3f6005a3 100644 --- a/src/lib/IO/IOMetadataHandler/Flysystem.php +++ b/src/lib/IO/IOMetadataHandler/Flysystem.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\Core\IO\IOMetadataHandler; use DateTime; diff --git a/src/lib/IO/IOMetadataHandler/LegacyDFSCluster.php b/src/lib/IO/IOMetadataHandler/LegacyDFSCluster.php index 3b6f0f9c34..a6e336b255 100644 --- a/src/lib/IO/IOMetadataHandler/LegacyDFSCluster.php +++ b/src/lib/IO/IOMetadataHandler/LegacyDFSCluster.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\Core\IO\IOMetadataHandler; use DateTime; diff --git a/src/lib/IO/IOService.php b/src/lib/IO/IOService.php index 2df7587935..791e05a5bf 100644 --- a/src/lib/IO/IOService.php +++ b/src/lib/IO/IOService.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\Core\IO; use Exception; diff --git a/src/lib/IO/IOServiceInterface.php b/src/lib/IO/IOServiceInterface.php index c676310600..19d8d62099 100644 --- a/src/lib/IO/IOServiceInterface.php +++ b/src/lib/IO/IOServiceInterface.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\Core\IO; use Ibexa\Core\IO\Values\BinaryFile; diff --git a/src/lib/IO/MetadataHandler.php b/src/lib/IO/MetadataHandler.php index 3b27be92f9..1d30271053 100644 --- a/src/lib/IO/MetadataHandler.php +++ b/src/lib/IO/MetadataHandler.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\Core\IO; /** diff --git a/src/lib/IO/MetadataHandler/ImageSize.php b/src/lib/IO/MetadataHandler/ImageSize.php index d7d47c1450..06b9aec4d1 100644 --- a/src/lib/IO/MetadataHandler/ImageSize.php +++ b/src/lib/IO/MetadataHandler/ImageSize.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\Core\IO\MetadataHandler; use Ibexa\Core\IO\MetadataHandler; diff --git a/src/lib/IO/MimeTypeDetector/FileInfo.php b/src/lib/IO/MimeTypeDetector/FileInfo.php index 0318ea902b..1633b10f8f 100644 --- a/src/lib/IO/MimeTypeDetector/FileInfo.php +++ b/src/lib/IO/MimeTypeDetector/FileInfo.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\Core\IO\MimeTypeDetector; use Ibexa\Contracts\Core\IO\MimeTypeDetector; diff --git a/src/lib/IO/TolerantIOService.php b/src/lib/IO/TolerantIOService.php index a92363f57b..c954fa5775 100644 --- a/src/lib/IO/TolerantIOService.php +++ b/src/lib/IO/TolerantIOService.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\Core\IO; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/src/lib/IO/UrlDecorator.php b/src/lib/IO/UrlDecorator.php index 6eb2d30cfc..61999a9ecb 100644 --- a/src/lib/IO/UrlDecorator.php +++ b/src/lib/IO/UrlDecorator.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\Core\IO; /** diff --git a/src/lib/IO/UrlRedecorator.php b/src/lib/IO/UrlRedecorator.php index 7f393d0a9d..b3bc3d2640 100644 --- a/src/lib/IO/UrlRedecorator.php +++ b/src/lib/IO/UrlRedecorator.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\Core\IO; /** diff --git a/src/lib/IO/UrlRedecoratorInterface.php b/src/lib/IO/UrlRedecoratorInterface.php index bcc0c0d886..6466dae982 100644 --- a/src/lib/IO/UrlRedecoratorInterface.php +++ b/src/lib/IO/UrlRedecoratorInterface.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\Core\IO; /** diff --git a/src/lib/IO/Values/BinaryFile.php b/src/lib/IO/Values/BinaryFile.php index 247f026a62..46c2b09adf 100644 --- a/src/lib/IO/Values/BinaryFile.php +++ b/src/lib/IO/Values/BinaryFile.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\Core\IO\Values; use Ibexa\Contracts\Core\Repository\Values\ValueObject; diff --git a/src/lib/IO/Values/BinaryFileCreateStruct.php b/src/lib/IO/Values/BinaryFileCreateStruct.php index 492877fd79..af284e83ab 100644 --- a/src/lib/IO/Values/BinaryFileCreateStruct.php +++ b/src/lib/IO/Values/BinaryFileCreateStruct.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\Core\IO\Values; use Ibexa\Contracts\Core\Repository\Values\ValueObject; diff --git a/src/lib/IO/Values/MissingBinaryFile.php b/src/lib/IO/Values/MissingBinaryFile.php index 8958ddf452..4bebe3c02c 100644 --- a/src/lib/IO/Values/MissingBinaryFile.php +++ b/src/lib/IO/Values/MissingBinaryFile.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\Core\IO\Values; /** diff --git a/src/lib/Limitation/AbstractPersistenceLimitationType.php b/src/lib/Limitation/AbstractPersistenceLimitationType.php index fe0c074b65..e6bdb26a9c 100644 --- a/src/lib/Limitation/AbstractPersistenceLimitationType.php +++ b/src/lib/Limitation/AbstractPersistenceLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Persistence\Handler as SPIPersistenceHandler; diff --git a/src/lib/Limitation/BlockingLimitationType.php b/src/lib/Limitation/BlockingLimitationType.php index b8bad0a85b..38f64cc444 100644 --- a/src/lib/Limitation/BlockingLimitationType.php +++ b/src/lib/Limitation/BlockingLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Type as SPILimitationTypeInterface; diff --git a/src/lib/Limitation/ContentTypeLimitationType.php b/src/lib/Limitation/ContentTypeLimitationType.php index 62e0e73136..62f13dfdcf 100644 --- a/src/lib/Limitation/ContentTypeLimitationType.php +++ b/src/lib/Limitation/ContentTypeLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Target; diff --git a/src/lib/Limitation/LocationLimitationType.php b/src/lib/Limitation/LocationLimitationType.php index 3c7cd6571f..45c0e3f535 100644 --- a/src/lib/Limitation/LocationLimitationType.php +++ b/src/lib/Limitation/LocationLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Type as SPILimitationTypeInterface; diff --git a/src/lib/Limitation/NewObjectStateLimitationType.php b/src/lib/Limitation/NewObjectStateLimitationType.php index bc0006b24c..d6e21ec666 100644 --- a/src/lib/Limitation/NewObjectStateLimitationType.php +++ b/src/lib/Limitation/NewObjectStateLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Type as SPILimitationTypeInterface; diff --git a/src/lib/Limitation/NewSectionLimitationType.php b/src/lib/Limitation/NewSectionLimitationType.php index b9186c1feb..317582025d 100644 --- a/src/lib/Limitation/NewSectionLimitationType.php +++ b/src/lib/Limitation/NewSectionLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Type as SPILimitationTypeInterface; diff --git a/src/lib/Limitation/ObjectStateLimitationType.php b/src/lib/Limitation/ObjectStateLimitationType.php index c1b015ca54..e103e9ab9c 100644 --- a/src/lib/Limitation/ObjectStateLimitationType.php +++ b/src/lib/Limitation/ObjectStateLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Type as SPILimitationTypeInterface; diff --git a/src/lib/Limitation/OwnerLimitationType.php b/src/lib/Limitation/OwnerLimitationType.php index c1a4da4c06..3967042601 100644 --- a/src/lib/Limitation/OwnerLimitationType.php +++ b/src/lib/Limitation/OwnerLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Type as SPILimitationTypeInterface; diff --git a/src/lib/Limitation/ParentContentTypeLimitationType.php b/src/lib/Limitation/ParentContentTypeLimitationType.php index f1e7fbe761..16b417f59c 100644 --- a/src/lib/Limitation/ParentContentTypeLimitationType.php +++ b/src/lib/Limitation/ParentContentTypeLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Type as SPILimitationTypeInterface; diff --git a/src/lib/Limitation/ParentDepthLimitationType.php b/src/lib/Limitation/ParentDepthLimitationType.php index 32ad40fb32..bcdcf47b1d 100644 --- a/src/lib/Limitation/ParentDepthLimitationType.php +++ b/src/lib/Limitation/ParentDepthLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Type as SPILimitationTypeInterface; diff --git a/src/lib/Limitation/ParentOwnerLimitationType.php b/src/lib/Limitation/ParentOwnerLimitationType.php index 7c7059d953..9e90a79321 100644 --- a/src/lib/Limitation/ParentOwnerLimitationType.php +++ b/src/lib/Limitation/ParentOwnerLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Target; diff --git a/src/lib/Limitation/ParentUserGroupLimitationType.php b/src/lib/Limitation/ParentUserGroupLimitationType.php index b4239508c0..fb7bc3cf28 100644 --- a/src/lib/Limitation/ParentUserGroupLimitationType.php +++ b/src/lib/Limitation/ParentUserGroupLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Target; diff --git a/src/lib/Limitation/SectionLimitationType.php b/src/lib/Limitation/SectionLimitationType.php index 99769e3958..015c7cf014 100644 --- a/src/lib/Limitation/SectionLimitationType.php +++ b/src/lib/Limitation/SectionLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Type as SPILimitationTypeInterface; diff --git a/src/lib/Limitation/SiteAccessLimitationType.php b/src/lib/Limitation/SiteAccessLimitationType.php index 13a087195d..5c7fa94da5 100644 --- a/src/lib/Limitation/SiteAccessLimitationType.php +++ b/src/lib/Limitation/SiteAccessLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Type as SPILimitationTypeInterface; diff --git a/src/lib/Limitation/StatusLimitationType.php b/src/lib/Limitation/StatusLimitationType.php index 93648c5340..24f00d6349 100644 --- a/src/lib/Limitation/StatusLimitationType.php +++ b/src/lib/Limitation/StatusLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Type as SPILimitationTypeInterface; diff --git a/src/lib/Limitation/SubtreeLimitationType.php b/src/lib/Limitation/SubtreeLimitationType.php index c642ec64e8..2625f07f49 100644 --- a/src/lib/Limitation/SubtreeLimitationType.php +++ b/src/lib/Limitation/SubtreeLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Target\Version; diff --git a/src/lib/Limitation/UserGroupLimitationType.php b/src/lib/Limitation/UserGroupLimitationType.php index 0232e10ec9..f2cbfe2422 100644 --- a/src/lib/Limitation/UserGroupLimitationType.php +++ b/src/lib/Limitation/UserGroupLimitationType.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Type as SPILimitationTypeInterface; diff --git a/src/lib/MVC/Exception/HiddenLocationException.php b/src/lib/MVC/Exception/HiddenLocationException.php index b8785a4704..6801b1be7a 100644 --- a/src/lib/MVC/Exception/HiddenLocationException.php +++ b/src/lib/MVC/Exception/HiddenLocationException.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\Core\MVC\Exception; use Ibexa\Contracts\Core\Repository\Values\Content\Location; diff --git a/src/lib/MVC/Exception/InvalidSiteAccessException.php b/src/lib/MVC/Exception/InvalidSiteAccessException.php index e16fcbd159..8ebbc5a3af 100644 --- a/src/lib/MVC/Exception/InvalidSiteAccessException.php +++ b/src/lib/MVC/Exception/InvalidSiteAccessException.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\Core\MVC\Exception; use Ibexa\Core\MVC\Symfony\SiteAccess\SiteAccessProviderInterface; diff --git a/src/lib/MVC/Exception/NoViewTemplateException.php b/src/lib/MVC/Exception/NoViewTemplateException.php index bd6af39de7..b433058f99 100644 --- a/src/lib/MVC/Exception/NoViewTemplateException.php +++ b/src/lib/MVC/Exception/NoViewTemplateException.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\Core\MVC\Exception; use Exception; diff --git a/src/lib/MVC/Exception/ParameterNotFoundException.php b/src/lib/MVC/Exception/ParameterNotFoundException.php index f7ede1eb92..96e08c8d9c 100644 --- a/src/lib/MVC/Exception/ParameterNotFoundException.php +++ b/src/lib/MVC/Exception/ParameterNotFoundException.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\Core\MVC\Exception; use InvalidArgumentException; diff --git a/src/lib/MVC/Exception/SourceImageNotFoundException.php b/src/lib/MVC/Exception/SourceImageNotFoundException.php index a277a9a549..6057ca766d 100644 --- a/src/lib/MVC/Exception/SourceImageNotFoundException.php +++ b/src/lib/MVC/Exception/SourceImageNotFoundException.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\Core\MVC\Exception; use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; diff --git a/src/lib/MVC/RepositoryAware.php b/src/lib/MVC/RepositoryAware.php index 0802400ec6..542d7a1fe1 100644 --- a/src/lib/MVC/RepositoryAware.php +++ b/src/lib/MVC/RepositoryAware.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\Core\MVC; use Ibexa\Contracts\Core\Repository\Repository; diff --git a/src/lib/MVC/RepositoryAwareInterface.php b/src/lib/MVC/RepositoryAwareInterface.php index f1484d5eff..c91a19f54f 100644 --- a/src/lib/MVC/RepositoryAwareInterface.php +++ b/src/lib/MVC/RepositoryAwareInterface.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\Core\MVC; use Ibexa\Contracts\Core\Repository\Repository; diff --git a/src/lib/MVC/Symfony/Component/Serializer/CompoundMatcherNormalizer.php b/src/lib/MVC/Symfony/Component/Serializer/CompoundMatcherNormalizer.php index 3fbb99fe05..02ba5b02fd 100644 --- a/src/lib/MVC/Symfony/Component/Serializer/CompoundMatcherNormalizer.php +++ b/src/lib/MVC/Symfony/Component/Serializer/CompoundMatcherNormalizer.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\Core\MVC\Symfony\Component\Serializer; use Ibexa\Core\MVC\Symfony\SiteAccess\Matcher; diff --git a/src/lib/MVC/Symfony/Component/Serializer/SimplifiedRequestNormalizer.php b/src/lib/MVC/Symfony/Component/Serializer/SimplifiedRequestNormalizer.php index 1032a189c5..0eb6a0d15c 100644 --- a/src/lib/MVC/Symfony/Component/Serializer/SimplifiedRequestNormalizer.php +++ b/src/lib/MVC/Symfony/Component/Serializer/SimplifiedRequestNormalizer.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\Core\MVC\Symfony\Component\Serializer; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/ConfigDumperInterface.php b/src/lib/MVC/Symfony/ConfigDumperInterface.php index 1da94ee506..3fe551a91c 100644 --- a/src/lib/MVC/Symfony/ConfigDumperInterface.php +++ b/src/lib/MVC/Symfony/ConfigDumperInterface.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\Core\MVC\Symfony; /** diff --git a/src/lib/MVC/Symfony/Configuration/VersatileScopeInterface.php b/src/lib/MVC/Symfony/Configuration/VersatileScopeInterface.php index 49dc21b643..2572cce165 100644 --- a/src/lib/MVC/Symfony/Configuration/VersatileScopeInterface.php +++ b/src/lib/MVC/Symfony/Configuration/VersatileScopeInterface.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\Core\MVC\Symfony\Configuration; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/lib/MVC/Symfony/Controller/Content/DownloadController.php b/src/lib/MVC/Symfony/Controller/Content/DownloadController.php index 46408987e6..be3fb9501c 100644 --- a/src/lib/MVC/Symfony/Controller/Content/DownloadController.php +++ b/src/lib/MVC/Symfony/Controller/Content/DownloadController.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\Core\MVC\Symfony\Controller\Content; use Ibexa\Bundle\IO\BinaryStreamResponse; diff --git a/src/lib/MVC/Symfony/Controller/Content/DownloadRedirectionController.php b/src/lib/MVC/Symfony/Controller/Content/DownloadRedirectionController.php index e40ceba30c..77797adeeb 100644 --- a/src/lib/MVC/Symfony/Controller/Content/DownloadRedirectionController.php +++ b/src/lib/MVC/Symfony/Controller/Content/DownloadRedirectionController.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\Core\MVC\Symfony\Controller\Content; use Ibexa\Contracts\Core\Repository\ContentService; diff --git a/src/lib/MVC/Symfony/Controller/Content/PreviewController.php b/src/lib/MVC/Symfony/Controller/Content/PreviewController.php index 2bfec8d11f..900dc25768 100644 --- a/src/lib/MVC/Symfony/Controller/Content/PreviewController.php +++ b/src/lib/MVC/Symfony/Controller/Content/PreviewController.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\Core\MVC\Symfony\Controller\Content; use Exception; diff --git a/src/lib/MVC/Symfony/Controller/Content/QueryController.php b/src/lib/MVC/Symfony/Controller/Content/QueryController.php index 17ba947b93..3f012e8ed7 100644 --- a/src/lib/MVC/Symfony/Controller/Content/QueryController.php +++ b/src/lib/MVC/Symfony/Controller/Content/QueryController.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\Core\MVC\Symfony\Controller\Content; use Ibexa\Contracts\Core\Repository\SearchService; diff --git a/src/lib/MVC/Symfony/Controller/Content/ViewController.php b/src/lib/MVC/Symfony/Controller/Content/ViewController.php index 9173379433..b35a0a34ba 100644 --- a/src/lib/MVC/Symfony/Controller/Content/ViewController.php +++ b/src/lib/MVC/Symfony/Controller/Content/ViewController.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\Core\MVC\Symfony\Controller\Content; use DateTime; diff --git a/src/lib/MVC/Symfony/Controller/Controller.php b/src/lib/MVC/Symfony/Controller/Controller.php index a931508152..8d898c9534 100644 --- a/src/lib/MVC/Symfony/Controller/Controller.php +++ b/src/lib/MVC/Symfony/Controller/Controller.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\Core\MVC\Symfony\Controller; use Ibexa\Core\MVC\Symfony\Security\Authorization\Attribute as AuthorizationAttribute; diff --git a/src/lib/MVC/Symfony/Controller/SecurityController.php b/src/lib/MVC/Symfony/Controller/SecurityController.php index 134f09acad..9e88ac416f 100644 --- a/src/lib/MVC/Symfony/Controller/SecurityController.php +++ b/src/lib/MVC/Symfony/Controller/SecurityController.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\Core\MVC\Symfony\Controller; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/lib/MVC/Symfony/Event/APIContentExceptionEvent.php b/src/lib/MVC/Symfony/Event/APIContentExceptionEvent.php index 04f8d8926a..05ed61599d 100644 --- a/src/lib/MVC/Symfony/Event/APIContentExceptionEvent.php +++ b/src/lib/MVC/Symfony/Event/APIContentExceptionEvent.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\Core\MVC\Symfony\Event; use Exception; diff --git a/src/lib/MVC/Symfony/Event/ConsoleInitEvent.php b/src/lib/MVC/Symfony/Event/ConsoleInitEvent.php index 3c1dddfdf8..c679483c71 100644 --- a/src/lib/MVC/Symfony/Event/ConsoleInitEvent.php +++ b/src/lib/MVC/Symfony/Event/ConsoleInitEvent.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\Core\MVC\Symfony\Event; use Symfony\Component\Console\Event\ConsoleEvent; diff --git a/src/lib/MVC/Symfony/Event/ContentCacheClearEvent.php b/src/lib/MVC/Symfony/Event/ContentCacheClearEvent.php index a692c8723f..023d1ecc3f 100644 --- a/src/lib/MVC/Symfony/Event/ContentCacheClearEvent.php +++ b/src/lib/MVC/Symfony/Event/ContentCacheClearEvent.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\Core\MVC\Symfony\Event; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/lib/MVC/Symfony/Event/PostSiteAccessMatchEvent.php b/src/lib/MVC/Symfony/Event/PostSiteAccessMatchEvent.php index 35520f3619..1780202ed9 100644 --- a/src/lib/MVC/Symfony/Event/PostSiteAccessMatchEvent.php +++ b/src/lib/MVC/Symfony/Event/PostSiteAccessMatchEvent.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\Core\MVC\Symfony\Event; use Ibexa\Core\MVC\Symfony\SiteAccess; diff --git a/src/lib/MVC/Symfony/Event/PreContentViewEvent.php b/src/lib/MVC/Symfony/Event/PreContentViewEvent.php index fc5e13207d..26aee26948 100644 --- a/src/lib/MVC/Symfony/Event/PreContentViewEvent.php +++ b/src/lib/MVC/Symfony/Event/PreContentViewEvent.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\Core\MVC\Symfony\Event; use Ibexa\Core\MVC\Symfony\View\View; diff --git a/src/lib/MVC/Symfony/Event/RouteReferenceGenerationEvent.php b/src/lib/MVC/Symfony/Event/RouteReferenceGenerationEvent.php index 19571aede2..eb4ba4efd4 100644 --- a/src/lib/MVC/Symfony/Event/RouteReferenceGenerationEvent.php +++ b/src/lib/MVC/Symfony/Event/RouteReferenceGenerationEvent.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\Core\MVC\Symfony\Event; use Ibexa\Core\MVC\Symfony\Routing\RouteReference; diff --git a/src/lib/MVC/Symfony/Event/ScopeChangeEvent.php b/src/lib/MVC/Symfony/Event/ScopeChangeEvent.php index 121c58e329..524c69bdfd 100644 --- a/src/lib/MVC/Symfony/Event/ScopeChangeEvent.php +++ b/src/lib/MVC/Symfony/Event/ScopeChangeEvent.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\Core\MVC\Symfony\Event; use Ibexa\Core\MVC\Symfony\SiteAccess; diff --git a/src/lib/MVC/Symfony/EventListener/LanguageSwitchListener.php b/src/lib/MVC/Symfony/EventListener/LanguageSwitchListener.php index 14dc3bc582..423aefd9c6 100644 --- a/src/lib/MVC/Symfony/EventListener/LanguageSwitchListener.php +++ b/src/lib/MVC/Symfony/EventListener/LanguageSwitchListener.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\Core\MVC\Symfony\EventListener; use Ibexa\Core\Helper\TranslationHelper; diff --git a/src/lib/MVC/Symfony/EventListener/SiteAccessMatchListener.php b/src/lib/MVC/Symfony/EventListener/SiteAccessMatchListener.php index e55cb6a6a0..cabe9ac865 100644 --- a/src/lib/MVC/Symfony/EventListener/SiteAccessMatchListener.php +++ b/src/lib/MVC/Symfony/EventListener/SiteAccessMatchListener.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\Core\MVC\Symfony\EventListener; // @todo Move SiteAccessMatcherRegistryInterface to \Ibexa\Core\MVC\Symfony\SiteAccess\Matcher diff --git a/src/lib/MVC/Symfony/FieldType/BinaryBase/ContentDownloadUrlGenerator.php b/src/lib/MVC/Symfony/FieldType/BinaryBase/ContentDownloadUrlGenerator.php index 14b7b7849a..8fec6d19e4 100644 --- a/src/lib/MVC/Symfony/FieldType/BinaryBase/ContentDownloadUrlGenerator.php +++ b/src/lib/MVC/Symfony/FieldType/BinaryBase/ContentDownloadUrlGenerator.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\Core\MVC\Symfony\FieldType\BinaryBase; use Ibexa\Contracts\Core\FieldType\BinaryBase\PathGenerator; diff --git a/src/lib/MVC/Symfony/FieldType/Relation/ParameterProvider.php b/src/lib/MVC/Symfony/FieldType/Relation/ParameterProvider.php index 625b009089..5de229b5db 100644 --- a/src/lib/MVC/Symfony/FieldType/Relation/ParameterProvider.php +++ b/src/lib/MVC/Symfony/FieldType/Relation/ParameterProvider.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\Core\MVC\Symfony\FieldType\Relation; use Ibexa\Contracts\Core\Repository\ContentService; diff --git a/src/lib/MVC/Symfony/FieldType/RelationList/ParameterProvider.php b/src/lib/MVC/Symfony/FieldType/RelationList/ParameterProvider.php index b5a2cb4b46..eae62a2072 100644 --- a/src/lib/MVC/Symfony/FieldType/RelationList/ParameterProvider.php +++ b/src/lib/MVC/Symfony/FieldType/RelationList/ParameterProvider.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\Core\MVC\Symfony\FieldType\RelationList; use Ibexa\Contracts\Core\Repository\ContentService; diff --git a/src/lib/MVC/Symfony/FieldType/View/ParameterProvider/LocaleParameterProvider.php b/src/lib/MVC/Symfony/FieldType/View/ParameterProvider/LocaleParameterProvider.php index 729156cdc7..9eb07ae8b1 100644 --- a/src/lib/MVC/Symfony/FieldType/View/ParameterProvider/LocaleParameterProvider.php +++ b/src/lib/MVC/Symfony/FieldType/View/ParameterProvider/LocaleParameterProvider.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\Core\MVC\Symfony\FieldType\View\ParameterProvider; use Ibexa\Contracts\Core\Repository\Values\Content\Field; diff --git a/src/lib/MVC/Symfony/FieldType/View/ParameterProviderInterface.php b/src/lib/MVC/Symfony/FieldType/View/ParameterProviderInterface.php index f5e5536732..a4a1c5b8e8 100644 --- a/src/lib/MVC/Symfony/FieldType/View/ParameterProviderInterface.php +++ b/src/lib/MVC/Symfony/FieldType/View/ParameterProviderInterface.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\Core\MVC\Symfony\FieldType\View; use Ibexa\Contracts\Core\Repository\Values\Content\Field; diff --git a/src/lib/MVC/Symfony/FieldType/View/ParameterProviderRegistry.php b/src/lib/MVC/Symfony/FieldType/View/ParameterProviderRegistry.php index ac27d7b061..ed366129fc 100644 --- a/src/lib/MVC/Symfony/FieldType/View/ParameterProviderRegistry.php +++ b/src/lib/MVC/Symfony/FieldType/View/ParameterProviderRegistry.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\Core\MVC\Symfony\FieldType\View; use InvalidArgumentException; diff --git a/src/lib/MVC/Symfony/FieldType/View/ParameterProviderRegistryInterface.php b/src/lib/MVC/Symfony/FieldType/View/ParameterProviderRegistryInterface.php index 3af3df6d52..d40fcf1f62 100644 --- a/src/lib/MVC/Symfony/FieldType/View/ParameterProviderRegistryInterface.php +++ b/src/lib/MVC/Symfony/FieldType/View/ParameterProviderRegistryInterface.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\Core\MVC\Symfony\FieldType\View; /** diff --git a/src/lib/MVC/Symfony/Locale/LocaleConverter.php b/src/lib/MVC/Symfony/Locale/LocaleConverter.php index 5f99846a5a..4a210f985d 100644 --- a/src/lib/MVC/Symfony/Locale/LocaleConverter.php +++ b/src/lib/MVC/Symfony/Locale/LocaleConverter.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\Core\MVC\Symfony\Locale; use Psr\Log\LoggerInterface; diff --git a/src/lib/MVC/Symfony/Locale/LocaleConverterInterface.php b/src/lib/MVC/Symfony/Locale/LocaleConverterInterface.php index 08bd545578..387aae3449 100644 --- a/src/lib/MVC/Symfony/Locale/LocaleConverterInterface.php +++ b/src/lib/MVC/Symfony/Locale/LocaleConverterInterface.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\Core\MVC\Symfony\Locale; /** diff --git a/src/lib/MVC/Symfony/MVCEvents.php b/src/lib/MVC/Symfony/MVCEvents.php index 903d67e6db..dd415eaf50 100644 --- a/src/lib/MVC/Symfony/MVCEvents.php +++ b/src/lib/MVC/Symfony/MVCEvents.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\Core\MVC\Symfony; final class MVCEvents diff --git a/src/lib/MVC/Symfony/Matcher/ClassNameMatcherFactory.php b/src/lib/MVC/Symfony/Matcher/ClassNameMatcherFactory.php index ccafe9b3a8..25f588cbe1 100644 --- a/src/lib/MVC/Symfony/Matcher/ClassNameMatcherFactory.php +++ b/src/lib/MVC/Symfony/Matcher/ClassNameMatcherFactory.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\Core\MVC\Symfony\Matcher; use Ibexa\Contracts\Core\Repository\Repository; diff --git a/src/lib/MVC/Symfony/Matcher/ConfigurableMatcherFactoryInterface.php b/src/lib/MVC/Symfony/Matcher/ConfigurableMatcherFactoryInterface.php index ef9c6a0a59..ed2cc2ac56 100644 --- a/src/lib/MVC/Symfony/Matcher/ConfigurableMatcherFactoryInterface.php +++ b/src/lib/MVC/Symfony/Matcher/ConfigurableMatcherFactoryInterface.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\Core\MVC\Symfony\Matcher; /** diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/Depth.php b/src/lib/MVC/Symfony/Matcher/ContentBased/Depth.php index 5ab721b4e8..ce3a0af336 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/Depth.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/Depth.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\Core\MVC\Symfony\Matcher\ContentBased; use Ibexa\Contracts\Core\Repository\Repository; diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Content.php b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Content.php index 3158b989b0..2ce556bacf 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Content.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Content.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentType.php b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentType.php index 630e11205e..0606deb3f9 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentType.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentType.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTypeGroup.php b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTypeGroup.php index 8b3b6fb74d..b6c570b9ef 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTypeGroup.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTypeGroup.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Location.php b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Location.php index 412c836aec..553ddfc1bb 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Location.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Location.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/LocationRemote.php b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/LocationRemote.php index 0f3b870650..c3ddd19ca3 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/LocationRemote.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/LocationRemote.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentContentType.php b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentContentType.php index 8b0ac09a3f..b0f36c2a6c 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentContentType.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentContentType.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\Repository; diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentLocation.php b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentLocation.php index 3b5dd3e6ce..1bebc971e9 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentLocation.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentLocation.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\Repository; diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Remote.php b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Remote.php index 8b8f15c619..8934978fb3 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Remote.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Remote.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Section.php b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Section.php index 6573b56ea7..4e51670d06 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Section.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/Id/Section.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ContentType.php b/src/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ContentType.php index 62deaf6a80..6161b71258 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ContentType.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ContentType.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\Core\MVC\Symfony\Matcher\ContentBased\Identifier; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ParentContentType.php b/src/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ParentContentType.php index 932c049929..0da4ba9e27 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ParentContentType.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ParentContentType.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\Core\MVC\Symfony\Matcher\ContentBased\Identifier; use Ibexa\Contracts\Core\Repository\Repository; diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/Identifier/Section.php b/src/lib/MVC/Symfony/Matcher/ContentBased/Identifier/Section.php index 97cff3130d..23c8e1aa0a 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/Identifier/Section.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/Identifier/Section.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\Core\MVC\Symfony\Matcher\ContentBased\Identifier; use Ibexa\Contracts\Core\Repository\Repository; diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/MatcherInterface.php b/src/lib/MVC/Symfony/Matcher/ContentBased/MatcherInterface.php index 4489855485..41fea2b927 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/MatcherInterface.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/MatcherInterface.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\Core\MVC\Symfony\Matcher\ContentBased; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/MultipleValued.php b/src/lib/MVC/Symfony/Matcher/ContentBased/MultipleValued.php index 55a64b198f..87e0e671fc 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/MultipleValued.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/MultipleValued.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\Core\MVC\Symfony\Matcher\ContentBased; use Ibexa\Core\MVC\RepositoryAware; diff --git a/src/lib/MVC/Symfony/Matcher/ContentBased/UrlAlias.php b/src/lib/MVC/Symfony/Matcher/ContentBased/UrlAlias.php index ec7f0b07a5..8537fe54e2 100644 --- a/src/lib/MVC/Symfony/Matcher/ContentBased/UrlAlias.php +++ b/src/lib/MVC/Symfony/Matcher/ContentBased/UrlAlias.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\Core\MVC\Symfony\Matcher\ContentBased; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/lib/MVC/Symfony/Matcher/DynamicallyConfiguredMatcherFactoryDecorator.php b/src/lib/MVC/Symfony/Matcher/DynamicallyConfiguredMatcherFactoryDecorator.php index d8a0be6c9c..4929cf8a24 100644 --- a/src/lib/MVC/Symfony/Matcher/DynamicallyConfiguredMatcherFactoryDecorator.php +++ b/src/lib/MVC/Symfony/Matcher/DynamicallyConfiguredMatcherFactoryDecorator.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\Core\MVC\Symfony\Matcher; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/lib/MVC/Symfony/Matcher/MatcherFactoryInterface.php b/src/lib/MVC/Symfony/Matcher/MatcherFactoryInterface.php index b51e0d295e..b0ec327380 100644 --- a/src/lib/MVC/Symfony/Matcher/MatcherFactoryInterface.php +++ b/src/lib/MVC/Symfony/Matcher/MatcherFactoryInterface.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\Core\MVC\Symfony\Matcher; use Ibexa\Core\MVC\Symfony\View\View; diff --git a/src/lib/MVC/Symfony/Matcher/ViewMatcherInterface.php b/src/lib/MVC/Symfony/Matcher/ViewMatcherInterface.php index 0a9e10ec0c..d8769de8f1 100644 --- a/src/lib/MVC/Symfony/Matcher/ViewMatcherInterface.php +++ b/src/lib/MVC/Symfony/Matcher/ViewMatcherInterface.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\Core\MVC\Symfony\Matcher; use Ibexa\Core\MVC\Symfony\View\View; diff --git a/src/lib/MVC/Symfony/RequestStackAware.php b/src/lib/MVC/Symfony/RequestStackAware.php index cce25a022e..4f67c09fa6 100644 --- a/src/lib/MVC/Symfony/RequestStackAware.php +++ b/src/lib/MVC/Symfony/RequestStackAware.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\Core\MVC\Symfony; use Symfony\Component\HttpFoundation\RequestStack; diff --git a/src/lib/MVC/Symfony/Routing/Generator.php b/src/lib/MVC/Symfony/Routing/Generator.php index eb9d819543..2fa0b891b9 100644 --- a/src/lib/MVC/Symfony/Routing/Generator.php +++ b/src/lib/MVC/Symfony/Routing/Generator.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\Core\MVC\Symfony\Routing; use Ibexa\Core\MVC\Symfony\SiteAccess; diff --git a/src/lib/MVC/Symfony/Routing/Generator/RouteReferenceGenerator.php b/src/lib/MVC/Symfony/Routing/Generator/RouteReferenceGenerator.php index 5fd3f6cd9c..f23a199f4f 100644 --- a/src/lib/MVC/Symfony/Routing/Generator/RouteReferenceGenerator.php +++ b/src/lib/MVC/Symfony/Routing/Generator/RouteReferenceGenerator.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\Core\MVC\Symfony\Routing\Generator; use Ibexa\Core\MVC\Symfony\Event\RouteReferenceGenerationEvent; diff --git a/src/lib/MVC/Symfony/Routing/Generator/RouteReferenceGeneratorInterface.php b/src/lib/MVC/Symfony/Routing/Generator/RouteReferenceGeneratorInterface.php index dc4c956c15..29764e9de1 100644 --- a/src/lib/MVC/Symfony/Routing/Generator/RouteReferenceGeneratorInterface.php +++ b/src/lib/MVC/Symfony/Routing/Generator/RouteReferenceGeneratorInterface.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\Core\MVC\Symfony\Routing\Generator; /** diff --git a/src/lib/MVC/Symfony/Routing/Generator/UrlAliasGenerator.php b/src/lib/MVC/Symfony/Routing/Generator/UrlAliasGenerator.php index 2066456640..61b9e9ab1c 100644 --- a/src/lib/MVC/Symfony/Routing/Generator/UrlAliasGenerator.php +++ b/src/lib/MVC/Symfony/Routing/Generator/UrlAliasGenerator.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\Core\MVC\Symfony\Routing\Generator; use Ibexa\Contracts\Core\Repository\Repository; diff --git a/src/lib/MVC/Symfony/Routing/RouteReference.php b/src/lib/MVC/Symfony/Routing/RouteReference.php index dca38f7f8e..a1a38dbbcc 100644 --- a/src/lib/MVC/Symfony/Routing/RouteReference.php +++ b/src/lib/MVC/Symfony/Routing/RouteReference.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\Core\MVC\Symfony\Routing; use Symfony\Component\HttpFoundation\ParameterBag; diff --git a/src/lib/MVC/Symfony/Routing/SimplifiedRequest.php b/src/lib/MVC/Symfony/Routing/SimplifiedRequest.php index fc3ae105e0..4ca1977061 100644 --- a/src/lib/MVC/Symfony/Routing/SimplifiedRequest.php +++ b/src/lib/MVC/Symfony/Routing/SimplifiedRequest.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\Core\MVC\Symfony\Routing; use Ibexa\Contracts\Core\Repository\Values\ValueObject; diff --git a/src/lib/MVC/Symfony/Routing/UrlAliasRouter.php b/src/lib/MVC/Symfony/Routing/UrlAliasRouter.php index e65c821831..9d1f22429e 100644 --- a/src/lib/MVC/Symfony/Routing/UrlAliasRouter.php +++ b/src/lib/MVC/Symfony/Routing/UrlAliasRouter.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\Core\MVC\Symfony\Routing; use Ibexa\Contracts\Core\Repository\ContentService; diff --git a/src/lib/MVC/Symfony/Routing/UrlWildcardRouter.php b/src/lib/MVC/Symfony/Routing/UrlWildcardRouter.php index 4b83a27ca7..c8c0d0055f 100644 --- a/src/lib/MVC/Symfony/Routing/UrlWildcardRouter.php +++ b/src/lib/MVC/Symfony/Routing/UrlWildcardRouter.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\Core\MVC\Symfony\Routing; use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; diff --git a/src/lib/MVC/Symfony/Security/Authentication/AnonymousAuthenticationProvider.php b/src/lib/MVC/Symfony/Security/Authentication/AnonymousAuthenticationProvider.php index eb50be4155..f4ad03819a 100644 --- a/src/lib/MVC/Symfony/Security/Authentication/AnonymousAuthenticationProvider.php +++ b/src/lib/MVC/Symfony/Security/Authentication/AnonymousAuthenticationProvider.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\Core\MVC\Symfony\Security\Authentication; use Ibexa\Contracts\Core\Repository\PermissionResolver; diff --git a/src/lib/MVC/Symfony/Security/Authentication/AuthenticatorInterface.php b/src/lib/MVC/Symfony/Security/Authentication/AuthenticatorInterface.php index 59b9324a0a..660efef741 100644 --- a/src/lib/MVC/Symfony/Security/Authentication/AuthenticatorInterface.php +++ b/src/lib/MVC/Symfony/Security/Authentication/AuthenticatorInterface.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\Core\MVC\Symfony\Security\Authentication; use Symfony\Component\HttpFoundation\Request; diff --git a/src/lib/MVC/Symfony/Security/Authentication/DefaultAuthenticationSuccessHandler.php b/src/lib/MVC/Symfony/Security/Authentication/DefaultAuthenticationSuccessHandler.php index bbd684225a..a0b4524021 100644 --- a/src/lib/MVC/Symfony/Security/Authentication/DefaultAuthenticationSuccessHandler.php +++ b/src/lib/MVC/Symfony/Security/Authentication/DefaultAuthenticationSuccessHandler.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\Core\MVC\Symfony\Security\Authentication; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/lib/MVC/Symfony/Security/Authentication/RememberMeRepositoryAuthenticationProvider.php b/src/lib/MVC/Symfony/Security/Authentication/RememberMeRepositoryAuthenticationProvider.php index f40ef6a1e0..a1e3245456 100644 --- a/src/lib/MVC/Symfony/Security/Authentication/RememberMeRepositoryAuthenticationProvider.php +++ b/src/lib/MVC/Symfony/Security/Authentication/RememberMeRepositoryAuthenticationProvider.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\Core\MVC\Symfony\Security\Authentication; use Ibexa\Contracts\Core\Repository\PermissionResolver; diff --git a/src/lib/MVC/Symfony/Security/Authentication/RepositoryAuthenticationProvider.php b/src/lib/MVC/Symfony/Security/Authentication/RepositoryAuthenticationProvider.php index cd50a94366..d95ce8b160 100644 --- a/src/lib/MVC/Symfony/Security/Authentication/RepositoryAuthenticationProvider.php +++ b/src/lib/MVC/Symfony/Security/Authentication/RepositoryAuthenticationProvider.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\Core\MVC\Symfony\Security\Authentication; use Ibexa\Bundle\Core\DependencyInjection\Compiler\SecurityPass; diff --git a/src/lib/MVC/Symfony/Security/Authorization/Attribute.php b/src/lib/MVC/Symfony/Security/Authorization/Attribute.php index e63bf61bbd..fccb583b54 100644 --- a/src/lib/MVC/Symfony/Security/Authorization/Attribute.php +++ b/src/lib/MVC/Symfony/Security/Authorization/Attribute.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\Core\MVC\Symfony\Security\Authorization; /** diff --git a/src/lib/MVC/Symfony/Security/Authorization/Voter/CoreVoter.php b/src/lib/MVC/Symfony/Security/Authorization/Voter/CoreVoter.php index fe508515ed..26cecaedc2 100644 --- a/src/lib/MVC/Symfony/Security/Authorization/Voter/CoreVoter.php +++ b/src/lib/MVC/Symfony/Security/Authorization/Voter/CoreVoter.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\Core\MVC\Symfony\Security\Authorization\Voter; use Ibexa\Contracts\Core\Repository\PermissionResolver; diff --git a/src/lib/MVC/Symfony/Security/Authorization/Voter/ValueObjectVoter.php b/src/lib/MVC/Symfony/Security/Authorization/Voter/ValueObjectVoter.php index 2674cb8271..f85ea6569a 100644 --- a/src/lib/MVC/Symfony/Security/Authorization/Voter/ValueObjectVoter.php +++ b/src/lib/MVC/Symfony/Security/Authorization/Voter/ValueObjectVoter.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\Core\MVC\Symfony\Security\Authorization\Voter; use Ibexa\Contracts\Core\Repository\PermissionResolver; diff --git a/src/lib/MVC/Symfony/Security/EventListener/SecurityListener.php b/src/lib/MVC/Symfony/Security/EventListener/SecurityListener.php index b836339099..14b60f79d2 100644 --- a/src/lib/MVC/Symfony/Security/EventListener/SecurityListener.php +++ b/src/lib/MVC/Symfony/Security/EventListener/SecurityListener.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\Core\MVC\Symfony\Security\EventListener; use Ibexa\Contracts\Core\Repository\PermissionResolver; diff --git a/src/lib/MVC/Symfony/Security/Exception/PasswordExpiredException.php b/src/lib/MVC/Symfony/Security/Exception/PasswordExpiredException.php index f9653ecced..bbe349d16c 100644 --- a/src/lib/MVC/Symfony/Security/Exception/PasswordExpiredException.php +++ b/src/lib/MVC/Symfony/Security/Exception/PasswordExpiredException.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\Core\MVC\Symfony\Security\Exception; use Symfony\Component\Security\Core\Exception\CustomUserMessageAccountStatusException; diff --git a/src/lib/MVC/Symfony/Security/Exception/UnauthorizedSiteAccessException.php b/src/lib/MVC/Symfony/Security/Exception/UnauthorizedSiteAccessException.php index e18c12dee7..06db5e8f73 100644 --- a/src/lib/MVC/Symfony/Security/Exception/UnauthorizedSiteAccessException.php +++ b/src/lib/MVC/Symfony/Security/Exception/UnauthorizedSiteAccessException.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\Core\MVC\Symfony\Security\Exception; use Exception; diff --git a/src/lib/MVC/Symfony/Security/HttpUtils.php b/src/lib/MVC/Symfony/Security/HttpUtils.php index 12059476cd..9e55db0ae7 100644 --- a/src/lib/MVC/Symfony/Security/HttpUtils.php +++ b/src/lib/MVC/Symfony/Security/HttpUtils.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\Core\MVC\Symfony\Security; use Ibexa\Core\MVC\Symfony\SiteAccess; diff --git a/src/lib/MVC/Symfony/Security/InteractiveLoginToken.php b/src/lib/MVC/Symfony/Security/InteractiveLoginToken.php index af7fc23494..93a7cb3d79 100644 --- a/src/lib/MVC/Symfony/Security/InteractiveLoginToken.php +++ b/src/lib/MVC/Symfony/Security/InteractiveLoginToken.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\Core\MVC\Symfony\Security; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; diff --git a/src/lib/MVC/Symfony/Security/ReferenceUserInterface.php b/src/lib/MVC/Symfony/Security/ReferenceUserInterface.php index 8e6d308277..bca1ce0825 100644 --- a/src/lib/MVC/Symfony/Security/ReferenceUserInterface.php +++ b/src/lib/MVC/Symfony/Security/ReferenceUserInterface.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\Core\MVC\Symfony\Security; /** diff --git a/src/lib/MVC/Symfony/Security/User/APIUserProviderInterface.php b/src/lib/MVC/Symfony/Security/User/APIUserProviderInterface.php index 97a8655796..85ca84e081 100644 --- a/src/lib/MVC/Symfony/Security/User/APIUserProviderInterface.php +++ b/src/lib/MVC/Symfony/Security/User/APIUserProviderInterface.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\Core\MVC\Symfony\Security\User; use Ibexa\Contracts\Core\Repository\Values\User\User as APIUser; diff --git a/src/lib/MVC/Symfony/Security/UserInterface.php b/src/lib/MVC/Symfony/Security/UserInterface.php index 05bb390f5d..5e75ac23ba 100644 --- a/src/lib/MVC/Symfony/Security/UserInterface.php +++ b/src/lib/MVC/Symfony/Security/UserInterface.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\Core\MVC\Symfony\Security; use Ibexa\Contracts\Core\Repository\Values\User\User as APIUser; diff --git a/src/lib/MVC/Symfony/Security/UserWrapped.php b/src/lib/MVC/Symfony/Security/UserWrapped.php index 9ce8ba4c61..7de58b54fb 100644 --- a/src/lib/MVC/Symfony/Security/UserWrapped.php +++ b/src/lib/MVC/Symfony/Security/UserWrapped.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\Core\MVC\Symfony\Security; use Ibexa\Contracts\Core\Repository\Values\User\User as APIUser; diff --git a/src/lib/MVC/Symfony/SiteAccess.php b/src/lib/MVC/Symfony/SiteAccess.php index 9ed34bbe6c..0f38623fab 100644 --- a/src/lib/MVC/Symfony/SiteAccess.php +++ b/src/lib/MVC/Symfony/SiteAccess.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\Core\MVC\Symfony; use Ibexa\Contracts\Core\Repository\Values\ValueObject; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher.php b/src/lib/MVC/Symfony/SiteAccess/Matcher.php index e68057ea00..80205e7515 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/Compound.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/Compound.php index 831c5ba765..f03a8fa8f0 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/Compound.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/Compound.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\Core\MVC\Symfony\SiteAccess\Matcher; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalAnd.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalAnd.php index df1ea30d7c..9d6ee11f19 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalAnd.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalAnd.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\Core\MVC\Symfony\SiteAccess\Matcher\Compound; use Ibexa\Core\MVC\Symfony\SiteAccess\Matcher\Compound; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalOr.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalOr.php index 6e72132d57..5dace917c4 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalOr.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/Compound/LogicalOr.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\Core\MVC\Symfony\SiteAccess\Matcher\Compound; use Ibexa\Core\MVC\Symfony\SiteAccess\Matcher\Compound; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/CompoundInterface.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/CompoundInterface.php index b2308956f6..8de1719f4d 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/CompoundInterface.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/CompoundInterface.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\Core\MVC\Symfony\SiteAccess\Matcher; use Ibexa\Core\MVC\Symfony\SiteAccess\Matcher; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/HostElement.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/HostElement.php index 3a1bbb4427..6d1984c0cc 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/HostElement.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/HostElement.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\Core\MVC\Symfony\SiteAccess\Matcher; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/HostText.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/HostText.php index 86c46df428..7fede2a377 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/HostText.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/HostText.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\Core\MVC\Symfony\SiteAccess\Matcher; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/Map.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/Map.php index 76d4db7b85..f16fa5fd02 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/Map.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/Map.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\Core\MVC\Symfony\SiteAccess\Matcher; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/Map/Host.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/Map/Host.php index 0658f59dc6..7a8b1aff43 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/Map/Host.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/Map/Host.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\Core\MVC\Symfony\SiteAccess\Matcher\Map; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/Map/Port.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/Map/Port.php index de1e7dd0a1..d954bca4e7 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/Map/Port.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/Map/Port.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\Core\MVC\Symfony\SiteAccess\Matcher\Map; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/Map/URI.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/Map/URI.php index 9e5eb6e256..1fdccd82fe 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/Map/URI.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/Map/URI.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\Core\MVC\Symfony\SiteAccess\Matcher\Map; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/Regex.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/Regex.php index 795d4a2002..f277b34a6d 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/Regex.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/Regex.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\Core\MVC\Symfony\SiteAccess\Matcher; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/Regex/Host.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/Regex/Host.php index 8bc64d4dcc..e09ff879ba 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/Regex/Host.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/Regex/Host.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\Core\MVC\Symfony\SiteAccess\Matcher\Regex; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/Regex/URI.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/Regex/URI.php index c0f2da883c..449a57fab8 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/Regex/URI.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/Regex/URI.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\Core\MVC\Symfony\SiteAccess\Matcher\Regex; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/URIElement.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/URIElement.php index b9f4df7b70..7f9a8aa636 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/URIElement.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/URIElement.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\Core\MVC\Symfony\SiteAccess\Matcher; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/Matcher/URIText.php b/src/lib/MVC/Symfony/SiteAccess/Matcher/URIText.php index b459630b88..abf8f1359d 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Matcher/URIText.php +++ b/src/lib/MVC/Symfony/SiteAccess/Matcher/URIText.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\Core\MVC\Symfony\SiteAccess\Matcher; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/MatcherBuilder.php b/src/lib/MVC/Symfony/SiteAccess/MatcherBuilder.php index f7705c9d19..8c514b8fcf 100644 --- a/src/lib/MVC/Symfony/SiteAccess/MatcherBuilder.php +++ b/src/lib/MVC/Symfony/SiteAccess/MatcherBuilder.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/MatcherBuilderInterface.php b/src/lib/MVC/Symfony/SiteAccess/MatcherBuilderInterface.php index ed6bb9c85f..c7bb4391dd 100644 --- a/src/lib/MVC/Symfony/SiteAccess/MatcherBuilderInterface.php +++ b/src/lib/MVC/Symfony/SiteAccess/MatcherBuilderInterface.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/Router.php b/src/lib/MVC/Symfony/SiteAccess/Router.php index 1cb57f141e..774a7c5c02 100644 --- a/src/lib/MVC/Symfony/SiteAccess/Router.php +++ b/src/lib/MVC/Symfony/SiteAccess/Router.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Exception\InvalidSiteAccessException; diff --git a/src/lib/MVC/Symfony/SiteAccess/SiteAccessAware.php b/src/lib/MVC/Symfony/SiteAccess/SiteAccessAware.php index 612c35513e..e2b0e0ee0c 100644 --- a/src/lib/MVC/Symfony/SiteAccess/SiteAccessAware.php +++ b/src/lib/MVC/Symfony/SiteAccess/SiteAccessAware.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\SiteAccess; diff --git a/src/lib/MVC/Symfony/SiteAccess/SiteAccessRouterInterface.php b/src/lib/MVC/Symfony/SiteAccess/SiteAccessRouterInterface.php index 0d0a7cfbef..8fa74733e6 100644 --- a/src/lib/MVC/Symfony/SiteAccess/SiteAccessRouterInterface.php +++ b/src/lib/MVC/Symfony/SiteAccess/SiteAccessRouterInterface.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/src/lib/MVC/Symfony/SiteAccess/URILexer.php b/src/lib/MVC/Symfony/SiteAccess/URILexer.php index 6c36bcf477..b47403a11d 100644 --- a/src/lib/MVC/Symfony/SiteAccess/URILexer.php +++ b/src/lib/MVC/Symfony/SiteAccess/URILexer.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\Core\MVC\Symfony\SiteAccess; /** diff --git a/src/lib/MVC/Symfony/SiteAccess/VersatileMatcher.php b/src/lib/MVC/Symfony/SiteAccess/VersatileMatcher.php index a46b60f6cc..09a66da580 100644 --- a/src/lib/MVC/Symfony/SiteAccess/VersatileMatcher.php +++ b/src/lib/MVC/Symfony/SiteAccess/VersatileMatcher.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\Core\MVC\Symfony\SiteAccess; /** diff --git a/src/lib/MVC/Symfony/Templating/Exception/MissingFieldBlockException.php b/src/lib/MVC/Symfony/Templating/Exception/MissingFieldBlockException.php index 1a80329451..aafd93cb7c 100644 --- a/src/lib/MVC/Symfony/Templating/Exception/MissingFieldBlockException.php +++ b/src/lib/MVC/Symfony/Templating/Exception/MissingFieldBlockException.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\Core\MVC\Symfony\Templating\Exception; use RuntimeException; diff --git a/src/lib/MVC/Symfony/Templating/FieldBlockRendererInterface.php b/src/lib/MVC/Symfony/Templating/FieldBlockRendererInterface.php index 72ddc65737..76fafaf50a 100644 --- a/src/lib/MVC/Symfony/Templating/FieldBlockRendererInterface.php +++ b/src/lib/MVC/Symfony/Templating/FieldBlockRendererInterface.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\Core\MVC\Symfony\Templating; use Ibexa\Contracts\Core\Repository\Values\Content\Content; diff --git a/src/lib/MVC/Symfony/Templating/GlobalHelper.php b/src/lib/MVC/Symfony/Templating/GlobalHelper.php index fb57f8ba50..854a46435e 100644 --- a/src/lib/MVC/Symfony/Templating/GlobalHelper.php +++ b/src/lib/MVC/Symfony/Templating/GlobalHelper.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\Core\MVC\Symfony\Templating; use Ibexa\Contracts\Core\Repository\LocationService; diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php index 348a7cd7e4..f19f336033 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtension.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\Core\MVC\Symfony\Templating\Twig\Extension; use Ibexa\Contracts\Core\Repository\Repository; diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/CoreExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/CoreExtension.php index 86ecb6ad85..821433e884 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/CoreExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/CoreExtension.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\Core\MVC\Symfony\Templating\Twig\Extension; use Ibexa\Core\MVC\Symfony\Templating\GlobalHelper; diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtension.php index a63c6f8e1b..88950eebc7 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtension.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\Core\MVC\Symfony\Templating\Twig\Extension; use Ibexa\Contracts\Core\Repository\Values\Content\Content; diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtension.php index 9c0d700ec7..b5664bb77d 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtension.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\Core\MVC\Symfony\Templating\Twig\Extension; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/ImageExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/ImageExtension.php index 0a85394329..10776d185c 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/ImageExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/ImageExtension.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\Core\MVC\Symfony\Templating\Twig\Extension; use Ibexa\Contracts\Core\Repository\Exceptions\InvalidVariationException; diff --git a/src/lib/MVC/Symfony/Translation/CatalogueMapperFileWriter.php b/src/lib/MVC/Symfony/Translation/CatalogueMapperFileWriter.php index ec2562f5c5..cbf8035d72 100644 --- a/src/lib/MVC/Symfony/Translation/CatalogueMapperFileWriter.php +++ b/src/lib/MVC/Symfony/Translation/CatalogueMapperFileWriter.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\Core\MVC\Symfony\Translation; use JMS\TranslationBundle\Exception\InvalidArgumentException; diff --git a/src/lib/MVC/Symfony/Translation/ExceptionMessageTemplateFileVisitor.php b/src/lib/MVC/Symfony/Translation/ExceptionMessageTemplateFileVisitor.php index c975d605b3..e4bf154c5e 100644 --- a/src/lib/MVC/Symfony/Translation/ExceptionMessageTemplateFileVisitor.php +++ b/src/lib/MVC/Symfony/Translation/ExceptionMessageTemplateFileVisitor.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\Core\MVC\Symfony\Translation; use Doctrine\Common\Annotations\DocParser; diff --git a/src/lib/MVC/Symfony/Translation/FieldTypesTranslationExtractor.php b/src/lib/MVC/Symfony/Translation/FieldTypesTranslationExtractor.php index cb30455b20..8345a54d3b 100644 --- a/src/lib/MVC/Symfony/Translation/FieldTypesTranslationExtractor.php +++ b/src/lib/MVC/Symfony/Translation/FieldTypesTranslationExtractor.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\Core\MVC\Symfony\Translation; use Ibexa\Core\FieldType\FieldTypeRegistry; diff --git a/src/lib/MVC/Symfony/Translation/TranslatableExceptionsFileVisitor.php b/src/lib/MVC/Symfony/Translation/TranslatableExceptionsFileVisitor.php index d7ffbeec1f..4a61f2dd6f 100644 --- a/src/lib/MVC/Symfony/Translation/TranslatableExceptionsFileVisitor.php +++ b/src/lib/MVC/Symfony/Translation/TranslatableExceptionsFileVisitor.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\Core\MVC\Symfony\Translation; use Doctrine\Common\Annotations\DocParser; diff --git a/src/lib/MVC/Symfony/Translation/ValidationErrorFileVisitor.php b/src/lib/MVC/Symfony/Translation/ValidationErrorFileVisitor.php index 81d6ace9e5..1b5b21ae09 100644 --- a/src/lib/MVC/Symfony/Translation/ValidationErrorFileVisitor.php +++ b/src/lib/MVC/Symfony/Translation/ValidationErrorFileVisitor.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\Core\MVC\Symfony\Translation; use Doctrine\Common\Annotations\DocParser; diff --git a/src/lib/MVC/Symfony/View/BaseView.php b/src/lib/MVC/Symfony/View/BaseView.php index 195274bbc2..bdeb883134 100644 --- a/src/lib/MVC/Symfony/View/BaseView.php +++ b/src/lib/MVC/Symfony/View/BaseView.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\Core\MVC\Symfony\View; use Ibexa\Core\Base\Exceptions\InvalidArgumentType; diff --git a/src/lib/MVC/Symfony/View/Builder/ContentViewBuilder.php b/src/lib/MVC/Symfony/View/Builder/ContentViewBuilder.php index 8f2c36ba7b..fe5cb6acea 100644 --- a/src/lib/MVC/Symfony/View/Builder/ContentViewBuilder.php +++ b/src/lib/MVC/Symfony/View/Builder/ContentViewBuilder.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\Core\MVC\Symfony\View\Builder; use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; diff --git a/src/lib/MVC/Symfony/View/Builder/ParametersFilter/RequestAttributes.php b/src/lib/MVC/Symfony/View/Builder/ParametersFilter/RequestAttributes.php index 82098c6341..8ec87d1539 100644 --- a/src/lib/MVC/Symfony/View/Builder/ParametersFilter/RequestAttributes.php +++ b/src/lib/MVC/Symfony/View/Builder/ParametersFilter/RequestAttributes.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\Core\MVC\Symfony\View\Builder\ParametersFilter; use Ibexa\Core\MVC\Symfony\View\Event\FilterViewBuilderParametersEvent; diff --git a/src/lib/MVC/Symfony/View/Builder/Registry/ControllerMatch.php b/src/lib/MVC/Symfony/View/Builder/Registry/ControllerMatch.php index 36fb40c5c8..034e5b10cf 100644 --- a/src/lib/MVC/Symfony/View/Builder/Registry/ControllerMatch.php +++ b/src/lib/MVC/Symfony/View/Builder/Registry/ControllerMatch.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\Core\MVC\Symfony\View\Builder\Registry; use Ibexa\Core\MVC\Symfony\View\Builder\ViewBuilderRegistry; diff --git a/src/lib/MVC/Symfony/View/Builder/ViewBuilder.php b/src/lib/MVC/Symfony/View/Builder/ViewBuilder.php index 533da06fca..9bb333b46d 100644 --- a/src/lib/MVC/Symfony/View/Builder/ViewBuilder.php +++ b/src/lib/MVC/Symfony/View/Builder/ViewBuilder.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\Core\MVC\Symfony\View\Builder; use Ibexa\Core\MVC\Symfony\View\View; diff --git a/src/lib/MVC/Symfony/View/Builder/ViewBuilderRegistry.php b/src/lib/MVC/Symfony/View/Builder/ViewBuilderRegistry.php index aebd4e1f46..d8c29c4cc0 100644 --- a/src/lib/MVC/Symfony/View/Builder/ViewBuilderRegistry.php +++ b/src/lib/MVC/Symfony/View/Builder/ViewBuilderRegistry.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\Core\MVC\Symfony\View\Builder; /** diff --git a/src/lib/MVC/Symfony/View/CachableView.php b/src/lib/MVC/Symfony/View/CachableView.php index 3f446392ed..7e9f073729 100644 --- a/src/lib/MVC/Symfony/View/CachableView.php +++ b/src/lib/MVC/Symfony/View/CachableView.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\Core\MVC\Symfony\View; /** diff --git a/src/lib/MVC/Symfony/View/Configurator.php b/src/lib/MVC/Symfony/View/Configurator.php index c17af6eaaa..ad516bc03e 100644 --- a/src/lib/MVC/Symfony/View/Configurator.php +++ b/src/lib/MVC/Symfony/View/Configurator.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\Core\MVC\Symfony\View; /** diff --git a/src/lib/MVC/Symfony/View/Configurator/ViewProvider.php b/src/lib/MVC/Symfony/View/Configurator/ViewProvider.php index 56534487e6..db75ad84dc 100644 --- a/src/lib/MVC/Symfony/View/Configurator/ViewProvider.php +++ b/src/lib/MVC/Symfony/View/Configurator/ViewProvider.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\Core\MVC\Symfony\View\Configurator; use Ibexa\Core\MVC\Symfony\View\Configurator; diff --git a/src/lib/MVC/Symfony/View/ContentValueView.php b/src/lib/MVC/Symfony/View/ContentValueView.php index 76160e3fd4..47d68ede1c 100644 --- a/src/lib/MVC/Symfony/View/ContentValueView.php +++ b/src/lib/MVC/Symfony/View/ContentValueView.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\Core\MVC\Symfony\View; /** diff --git a/src/lib/MVC/Symfony/View/ContentView.php b/src/lib/MVC/Symfony/View/ContentView.php index 9777af3acf..981b960163 100644 --- a/src/lib/MVC/Symfony/View/ContentView.php +++ b/src/lib/MVC/Symfony/View/ContentView.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\Core\MVC\Symfony\View; use Ibexa\Contracts\Core\Repository\Values\Content\Content; diff --git a/src/lib/MVC/Symfony/View/CustomLocationControllerChecker.php b/src/lib/MVC/Symfony/View/CustomLocationControllerChecker.php index 4aaab8fb4b..116e209408 100644 --- a/src/lib/MVC/Symfony/View/CustomLocationControllerChecker.php +++ b/src/lib/MVC/Symfony/View/CustomLocationControllerChecker.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\Core\MVC\Symfony\View; use Ibexa\Contracts\Core\Repository\Values\Content\Content; diff --git a/src/lib/MVC/Symfony/View/EmbedView.php b/src/lib/MVC/Symfony/View/EmbedView.php index a13a7c467e..b18f7c00de 100644 --- a/src/lib/MVC/Symfony/View/EmbedView.php +++ b/src/lib/MVC/Symfony/View/EmbedView.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\Core\MVC\Symfony\View; /** diff --git a/src/lib/MVC/Symfony/View/Event/FilterViewBuilderParametersEvent.php b/src/lib/MVC/Symfony/View/Event/FilterViewBuilderParametersEvent.php index 81f9eeec7f..9794e2c16d 100644 --- a/src/lib/MVC/Symfony/View/Event/FilterViewBuilderParametersEvent.php +++ b/src/lib/MVC/Symfony/View/Event/FilterViewBuilderParametersEvent.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\Core\MVC\Symfony\View\Event; use Symfony\Component\HttpFoundation\ParameterBag; diff --git a/src/lib/MVC/Symfony/View/Event/FilterViewParametersEvent.php b/src/lib/MVC/Symfony/View/Event/FilterViewParametersEvent.php index 266f6ae301..8a289349f0 100644 --- a/src/lib/MVC/Symfony/View/Event/FilterViewParametersEvent.php +++ b/src/lib/MVC/Symfony/View/Event/FilterViewParametersEvent.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\Core\MVC\Symfony\View\Event; use Ibexa\Core\MVC\Symfony\View\View; diff --git a/src/lib/MVC/Symfony/View/LocationValueView.php b/src/lib/MVC/Symfony/View/LocationValueView.php index 1f6029a0a3..e0a03ee080 100644 --- a/src/lib/MVC/Symfony/View/LocationValueView.php +++ b/src/lib/MVC/Symfony/View/LocationValueView.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\Core\MVC\Symfony\View; interface LocationValueView diff --git a/src/lib/MVC/Symfony/View/Manager.php b/src/lib/MVC/Symfony/View/Manager.php index fd8242486d..ecb4e9acef 100644 --- a/src/lib/MVC/Symfony/View/Manager.php +++ b/src/lib/MVC/Symfony/View/Manager.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\Core\MVC\Symfony\View; use Ibexa\Contracts\Core\Repository\Repository; diff --git a/src/lib/MVC/Symfony/View/ParametersInjector.php b/src/lib/MVC/Symfony/View/ParametersInjector.php index 2f4468f34b..06ac8fa01c 100644 --- a/src/lib/MVC/Symfony/View/ParametersInjector.php +++ b/src/lib/MVC/Symfony/View/ParametersInjector.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\Core\MVC\Symfony\View; /** diff --git a/src/lib/MVC/Symfony/View/ParametersInjector/CustomParameters.php b/src/lib/MVC/Symfony/View/ParametersInjector/CustomParameters.php index 7fc7836c11..87ce2a1630 100644 --- a/src/lib/MVC/Symfony/View/ParametersInjector/CustomParameters.php +++ b/src/lib/MVC/Symfony/View/ParametersInjector/CustomParameters.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\Core\MVC\Symfony\View\ParametersInjector; use Ibexa\Core\MVC\Symfony\View\Event\FilterViewParametersEvent; diff --git a/src/lib/MVC/Symfony/View/ParametersInjector/EmbedObjectParameters.php b/src/lib/MVC/Symfony/View/ParametersInjector/EmbedObjectParameters.php index 992dc85308..ab4c31f78d 100644 --- a/src/lib/MVC/Symfony/View/ParametersInjector/EmbedObjectParameters.php +++ b/src/lib/MVC/Symfony/View/ParametersInjector/EmbedObjectParameters.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\Core\MVC\Symfony\View\ParametersInjector; use Ibexa\Core\MVC\Symfony\View\Event\FilterViewParametersEvent; diff --git a/src/lib/MVC/Symfony/View/ParametersInjector/EventDispatcherInjector.php b/src/lib/MVC/Symfony/View/ParametersInjector/EventDispatcherInjector.php index 254dd811a7..99abc7272a 100644 --- a/src/lib/MVC/Symfony/View/ParametersInjector/EventDispatcherInjector.php +++ b/src/lib/MVC/Symfony/View/ParametersInjector/EventDispatcherInjector.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\Core\MVC\Symfony\View\ParametersInjector; use Ibexa\Core\MVC\Symfony\View\Event\FilterViewParametersEvent; diff --git a/src/lib/MVC/Symfony/View/ParametersInjector/NoLayout.php b/src/lib/MVC/Symfony/View/ParametersInjector/NoLayout.php index b8ffd98e36..a71f6704ae 100644 --- a/src/lib/MVC/Symfony/View/ParametersInjector/NoLayout.php +++ b/src/lib/MVC/Symfony/View/ParametersInjector/NoLayout.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\Core\MVC\Symfony\View\ParametersInjector; use Ibexa\Core\MVC\Symfony\View\Event\FilterViewParametersEvent; diff --git a/src/lib/MVC/Symfony/View/ParametersInjector/ValueObjectsIds.php b/src/lib/MVC/Symfony/View/ParametersInjector/ValueObjectsIds.php index ad96c283ff..4218dcf18a 100644 --- a/src/lib/MVC/Symfony/View/ParametersInjector/ValueObjectsIds.php +++ b/src/lib/MVC/Symfony/View/ParametersInjector/ValueObjectsIds.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\Core\MVC\Symfony\View\ParametersInjector; use Ibexa\Contracts\Core\Repository\Values\Content\Location; diff --git a/src/lib/MVC/Symfony/View/ParametersInjector/ViewbaseLayout.php b/src/lib/MVC/Symfony/View/ParametersInjector/ViewbaseLayout.php index 05f0096c01..b90d0ac79c 100644 --- a/src/lib/MVC/Symfony/View/ParametersInjector/ViewbaseLayout.php +++ b/src/lib/MVC/Symfony/View/ParametersInjector/ViewbaseLayout.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\Core\MVC\Symfony\View\ParametersInjector; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/src/lib/MVC/Symfony/View/Provider/Configured.php b/src/lib/MVC/Symfony/View/Provider/Configured.php index 3f56c1713f..d2bf56d6be 100644 --- a/src/lib/MVC/Symfony/View/Provider/Configured.php +++ b/src/lib/MVC/Symfony/View/Provider/Configured.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\Core\MVC\Symfony\View\Provider; use Ibexa\Core\MVC\Symfony\Matcher\MatcherFactoryInterface; diff --git a/src/lib/MVC/Symfony/View/Provider/Content.php b/src/lib/MVC/Symfony/View/Provider/Content.php index 07ea6de95c..59e5f6d896 100644 --- a/src/lib/MVC/Symfony/View/Provider/Content.php +++ b/src/lib/MVC/Symfony/View/Provider/Content.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\Core\MVC\Symfony\View\Provider; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/lib/MVC/Symfony/View/Provider/Location.php b/src/lib/MVC/Symfony/View/Provider/Location.php index 65f86631c0..d3c01d92cd 100644 --- a/src/lib/MVC/Symfony/View/Provider/Location.php +++ b/src/lib/MVC/Symfony/View/Provider/Location.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\Core\MVC\Symfony\View\Provider; use Ibexa\Contracts\Core\Repository\Values\Content\Location as APIContentLocation; diff --git a/src/lib/MVC/Symfony/View/Provider/Registry.php b/src/lib/MVC/Symfony/View/Provider/Registry.php index 6565514840..8eb4373f63 100644 --- a/src/lib/MVC/Symfony/View/Provider/Registry.php +++ b/src/lib/MVC/Symfony/View/Provider/Registry.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\Core\MVC\Symfony\View\Provider; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/src/lib/MVC/Symfony/View/Renderer.php b/src/lib/MVC/Symfony/View/Renderer.php index 8132e74189..8d03b30f26 100644 --- a/src/lib/MVC/Symfony/View/Renderer.php +++ b/src/lib/MVC/Symfony/View/Renderer.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\Core\MVC\Symfony\View; /** diff --git a/src/lib/MVC/Symfony/View/Renderer/TemplateRenderer.php b/src/lib/MVC/Symfony/View/Renderer/TemplateRenderer.php index 52326882e5..e7fe4df7dd 100644 --- a/src/lib/MVC/Symfony/View/Renderer/TemplateRenderer.php +++ b/src/lib/MVC/Symfony/View/Renderer/TemplateRenderer.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\Core\MVC\Symfony\View\Renderer; use Closure; diff --git a/src/lib/MVC/Symfony/View/View.php b/src/lib/MVC/Symfony/View/View.php index dec7f2e0fe..4d80d97cc5 100644 --- a/src/lib/MVC/Symfony/View/View.php +++ b/src/lib/MVC/Symfony/View/View.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\Core\MVC\Symfony\View; use Symfony\Component\HttpFoundation\Response; diff --git a/src/lib/MVC/Symfony/View/ViewEvents.php b/src/lib/MVC/Symfony/View/ViewEvents.php index 689af41599..e9786c67e6 100644 --- a/src/lib/MVC/Symfony/View/ViewEvents.php +++ b/src/lib/MVC/Symfony/View/ViewEvents.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\Core\MVC\Symfony\View; /** diff --git a/src/lib/MVC/Symfony/View/ViewManagerInterface.php b/src/lib/MVC/Symfony/View/ViewManagerInterface.php index cc72431fdf..2c3cc38bf2 100644 --- a/src/lib/MVC/Symfony/View/ViewManagerInterface.php +++ b/src/lib/MVC/Symfony/View/ViewManagerInterface.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\Core\MVC\Symfony\View; use Ibexa\Contracts\Core\Repository\Values\Content\Content; diff --git a/src/lib/MVC/Symfony/View/ViewProvider.php b/src/lib/MVC/Symfony/View/ViewProvider.php index 8de5df92f5..dfa1bf0dd6 100644 --- a/src/lib/MVC/Symfony/View/ViewProvider.php +++ b/src/lib/MVC/Symfony/View/ViewProvider.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\Core\MVC\Symfony\View; interface ViewProvider diff --git a/src/lib/Pagination/Pagerfanta/ContentSearchAdapter.php b/src/lib/Pagination/Pagerfanta/ContentSearchAdapter.php index 24317cec7d..9a7a399083 100644 --- a/src/lib/Pagination/Pagerfanta/ContentSearchAdapter.php +++ b/src/lib/Pagination/Pagerfanta/ContentSearchAdapter.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\Core\Pagination\Pagerfanta; /** diff --git a/src/lib/Pagination/Pagerfanta/ContentSearchHitAdapter.php b/src/lib/Pagination/Pagerfanta/ContentSearchHitAdapter.php index 891beb1ddb..6211971e16 100644 --- a/src/lib/Pagination/Pagerfanta/ContentSearchHitAdapter.php +++ b/src/lib/Pagination/Pagerfanta/ContentSearchHitAdapter.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\Core\Pagination\Pagerfanta; use Ibexa\Contracts\Core\Repository\SearchService; diff --git a/src/lib/Pagination/Pagerfanta/LocationSearchAdapter.php b/src/lib/Pagination/Pagerfanta/LocationSearchAdapter.php index 8bfaa34ad3..5ccb9cd5de 100644 --- a/src/lib/Pagination/Pagerfanta/LocationSearchAdapter.php +++ b/src/lib/Pagination/Pagerfanta/LocationSearchAdapter.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\Core\Pagination\Pagerfanta; /** diff --git a/src/lib/Pagination/Pagerfanta/LocationSearchHitAdapter.php b/src/lib/Pagination/Pagerfanta/LocationSearchHitAdapter.php index c0ec9fc2bf..4602bb4006 100644 --- a/src/lib/Pagination/Pagerfanta/LocationSearchHitAdapter.php +++ b/src/lib/Pagination/Pagerfanta/LocationSearchHitAdapter.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\Core\Pagination\Pagerfanta; use Ibexa\Contracts\Core\Repository\SearchService; diff --git a/src/lib/Persistence/Cache/AbstractHandler.php b/src/lib/Persistence/Cache/AbstractHandler.php index 04fdddd34a..d9d86cd243 100644 --- a/src/lib/Persistence/Cache/AbstractHandler.php +++ b/src/lib/Persistence/Cache/AbstractHandler.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Handler as PersistenceHandler; diff --git a/src/lib/Persistence/Cache/AbstractInMemoryHandler.php b/src/lib/Persistence/Cache/AbstractInMemoryHandler.php index 8fa1ae1072..5a3f5d35d3 100644 --- a/src/lib/Persistence/Cache/AbstractInMemoryHandler.php +++ b/src/lib/Persistence/Cache/AbstractInMemoryHandler.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\Core\Persistence\Cache; use Ibexa\Core\Persistence\Cache\Adapter\TransactionAwareAdapterInterface; diff --git a/src/lib/Persistence/Cache/AbstractInMemoryPersistenceHandler.php b/src/lib/Persistence/Cache/AbstractInMemoryPersistenceHandler.php index 6d76d31c11..5da20fac52 100644 --- a/src/lib/Persistence/Cache/AbstractInMemoryPersistenceHandler.php +++ b/src/lib/Persistence/Cache/AbstractInMemoryPersistenceHandler.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Handler as PersistenceHandler; diff --git a/src/lib/Persistence/Cache/ContentHandler.php b/src/lib/Persistence/Cache/ContentHandler.php index 9047a4c182..30794a01b0 100644 --- a/src/lib/Persistence/Cache/ContentHandler.php +++ b/src/lib/Persistence/Cache/ContentHandler.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content; diff --git a/src/lib/Persistence/Cache/ContentLanguageHandler.php b/src/lib/Persistence/Cache/ContentLanguageHandler.php index 96c6d167e1..e5e02875ee 100644 --- a/src/lib/Persistence/Cache/ContentLanguageHandler.php +++ b/src/lib/Persistence/Cache/ContentLanguageHandler.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\Language; diff --git a/src/lib/Persistence/Cache/ContentTypeHandler.php b/src/lib/Persistence/Cache/ContentTypeHandler.php index ed24ed5fc7..a8e4dda0dd 100644 --- a/src/lib/Persistence/Cache/ContentTypeHandler.php +++ b/src/lib/Persistence/Cache/ContentTypeHandler.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\Type; diff --git a/src/lib/Persistence/Cache/LocationHandler.php b/src/lib/Persistence/Cache/LocationHandler.php index dc07fd9f93..1d681883a6 100644 --- a/src/lib/Persistence/Cache/LocationHandler.php +++ b/src/lib/Persistence/Cache/LocationHandler.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\Location; diff --git a/src/lib/Persistence/Cache/ObjectStateHandler.php b/src/lib/Persistence/Cache/ObjectStateHandler.php index 8fe709234a..f8c6cfad8e 100644 --- a/src/lib/Persistence/Cache/ObjectStateHandler.php +++ b/src/lib/Persistence/Cache/ObjectStateHandler.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\ObjectState; diff --git a/src/lib/Persistence/Cache/SectionHandler.php b/src/lib/Persistence/Cache/SectionHandler.php index 09755f9aaf..39c9d6c836 100644 --- a/src/lib/Persistence/Cache/SectionHandler.php +++ b/src/lib/Persistence/Cache/SectionHandler.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\Section\Handler as SectionHandlerInterface; diff --git a/src/lib/Persistence/Cache/SettingHandler.php b/src/lib/Persistence/Cache/SettingHandler.php index ea295842f5..a409ad60f6 100644 --- a/src/lib/Persistence/Cache/SettingHandler.php +++ b/src/lib/Persistence/Cache/SettingHandler.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Setting\Handler as SettingHandlerInterface; diff --git a/src/lib/Persistence/Cache/TransactionHandler.php b/src/lib/Persistence/Cache/TransactionHandler.php index 580bb4b610..8801adc533 100644 --- a/src/lib/Persistence/Cache/TransactionHandler.php +++ b/src/lib/Persistence/Cache/TransactionHandler.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\TransactionHandler as TransactionHandlerInterface; diff --git a/src/lib/Persistence/Cache/TrashHandler.php b/src/lib/Persistence/Cache/TrashHandler.php index a8f5fdd39f..b3f0ef6729 100644 --- a/src/lib/Persistence/Cache/TrashHandler.php +++ b/src/lib/Persistence/Cache/TrashHandler.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\Location\Trash\Handler as TrashHandlerInterface; diff --git a/src/lib/Persistence/Cache/URLHandler.php b/src/lib/Persistence/Cache/URLHandler.php index 517e0a7948..53947d7e5d 100644 --- a/src/lib/Persistence/Cache/URLHandler.php +++ b/src/lib/Persistence/Cache/URLHandler.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\URL\Handler as URLHandlerInterface; diff --git a/src/lib/Persistence/Cache/UrlAliasHandler.php b/src/lib/Persistence/Cache/UrlAliasHandler.php index 0edfaeb3f6..98fd819cf1 100644 --- a/src/lib/Persistence/Cache/UrlAliasHandler.php +++ b/src/lib/Persistence/Cache/UrlAliasHandler.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\UrlAlias; diff --git a/src/lib/Persistence/Cache/UrlWildcardHandler.php b/src/lib/Persistence/Cache/UrlWildcardHandler.php index fb92a76ba7..e51ab896ca 100644 --- a/src/lib/Persistence/Cache/UrlWildcardHandler.php +++ b/src/lib/Persistence/Cache/UrlWildcardHandler.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\UrlWildcard; diff --git a/src/lib/Persistence/Cache/UserHandler.php b/src/lib/Persistence/Cache/UserHandler.php index 0a5999dffc..eaf8574f5d 100644 --- a/src/lib/Persistence/Cache/UserHandler.php +++ b/src/lib/Persistence/Cache/UserHandler.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\User; diff --git a/src/lib/Persistence/FieldType.php b/src/lib/Persistence/FieldType.php index 259f6c6ebe..93909c06b1 100644 --- a/src/lib/Persistence/FieldType.php +++ b/src/lib/Persistence/FieldType.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\Core\Persistence; use Ibexa\Contracts\Core\FieldType\FieldType as SPIFieldType; diff --git a/src/lib/Persistence/FieldTypeRegistry.php b/src/lib/Persistence/FieldTypeRegistry.php index fe013d35ce..1408b16fc5 100644 --- a/src/lib/Persistence/FieldTypeRegistry.php +++ b/src/lib/Persistence/FieldTypeRegistry.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\Core\Persistence; use Ibexa\Contracts\Core\FieldType\FieldType as SPIFieldType; diff --git a/src/lib/Persistence/Legacy/Content/FieldHandler.php b/src/lib/Persistence/Legacy/Content/FieldHandler.php index da16face3b..99b583d443 100644 --- a/src/lib/Persistence/Legacy/Content/FieldHandler.php +++ b/src/lib/Persistence/Legacy/Content/FieldHandler.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\Core\Persistence\Legacy\Content; use Ibexa\Contracts\Core\Persistence\Content; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter.php index 95601cafe9..3862a6f690 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter.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\Core\Persistence\Legacy\Content\FieldValue; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/AuthorConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/AuthorConverter.php index 379d821ce7..89c2bee915 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/AuthorConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/AuthorConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use DOMDocument; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/BinaryFileConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/BinaryFileConverter.php index 5789e2bc8e..0de9160e3e 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/BinaryFileConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/BinaryFileConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldTypeConstraints; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/CheckboxConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/CheckboxConverter.php index dd3486bbf4..8265604427 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/CheckboxConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/CheckboxConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryConverter.php index 670839dddb..c6f68b1b76 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/DateAndTimeConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/DateAndTimeConverter.php index 42a2efc4f1..3145a47307 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/DateAndTimeConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/DateAndTimeConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use DateInterval; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/DateConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/DateConverter.php index c311520a42..83e6cf2072 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/DateConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/DateConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/EmailAddressConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/EmailAddressConverter.php index b1bd4aae4b..40f9806e25 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/EmailAddressConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/EmailAddressConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/Exception/NotFound.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/Exception/NotFound.php index d11218747c..fc4ee6e851 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/Exception/NotFound.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/Exception/NotFound.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\Core\Persistence\Legacy\Content\FieldValue\Converter\Exception; use Ibexa\Core\Base\Exceptions\NotFoundException; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/FloatConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/FloatConverter.php index d13a502764..619738e431 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/FloatConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/FloatConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/ISBNConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/ISBNConverter.php index 38776a37c1..822e81e241 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/ISBNConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/ISBNConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/ImageConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/ImageConverter.php index 3b30bd924a..a4d6eb4d82 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/ImageConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/ImageConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldTypeConstraints; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/IntegerConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/IntegerConverter.php index 63e494280e..3cb51ae5a1 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/IntegerConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/IntegerConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/KeywordConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/KeywordConverter.php index 8832a09702..7d4145ee69 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/KeywordConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/KeywordConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/MapLocationConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/MapLocationConverter.php index ec78361fe1..f349147d77 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/MapLocationConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/MapLocationConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/MediaConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/MediaConverter.php index 9f64106d7d..014b2dbe95 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/MediaConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/MediaConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\Type\FieldDefinition; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/NullConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/NullConverter.php index 909ef9defa..37dbededc0 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/NullConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/NullConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationConverter.php index b0fcde53fa..370bba3f7e 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use DOMDocument; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationListConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationListConverter.php index 172d157953..38e0651e2a 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationListConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationListConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Doctrine\DBAL\Connection; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/SelectionConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/SelectionConverter.php index f2f14815f1..f10b01e1f9 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/SelectionConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/SelectionConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use DOMDocument; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/TextBlockConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/TextBlockConverter.php index 59460d3e03..95f977a1ce 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/TextBlockConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/TextBlockConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/TextLineConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/TextLineConverter.php index 30e0c13726..49c46bc11d 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/TextLineConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/TextLineConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/TimeConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/TimeConverter.php index df9b133fb8..456165a0f1 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/TimeConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/TimeConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use DateTime; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/UrlConverter.php b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/UrlConverter.php index cdbd95203a..e690bb07a4 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/Converter/UrlConverter.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/Converter/UrlConverter.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/src/lib/Persistence/Legacy/Content/FieldValue/ConverterRegistry.php b/src/lib/Persistence/Legacy/Content/FieldValue/ConverterRegistry.php index 0a2da82760..8c2dc91e7b 100644 --- a/src/lib/Persistence/Legacy/Content/FieldValue/ConverterRegistry.php +++ b/src/lib/Persistence/Legacy/Content/FieldValue/ConverterRegistry.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\Core\Persistence\Legacy\Content\FieldValue; use Ibexa\Core\Persistence\Legacy\Content\FieldValue\Converter\Exception\NotFound; diff --git a/src/lib/Persistence/Legacy/Content/Gateway.php b/src/lib/Persistence/Legacy/Content/Gateway.php index 95f12bc0b4..181007e7bd 100644 --- a/src/lib/Persistence/Legacy/Content/Gateway.php +++ b/src/lib/Persistence/Legacy/Content/Gateway.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\Core\Persistence\Legacy\Content; use Ibexa\Contracts\Core\Persistence\Content; diff --git a/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php b/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php index 29d1569b52..d450b36698 100644 --- a/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php +++ b/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase.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\Core\Persistence\Legacy\Content\Gateway; use Doctrine\DBAL\Connection; diff --git a/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase/QueryBuilder.php b/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase/QueryBuilder.php index cdc28887e9..0b71efd067 100644 --- a/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase/QueryBuilder.php +++ b/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase/QueryBuilder.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\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase; use Doctrine\DBAL\Connection; diff --git a/src/lib/Persistence/Legacy/Content/Gateway/ExceptionConversion.php b/src/lib/Persistence/Legacy/Content/Gateway/ExceptionConversion.php index f4e8f9dc32..6ba5f755b3 100644 --- a/src/lib/Persistence/Legacy/Content/Gateway/ExceptionConversion.php +++ b/src/lib/Persistence/Legacy/Content/Gateway/ExceptionConversion.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\Core\Persistence\Legacy\Content\Gateway; use Doctrine\DBAL\DBALException; diff --git a/src/lib/Persistence/Legacy/Content/Handler.php b/src/lib/Persistence/Legacy/Content/Handler.php index 88cef6dd00..45dce04045 100644 --- a/src/lib/Persistence/Legacy/Content/Handler.php +++ b/src/lib/Persistence/Legacy/Content/Handler.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\Core\Persistence\Legacy\Content; use Exception; diff --git a/src/lib/Persistence/Legacy/Content/Language/CachingHandler.php b/src/lib/Persistence/Legacy/Content/Language/CachingHandler.php index 6b4e8f16ef..807d2416ad 100644 --- a/src/lib/Persistence/Legacy/Content/Language/CachingHandler.php +++ b/src/lib/Persistence/Legacy/Content/Language/CachingHandler.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\Core\Persistence\Legacy\Content\Language; use Ibexa\Contracts\Core\Persistence\Content\Language; diff --git a/src/lib/Persistence/Legacy/Content/Language/Handler.php b/src/lib/Persistence/Legacy/Content/Language/Handler.php index a3db53098c..5cf0c0d43e 100644 --- a/src/lib/Persistence/Legacy/Content/Language/Handler.php +++ b/src/lib/Persistence/Legacy/Content/Language/Handler.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\Core\Persistence\Legacy\Content\Language; use Ibexa\Contracts\Core\Persistence\Content\Language; diff --git a/src/lib/Persistence/Legacy/Content/Language/Mapper.php b/src/lib/Persistence/Legacy/Content/Language/Mapper.php index ec3bc16224..b085cdee83 100644 --- a/src/lib/Persistence/Legacy/Content/Language/Mapper.php +++ b/src/lib/Persistence/Legacy/Content/Language/Mapper.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\Core\Persistence\Legacy\Content\Language; use Ibexa\Contracts\Core\Persistence\Content\Language; diff --git a/src/lib/Persistence/Legacy/Content/Language/MaskGenerator.php b/src/lib/Persistence/Legacy/Content/Language/MaskGenerator.php index c51c84f85f..fbcec7fbc5 100644 --- a/src/lib/Persistence/Legacy/Content/Language/MaskGenerator.php +++ b/src/lib/Persistence/Legacy/Content/Language/MaskGenerator.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\Core\Persistence\Legacy\Content\Language; use Ibexa\Contracts\Core\Persistence\Content\Language\Handler as LanguageHandler; diff --git a/src/lib/Persistence/Legacy/Content/Location/Gateway.php b/src/lib/Persistence/Legacy/Content/Location/Gateway.php index 57e7838eeb..009b137c89 100644 --- a/src/lib/Persistence/Legacy/Content/Location/Gateway.php +++ b/src/lib/Persistence/Legacy/Content/Location/Gateway.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\Core\Persistence\Legacy\Content\Location; use Ibexa\Contracts\Core\Persistence\Content\Location; diff --git a/src/lib/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabase.php b/src/lib/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabase.php index 8341e96196..968343fa3e 100644 --- a/src/lib/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabase.php +++ b/src/lib/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabase.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\Core\Persistence\Legacy\Content\Location\Gateway; use Doctrine\DBAL\Connection; @@ -229,6 +230,7 @@ public function getSubtreeContent(int $sourceId, bool $onlyIds = false): array $statement = $query->execute(); $results = $statement->fetchAll($onlyIds ? (FetchMode::COLUMN | PDO::FETCH_GROUP) : FetchMode::ASSOCIATIVE); + // array_map() is used to map all elements stored as $results[$i][0] to $results[$i] return $onlyIds ? array_map(static function (array $result) { diff --git a/src/lib/Persistence/Legacy/Content/Location/Gateway/ExceptionConversion.php b/src/lib/Persistence/Legacy/Content/Location/Gateway/ExceptionConversion.php index 70fe4b717c..52f78048d9 100644 --- a/src/lib/Persistence/Legacy/Content/Location/Gateway/ExceptionConversion.php +++ b/src/lib/Persistence/Legacy/Content/Location/Gateway/ExceptionConversion.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\Core\Persistence\Legacy\Content\Location\Gateway; use Doctrine\DBAL\DBALException; diff --git a/src/lib/Persistence/Legacy/Content/Location/Handler.php b/src/lib/Persistence/Legacy/Content/Location/Handler.php index 758e221c4a..94809a6f48 100644 --- a/src/lib/Persistence/Legacy/Content/Location/Handler.php +++ b/src/lib/Persistence/Legacy/Content/Location/Handler.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\Core\Persistence\Legacy\Content\Location; use Ibexa\Contracts\Core\Persistence\Content; diff --git a/src/lib/Persistence/Legacy/Content/Location/Mapper.php b/src/lib/Persistence/Legacy/Content/Location/Mapper.php index 4afeb7109e..6bbf29c5fa 100644 --- a/src/lib/Persistence/Legacy/Content/Location/Mapper.php +++ b/src/lib/Persistence/Legacy/Content/Location/Mapper.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\Core\Persistence\Legacy\Content\Location; use Ibexa\Contracts\Core\Persistence\Content\Location; diff --git a/src/lib/Persistence/Legacy/Content/Location/Trash/Handler.php b/src/lib/Persistence/Legacy/Content/Location/Trash/Handler.php index 18cdd924b6..1ef1ba9168 100644 --- a/src/lib/Persistence/Legacy/Content/Location/Trash/Handler.php +++ b/src/lib/Persistence/Legacy/Content/Location/Trash/Handler.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\Core\Persistence\Legacy\Content\Location\Trash; use Ibexa\Contracts\Core\Persistence\Content\Location\Trash\Handler as BaseTrashHandler; diff --git a/src/lib/Persistence/Legacy/Content/Mapper.php b/src/lib/Persistence/Legacy/Content/Mapper.php index b7cf7823be..f8c2ec1d85 100644 --- a/src/lib/Persistence/Legacy/Content/Mapper.php +++ b/src/lib/Persistence/Legacy/Content/Mapper.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\Core\Persistence\Legacy\Content; use Ibexa\Contracts\Core\Persistence\Content; diff --git a/src/lib/Persistence/Legacy/Content/ObjectState/Handler.php b/src/lib/Persistence/Legacy/Content/ObjectState/Handler.php index d27e0920b3..a34f6bb9f7 100644 --- a/src/lib/Persistence/Legacy/Content/ObjectState/Handler.php +++ b/src/lib/Persistence/Legacy/Content/ObjectState/Handler.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\Core\Persistence\Legacy\Content\ObjectState; use Ibexa\Contracts\Core\Persistence\Content\ObjectState\Handler as BaseObjectStateHandler; diff --git a/src/lib/Persistence/Legacy/Content/ObjectState/Mapper.php b/src/lib/Persistence/Legacy/Content/ObjectState/Mapper.php index da6cb8d1f4..e49d65c827 100644 --- a/src/lib/Persistence/Legacy/Content/ObjectState/Mapper.php +++ b/src/lib/Persistence/Legacy/Content/ObjectState/Mapper.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\Core\Persistence\Legacy\Content\ObjectState; use Ibexa\Contracts\Core\Persistence\Content\Language\Handler as LanguageHandler; diff --git a/src/lib/Persistence/Legacy/Content/Section/Handler.php b/src/lib/Persistence/Legacy/Content/Section/Handler.php index 76f03f85df..9813126701 100644 --- a/src/lib/Persistence/Legacy/Content/Section/Handler.php +++ b/src/lib/Persistence/Legacy/Content/Section/Handler.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\Core\Persistence\Legacy\Content\Section; use Ibexa\Contracts\Core\Persistence\Content\Section; diff --git a/src/lib/Persistence/Legacy/Content/StorageFieldDefinition.php b/src/lib/Persistence/Legacy/Content/StorageFieldDefinition.php index e5a283184c..d657ad7c5d 100644 --- a/src/lib/Persistence/Legacy/Content/StorageFieldDefinition.php +++ b/src/lib/Persistence/Legacy/Content/StorageFieldDefinition.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\Core\Persistence\Legacy\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/lib/Persistence/Legacy/Content/StorageFieldValue.php b/src/lib/Persistence/Legacy/Content/StorageFieldValue.php index 2914c1baf7..a4ee9a8c69 100644 --- a/src/lib/Persistence/Legacy/Content/StorageFieldValue.php +++ b/src/lib/Persistence/Legacy/Content/StorageFieldValue.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\Core\Persistence\Legacy\Content; use Ibexa\Contracts\Core\Persistence\ValueObject; diff --git a/src/lib/Persistence/Legacy/Content/StorageHandler.php b/src/lib/Persistence/Legacy/Content/StorageHandler.php index 475f6a1e98..cc2183b92f 100644 --- a/src/lib/Persistence/Legacy/Content/StorageHandler.php +++ b/src/lib/Persistence/Legacy/Content/StorageHandler.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\Core\Persistence\Legacy\Content; use Ibexa\Contracts\Core\Persistence\Content\Field; diff --git a/src/lib/Persistence/Legacy/Content/StorageRegistry.php b/src/lib/Persistence/Legacy/Content/StorageRegistry.php index 0de52b627a..5869f546aa 100644 --- a/src/lib/Persistence/Legacy/Content/StorageRegistry.php +++ b/src/lib/Persistence/Legacy/Content/StorageRegistry.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\Core\Persistence\Legacy\Content; use Ibexa\Contracts\Core\FieldType\FieldStorage; diff --git a/src/lib/Persistence/Legacy/Content/TreeHandler.php b/src/lib/Persistence/Legacy/Content/TreeHandler.php index 700b067e94..cc6391b113 100644 --- a/src/lib/Persistence/Legacy/Content/TreeHandler.php +++ b/src/lib/Persistence/Legacy/Content/TreeHandler.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\Core\Persistence\Legacy\Content; use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; diff --git a/src/lib/Persistence/Legacy/Content/Type/ContentUpdater.php b/src/lib/Persistence/Legacy/Content/Type/ContentUpdater.php index 9c53b14628..1c04fee47f 100644 --- a/src/lib/Persistence/Legacy/Content/Type/ContentUpdater.php +++ b/src/lib/Persistence/Legacy/Content/Type/ContentUpdater.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\Core\Persistence\Legacy\Content\Type; use Ibexa\Contracts\Core\Persistence\Content\Type; diff --git a/src/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action.php b/src/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action.php index cb7c3d8fff..f011e2c313 100644 --- a/src/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action.php +++ b/src/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action.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\Core\Persistence\Legacy\Content\Type\ContentUpdater; use Ibexa\Core\Persistence\Legacy\Content\Gateway as ContentGateway; diff --git a/src/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/AddField.php b/src/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/AddField.php index 2bfceff98c..a62df29175 100644 --- a/src/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/AddField.php +++ b/src/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/AddField.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\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action; use Ibexa\Contracts\Core\Persistence\Content; diff --git a/src/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/RemoveField.php b/src/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/RemoveField.php index dc8123ff8f..1299a73b12 100644 --- a/src/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/RemoveField.php +++ b/src/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/RemoveField.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\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action; use Ibexa\Contracts\Core\Persistence\Content\Type\FieldDefinition; diff --git a/src/lib/Persistence/Legacy/Content/Type/Handler.php b/src/lib/Persistence/Legacy/Content/Type/Handler.php index af6b85e3b3..5df8f5a699 100644 --- a/src/lib/Persistence/Legacy/Content/Type/Handler.php +++ b/src/lib/Persistence/Legacy/Content/Type/Handler.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\Core\Persistence\Legacy\Content\Type; use Ibexa\Contracts\Core\Persistence\Content\Type; @@ -477,6 +478,7 @@ public function unlink($groupId, $contentTypeId, $status) } $this->contentTypeGateway->deleteGroupAssignment($groupId, $contentTypeId, $status); + // @todo FIXME: What is to be returned? return true; } @@ -495,6 +497,7 @@ public function unlink($groupId, $contentTypeId, $status) public function link($groupId, $contentTypeId, $status) { $this->contentTypeGateway->insertGroupAssignment($groupId, $contentTypeId, $status); + // @todo FIXME: What is to be returned? return true; } diff --git a/src/lib/Persistence/Legacy/Content/Type/Mapper.php b/src/lib/Persistence/Legacy/Content/Type/Mapper.php index af8c060d95..80f08556eb 100644 --- a/src/lib/Persistence/Legacy/Content/Type/Mapper.php +++ b/src/lib/Persistence/Legacy/Content/Type/Mapper.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\Core\Persistence\Legacy\Content\Type; use Ibexa\Contracts\Core\Persistence\Content\Type; diff --git a/src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php b/src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php index ec9c7e990d..2355b67682 100644 --- a/src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php +++ b/src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.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\Core\Persistence\Legacy\Content\Type; use Ibexa\Contracts\Core\Persistence\Content\Type; diff --git a/src/lib/Persistence/Legacy/Content/UrlAlias/DTO/SwappedLocationProperties.php b/src/lib/Persistence/Legacy/Content/UrlAlias/DTO/SwappedLocationProperties.php index 903815c635..75a8d241bc 100644 --- a/src/lib/Persistence/Legacy/Content/UrlAlias/DTO/SwappedLocationProperties.php +++ b/src/lib/Persistence/Legacy/Content/UrlAlias/DTO/SwappedLocationProperties.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\Core\Persistence\Legacy\Content\UrlAlias\DTO; /** diff --git a/src/lib/Persistence/Legacy/Content/UrlAlias/DTO/UrlAliasForSwappedLocation.php b/src/lib/Persistence/Legacy/Content/UrlAlias/DTO/UrlAliasForSwappedLocation.php index 670f5169ee..bee42796e7 100644 --- a/src/lib/Persistence/Legacy/Content/UrlAlias/DTO/UrlAliasForSwappedLocation.php +++ b/src/lib/Persistence/Legacy/Content/UrlAlias/DTO/UrlAliasForSwappedLocation.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\Core\Persistence\Legacy\Content\UrlAlias\DTO; /** diff --git a/src/lib/Persistence/Legacy/Content/UrlAlias/Handler.php b/src/lib/Persistence/Legacy/Content/UrlAlias/Handler.php index 49d08729da..b841ce4bac 100644 --- a/src/lib/Persistence/Legacy/Content/UrlAlias/Handler.php +++ b/src/lib/Persistence/Legacy/Content/UrlAlias/Handler.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\Core\Persistence\Legacy\Content\UrlAlias; use Doctrine\DBAL\Exception\UniqueConstraintViolationException; diff --git a/src/lib/Persistence/Legacy/Content/UrlAlias/Mapper.php b/src/lib/Persistence/Legacy/Content/UrlAlias/Mapper.php index 17cad221a1..443fe50f87 100644 --- a/src/lib/Persistence/Legacy/Content/UrlAlias/Mapper.php +++ b/src/lib/Persistence/Legacy/Content/UrlAlias/Mapper.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\Core\Persistence\Legacy\Content\UrlAlias; use Ibexa\Contracts\Core\Persistence\Content\UrlAlias; diff --git a/src/lib/Persistence/Legacy/Content/UrlAlias/SlugConverter.php b/src/lib/Persistence/Legacy/Content/UrlAlias/SlugConverter.php index d24883391c..7eec2456c6 100644 --- a/src/lib/Persistence/Legacy/Content/UrlAlias/SlugConverter.php +++ b/src/lib/Persistence/Legacy/Content/UrlAlias/SlugConverter.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\Core\Persistence\Legacy\Content\UrlAlias; use Ibexa\Core\Persistence\TransformationProcessor; diff --git a/src/lib/Persistence/Legacy/Content/UrlWildcard/Handler.php b/src/lib/Persistence/Legacy/Content/UrlWildcard/Handler.php index 4b72da8672..ec92b97058 100644 --- a/src/lib/Persistence/Legacy/Content/UrlWildcard/Handler.php +++ b/src/lib/Persistence/Legacy/Content/UrlWildcard/Handler.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\Core\Persistence\Legacy\Content\UrlWildcard; use Ibexa\Contracts\Core\Persistence\Content\UrlWildcard; diff --git a/src/lib/Persistence/Legacy/Content/UrlWildcard/Mapper.php b/src/lib/Persistence/Legacy/Content/UrlWildcard/Mapper.php index 81009c90bb..b074b98e28 100644 --- a/src/lib/Persistence/Legacy/Content/UrlWildcard/Mapper.php +++ b/src/lib/Persistence/Legacy/Content/UrlWildcard/Mapper.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\Core\Persistence\Legacy\Content\UrlWildcard; use Ibexa\Contracts\Core\Persistence\Content\UrlWildcard; diff --git a/src/lib/Persistence/Legacy/Exception/GroupNotEmpty.php b/src/lib/Persistence/Legacy/Exception/GroupNotEmpty.php index a494be98cd..b3ec5faf80 100644 --- a/src/lib/Persistence/Legacy/Exception/GroupNotEmpty.php +++ b/src/lib/Persistence/Legacy/Exception/GroupNotEmpty.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\Core\Persistence\Legacy\Exception; use Ibexa\Core\Base\Exceptions\BadStateException; diff --git a/src/lib/Persistence/Legacy/Exception/RemoveLastGroupFromType.php b/src/lib/Persistence/Legacy/Exception/RemoveLastGroupFromType.php index 2b7c914deb..8930fbcfe2 100644 --- a/src/lib/Persistence/Legacy/Exception/RemoveLastGroupFromType.php +++ b/src/lib/Persistence/Legacy/Exception/RemoveLastGroupFromType.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\Core\Persistence\Legacy\Exception; use Ibexa\Core\Base\Exceptions\BadStateException; diff --git a/src/lib/Persistence/Legacy/Exception/RoleNotFound.php b/src/lib/Persistence/Legacy/Exception/RoleNotFound.php index 35373f0e8e..31720b33c2 100644 --- a/src/lib/Persistence/Legacy/Exception/RoleNotFound.php +++ b/src/lib/Persistence/Legacy/Exception/RoleNotFound.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\Core\Persistence\Legacy\Exception; use Ibexa\Core\Base\Exceptions\NotFoundException; diff --git a/src/lib/Persistence/Legacy/Exception/StorageNotFound.php b/src/lib/Persistence/Legacy/Exception/StorageNotFound.php index 98b0c3e854..cf00d0faf1 100644 --- a/src/lib/Persistence/Legacy/Exception/StorageNotFound.php +++ b/src/lib/Persistence/Legacy/Exception/StorageNotFound.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\Core\Persistence\Legacy\Exception; use InvalidArgumentException; diff --git a/src/lib/Persistence/Legacy/Exception/TypeGroupNotFound.php b/src/lib/Persistence/Legacy/Exception/TypeGroupNotFound.php index 4f016df335..afdf91e275 100644 --- a/src/lib/Persistence/Legacy/Exception/TypeGroupNotFound.php +++ b/src/lib/Persistence/Legacy/Exception/TypeGroupNotFound.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\Core\Persistence\Legacy\Exception; use Ibexa\Core\Base\Exceptions\NotFoundException; diff --git a/src/lib/Persistence/Legacy/Exception/TypeNotFound.php b/src/lib/Persistence/Legacy/Exception/TypeNotFound.php index 58ce696196..7bf36f3f41 100644 --- a/src/lib/Persistence/Legacy/Exception/TypeNotFound.php +++ b/src/lib/Persistence/Legacy/Exception/TypeNotFound.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\Core\Persistence\Legacy\Exception; use Ibexa\Core\Base\Exceptions\NotFoundException; diff --git a/src/lib/Persistence/Legacy/Exception/TypeStillHasContent.php b/src/lib/Persistence/Legacy/Exception/TypeStillHasContent.php index 196812c40b..23b44ac2e1 100644 --- a/src/lib/Persistence/Legacy/Exception/TypeStillHasContent.php +++ b/src/lib/Persistence/Legacy/Exception/TypeStillHasContent.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\Core\Persistence\Legacy\Exception; use Ibexa\Core\Base\Exceptions\BadStateException; diff --git a/src/lib/Persistence/Legacy/Setting/Handler.php b/src/lib/Persistence/Legacy/Setting/Handler.php index b336a0bf92..c4329cfb70 100644 --- a/src/lib/Persistence/Legacy/Setting/Handler.php +++ b/src/lib/Persistence/Legacy/Setting/Handler.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\Core\Persistence\Legacy\Setting; use Ibexa\Contracts\Core\Persistence\Setting\Handler as BaseSettingHandler; diff --git a/src/lib/Persistence/Legacy/TransactionHandler.php b/src/lib/Persistence/Legacy/TransactionHandler.php index b450b9bdf3..45d29a6dff 100644 --- a/src/lib/Persistence/Legacy/TransactionHandler.php +++ b/src/lib/Persistence/Legacy/TransactionHandler.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\Core\Persistence\Legacy; use Doctrine\DBAL\Connection; diff --git a/src/lib/Persistence/Legacy/URL/Gateway.php b/src/lib/Persistence/Legacy/URL/Gateway.php index ed83690ed7..ee00264e77 100644 --- a/src/lib/Persistence/Legacy/URL/Gateway.php +++ b/src/lib/Persistence/Legacy/URL/Gateway.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\Core\Persistence\Legacy\URL; use Ibexa\Contracts\Core\Persistence\URL\URL; diff --git a/src/lib/Persistence/Legacy/URL/Gateway/DoctrineDatabase.php b/src/lib/Persistence/Legacy/URL/Gateway/DoctrineDatabase.php index 81a7f53e36..9895c3dd6d 100644 --- a/src/lib/Persistence/Legacy/URL/Gateway/DoctrineDatabase.php +++ b/src/lib/Persistence/Legacy/URL/Gateway/DoctrineDatabase.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\Core\Persistence\Legacy\URL\Gateway; use Doctrine\DBAL\Connection; diff --git a/src/lib/Persistence/Legacy/URL/Gateway/ExceptionConversion.php b/src/lib/Persistence/Legacy/URL/Gateway/ExceptionConversion.php index ff301d2ad1..9958240c78 100644 --- a/src/lib/Persistence/Legacy/URL/Gateway/ExceptionConversion.php +++ b/src/lib/Persistence/Legacy/URL/Gateway/ExceptionConversion.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\Core\Persistence\Legacy\URL\Gateway; use Doctrine\DBAL\DBALException; diff --git a/src/lib/Persistence/Legacy/URL/Handler.php b/src/lib/Persistence/Legacy/URL/Handler.php index 5ce9869be6..6dc8d4f9ef 100644 --- a/src/lib/Persistence/Legacy/URL/Handler.php +++ b/src/lib/Persistence/Legacy/URL/Handler.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\Core\Persistence\Legacy\URL; use Ibexa\Contracts\Core\Persistence\URL\Handler as HandlerInterface; diff --git a/src/lib/Persistence/Legacy/URL/Mapper.php b/src/lib/Persistence/Legacy/URL/Mapper.php index 3b29647e3c..4221d83fb2 100644 --- a/src/lib/Persistence/Legacy/URL/Mapper.php +++ b/src/lib/Persistence/Legacy/URL/Mapper.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\Core\Persistence\Legacy\URL; use Ibexa\Contracts\Core\Persistence\URL\URL; diff --git a/src/lib/Persistence/Legacy/URL/Query/CriteriaConverter.php b/src/lib/Persistence/Legacy/URL/Query/CriteriaConverter.php index 21e7002ac7..981e042f2f 100644 --- a/src/lib/Persistence/Legacy/URL/Query/CriteriaConverter.php +++ b/src/lib/Persistence/Legacy/URL/Query/CriteriaConverter.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\Core\Persistence\Legacy\URL\Query; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler.php b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler.php index dc8920b58c..7ac19679ed 100644 --- a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler.php +++ b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler.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\Core\Persistence\Legacy\URL\Query; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalAnd.php b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalAnd.php index 3367ea0168..617caba36a 100644 --- a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalAnd.php +++ b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalAnd.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalNot.php b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalNot.php index 35d8c9208e..7c96a36278 100644 --- a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalNot.php +++ b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalNot.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalOr.php b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalOr.php index 07642ebb14..fea8b4ccf3 100644 --- a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalOr.php +++ b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalOr.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchAll.php b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchAll.php index f0374904c7..e67cf64ee8 100644 --- a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchAll.php +++ b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchAll.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchNone.php b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchNone.php index 7d4efc15e8..b12b32d4b1 100644 --- a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchNone.php +++ b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchNone.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/Pattern.php b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/Pattern.php index 201cc5165b..672baea7e3 100644 --- a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/Pattern.php +++ b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/Pattern.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\ParameterType; diff --git a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/Validity.php b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/Validity.php index fafa42df36..5854c45471 100644 --- a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/Validity.php +++ b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/Validity.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\ParameterType; diff --git a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/VisibleOnly.php b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/VisibleOnly.php index 8564418beb..d471911b6a 100644 --- a/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/VisibleOnly.php +++ b/src/lib/Persistence/Legacy/URL/Query/CriterionHandler/VisibleOnly.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\ParameterType; diff --git a/src/lib/Persistence/Legacy/User/Handler.php b/src/lib/Persistence/Legacy/User/Handler.php index c476a49e35..c3a5294b04 100644 --- a/src/lib/Persistence/Legacy/User/Handler.php +++ b/src/lib/Persistence/Legacy/User/Handler.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\Core\Persistence\Legacy\User; use Ibexa\Contracts\Core\Persistence\User; diff --git a/src/lib/Persistence/Legacy/User/Mapper.php b/src/lib/Persistence/Legacy/User/Mapper.php index df7abea750..aff71f3dd9 100644 --- a/src/lib/Persistence/Legacy/User/Mapper.php +++ b/src/lib/Persistence/Legacy/User/Mapper.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\Core\Persistence\Legacy\User; use Ibexa\Contracts\Core\Persistence\User; diff --git a/src/lib/Persistence/Legacy/User/Role/LimitationConverter.php b/src/lib/Persistence/Legacy/User/Role/LimitationConverter.php index ca59e3c758..0e906200b5 100644 --- a/src/lib/Persistence/Legacy/User/Role/LimitationConverter.php +++ b/src/lib/Persistence/Legacy/User/Role/LimitationConverter.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\Core\Persistence\Legacy\User\Role; use Ibexa\Contracts\Core\Persistence\User\Policy; diff --git a/src/lib/Persistence/Legacy/User/Role/LimitationHandler.php b/src/lib/Persistence/Legacy/User/Role/LimitationHandler.php index 89281cea7e..94273b722e 100644 --- a/src/lib/Persistence/Legacy/User/Role/LimitationHandler.php +++ b/src/lib/Persistence/Legacy/User/Role/LimitationHandler.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\Core\Persistence\Legacy\User\Role; use Doctrine\DBAL\Connection; diff --git a/src/lib/Persistence/Legacy/User/Role/LimitationHandler/ObjectStateHandler.php b/src/lib/Persistence/Legacy/User/Role/LimitationHandler/ObjectStateHandler.php index 4518c477ec..6ca4ac046d 100644 --- a/src/lib/Persistence/Legacy/User/Role/LimitationHandler/ObjectStateHandler.php +++ b/src/lib/Persistence/Legacy/User/Role/LimitationHandler/ObjectStateHandler.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\Core\Persistence\Legacy\User\Role\LimitationHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Persistence/TransformationProcessor.php b/src/lib/Persistence/TransformationProcessor.php index 025e321403..de21cd6c82 100644 --- a/src/lib/Persistence/TransformationProcessor.php +++ b/src/lib/Persistence/TransformationProcessor.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\Core\Persistence; use Ibexa\Core\Persistence\TransformationProcessor\PcreCompiler; diff --git a/src/lib/Persistence/TransformationProcessor/DefinitionBased.php b/src/lib/Persistence/TransformationProcessor/DefinitionBased.php index 60be031dd7..9343f3da59 100644 --- a/src/lib/Persistence/TransformationProcessor/DefinitionBased.php +++ b/src/lib/Persistence/TransformationProcessor/DefinitionBased.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\Core\Persistence\TransformationProcessor; use Ibexa\Core\Persistence\TransformationProcessor; diff --git a/src/lib/Persistence/TransformationProcessor/DefinitionBased/Parser.php b/src/lib/Persistence/TransformationProcessor/DefinitionBased/Parser.php index 4e2a31de38..cb4993a49b 100644 --- a/src/lib/Persistence/TransformationProcessor/DefinitionBased/Parser.php +++ b/src/lib/Persistence/TransformationProcessor/DefinitionBased/Parser.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\Core\Persistence\TransformationProcessor\DefinitionBased; use Ibexa\Core\Persistence\TransformationProcessor; diff --git a/src/lib/Persistence/TransformationProcessor/PcreCompiler.php b/src/lib/Persistence/TransformationProcessor/PcreCompiler.php index fc96e7de11..c87c420c2a 100644 --- a/src/lib/Persistence/TransformationProcessor/PcreCompiler.php +++ b/src/lib/Persistence/TransformationProcessor/PcreCompiler.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\Core\Persistence\TransformationProcessor; use Ibexa\Core\Persistence\TransformationProcessor; diff --git a/src/lib/Persistence/TransformationProcessor/PreprocessedBased.php b/src/lib/Persistence/TransformationProcessor/PreprocessedBased.php index 2af518212d..75cc29bbc7 100644 --- a/src/lib/Persistence/TransformationProcessor/PreprocessedBased.php +++ b/src/lib/Persistence/TransformationProcessor/PreprocessedBased.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\Core\Persistence\TransformationProcessor; use Ibexa\Core\Persistence\TransformationProcessor; diff --git a/src/lib/Persistence/Utf8Converter.php b/src/lib/Persistence/Utf8Converter.php index f5220226cc..9e53609a9a 100644 --- a/src/lib/Persistence/Utf8Converter.php +++ b/src/lib/Persistence/Utf8Converter.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\Core\Persistence; use RuntimeException; diff --git a/src/lib/Query/QueryFactoryInterface.php b/src/lib/Query/QueryFactoryInterface.php index 4149075b8e..4d9cc08d1d 100644 --- a/src/lib/Query/QueryFactoryInterface.php +++ b/src/lib/Query/QueryFactoryInterface.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\Core\Query; use Ibexa\Contracts\Core\Repository\Values\Content\Query; diff --git a/src/lib/QueryType/ArrayQueryTypeRegistry.php b/src/lib/QueryType/ArrayQueryTypeRegistry.php index 58593a6cd4..147e942bff 100644 --- a/src/lib/QueryType/ArrayQueryTypeRegistry.php +++ b/src/lib/QueryType/ArrayQueryTypeRegistry.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\Core\QueryType; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/src/lib/QueryType/ContentViewQueryTypeMapper.php b/src/lib/QueryType/ContentViewQueryTypeMapper.php index 8e3e5ea460..db3d3d907f 100644 --- a/src/lib/QueryType/ContentViewQueryTypeMapper.php +++ b/src/lib/QueryType/ContentViewQueryTypeMapper.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\Core\QueryType; use Ibexa\Core\MVC\Symfony\View\ContentView; diff --git a/src/lib/QueryType/OptionsResolverBasedQueryType.php b/src/lib/QueryType/OptionsResolverBasedQueryType.php index d6d8d1266f..26abc7b494 100644 --- a/src/lib/QueryType/OptionsResolverBasedQueryType.php +++ b/src/lib/QueryType/OptionsResolverBasedQueryType.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\Core\QueryType; use Ibexa\Contracts\Core\Repository\Values\Content\Query; diff --git a/src/lib/QueryType/QueryParameterContentViewQueryTypeMapper.php b/src/lib/QueryType/QueryParameterContentViewQueryTypeMapper.php index e629ddf755..f52f05442c 100644 --- a/src/lib/QueryType/QueryParameterContentViewQueryTypeMapper.php +++ b/src/lib/QueryType/QueryParameterContentViewQueryTypeMapper.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\Core\QueryType; use Ibexa\Core\MVC\Symfony\View\ContentView; diff --git a/src/lib/QueryType/QueryType.php b/src/lib/QueryType/QueryType.php index 4f30d22ff6..c94ed9c9a0 100644 --- a/src/lib/QueryType/QueryType.php +++ b/src/lib/QueryType/QueryType.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\Core\QueryType; /** diff --git a/src/lib/QueryType/QueryTypeRegistry.php b/src/lib/QueryType/QueryTypeRegistry.php index 74c96dfe7b..5748c8b268 100644 --- a/src/lib/QueryType/QueryTypeRegistry.php +++ b/src/lib/QueryType/QueryTypeRegistry.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\Core\QueryType; /** diff --git a/src/lib/Repository/Helper/NameSchemaService.php b/src/lib/Repository/Helper/NameSchemaService.php index 111edb167c..25e2ae564b 100644 --- a/src/lib/Repository/Helper/NameSchemaService.php +++ b/src/lib/Repository/Helper/NameSchemaService.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\Core\Repository\Helper; use Ibexa\Contracts\Core\Persistence\Content\Type as SPIContentType; diff --git a/src/lib/Repository/Helper/RelationProcessor.php b/src/lib/Repository/Helper/RelationProcessor.php index bcb4914ec7..761e75179f 100644 --- a/src/lib/Repository/Helper/RelationProcessor.php +++ b/src/lib/Repository/Helper/RelationProcessor.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\Core\Repository\Helper; use Ibexa\Contracts\Core\FieldType\FieldType as SPIFieldType; diff --git a/src/lib/Repository/Helper/RoleDomainMapper.php b/src/lib/Repository/Helper/RoleDomainMapper.php index abec45016a..1789f5fd9b 100644 --- a/src/lib/Repository/Helper/RoleDomainMapper.php +++ b/src/lib/Repository/Helper/RoleDomainMapper.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\Core\Repository\Helper; use Ibexa\Core\Repository\Mapper\RoleDomainMapper as BaseRoleDomainMapper; diff --git a/src/lib/Repository/LanguageService.php b/src/lib/Repository/LanguageService.php index 8e47d8ab2b..6ca9970a11 100644 --- a/src/lib/Repository/LanguageService.php +++ b/src/lib/Repository/LanguageService.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\Core\Repository; use Exception; diff --git a/src/lib/Repository/Mapper/ContentDomainMapper.php b/src/lib/Repository/Mapper/ContentDomainMapper.php index 45cc8cf94b..b3487b7c68 100644 --- a/src/lib/Repository/Mapper/ContentDomainMapper.php +++ b/src/lib/Repository/Mapper/ContentDomainMapper.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\Core\Repository\Mapper; use DateTime; diff --git a/src/lib/Repository/Mapper/RoleDomainMapper.php b/src/lib/Repository/Mapper/RoleDomainMapper.php index 3f5f6ecd0c..6e0db859e2 100644 --- a/src/lib/Repository/Mapper/RoleDomainMapper.php +++ b/src/lib/Repository/Mapper/RoleDomainMapper.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\Core\Repository\Mapper; use Ibexa\Contracts\Core\Persistence\User\Policy as SPIPolicy; diff --git a/src/lib/Repository/NameSchema/NameSchemaService.php b/src/lib/Repository/NameSchema/NameSchemaService.php index 782a154191..049a52edfa 100644 --- a/src/lib/Repository/NameSchema/NameSchemaService.php +++ b/src/lib/Repository/NameSchema/NameSchemaService.php @@ -54,7 +54,7 @@ class NameSchemaService implements NameSchemaServiceInterface protected FieldTypeRegistry $fieldTypeRegistry; /** - * @param array{limit?: integer, sequence?: string} $settings + * @param array{limit?: int, sequence?: string} $settings */ protected array $settings; @@ -63,7 +63,7 @@ class NameSchemaService implements NameSchemaServiceInterface private SchemaIdentifierExtractorInterface $schemaIdentifierExtractor; /** - * @param array{limit?: integer, sequence?: string} $settings + * @param array{limit?: int, sequence?: string} $settings */ public function __construct( FieldTypeRegistry $fieldTypeRegistry, diff --git a/src/lib/Repository/ObjectStateService.php b/src/lib/Repository/ObjectStateService.php index e654a1621c..50d66b14bb 100644 --- a/src/lib/Repository/ObjectStateService.php +++ b/src/lib/Repository/ObjectStateService.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\Core\Repository; use Exception; diff --git a/src/lib/Repository/PermissionsCriterionHandler.php b/src/lib/Repository/PermissionsCriterionHandler.php index 09278d4841..a9edb9d220 100644 --- a/src/lib/Repository/PermissionsCriterionHandler.php +++ b/src/lib/Repository/PermissionsCriterionHandler.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\Core\Repository; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; diff --git a/src/lib/Repository/ProxyFactory/ProxyDomainMapperFactoryInterface.php b/src/lib/Repository/ProxyFactory/ProxyDomainMapperFactoryInterface.php index 8c7dce26be..bf07dc66f9 100644 --- a/src/lib/Repository/ProxyFactory/ProxyDomainMapperFactoryInterface.php +++ b/src/lib/Repository/ProxyFactory/ProxyDomainMapperFactoryInterface.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\Core\Repository\ProxyFactory; use Ibexa\Contracts\Core\Repository\Repository; diff --git a/src/lib/Repository/Repository.php b/src/lib/Repository/Repository.php index d97c929160..aa9dae0b55 100644 --- a/src/lib/Repository/Repository.php +++ b/src/lib/Repository/Repository.php @@ -725,6 +725,7 @@ public function getPermissionResolver(): PermissionResolverInterface /** * @internal + * * @private */ public function getNameSchemaService(): NameSchemaServiceInterface diff --git a/src/lib/Repository/RoleService.php b/src/lib/Repository/RoleService.php index b57f1fda30..d6b7cc4373 100644 --- a/src/lib/Repository/RoleService.php +++ b/src/lib/Repository/RoleService.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\Core\Repository; use Exception; diff --git a/src/lib/Repository/SiteAccessAware/ContentTypeService.php b/src/lib/Repository/SiteAccessAware/ContentTypeService.php index 939c03f652..e13caad382 100644 --- a/src/lib/Repository/SiteAccessAware/ContentTypeService.php +++ b/src/lib/Repository/SiteAccessAware/ContentTypeService.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\Core\Repository\SiteAccessAware; use Ibexa\Contracts\Core\Repository\ContentTypeService as ContentTypeServiceInterface; diff --git a/src/lib/Repository/SiteAccessAware/Language/LanguageResolver.php b/src/lib/Repository/SiteAccessAware/Language/LanguageResolver.php index da05360ee8..d7209632f1 100644 --- a/src/lib/Repository/SiteAccessAware/Language/LanguageResolver.php +++ b/src/lib/Repository/SiteAccessAware/Language/LanguageResolver.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\Core\Repository\SiteAccessAware\Language; /** diff --git a/src/lib/Repository/SiteAccessAware/LanguageService.php b/src/lib/Repository/SiteAccessAware/LanguageService.php index 1c43282c3a..430479c1d0 100644 --- a/src/lib/Repository/SiteAccessAware/LanguageService.php +++ b/src/lib/Repository/SiteAccessAware/LanguageService.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\Core\Repository\SiteAccessAware; use Ibexa\Contracts\Core\Repository\LanguageService as LanguageServiceInterface; diff --git a/src/lib/Repository/SiteAccessAware/ObjectStateService.php b/src/lib/Repository/SiteAccessAware/ObjectStateService.php index 86c587777b..710692d4bd 100644 --- a/src/lib/Repository/SiteAccessAware/ObjectStateService.php +++ b/src/lib/Repository/SiteAccessAware/ObjectStateService.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\Core\Repository\SiteAccessAware; use Ibexa\Contracts\Core\Repository\LanguageResolver; diff --git a/src/lib/Repository/Values/Content/Query/Criterion/PermissionSubtree.php b/src/lib/Repository/Values/Content/Query/Criterion/PermissionSubtree.php index 4f0495f93f..cb8108fb55 100644 --- a/src/lib/Repository/Values/Content/Query/Criterion/PermissionSubtree.php +++ b/src/lib/Repository/Values/Content/Query/Criterion/PermissionSubtree.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\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Subtree as APISubtreeCriterion; diff --git a/src/lib/Repository/Values/Content/VersionInfo.php b/src/lib/Repository/Values/Content/VersionInfo.php index 891fb19137..0cf535d6d0 100644 --- a/src/lib/Repository/Values/Content/VersionInfo.php +++ b/src/lib/Repository/Values/Content/VersionInfo.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\Core\Repository\Values\Content; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; diff --git a/src/lib/Repository/Values/ContentType/ContentType.php b/src/lib/Repository/Values/ContentType/ContentType.php index d20ce31e2a..e4dfca7a65 100644 --- a/src/lib/Repository/Values/ContentType/ContentType.php +++ b/src/lib/Repository/Values/ContentType/ContentType.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\Core\Repository\Values\ContentType; use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType as APIContentType; diff --git a/src/lib/Repository/Values/ContentType/ContentTypeCreateStruct.php b/src/lib/Repository/Values/ContentType/ContentTypeCreateStruct.php index c9d5c10188..0bff232008 100644 --- a/src/lib/Repository/Values/ContentType/ContentTypeCreateStruct.php +++ b/src/lib/Repository/Values/ContentType/ContentTypeCreateStruct.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\Core\Repository\Values\ContentType; use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeCreateStruct as APIContentTypeCreateStruct; diff --git a/src/lib/Repository/Values/ContentType/ContentTypeDraft.php b/src/lib/Repository/Values/ContentType/ContentTypeDraft.php index b202f815e3..e59bdd8b9c 100644 --- a/src/lib/Repository/Values/ContentType/ContentTypeDraft.php +++ b/src/lib/Repository/Values/ContentType/ContentTypeDraft.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\Core\Repository\Values\ContentType; use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeDraft as APIContentTypeDraft; diff --git a/src/lib/Repository/Values/ContentType/ContentTypeGroup.php b/src/lib/Repository/Values/ContentType/ContentTypeGroup.php index b6c39bee0d..d35cb0c18e 100644 --- a/src/lib/Repository/Values/ContentType/ContentTypeGroup.php +++ b/src/lib/Repository/Values/ContentType/ContentTypeGroup.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\Core\Repository\Values\ContentType; use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup as APIContentTypeGroup; diff --git a/src/lib/Repository/Values/MultiLanguageDescriptionTrait.php b/src/lib/Repository/Values/MultiLanguageDescriptionTrait.php index ec3756504c..d311382304 100644 --- a/src/lib/Repository/Values/MultiLanguageDescriptionTrait.php +++ b/src/lib/Repository/Values/MultiLanguageDescriptionTrait.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\Core\Repository\Values; /** diff --git a/src/lib/Repository/Values/MultiLanguageNameTrait.php b/src/lib/Repository/Values/MultiLanguageNameTrait.php index 159c05c54f..c9f83abd89 100644 --- a/src/lib/Repository/Values/MultiLanguageNameTrait.php +++ b/src/lib/Repository/Values/MultiLanguageNameTrait.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\Core\Repository\Values; /** diff --git a/src/lib/Repository/Values/MultiLanguageTrait.php b/src/lib/Repository/Values/MultiLanguageTrait.php index 8643055ab6..0cbe5990d1 100644 --- a/src/lib/Repository/Values/MultiLanguageTrait.php +++ b/src/lib/Repository/Values/MultiLanguageTrait.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\Core\Repository\Values; /** diff --git a/src/lib/Repository/Values/ObjectState/ObjectStateGroup.php b/src/lib/Repository/Values/ObjectState/ObjectStateGroup.php index 411490eb79..1c5c28451d 100644 --- a/src/lib/Repository/Values/ObjectState/ObjectStateGroup.php +++ b/src/lib/Repository/Values/ObjectState/ObjectStateGroup.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\Core\Repository\Values\ObjectState; use Ibexa\Contracts\Core\Repository\Values\ObjectState\ObjectStateGroup as APIObjectStateGroup; diff --git a/src/lib/Repository/Values/User/PolicyUpdateStruct.php b/src/lib/Repository/Values/User/PolicyUpdateStruct.php index 93e5011c0b..45d50b85dd 100644 --- a/src/lib/Repository/Values/User/PolicyUpdateStruct.php +++ b/src/lib/Repository/Values/User/PolicyUpdateStruct.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\Core\Repository\Values\User; use Ibexa\Contracts\Core\Repository\Values\User\Limitation; diff --git a/src/lib/Repository/Values/User/Role.php b/src/lib/Repository/Values/User/Role.php index fc1eae0e36..4f56f7fbfb 100644 --- a/src/lib/Repository/Values/User/Role.php +++ b/src/lib/Repository/Values/User/Role.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\Core\Repository\Values\User; use Ibexa\Contracts\Core\Repository\Values\User\Role as APIRole; diff --git a/src/lib/Search/Common/BackgroundIndexer.php b/src/lib/Search/Common/BackgroundIndexer.php index 0fb7eb39a3..9f6b6c37c7 100644 --- a/src/lib/Search/Common/BackgroundIndexer.php +++ b/src/lib/Search/Common/BackgroundIndexer.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\Core\Search\Common; use Ibexa\Contracts\Core\Persistence\Content\ContentInfo; diff --git a/src/lib/Search/Common/BackgroundIndexer/NullIndexer.php b/src/lib/Search/Common/BackgroundIndexer/NullIndexer.php index 87c4986740..00dad284f4 100644 --- a/src/lib/Search/Common/BackgroundIndexer/NullIndexer.php +++ b/src/lib/Search/Common/BackgroundIndexer/NullIndexer.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\Core\Search\Common\BackgroundIndexer; use Ibexa\Contracts\Core\Persistence\Content\ContentInfo; diff --git a/src/lib/Search/Common/EventSubscriber/AbstractSearchEventSubscriber.php b/src/lib/Search/Common/EventSubscriber/AbstractSearchEventSubscriber.php index 71d05750f3..deeabedd6f 100644 --- a/src/lib/Search/Common/EventSubscriber/AbstractSearchEventSubscriber.php +++ b/src/lib/Search/Common/EventSubscriber/AbstractSearchEventSubscriber.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\Core\Search\Common\EventSubscriber; use Ibexa\Contracts\Core\Persistence\Handler as PersistenceHandler; diff --git a/src/lib/Search/Common/EventSubscriber/ContentEventSubscriber.php b/src/lib/Search/Common/EventSubscriber/ContentEventSubscriber.php index 5aa0adf2f5..032179b589 100644 --- a/src/lib/Search/Common/EventSubscriber/ContentEventSubscriber.php +++ b/src/lib/Search/Common/EventSubscriber/ContentEventSubscriber.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\Core\Search\Common\EventSubscriber; use Ibexa\Contracts\Core\Repository\Events\Content\CopyContentEvent; diff --git a/src/lib/Search/Common/EventSubscriber/LocationEventSubscriber.php b/src/lib/Search/Common/EventSubscriber/LocationEventSubscriber.php index 8970e9a930..62fabd52c8 100644 --- a/src/lib/Search/Common/EventSubscriber/LocationEventSubscriber.php +++ b/src/lib/Search/Common/EventSubscriber/LocationEventSubscriber.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\Core\Search\Common\EventSubscriber; use Ibexa\Contracts\Core\Repository\Events\Location\CopySubtreeEvent; diff --git a/src/lib/Search/Common/EventSubscriber/ObjectStateEventSubscriber.php b/src/lib/Search/Common/EventSubscriber/ObjectStateEventSubscriber.php index d8ebb44443..46b6e5b593 100644 --- a/src/lib/Search/Common/EventSubscriber/ObjectStateEventSubscriber.php +++ b/src/lib/Search/Common/EventSubscriber/ObjectStateEventSubscriber.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\Core\Search\Common\EventSubscriber; use Ibexa\Contracts\Core\Repository\Events\ObjectState\SetContentStateEvent; diff --git a/src/lib/Search/Common/EventSubscriber/SectionEventSubscriber.php b/src/lib/Search/Common/EventSubscriber/SectionEventSubscriber.php index 700bd9c25e..67b2800dc5 100644 --- a/src/lib/Search/Common/EventSubscriber/SectionEventSubscriber.php +++ b/src/lib/Search/Common/EventSubscriber/SectionEventSubscriber.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\Core\Search\Common\EventSubscriber; use Ibexa\Contracts\Core\Repository\Events\Section\AssignSectionEvent; diff --git a/src/lib/Search/Common/EventSubscriber/TrashEventSubscriber.php b/src/lib/Search/Common/EventSubscriber/TrashEventSubscriber.php index 0d9da88fab..ef2b64a9f1 100644 --- a/src/lib/Search/Common/EventSubscriber/TrashEventSubscriber.php +++ b/src/lib/Search/Common/EventSubscriber/TrashEventSubscriber.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\Core\Search\Common\EventSubscriber; use Ibexa\Contracts\Core\Repository\Events\Trash\DeleteTrashItemEvent; diff --git a/src/lib/Search/Common/EventSubscriber/UserEventSubscriber.php b/src/lib/Search/Common/EventSubscriber/UserEventSubscriber.php index 979e0313ae..959da4c0b9 100644 --- a/src/lib/Search/Common/EventSubscriber/UserEventSubscriber.php +++ b/src/lib/Search/Common/EventSubscriber/UserEventSubscriber.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\Core\Search\Common\EventSubscriber; use Ibexa\Contracts\Core\Repository\Event\AfterEvent; diff --git a/src/lib/Search/Common/FieldNameGenerator.php b/src/lib/Search/Common/FieldNameGenerator.php index 48b2bed3c7..45e7010450 100644 --- a/src/lib/Search/Common/FieldNameGenerator.php +++ b/src/lib/Search/Common/FieldNameGenerator.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\Core\Search\Common; use Ibexa\Contracts\Core\Search\FieldType; diff --git a/src/lib/Search/Common/FieldNameResolver.php b/src/lib/Search/Common/FieldNameResolver.php index 1bce132395..b4476d74d8 100644 --- a/src/lib/Search/Common/FieldNameResolver.php +++ b/src/lib/Search/Common/FieldNameResolver.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\Core\Search\Common; use Ibexa\Contracts\Core\Persistence\Content\Type\Handler as ContentTypeHandler; diff --git a/src/lib/Search/Common/FieldRegistry.php b/src/lib/Search/Common/FieldRegistry.php index 89d928544e..45e8c412b7 100644 --- a/src/lib/Search/Common/FieldRegistry.php +++ b/src/lib/Search/Common/FieldRegistry.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\Core\Search\Common; use Ibexa\Contracts\Core\FieldType\Indexable; diff --git a/src/lib/Search/Common/FieldValueMapper.php b/src/lib/Search/Common/FieldValueMapper.php index 5c9e2ab7b3..a01dfa75c6 100644 --- a/src/lib/Search/Common/FieldValueMapper.php +++ b/src/lib/Search/Common/FieldValueMapper.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\Core\Search\Common; use Ibexa\Contracts\Core\Search\Field; diff --git a/src/lib/Search/Common/FieldValueMapper/Aggregate.php b/src/lib/Search/Common/FieldValueMapper/Aggregate.php index 6b9d0c090a..9540d6fc49 100644 --- a/src/lib/Search/Common/FieldValueMapper/Aggregate.php +++ b/src/lib/Search/Common/FieldValueMapper/Aggregate.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\Core\Search\Common\FieldValueMapper; use Ibexa\Contracts\Core\Repository\Exceptions\NotImplementedException; diff --git a/src/lib/Search/Common/FieldValueMapper/BooleanMapper.php b/src/lib/Search/Common/FieldValueMapper/BooleanMapper.php index fe725e9d14..839d75c8ae 100644 --- a/src/lib/Search/Common/FieldValueMapper/BooleanMapper.php +++ b/src/lib/Search/Common/FieldValueMapper/BooleanMapper.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\Core\Search\Common\FieldValueMapper; use Ibexa\Contracts\Core\Search\Field; diff --git a/src/lib/Search/Common/FieldValueMapper/DateMapper.php b/src/lib/Search/Common/FieldValueMapper/DateMapper.php index 74bd043621..6e81625b11 100644 --- a/src/lib/Search/Common/FieldValueMapper/DateMapper.php +++ b/src/lib/Search/Common/FieldValueMapper/DateMapper.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\Core\Search\Common\FieldValueMapper; use DateTime; diff --git a/src/lib/Search/Common/FieldValueMapper/DocumentMapper.php b/src/lib/Search/Common/FieldValueMapper/DocumentMapper.php index 639b041502..c8e926d161 100644 --- a/src/lib/Search/Common/FieldValueMapper/DocumentMapper.php +++ b/src/lib/Search/Common/FieldValueMapper/DocumentMapper.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\Core\Search\Common\FieldValueMapper; use Ibexa\Contracts\Core\Search\Field; diff --git a/src/lib/Search/Common/FieldValueMapper/FloatMapper.php b/src/lib/Search/Common/FieldValueMapper/FloatMapper.php index 4ca7584844..58ca654251 100644 --- a/src/lib/Search/Common/FieldValueMapper/FloatMapper.php +++ b/src/lib/Search/Common/FieldValueMapper/FloatMapper.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\Core\Search\Common\FieldValueMapper; use Ibexa\Contracts\Core\Search\Field; diff --git a/src/lib/Search/Common/FieldValueMapper/GeoLocationMapper.php b/src/lib/Search/Common/FieldValueMapper/GeoLocationMapper.php index 83f33ea4dc..53dddb41cd 100644 --- a/src/lib/Search/Common/FieldValueMapper/GeoLocationMapper.php +++ b/src/lib/Search/Common/FieldValueMapper/GeoLocationMapper.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\Core\Search\Common\FieldValueMapper; use Ibexa\Contracts\Core\Search\Field; diff --git a/src/lib/Search/Common/FieldValueMapper/IdentifierMapper.php b/src/lib/Search/Common/FieldValueMapper/IdentifierMapper.php index c15c45a62f..7ed08164ba 100644 --- a/src/lib/Search/Common/FieldValueMapper/IdentifierMapper.php +++ b/src/lib/Search/Common/FieldValueMapper/IdentifierMapper.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\Core\Search\Common\FieldValueMapper; use Ibexa\Contracts\Core\Search\Field; diff --git a/src/lib/Search/Common/FieldValueMapper/IntegerMapper.php b/src/lib/Search/Common/FieldValueMapper/IntegerMapper.php index cb97133213..aeea5893fb 100644 --- a/src/lib/Search/Common/FieldValueMapper/IntegerMapper.php +++ b/src/lib/Search/Common/FieldValueMapper/IntegerMapper.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\Core\Search\Common\FieldValueMapper; use Ibexa\Contracts\Core\Search\Field; diff --git a/src/lib/Search/Common/FieldValueMapper/MultipleBooleanMapper.php b/src/lib/Search/Common/FieldValueMapper/MultipleBooleanMapper.php index 7f6c451ce3..1cc9a75821 100644 --- a/src/lib/Search/Common/FieldValueMapper/MultipleBooleanMapper.php +++ b/src/lib/Search/Common/FieldValueMapper/MultipleBooleanMapper.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\Core\Search\Common\FieldValueMapper; use Ibexa\Contracts\Core\Search\Field; diff --git a/src/lib/Search/Common/FieldValueMapper/MultipleIdentifierMapper.php b/src/lib/Search/Common/FieldValueMapper/MultipleIdentifierMapper.php index c48b32b24c..6dcced5e5c 100644 --- a/src/lib/Search/Common/FieldValueMapper/MultipleIdentifierMapper.php +++ b/src/lib/Search/Common/FieldValueMapper/MultipleIdentifierMapper.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\Core\Search\Common\FieldValueMapper; use Ibexa\Contracts\Core\Search\Field; diff --git a/src/lib/Search/Common/FieldValueMapper/MultipleIntegerMapper.php b/src/lib/Search/Common/FieldValueMapper/MultipleIntegerMapper.php index c45d80ecb7..6952f5649a 100644 --- a/src/lib/Search/Common/FieldValueMapper/MultipleIntegerMapper.php +++ b/src/lib/Search/Common/FieldValueMapper/MultipleIntegerMapper.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\Core\Search\Common\FieldValueMapper; use Ibexa\Contracts\Core\Search\Field; diff --git a/src/lib/Search/Common/FieldValueMapper/MultipleRemoteIdentifierMapper.php b/src/lib/Search/Common/FieldValueMapper/MultipleRemoteIdentifierMapper.php index 287f332a59..972410350b 100644 --- a/src/lib/Search/Common/FieldValueMapper/MultipleRemoteIdentifierMapper.php +++ b/src/lib/Search/Common/FieldValueMapper/MultipleRemoteIdentifierMapper.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\Core\Search\Common\FieldValueMapper; use Ibexa\Contracts\Core\Search\Field; diff --git a/src/lib/Search/Common/FieldValueMapper/MultipleStringMapper.php b/src/lib/Search/Common/FieldValueMapper/MultipleStringMapper.php index 30f5b35e03..6046f1dc03 100644 --- a/src/lib/Search/Common/FieldValueMapper/MultipleStringMapper.php +++ b/src/lib/Search/Common/FieldValueMapper/MultipleStringMapper.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\Core\Search\Common\FieldValueMapper; use Ibexa\Contracts\Core\Search\Field; diff --git a/src/lib/Search/Common/FieldValueMapper/PriceMapper.php b/src/lib/Search/Common/FieldValueMapper/PriceMapper.php index 7c5b803831..8052801b0b 100644 --- a/src/lib/Search/Common/FieldValueMapper/PriceMapper.php +++ b/src/lib/Search/Common/FieldValueMapper/PriceMapper.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\Core\Search\Common\FieldValueMapper; use Ibexa\Contracts\Core\Search\Field; diff --git a/src/lib/Search/Common/FieldValueMapper/RemoteIdentifierMapper.php b/src/lib/Search/Common/FieldValueMapper/RemoteIdentifierMapper.php index e1d7c9aecd..0e05d61e68 100644 --- a/src/lib/Search/Common/FieldValueMapper/RemoteIdentifierMapper.php +++ b/src/lib/Search/Common/FieldValueMapper/RemoteIdentifierMapper.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\Core\Search\Common\FieldValueMapper; use Ibexa\Contracts\Core\Search\Field; diff --git a/src/lib/Search/Common/FieldValueMapper/StringMapper.php b/src/lib/Search/Common/FieldValueMapper/StringMapper.php index 1050b068ed..f410ce4b20 100644 --- a/src/lib/Search/Common/FieldValueMapper/StringMapper.php +++ b/src/lib/Search/Common/FieldValueMapper/StringMapper.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\Core\Search\Common\FieldValueMapper; use Ibexa\Contracts\Core\Search\Field; diff --git a/src/lib/Search/Common/IncrementalIndexer.php b/src/lib/Search/Common/IncrementalIndexer.php index 86b278141a..3ade0a214e 100644 --- a/src/lib/Search/Common/IncrementalIndexer.php +++ b/src/lib/Search/Common/IncrementalIndexer.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\Core\Search\Common; use Doctrine\DBAL\FetchMode; diff --git a/src/lib/Search/Common/Indexer.php b/src/lib/Search/Common/Indexer.php index e13db89017..a70b0a0969 100644 --- a/src/lib/Search/Common/Indexer.php +++ b/src/lib/Search/Common/Indexer.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\Core\Search\Common; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriteriaConverter.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriteriaConverter.php index dd474e2fb9..1918480c7d 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriteriaConverter.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriteriaConverter.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\Core\Search\Legacy\Content\Common\Gateway; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler.php index 832a977cd3..3896e85e1b 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler.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\Core\Search\Legacy\Content\Common\Gateway; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentId.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentId.php index 6698700ae9..a3c4cbebc0 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentId.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentId.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentTypeGroupId.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentTypeGroupId.php index b844dd6ce8..3c1ffa3c59 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentTypeGroupId.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentTypeGroupId.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentTypeId.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentTypeId.php index c705ad2539..cc88af30e6 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentTypeId.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentTypeId.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentTypeIdentifier.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentTypeIdentifier.php index c1c9504f42..b7816db167 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentTypeIdentifier.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentTypeIdentifier.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/DateMetadata.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/DateMetadata.php index ca5c2e128f..101ace0fb4 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/DateMetadata.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/DateMetadata.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/Field.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/Field.php index 4ed7cb1cca..47ee09368c 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/Field.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/Field.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldBase.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldBase.php index 67cc3f2c67..7fb4a4e34a 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldBase.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldBase.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldRelation.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldRelation.php index 2f1d13def5..339518b23b 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldRelation.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldRelation.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Converter.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Converter.php index 4f3b9aa426..77fc2badad 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Converter.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Converter.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FieldValue; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler.php index d061587f5e..b846e0407a 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FieldValue; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Collection.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Collection.php index e391e08a1e..182c93316a 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Collection.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Collection.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FieldValue\Handler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Composite.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Composite.php index 22c8b1d01b..0d7b021b57 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Composite.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Composite.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FieldValue\Handler; use Ibexa\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FieldValue\Handler; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Keyword.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Keyword.php index 700aaf1156..5b60c90b1d 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Keyword.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Keyword.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FieldValue\Handler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Simple.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Simple.php index 29a550f99e..c5df88347e 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Simple.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/Handler/Simple.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FieldValue\Handler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/HandlerRegistry.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/HandlerRegistry.php index 355eee7969..fccf853101 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/HandlerRegistry.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldValue/HandlerRegistry.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FieldValue; use OutOfBoundsException; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FullText.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FullText.php index 2b17830ac3..965a52a7b3 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FullText.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/FullText.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LanguageCode.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LanguageCode.php index 52d734ed49..856223af58 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LanguageCode.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LanguageCode.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LogicalAnd.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LogicalAnd.php index bb751a7fff..9a95601752 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LogicalAnd.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LogicalAnd.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LogicalNot.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LogicalNot.php index 3ee7879967..ee2bc9f817 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LogicalNot.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LogicalNot.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LogicalOr.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LogicalOr.php index 8d4ee794b7..af85ededbb 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LogicalOr.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/LogicalOr.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/MapLocationDistance.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/MapLocationDistance.php index 16dc37890a..4ad49df2e7 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/MapLocationDistance.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/MapLocationDistance.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/MatchAll.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/MatchAll.php index 0c38f0ed7e..440f60c6fa 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/MatchAll.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/MatchAll.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/MatchNone.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/MatchNone.php index a6f3b23853..ab3df627e9 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/MatchNone.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/MatchNone.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ObjectStateId.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ObjectStateId.php index b1b4f97458..180a35067d 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ObjectStateId.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ObjectStateId.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/RemoteId.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/RemoteId.php index c0293e280f..eed4fd3ba9 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/RemoteId.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/RemoteId.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/SectionId.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/SectionId.php index 462d4096ef..495ce4cd06 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/SectionId.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/SectionId.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/UserMetadata.php b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/UserMetadata.php index 4da42b0668..555f30d89f 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/UserMetadata.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/UserMetadata.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\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseConverter.php b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseConverter.php index 01450d0537..fb59f50477 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseConverter.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseConverter.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\Core\Search\Legacy\Content\Common\Gateway; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler.php b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler.php index b5a168bc95..6d15fc3cd6 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler.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\Core\Search\Legacy\Content\Common\Gateway; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/AbstractRandom.php b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/AbstractRandom.php index 66cd7994d6..96bcaf0bbf 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/AbstractRandom.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/AbstractRandom.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\Core\Search\Legacy\Content\Common\Gateway\SortClauseHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/ContentId.php b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/ContentId.php index 12dbacdf12..908dbffe73 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/ContentId.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/ContentId.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\Core\Search\Legacy\Content\Common\Gateway\SortClauseHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/ContentName.php b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/ContentName.php index 177bb8101e..f50114404e 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/ContentName.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/ContentName.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\Core\Search\Legacy\Content\Common\Gateway\SortClauseHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/DateModified.php b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/DateModified.php index 7e02069cf1..d9b97653ac 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/DateModified.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/DateModified.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\Core\Search\Legacy\Content\Common\Gateway\SortClauseHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/DatePublished.php b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/DatePublished.php index 7779e01e46..0c5b0b53ba 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/DatePublished.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/DatePublished.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\Core\Search\Legacy\Content\Common\Gateway\SortClauseHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/Field.php b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/Field.php index 8e231d518c..f7146b5ed1 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/Field.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/Field.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\Core\Search\Legacy\Content\Common\Gateway\SortClauseHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/MapLocationDistance.php b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/MapLocationDistance.php index 79c0888b38..908d9ec7c7 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/MapLocationDistance.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/MapLocationDistance.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\Core\Search\Legacy\Content\Common\Gateway\SortClauseHandler; use Doctrine\DBAL\ParameterType; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/SectionIdentifier.php b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/SectionIdentifier.php index ab8f302158..f29d541728 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/SectionIdentifier.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/SectionIdentifier.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\Core\Search\Legacy\Content\Common\Gateway\SortClauseHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/SectionName.php b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/SectionName.php index bb181ae479..8011c3de60 100644 --- a/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/SectionName.php +++ b/src/lib/Search/Legacy/Content/Common/Gateway/SortClauseHandler/SectionName.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\Core\Search\Legacy\Content\Common\Gateway\SortClauseHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/FullTextData.php b/src/lib/Search/Legacy/Content/FullTextData.php index 4edffb6c47..e33b2e326a 100644 --- a/src/lib/Search/Legacy/Content/FullTextData.php +++ b/src/lib/Search/Legacy/Content/FullTextData.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\Core\Search\Legacy\Content; use Ibexa\Contracts\Core\Repository\Values\ValueObject; diff --git a/src/lib/Search/Legacy/Content/FullTextValue.php b/src/lib/Search/Legacy/Content/FullTextValue.php index eba5b4cfa2..fe67650847 100644 --- a/src/lib/Search/Legacy/Content/FullTextValue.php +++ b/src/lib/Search/Legacy/Content/FullTextValue.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\Core\Search\Legacy\Content; use Ibexa\Contracts\Core\Repository\Values\ValueObject; diff --git a/src/lib/Search/Legacy/Content/Gateway.php b/src/lib/Search/Legacy/Content/Gateway.php index a989baf18d..6deae61d2f 100644 --- a/src/lib/Search/Legacy/Content/Gateway.php +++ b/src/lib/Search/Legacy/Content/Gateway.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\Core\Search\Legacy\Content; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; diff --git a/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/Ancestor.php b/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/Ancestor.php index 00d546d883..d40e537ebb 100644 --- a/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/Ancestor.php +++ b/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/Ancestor.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\Core\Search\Legacy\Content\Gateway\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/LocationId.php b/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/LocationId.php index 1e317dc3c4..3ac44137dd 100644 --- a/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/LocationId.php +++ b/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/LocationId.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\Core\Search\Legacy\Content\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/LocationRemoteId.php b/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/LocationRemoteId.php index 2744257e40..fec44b5d36 100644 --- a/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/LocationRemoteId.php +++ b/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/LocationRemoteId.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\Core\Search\Legacy\Content\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/ParentLocationId.php b/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/ParentLocationId.php index 96eefe9578..cbc4c6e5ec 100644 --- a/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/ParentLocationId.php +++ b/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/ParentLocationId.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\Core\Search\Legacy\Content\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/PermissionSubtree.php b/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/PermissionSubtree.php index 61831618e8..9049d943c1 100644 --- a/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/PermissionSubtree.php +++ b/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/PermissionSubtree.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\Core\Search\Legacy\Content\Gateway\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/Subtree.php b/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/Subtree.php index 618dd096f9..011c4abfd0 100644 --- a/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/Subtree.php +++ b/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/Subtree.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\Core\Search\Legacy\Content\Gateway\CriterionHandler; use Doctrine\DBAL\ParameterType; diff --git a/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/Visibility.php b/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/Visibility.php index cebcca8901..2bf4ba1694 100644 --- a/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/Visibility.php +++ b/src/lib/Search/Legacy/Content/Gateway/CriterionHandler/Visibility.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\Core\Search\Legacy\Content\Gateway\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Gateway/DoctrineDatabase.php b/src/lib/Search/Legacy/Content/Gateway/DoctrineDatabase.php index 1fb0688ca2..fcb230659a 100644 --- a/src/lib/Search/Legacy/Content/Gateway/DoctrineDatabase.php +++ b/src/lib/Search/Legacy/Content/Gateway/DoctrineDatabase.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\Core\Search\Legacy\Content\Gateway; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Gateway/ExceptionConversion.php b/src/lib/Search/Legacy/Content/Gateway/ExceptionConversion.php index d60dceb681..909cf60949 100644 --- a/src/lib/Search/Legacy/Content/Gateway/ExceptionConversion.php +++ b/src/lib/Search/Legacy/Content/Gateway/ExceptionConversion.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\Core\Search\Legacy\Content\Gateway; use Doctrine\DBAL\DBALException; diff --git a/src/lib/Search/Legacy/Content/Handler.php b/src/lib/Search/Legacy/Content/Handler.php index e00265b39b..a6c106aba3 100644 --- a/src/lib/Search/Legacy/Content/Handler.php +++ b/src/lib/Search/Legacy/Content/Handler.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\Core\Search\Legacy\Content; use Ibexa\Contracts\Core\Persistence\Content; diff --git a/src/lib/Search/Legacy/Content/Indexer.php b/src/lib/Search/Legacy/Content/Indexer.php index 63f3bcbc97..82bcabdb67 100644 --- a/src/lib/Search/Legacy/Content/Indexer.php +++ b/src/lib/Search/Legacy/Content/Indexer.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\Core\Search\Legacy\Content; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway.php b/src/lib/Search/Legacy/Content/Location/Gateway.php index c693eb89d0..1ebf2700d5 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway.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\Core\Search\Legacy\Content\Location; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Ancestor.php b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Ancestor.php index 8ba0e4613d..e135fa8deb 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Ancestor.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Ancestor.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\Core\Search\Legacy\Content\Location\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Location/Depth.php b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Location/Depth.php index 4f7f5b6163..f792119cff 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Location/Depth.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Location/Depth.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\Core\Search\Legacy\Content\Location\Gateway\CriterionHandler\Location; use Doctrine\DBAL\ParameterType; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Location/IsMainLocation.php b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Location/IsMainLocation.php index 817a712a4e..1425e78aef 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Location/IsMainLocation.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Location/IsMainLocation.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\Core\Search\Legacy\Content\Location\Gateway\CriterionHandler\Location; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Location/Priority.php b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Location/Priority.php index 649b7e2f76..6777a9351c 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Location/Priority.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Location/Priority.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\Core\Search\Legacy\Content\Location\Gateway\CriterionHandler\Location; use Doctrine\DBAL\ParameterType; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/LocationId.php b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/LocationId.php index 71dc3883ba..d2fa983c9e 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/LocationId.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/LocationId.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\Core\Search\Legacy\Content\Location\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/LocationRemoteId.php b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/LocationRemoteId.php index ac1c77558a..b777f1a4e6 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/LocationRemoteId.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/LocationRemoteId.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\Core\Search\Legacy\Content\Location\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/ParentLocationId.php b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/ParentLocationId.php index cd30b576d4..dda6dac23f 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/ParentLocationId.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/ParentLocationId.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\Core\Search\Legacy\Content\Location\Gateway\CriterionHandler; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Subtree.php b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Subtree.php index 64fb35fb5f..c8f3199348 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Subtree.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Subtree.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\Core\Search\Legacy\Content\Location\Gateway\CriterionHandler; use Doctrine\DBAL\ParameterType; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Visibility.php b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Visibility.php index 45fd8742a0..8af91230ea 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Visibility.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/CriterionHandler/Visibility.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\Core\Search\Legacy\Content\Location\Gateway\CriterionHandler; use Doctrine\DBAL\ParameterType; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/DoctrineDatabase.php b/src/lib/Search/Legacy/Content/Location/Gateway/DoctrineDatabase.php index 553aeae3ad..19bc27e67f 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/DoctrineDatabase.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/DoctrineDatabase.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\Core\Search\Legacy\Content\Location\Gateway; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/ExceptionConversion.php b/src/lib/Search/Legacy/Content/Location/Gateway/ExceptionConversion.php index 9af3219ee2..58349ab052 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/ExceptionConversion.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/ExceptionConversion.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\Core\Search\Legacy\Content\Location\Gateway; use Doctrine\DBAL\DBALException; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Depth.php b/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Depth.php index 180ef47c0e..0ef5767581 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Depth.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Depth.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\Core\Search\Legacy\Content\Location\Gateway\SortClauseHandler\Location; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Id.php b/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Id.php index fa0384da07..62180704b0 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Id.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Id.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\Core\Search\Legacy\Content\Location\Gateway\SortClauseHandler\Location; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/IsMainLocation.php b/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/IsMainLocation.php index c56cbf6ccf..402f0a1044 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/IsMainLocation.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/IsMainLocation.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\Core\Search\Legacy\Content\Location\Gateway\SortClauseHandler\Location; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Path.php b/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Path.php index 0bcbfaa06c..c8e2d4c454 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Path.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Path.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\Core\Search\Legacy\Content\Location\Gateway\SortClauseHandler\Location; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Priority.php b/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Priority.php index 84b9ddeb95..1c4e1bd462 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Priority.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Priority.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\Core\Search\Legacy\Content\Location\Gateway\SortClauseHandler\Location; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Visibility.php b/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Visibility.php index 778b15d39e..d555c6f65b 100644 --- a/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Visibility.php +++ b/src/lib/Search/Legacy/Content/Location/Gateway/SortClauseHandler/Location/Visibility.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\Core\Search\Legacy\Content\Location\Gateway\SortClauseHandler\Location; use Doctrine\DBAL\Query\QueryBuilder; diff --git a/src/lib/Search/Legacy/Content/Mapper/FullTextMapper.php b/src/lib/Search/Legacy/Content/Mapper/FullTextMapper.php index 25b60009b2..3aad26be50 100644 --- a/src/lib/Search/Legacy/Content/Mapper/FullTextMapper.php +++ b/src/lib/Search/Legacy/Content/Mapper/FullTextMapper.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\Core\Search\Legacy\Content\Mapper; use Ibexa\Contracts\Core\Persistence\Content; diff --git a/src/lib/Search/Legacy/Content/WordIndexer/Gateway.php b/src/lib/Search/Legacy/Content/WordIndexer/Gateway.php index 2bac94a015..d5debee115 100644 --- a/src/lib/Search/Legacy/Content/WordIndexer/Gateway.php +++ b/src/lib/Search/Legacy/Content/WordIndexer/Gateway.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\Core\Search\Legacy\Content\WordIndexer; use Ibexa\Contracts\Core\Persistence\Content; diff --git a/src/lib/Search/Legacy/Content/WordIndexer/Gateway/DoctrineDatabase.php b/src/lib/Search/Legacy/Content/WordIndexer/Gateway/DoctrineDatabase.php index 0ae44a2456..7c84160c9d 100644 --- a/src/lib/Search/Legacy/Content/WordIndexer/Gateway/DoctrineDatabase.php +++ b/src/lib/Search/Legacy/Content/WordIndexer/Gateway/DoctrineDatabase.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\Core\Search\Legacy\Content\WordIndexer\Gateway; use Doctrine\DBAL\Connection; diff --git a/src/lib/Search/Legacy/Content/WordIndexer/Repository/SearchIndex.php b/src/lib/Search/Legacy/Content/WordIndexer/Repository/SearchIndex.php index 7b3092af9a..2e02d5fa2b 100644 --- a/src/lib/Search/Legacy/Content/WordIndexer/Repository/SearchIndex.php +++ b/src/lib/Search/Legacy/Content/WordIndexer/Repository/SearchIndex.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\Core\Search\Legacy\Content\WordIndexer\Repository; use Doctrine\DBAL\Connection; diff --git a/tests/bundle/Core/ApiLoader/CacheFactoryTest.php b/tests/bundle/Core/ApiLoader/CacheFactoryTest.php index 0d9b5d3922..43c46a3e07 100644 --- a/tests/bundle/Core/ApiLoader/CacheFactoryTest.php +++ b/tests/bundle/Core/ApiLoader/CacheFactoryTest.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\Core\ApiLoader; use Ibexa\Bundle\Core\ApiLoader\CacheFactory; @@ -46,21 +47,21 @@ public function providerGetService() public function testGetService($name, $expected) { $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('cache_service_name') - ->will($this->returnValue($name)); + ->will(self::returnValue($name)); $this->container - ->expects($this->once()) + ->expects(self::once()) ->method('get') ->with($expected) - ->will($this->returnValue($this->createMock(AdapterInterface::class))); + ->will(self::returnValue($this->createMock(AdapterInterface::class))); $factory = new CacheFactory(); $factory->setContainer($this->container); - $this->assertInstanceOf(TagAwareAdapter::class, $factory->getCachePool($this->configResolver)); + self::assertInstanceOf(TagAwareAdapter::class, $factory->getCachePool($this->configResolver)); } } diff --git a/tests/bundle/Core/ApiLoader/RepositoryConfigurationProviderTest.php b/tests/bundle/Core/ApiLoader/RepositoryConfigurationProviderTest.php index 76e4a8b2f2..8556532b5a 100644 --- a/tests/bundle/Core/ApiLoader/RepositoryConfigurationProviderTest.php +++ b/tests/bundle/Core/ApiLoader/RepositoryConfigurationProviderTest.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\Core\ApiLoader; use Ibexa\Bundle\Core\ApiLoader\Exception\InvalidRepositoryException; @@ -30,12 +31,12 @@ public function testGetRepositoryConfigSpecifiedRepository() $provider = new RepositoryConfigurationProvider($configResolver, $repositories); $configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('repository') - ->will($this->returnValue($repositoryAlias)); + ->will(self::returnValue($repositoryAlias)); - $this->assertSame( + self::assertSame( ['alias' => $repositoryAlias] + $repositoryConfig, $provider->getRepositoryConfig() ); @@ -58,12 +59,12 @@ public function testGetRepositoryConfigNotSpecifiedRepository() $provider = new RepositoryConfigurationProvider($configResolver, $repositories); $configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('repository') - ->will($this->returnValue(null)); + ->will(self::returnValue(null)); - $this->assertSame( + self::assertSame( ['alias' => $repositoryAlias] + $repositoryConfig, $provider->getRepositoryConfig() ); @@ -79,10 +80,10 @@ public function testGetRepositoryConfigUndefinedRepository(array $repositories): $configResolver = $this->getConfigResolverMock(); $configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('repository') - ->will($this->returnValue('undefined_repository')); + ->will(self::returnValue('undefined_repository')); $provider = new RepositoryConfigurationProvider($configResolver, $repositories); $provider->getRepositoryConfig(); diff --git a/tests/bundle/Core/ApiLoader/StorageConnectionFactoryTest.php b/tests/bundle/Core/ApiLoader/StorageConnectionFactoryTest.php index d49be25545..206d073f9a 100644 --- a/tests/bundle/Core/ApiLoader/StorageConnectionFactoryTest.php +++ b/tests/bundle/Core/ApiLoader/StorageConnectionFactoryTest.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\Core\ApiLoader; use Ibexa\Bundle\Core\ApiLoader\Exception\InvalidRepositoryException; @@ -31,28 +32,28 @@ public function testGetConnection($repositoryAlias, $doctrineConnection) $configResolver = $this->getConfigResolverMock(); $configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('repository') - ->will($this->returnValue($repositoryAlias)); + ->will(self::returnValue($repositoryAlias)); $container = $this->getContainerMock(); $container - ->expects($this->once()) + ->expects(self::once()) ->method('has') ->with("doctrine.dbal.{$doctrineConnection}_connection") - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $container - ->expects($this->once()) + ->expects(self::once()) ->method('get') ->with("doctrine.dbal.{$doctrineConnection}_connection") - ->will($this->returnValue($this->getMockBuilder('Doctrine\DBAL\Connection')->disableOriginalConstructor()->getMock())); + ->will(self::returnValue($this->getMockBuilder('Doctrine\DBAL\Connection')->disableOriginalConstructor()->getMock())); $repositoryConfigurationProvider = new RepositoryConfigurationProvider($configResolver, $repositories); $factory = new StorageConnectionFactory($repositoryConfigurationProvider); $factory->setContainer($container); $connection = $factory->getConnection(); - $this->assertInstanceOf( + self::assertInstanceOf( 'Doctrine\DBAL\Connection', $connection ); @@ -82,10 +83,10 @@ public function testGetConnectionInvalidRepository() $configResolver = $this->getConfigResolverMock(); $configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('repository') - ->will($this->returnValue('inexistent_repository')); + ->will(self::returnValue('inexistent_repository')); $repositoryConfigurationProvider = new RepositoryConfigurationProvider($configResolver, $repositories); $factory = new StorageConnectionFactory($repositoryConfigurationProvider); @@ -106,21 +107,21 @@ public function testGetConnectionInvalidConnection() ], ]; $repositoryConfigurationProviderMock - ->expects($this->once()) + ->expects(self::once()) ->method('getRepositoryConfig') - ->will($this->returnValue($repositoryConfig)); + ->will(self::returnValue($repositoryConfig)); $container = $this->getContainerMock(); $container - ->expects($this->once()) + ->expects(self::once()) ->method('has') ->with('doctrine.dbal.my_doctrine_connection_connection') - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $container - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('doctrine.connections') - ->will($this->returnValue([])); + ->will(self::returnValue([])); $factory = new StorageConnectionFactory($repositoryConfigurationProviderMock); $factory->setContainer($container); $factory->getConnection(); diff --git a/tests/bundle/Core/ApiLoader/StorageEngineFactoryTest.php b/tests/bundle/Core/ApiLoader/StorageEngineFactoryTest.php index aed319c78f..88fd24b007 100644 --- a/tests/bundle/Core/ApiLoader/StorageEngineFactoryTest.php +++ b/tests/bundle/Core/ApiLoader/StorageEngineFactoryTest.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\Core\ApiLoader; use Ibexa\Bundle\Core\ApiLoader\Exception\InvalidStorageEngine; @@ -31,7 +32,7 @@ public function testRegisterStorageEngine() $factory->registerStorageEngine($persistenceHandler, $identifier); } - $this->assertSame($storageEngines, $factory->getStorageEngines()); + self::assertSame($storageEngines, $factory->getStorageEngines()); } public function testBuildStorageEngine() @@ -63,12 +64,12 @@ public function testBuildStorageEngine() } $configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('repository') - ->will($this->returnValue($repositoryAlias)); + ->will(self::returnValue($repositoryAlias)); - $this->assertSame($expectedStorageEngine, $factory->buildStorageEngine()); + self::assertSame($expectedStorageEngine, $factory->buildStorageEngine()); } public function testBuildInvalidStorageEngine() @@ -103,12 +104,12 @@ public function testBuildInvalidStorageEngine() } $configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('repository') - ->will($this->returnValue($repositoryAlias)); + ->will(self::returnValue($repositoryAlias)); - $this->assertSame($this->getPersistenceHandlerMock(), $factory->buildStorageEngine()); + self::assertSame($this->getPersistenceHandlerMock(), $factory->buildStorageEngine()); } /** diff --git a/tests/bundle/Core/Cache/Warmer/ProxyCacheWarmerTest.php b/tests/bundle/Core/Cache/Warmer/ProxyCacheWarmerTest.php index 19ab3183b3..472b77021d 100644 --- a/tests/bundle/Core/Cache/Warmer/ProxyCacheWarmerTest.php +++ b/tests/bundle/Core/Cache/Warmer/ProxyCacheWarmerTest.php @@ -28,13 +28,13 @@ protected function setUp(): void public function testIsOptional(): void { - $this->assertFalse($this->proxyCacheWarmer->isOptional()); + self::assertFalse($this->proxyCacheWarmer->isOptional()); } public function testWarmUp(): void { $this->proxyGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('warmUp') ->with(ProxyCacheWarmer::PROXY_CLASSES); diff --git a/tests/bundle/Core/ChainConfigResolverTest.php b/tests/bundle/Core/ChainConfigResolverTest.php index 882ab18ceb..80bf182a76 100644 --- a/tests/bundle/Core/ChainConfigResolverTest.php +++ b/tests/bundle/Core/ChainConfigResolverTest.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\Core; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ChainConfigResolver; @@ -26,14 +27,14 @@ protected function setUp(): void public function testPriority() { - $this->assertEquals([], $this->chainResolver->getAllResolvers()); + self::assertEquals([], $this->chainResolver->getAllResolvers()); list($low, $high) = $this->createResolverMocks(); $this->chainResolver->addResolver($low, 10); $this->chainResolver->addResolver($high, 100); - $this->assertEquals( + self::assertEquals( [ $high, $low, @@ -55,10 +56,10 @@ public function testSortResolvers() ['sortResolvers'] ); $resolver - ->expects($this->once()) + ->expects(self::once()) ->method('sortResolvers') ->will( - $this->returnValue( + self::returnValue( [$high, $medium, $low] ) ); @@ -69,7 +70,7 @@ public function testSortResolvers() $expectedSortedRouters = [$high, $medium, $low]; // Let's get all routers 5 times, we should only sort once. for ($i = 0; $i < 5; ++$i) { - $this->assertSame($expectedSortedRouters, $resolver->getAllResolvers()); + self::assertSame($expectedSortedRouters, $resolver->getAllResolvers()); } } @@ -86,19 +87,19 @@ public function testReSortResolvers() ['sortResolvers'] ); $resolver - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('sortResolvers') ->will( - $this->returnValue( + self::returnValue( [$high, $medium, $low] ) ); // The second time sortResolvers() is called, we're supposed to get the newly added router ($highest) $resolver - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('sortResolvers') ->will( - $this->returnValue( + self::returnValue( [$highest, $high, $medium, $low] ) ); @@ -106,14 +107,14 @@ public function testReSortResolvers() $resolver->addResolver($low, 10); $resolver->addResolver($medium, 50); $resolver->addResolver($high, 100); - $this->assertSame( + self::assertSame( [$high, $medium, $low], $resolver->getAllResolvers() ); // Now adding another resolver on the fly, sorting must have been reset $resolver->addResolver($highest, 101); - $this->assertSame( + self::assertSame( [$highest, $high, $medium, $low], $resolver->getAllResolvers() ); @@ -131,7 +132,7 @@ public function testSetDefaultNamespace() $namespace = 'foo'; foreach ($this->createResolverMocks() as $i => $resolver) { $resolver - ->expects($this->once()) + ->expects(self::once()) ->method('setDefaultNamespace') ->with($namespace); $this->chainResolver->addResolver($resolver, $i); @@ -149,10 +150,10 @@ public function testGetParameterInvalid() $scope = 'scope'; foreach ($this->createResolverMocks() as $resolver) { $resolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with($paramName, $namespace, $scope) - ->will($this->throwException(new ParameterNotFoundException($paramName, $namespace))); + ->will(self::throwException(new ParameterNotFoundException($paramName, $namespace))); $this->chainResolver->addResolver($resolver); } @@ -171,13 +172,13 @@ public function testGetParameter($paramName, $namespace, $scope, $expectedValue) { $resolver = $this->createMock(ConfigResolverInterface::class); $resolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with($paramName, $namespace, $scope) - ->will($this->returnValue($expectedValue)); + ->will(self::returnValue($expectedValue)); $this->chainResolver->addResolver($resolver); - $this->assertSame($expectedValue, $this->chainResolver->getParameter($paramName, $namespace, $scope)); + self::assertSame($expectedValue, $this->chainResolver->getParameter($paramName, $namespace, $scope)); } public function getParameterProvider() @@ -198,27 +199,27 @@ public function testHasParameterTrue() $resolver1 = $this->createMock(ConfigResolverInterface::class); $resolver1 - ->expects($this->once()) + ->expects(self::once()) ->method('hasParameter') ->with($paramName, $namespace, $scope) - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $this->chainResolver->addResolver($resolver1); $resolver2 = $this->createMock(ConfigResolverInterface::class); $resolver2 - ->expects($this->once()) + ->expects(self::once()) ->method('hasParameter') ->with($paramName, $namespace, $scope) - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $this->chainResolver->addResolver($resolver2); $resolver3 = $this->createMock(ConfigResolverInterface::class); $resolver3 - ->expects($this->never()) + ->expects(self::never()) ->method('hasParameter'); $this->chainResolver->addResolver($resolver3); - $this->assertTrue($this->chainResolver->hasParameter($paramName, $namespace, $scope)); + self::assertTrue($this->chainResolver->hasParameter($paramName, $namespace, $scope)); } public function testHasParameterFalse() @@ -229,13 +230,13 @@ public function testHasParameterFalse() $resolver = $this->createMock(ConfigResolverInterface::class); $resolver - ->expects($this->once()) + ->expects(self::once()) ->method('hasParameter') ->with($paramName, $namespace, $scope) - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $this->chainResolver->addResolver($resolver); - $this->assertFalse($this->chainResolver->hasParameter($paramName, $namespace, $scope)); + self::assertFalse($this->chainResolver->hasParameter($paramName, $namespace, $scope)); } /** diff --git a/tests/bundle/Core/ConfigResolverTest.php b/tests/bundle/Core/ConfigResolverTest.php index 3b2985db40..6f39287ff6 100644 --- a/tests/bundle/Core/ConfigResolverTest.php +++ b/tests/bundle/Core/ConfigResolverTest.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\Core; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ConfigResolver; @@ -54,13 +55,13 @@ public function testGetSetUndefinedStrategy() $defaultNS = 'ibexa.site_access.config'; $resolver = $this->getResolver($defaultNS, $strategy); - $this->assertSame($strategy, $resolver->getUndefinedStrategy()); + self::assertSame($strategy, $resolver->getUndefinedStrategy()); $resolver->setUndefinedStrategy(ConfigResolver::UNDEFINED_STRATEGY_EXCEPTION); - $this->assertSame(ConfigResolver::UNDEFINED_STRATEGY_EXCEPTION, $resolver->getUndefinedStrategy()); + self::assertSame(ConfigResolver::UNDEFINED_STRATEGY_EXCEPTION, $resolver->getUndefinedStrategy()); - $this->assertSame($defaultNS, $resolver->getDefaultNamespace()); + self::assertSame($defaultNS, $resolver->getDefaultNamespace()); $resolver->setDefaultNamespace('anotherNamespace'); - $this->assertSame('anotherNamespace', $resolver->getDefaultNamespace()); + self::assertSame('anotherNamespace', $resolver->getDefaultNamespace()); } public function testGetParameterFailedWithException() @@ -74,7 +75,7 @@ public function testGetParameterFailedWithException() public function testGetParameterFailedNull() { $resolver = $this->getResolver('ibexa.site_access.config', ConfigResolver::UNDEFINED_STRATEGY_NULL); - $this->assertNull($resolver->getParameter('foo')); + self::assertNull($resolver->getParameter('foo')); } public function parameterProvider() @@ -111,17 +112,17 @@ public function testGetParameterGlobalScope($paramName, $expectedValue) { $globalScopeParameter = "ibexa.site_access.config.global.$paramName"; $this->containerMock - ->expects($this->once()) + ->expects(self::once()) ->method('hasParameter') ->with($globalScopeParameter) - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $this->containerMock - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with($globalScopeParameter) - ->will($this->returnValue($expectedValue)); + ->will(self::returnValue($expectedValue)); - $this->assertSame($expectedValue, $this->getResolver()->getParameter($paramName)); + self::assertSame($expectedValue, $this->getResolver()->getParameter($paramName)); } /** @@ -131,23 +132,23 @@ public function testGetParameterRelativeScope($paramName, $expectedValue) { $relativeScopeParameter = "ibexa.site_access.config.{$this->siteAccess->name}.$paramName"; $this->containerMock - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('hasParameter') ->with( - $this->logicalOr( + self::logicalOr( "ibexa.site_access.config.global.$paramName", $relativeScopeParameter ) ) // First call is for "global" scope, second is the right one - ->will($this->onConsecutiveCalls(false, true)); + ->will(self::onConsecutiveCalls(false, true)); $this->containerMock - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with($relativeScopeParameter) - ->will($this->returnValue($expectedValue)); + ->will(self::returnValue($expectedValue)); - $this->assertSame($expectedValue, $this->getResolver()->getParameter($paramName)); + self::assertSame($expectedValue, $this->getResolver()->getParameter($paramName)); } /** @@ -158,23 +159,23 @@ public function testGetParameterSpecificScope($paramName, $expectedValue) $scope = 'some_siteaccess'; $relativeScopeParameter = "ibexa.site_access.config.$scope.$paramName"; $this->containerMock - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('hasParameter') ->with( - $this->logicalOr( + self::logicalOr( "ibexa.site_access.config.global.$paramName", $relativeScopeParameter ) ) // First call is for "global" scope, second is the right one - ->will($this->onConsecutiveCalls(false, true)); + ->will(self::onConsecutiveCalls(false, true)); $this->containerMock - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with($relativeScopeParameter) - ->will($this->returnValue($expectedValue)); + ->will(self::returnValue($expectedValue)); - $this->assertSame( + self::assertSame( $expectedValue, $this->getResolver()->getParameter($paramName, 'ibexa.site_access.config', $scope) ); @@ -188,24 +189,24 @@ public function testGetParameterDefaultScope($paramName, $expectedValue) $defaultScopeParameter = "ibexa.site_access.config.default.$paramName"; $relativeScopeParameter = "ibexa.site_access.config.{$this->siteAccess->name}.$paramName"; $this->containerMock - ->expects($this->exactly(3)) + ->expects(self::exactly(3)) ->method('hasParameter') ->with( - $this->logicalOr( + self::logicalOr( "ibexa.site_access.config.global.$paramName", $relativeScopeParameter, $defaultScopeParameter ) ) // First call is for "global" scope, second is the right one - ->will($this->onConsecutiveCalls(false, false, true)); + ->will(self::onConsecutiveCalls(false, false, true)); $this->containerMock - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with($defaultScopeParameter) - ->will($this->returnValue($expectedValue)); + ->will(self::returnValue($expectedValue)); - $this->assertSame($expectedValue, $this->getResolver()->getParameter($paramName)); + self::assertSame($expectedValue, $this->getResolver()->getParameter($paramName)); } public function hasParameterProvider() @@ -235,10 +236,10 @@ public function testHasParameterNoNamespace($defaultMatch, $groupMatch, $scopeMa [$this->siteAccess->name => [$groupName]] ); - $this->containerMock->expects($this->atLeastOnce()) + $this->containerMock->expects(self::atLeastOnce()) ->method('hasParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ["ibexa.site_access.config.default.$paramName", $defaultMatch], ["ibexa.site_access.config.$groupName.$paramName", $groupMatch], @@ -248,7 +249,7 @@ public function testHasParameterNoNamespace($defaultMatch, $groupMatch, $scopeMa ) ); - $this->assertSame($expectedResult, $configResolver->hasParameter($paramName)); + self::assertSame($expectedResult, $configResolver->hasParameter($paramName)); } /** @@ -269,10 +270,10 @@ public function testHasParameterWithNamespaceAndScope($defaultMatch, $groupMatch ] ); - $this->containerMock->expects($this->atLeastOnce()) + $this->containerMock->expects(self::atLeastOnce()) ->method('hasParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ["$namespace.default.$paramName", $defaultMatch], ["$namespace.$groupName.$paramName", $groupMatch], @@ -282,16 +283,16 @@ public function testHasParameterWithNamespaceAndScope($defaultMatch, $groupMatch ) ); - $this->assertSame($expectedResult, $configResolver->hasParameter($paramName, $namespace, $scope)); + self::assertSame($expectedResult, $configResolver->hasParameter($paramName, $namespace, $scope)); } public function testGetSetDefaultScope() { $newDefaultScope = 'bar'; $configResolver = $this->getResolver(); - $this->assertSame($this->siteAccess->name, $configResolver->getDefaultScope()); + self::assertSame($this->siteAccess->name, $configResolver->getDefaultScope()); $configResolver->setDefaultScope($newDefaultScope); - $this->assertSame($newDefaultScope, $configResolver->getDefaultScope()); + self::assertSame($newDefaultScope, $configResolver->getDefaultScope()); } } diff --git a/tests/bundle/Core/Converter/AbstractParamConverterTest.php b/tests/bundle/Core/Converter/AbstractParamConverterTest.php index 4a2053229e..0336492210 100644 --- a/tests/bundle/Core/Converter/AbstractParamConverterTest.php +++ b/tests/bundle/Core/Converter/AbstractParamConverterTest.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\Core\Converter; use PHPUnit\Framework\TestCase; @@ -20,14 +21,14 @@ public function createConfiguration($class = null, $name = null) ->getMock(); if ($name !== null) { - $config->expects($this->any()) + $config->expects(self::any()) ->method('getName') - ->will($this->returnValue($name)); + ->will(self::returnValue($name)); } if ($class !== null) { - $config->expects($this->any()) + $config->expects(self::any()) ->method('getClass') - ->will($this->returnValue($class)); + ->will(self::returnValue($class)); } return $config; diff --git a/tests/bundle/Core/Converter/ContentParamConverterTest.php b/tests/bundle/Core/Converter/ContentParamConverterTest.php index 21cf408c6f..63478df3ea 100644 --- a/tests/bundle/Core/Converter/ContentParamConverterTest.php +++ b/tests/bundle/Core/Converter/ContentParamConverterTest.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\Core\Converter; use Ibexa\Bundle\Core\Converter\ContentParamConverter; @@ -31,13 +32,13 @@ protected function setUp(): void public function testSupports() { $config = $this->createConfiguration(self::CONTENT_CLASS); - $this->assertTrue($this->converter->supports($config)); + self::assertTrue($this->converter->supports($config)); $config = $this->createConfiguration(__CLASS__); - $this->assertFalse($this->converter->supports($config)); + self::assertFalse($this->converter->supports($config)); $config = $this->createConfiguration(); - $this->assertFalse($this->converter->supports($config)); + self::assertFalse($this->converter->supports($config)); } public function testApplyContent() @@ -46,17 +47,17 @@ public function testApplyContent() $valueObject = $this->createMock(Content::class); $this->contentServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadContent') ->with($id) - ->will($this->returnValue($valueObject)); + ->will(self::returnValue($valueObject)); $request = new Request([], [], [self::PROPERTY_NAME => $id]); $config = $this->createConfiguration(self::CONTENT_CLASS, 'content'); $this->converter->apply($request, $config); - $this->assertInstanceOf(self::CONTENT_CLASS, $request->attributes->get('content')); + self::assertInstanceOf(self::CONTENT_CLASS, $request->attributes->get('content')); } public function testApplyContentOptionalWithEmptyAttribute() @@ -64,12 +65,12 @@ public function testApplyContentOptionalWithEmptyAttribute() $request = new Request([], [], [self::PROPERTY_NAME => null]); $config = $this->createConfiguration(self::CONTENT_CLASS, 'content'); - $config->expects($this->once()) + $config->expects(self::once()) ->method('isOptional') - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); - $this->assertFalse($this->converter->apply($request, $config)); - $this->assertNull($request->attributes->get('content')); + self::assertFalse($this->converter->apply($request, $config)); + self::assertNull($request->attributes->get('content')); } } diff --git a/tests/bundle/Core/Converter/LocationParamConverterTest.php b/tests/bundle/Core/Converter/LocationParamConverterTest.php index e2b69783f1..d91ede800d 100644 --- a/tests/bundle/Core/Converter/LocationParamConverterTest.php +++ b/tests/bundle/Core/Converter/LocationParamConverterTest.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\Core\Converter; use Ibexa\Bundle\Core\Converter\LocationParamConverter; @@ -34,13 +35,13 @@ protected function setUp(): void public function testSupports() { $config = $this->createConfiguration(self::LOCATION_CLASS); - $this->assertTrue($this->converter->supports($config)); + self::assertTrue($this->converter->supports($config)); $config = $this->createConfiguration(__CLASS__); - $this->assertFalse($this->converter->supports($config)); + self::assertFalse($this->converter->supports($config)); $config = $this->createConfiguration(); - $this->assertFalse($this->converter->supports($config)); + self::assertFalse($this->converter->supports($config)); } public function testApplyLocation() @@ -49,17 +50,17 @@ public function testApplyLocation() $valueObject = $this->createMock(Location::class); $this->locationServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') ->with($id) - ->will($this->returnValue($valueObject)); + ->will(self::returnValue($valueObject)); $request = new Request([], [], [self::PROPERTY_NAME => $id]); $config = $this->createConfiguration(self::LOCATION_CLASS, 'location'); $this->converter->apply($request, $config); - $this->assertInstanceOf(self::LOCATION_CLASS, $request->attributes->get('location')); + self::assertInstanceOf(self::LOCATION_CLASS, $request->attributes->get('location')); } public function testApplyLocationOptionalWithEmptyAttribute() @@ -67,12 +68,12 @@ public function testApplyLocationOptionalWithEmptyAttribute() $request = new Request([], [], [self::PROPERTY_NAME => null]); $config = $this->createConfiguration(self::LOCATION_CLASS, 'location'); - $config->expects($this->once()) + $config->expects(self::once()) ->method('isOptional') - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); - $this->assertFalse($this->converter->apply($request, $config)); - $this->assertNull($request->attributes->get('location')); + self::assertFalse($this->converter->apply($request, $config)); + self::assertNull($request->attributes->get('location')); } } diff --git a/tests/bundle/Core/DependencyInjection/Compiler/ChainConfigResolverPassTest.php b/tests/bundle/Core/DependencyInjection/Compiler/ChainConfigResolverPassTest.php index c973128d31..fbfd87248d 100644 --- a/tests/bundle/Core/DependencyInjection/Compiler/ChainConfigResolverPassTest.php +++ b/tests/bundle/Core/DependencyInjection/Compiler/ChainConfigResolverPassTest.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\DependencyInjection\Compiler\ChainConfigResolverPass; diff --git a/tests/bundle/Core/DependencyInjection/Compiler/ChainRoutingPassTest.php b/tests/bundle/Core/DependencyInjection/Compiler/ChainRoutingPassTest.php index c9ce1f34e9..e032b3b910 100644 --- a/tests/bundle/Core/DependencyInjection/Compiler/ChainRoutingPassTest.php +++ b/tests/bundle/Core/DependencyInjection/Compiler/ChainRoutingPassTest.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\DependencyInjection\Compiler\ChainRoutingPass; diff --git a/tests/bundle/Core/DependencyInjection/Compiler/FieldTypeParameterProviderRegistryPassTest.php b/tests/bundle/Core/DependencyInjection/Compiler/FieldTypeParameterProviderRegistryPassTest.php index f034ae26a6..4c457f430d 100644 --- a/tests/bundle/Core/DependencyInjection/Compiler/FieldTypeParameterProviderRegistryPassTest.php +++ b/tests/bundle/Core/DependencyInjection/Compiler/FieldTypeParameterProviderRegistryPassTest.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\DependencyInjection\Compiler\FieldTypeParameterProviderRegistryPass; diff --git a/tests/bundle/Core/DependencyInjection/Compiler/FragmentPassTest.php b/tests/bundle/Core/DependencyInjection/Compiler/FragmentPassTest.php index f59baf694a..232ecd16bb 100644 --- a/tests/bundle/Core/DependencyInjection/Compiler/FragmentPassTest.php +++ b/tests/bundle/Core/DependencyInjection/Compiler/FragmentPassTest.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\DependencyInjection\Compiler\FragmentPass; @@ -43,45 +44,45 @@ public function testProcess() $this->compile(); - $this->assertTrue($this->container->hasDefinition('fragment.listener')); + self::assertTrue($this->container->hasDefinition('fragment.listener')); $fragmentListenerDef = $this->container->getDefinition('fragment.listener'); $factoryArray = $fragmentListenerDef->getFactory(); - $this->assertInstanceOf(Reference::class, $factoryArray[0]); - $this->assertEquals('buildFragmentListener', $factoryArray[1]); - $this->assertEquals(FragmentListenerFactory::class, $factoryArray[0]); + self::assertInstanceOf(Reference::class, $factoryArray[0]); + self::assertEquals('buildFragmentListener', $factoryArray[1]); + self::assertEquals(FragmentListenerFactory::class, $factoryArray[0]); - $this->assertTrue($this->container->hasDefinition('fragment.renderer.inline.inner')); - $this->assertSame($inlineRendererDef, $this->container->getDefinition('fragment.renderer.inline.inner')); - $this->assertFalse($inlineRendererDef->isPublic()); - $this->assertTrue($this->container->hasDefinition('fragment.renderer.esi.inner')); - $this->assertSame($esiRendererDef, $this->container->getDefinition('fragment.renderer.esi.inner')); - $this->assertFalse($esiRendererDef->isPublic()); - $this->assertTrue($this->container->hasDefinition('fragment.renderer.hinclude.inner')); - $this->assertSame($hincludeRendererDef, $this->container->getDefinition('fragment.renderer.hinclude.inner')); - $this->assertFalse($hincludeRendererDef->isPublic()); + self::assertTrue($this->container->hasDefinition('fragment.renderer.inline.inner')); + self::assertSame($inlineRendererDef, $this->container->getDefinition('fragment.renderer.inline.inner')); + self::assertFalse($inlineRendererDef->isPublic()); + self::assertTrue($this->container->hasDefinition('fragment.renderer.esi.inner')); + self::assertSame($esiRendererDef, $this->container->getDefinition('fragment.renderer.esi.inner')); + self::assertFalse($esiRendererDef->isPublic()); + self::assertTrue($this->container->hasDefinition('fragment.renderer.hinclude.inner')); + self::assertSame($hincludeRendererDef, $this->container->getDefinition('fragment.renderer.hinclude.inner')); + self::assertFalse($hincludeRendererDef->isPublic()); $this->assertContainerBuilderHasServiceDefinitionWithParent('fragment.renderer.inline', DecoratedFragmentRenderer::class); $decoratedInlineDef = $this->container->getDefinition('fragment.renderer.inline'); - $this->assertSame(['kernel.fragment_renderer' => [[]]], $decoratedInlineDef->getTags()); - $this->assertEquals( + self::assertSame(['kernel.fragment_renderer' => [[]]], $decoratedInlineDef->getTags()); + self::assertEquals( [new Reference('fragment.renderer.inline.inner')], $decoratedInlineDef->getArguments() ); - $this->assertSame(InlineFragmentRenderer::class, $decoratedInlineDef->getClass()); + self::assertSame(InlineFragmentRenderer::class, $decoratedInlineDef->getClass()); $this->assertContainerBuilderHasServiceDefinitionWithParent('fragment.renderer.esi', DecoratedFragmentRenderer::class); $decoratedEsiDef = $this->container->getDefinition('fragment.renderer.esi'); - $this->assertSame(['kernel.fragment_renderer' => [[]]], $decoratedEsiDef->getTags()); - $this->assertEquals( + self::assertSame(['kernel.fragment_renderer' => [[]]], $decoratedEsiDef->getTags()); + self::assertEquals( [new Reference('fragment.renderer.esi.inner')], $decoratedEsiDef->getArguments() ); $this->assertContainerBuilderHasServiceDefinitionWithParent('fragment.renderer.hinclude', DecoratedFragmentRenderer::class); $decoratedHincludeDef = $this->container->getDefinition('fragment.renderer.hinclude'); - $this->assertSame(['kernel.fragment_renderer' => [[]]], $decoratedHincludeDef->getTags()); - $this->assertEquals( + self::assertSame(['kernel.fragment_renderer' => [[]]], $decoratedHincludeDef->getTags()); + self::assertEquals( [new Reference('fragment.renderer.hinclude.inner')], $decoratedHincludeDef->getArguments() ); diff --git a/tests/bundle/Core/DependencyInjection/Compiler/PlaceholderProviderPassTest.php b/tests/bundle/Core/DependencyInjection/Compiler/PlaceholderProviderPassTest.php index fd54bb4f0d..73c2d2ad3b 100644 --- a/tests/bundle/Core/DependencyInjection/Compiler/PlaceholderProviderPassTest.php +++ b/tests/bundle/Core/DependencyInjection/Compiler/PlaceholderProviderPassTest.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\DependencyInjection\Compiler\PlaceholderProviderPass; diff --git a/tests/bundle/Core/DependencyInjection/Compiler/RegisterStorageEnginePassTest.php b/tests/bundle/Core/DependencyInjection/Compiler/RegisterStorageEnginePassTest.php index 97d6cfd0f0..d88ab98feb 100644 --- a/tests/bundle/Core/DependencyInjection/Compiler/RegisterStorageEnginePassTest.php +++ b/tests/bundle/Core/DependencyInjection/Compiler/RegisterStorageEnginePassTest.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\ApiLoader\StorageEngineFactory; diff --git a/tests/bundle/Core/DependencyInjection/Compiler/SecurityPassTest.php b/tests/bundle/Core/DependencyInjection/Compiler/SecurityPassTest.php index 605e800554..e76f5988b4 100644 --- a/tests/bundle/Core/DependencyInjection/Compiler/SecurityPassTest.php +++ b/tests/bundle/Core/DependencyInjection/Compiler/SecurityPassTest.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\DependencyInjection\Compiler\SecurityPass; diff --git a/tests/bundle/Core/DependencyInjection/Compiler/SlugConverterConfigurationPassTest.php b/tests/bundle/Core/DependencyInjection/Compiler/SlugConverterConfigurationPassTest.php index 06f0dbf9fa..d398d4599b 100644 --- a/tests/bundle/Core/DependencyInjection/Compiler/SlugConverterConfigurationPassTest.php +++ b/tests/bundle/Core/DependencyInjection/Compiler/SlugConverterConfigurationPassTest.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\DependencyInjection\Compiler\SlugConverterConfigurationPass; @@ -63,10 +64,10 @@ public function testMergeConfigurations( $configurationPropertyRef->setAccessible(true); $configuration = $configurationPropertyRef->getValue($this->container->get(\Ibexa\Core\Persistence\Legacy\Content\UrlAlias\SlugConverter::class)); - $this->assertEquals('urlalias', $configuration['transformation']); - $this->assertEquals('underscore', $configuration['wordSeparatorName']); - $this->assertEquals($expectedCommands, $configuration['transformationGroups']['urlalias']['commands']); - $this->assertEquals('url_cleanup', $configuration['transformationGroups']['urlalias']['cleanupMethod']); + self::assertEquals('urlalias', $configuration['transformation']); + self::assertEquals('underscore', $configuration['wordSeparatorName']); + self::assertEquals($expectedCommands, $configuration['transformationGroups']['urlalias']['commands']); + self::assertEquals('url_cleanup', $configuration['transformationGroups']['urlalias']['cleanupMethod']); } public function configurationProvider() diff --git a/tests/bundle/Core/DependencyInjection/Compiler/TranslationCollectorPassTest.php b/tests/bundle/Core/DependencyInjection/Compiler/TranslationCollectorPassTest.php index 0493675f98..27195f21d8 100644 --- a/tests/bundle/Core/DependencyInjection/Compiler/TranslationCollectorPassTest.php +++ b/tests/bundle/Core/DependencyInjection/Compiler/TranslationCollectorPassTest.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\DependencyInjection\Compiler\TranslationCollectorPass; diff --git a/tests/bundle/Core/DependencyInjection/Compiler/URLHandlerPassTest.php b/tests/bundle/Core/DependencyInjection/Compiler/URLHandlerPassTest.php index bb0b3f3644..c960b87871 100644 --- a/tests/bundle/Core/DependencyInjection/Compiler/URLHandlerPassTest.php +++ b/tests/bundle/Core/DependencyInjection/Compiler/URLHandlerPassTest.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\DependencyInjection\Compiler\URLHandlerPass; diff --git a/tests/bundle/Core/DependencyInjection/Compiler/ViewProvidersPassTest.php b/tests/bundle/Core/DependencyInjection/Compiler/ViewProvidersPassTest.php index dd58d5da36..9ea5e735fa 100644 --- a/tests/bundle/Core/DependencyInjection/Compiler/ViewProvidersPassTest.php +++ b/tests/bundle/Core/DependencyInjection/Compiler/ViewProvidersPassTest.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\Core\DependencyInjection\Compiler; use Ibexa\Bundle\Core\DependencyInjection\Compiler\ViewProvidersPass; diff --git a/tests/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingParserTest.php b/tests/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingParserTest.php index 52fcf604d5..465cf2bdc1 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingParserTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingParserTest.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\Core\DependencyInjection\Configuration\ComplexSettings; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ComplexSettings\ComplexSettingParser; diff --git a/tests/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingValueResolverTest.php b/tests/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingValueResolverTest.php index 6005e51f81..adda2b1be4 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingValueResolverTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/ComplexSettings/ComplexSettingValueResolverTest.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\Core\DependencyInjection\Configuration\ComplexSettings; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ComplexSettings\ComplexSettingValueResolver; diff --git a/tests/bundle/Core/DependencyInjection/Configuration/ConfigParserTest.php b/tests/bundle/Core/DependencyInjection/Configuration/ConfigParserTest.php index d1c0332a92..54aa5cd459 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/ConfigParserTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/ConfigParserTest.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\Core\DependencyInjection\Configuration; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ConfigParser; @@ -36,13 +37,13 @@ public function testConstruct() $this->getConfigurationParserMock(), ]; $configParser = new ConfigParser($innerParsers); - $this->assertSame($innerParsers, $configParser->getConfigParsers()); + self::assertSame($innerParsers, $configParser->getConfigParsers()); } public function testGetSetInnerParsers() { $configParser = new ConfigParser(); - $this->assertSame([], $configParser->getConfigParsers()); + self::assertSame([], $configParser->getConfigParsers()); $innerParsers = [ $this->getConfigurationParserMock(), @@ -50,7 +51,7 @@ public function testGetSetInnerParsers() $this->getConfigurationParserMock(), ]; $configParser->setConfigParsers($innerParsers); - $this->assertSame($innerParsers, $configParser->getConfigParsers()); + self::assertSame($innerParsers, $configParser->getConfigParsers()); } public function testMapConfig() @@ -71,7 +72,7 @@ public function testMapConfig() foreach ($parsers as $parser) { /* @var \PHPUnit\Framework\MockObject\MockObject $parser */ $parser - ->expects($this->once()) + ->expects(self::once()) ->method('mapConfig') ->with($scopeSettings, $currentScope, $contextualizer); } @@ -96,11 +97,11 @@ public function testPrePostMap() foreach ($parsers as $parser) { /* @var \PHPUnit\Framework\MockObject\MockObject $parser */ $parser - ->expects($this->once()) + ->expects(self::once()) ->method('preMap') ->with($config, $contextualizer); $parser - ->expects($this->once()) + ->expects(self::once()) ->method('postMap') ->with($config, $contextualizer); } @@ -122,7 +123,7 @@ public function testAddSemanticConfig() foreach ($parsers as $parser) { /* @var \PHPUnit\Framework\MockObject\MockObject $parser */ $parser - ->expects($this->once()) + ->expects(self::once()) ->method('addSemanticConfig') ->with($nodeBuilder); } diff --git a/tests/bundle/Core/DependencyInjection/Configuration/ConfigResolver/ChainConfigResolverTest.php b/tests/bundle/Core/DependencyInjection/Configuration/ConfigResolver/ChainConfigResolverTest.php index 64add1fe17..d0df89631b 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/ConfigResolver/ChainConfigResolverTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/ConfigResolver/ChainConfigResolverTest.php @@ -56,10 +56,10 @@ public function testGetParameterDefaultScope(string $paramName, $expectedValue): $saGroupScopeParameter = $this->getParameter($paramName, self::SA_GROUP); $defaultScopeParameter = $this->getParameter($paramName, self::SCOPE_DEFAULT); $this->containerMock - ->expects($this->exactly(4)) + ->expects(self::exactly(4)) ->method('hasParameter') ->with( - $this->logicalOr( + self::logicalOr( $globalScopeParameter, $relativeScopeParameter, $saGroupScopeParameter, @@ -67,14 +67,14 @@ public function testGetParameterDefaultScope(string $paramName, $expectedValue): ) ) // First call is for "global" scope, second for SA scope, third fo SA group scope, last is the right one - ->will($this->onConsecutiveCalls(false, false, false, true)); + ->will(self::onConsecutiveCalls(false, false, false, true)); $this->containerMock - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with($defaultScopeParameter) ->willReturn($expectedValue); - $this->assertSame($expectedValue, $this->getChainConfigResolver()->getParameter($paramName)); + self::assertSame($expectedValue, $this->getChainConfigResolver()->getParameter($paramName)); } /** @@ -85,23 +85,23 @@ public function testGetParameterRelativeScope(string $paramName, $expectedValue) $globalScopeParameter = $this->getParameter($paramName, self::SCOPE_GLOBAL); $relativeScopeParameter = $this->getParameter($paramName, $this->siteAccess->name); $this->containerMock - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('hasParameter') ->with( - $this->logicalOr( + self::logicalOr( $globalScopeParameter, $relativeScopeParameter ) ) // First call is for "global" scope, second is the right one - ->will($this->onConsecutiveCalls(false, true)); + ->will(self::onConsecutiveCalls(false, true)); $this->containerMock - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with($relativeScopeParameter) ->willReturn($expectedValue); - $this->assertSame($expectedValue, $this->getChainConfigResolver()->getParameter($paramName)); + self::assertSame($expectedValue, $this->getChainConfigResolver()->getParameter($paramName)); } /** @@ -111,23 +111,23 @@ public function testGetParameterSpecificScope(string $paramName, $expectedValue) { $specificScopeParameter = $this->getParameter($paramName, self::FIRST_SA_NAME); $this->containerMock - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('hasParameter') ->with( - $this->logicalOr( + self::logicalOr( "ibexa.site_access.config.global.$paramName", $specificScopeParameter ) ) // First call is for "global" scope, second is the right one - ->will($this->onConsecutiveCalls(false, true)); + ->will(self::onConsecutiveCalls(false, true)); $this->containerMock - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with($specificScopeParameter) ->willReturn($expectedValue); - $this->assertSame( + self::assertSame( $expectedValue, $this->getChainConfigResolver()->getParameter($paramName, self::DEFAULT_NAMESPACE, self::FIRST_SA_NAME) ); @@ -140,17 +140,17 @@ public function testGetParameterGlobalScope(string $paramName, $expectedValue): { $globalScopeParameter = $this->getParameter($paramName, self::SCOPE_GLOBAL); $this->containerMock - ->expects($this->once()) + ->expects(self::once()) ->method('hasParameter') ->with($globalScopeParameter) ->willReturn(true); $this->containerMock - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with($globalScopeParameter) ->willReturn($expectedValue); - $this->assertSame($expectedValue, $this->getChainConfigResolver()->getParameter($paramName)); + self::assertSame($expectedValue, $this->getChainConfigResolver()->getParameter($paramName)); } /** @@ -168,7 +168,7 @@ public function testHasParameterNoNamespace( $chainConfigResolver = $this->getChainConfigResolver(); - $this->containerMock->expects($this->atLeastOnce()) + $this->containerMock->expects(self::atLeastOnce()) ->method('hasParameter') ->willReturnMap( [ @@ -179,7 +179,7 @@ public function testHasParameterNoNamespace( ] ); - $this->assertSame($expectedResult, $chainConfigResolver->hasParameter($paramName)); + self::assertSame($expectedResult, $chainConfigResolver->hasParameter($paramName)); } /** @@ -199,7 +199,7 @@ public function testHasParameterWithNamespaceAndScope( $chainConfigResolver = $this->getChainConfigResolver(); - $this->containerMock->expects($this->atLeastOnce()) + $this->containerMock->expects(self::atLeastOnce()) ->method('hasParameter') ->willReturnMap( [ @@ -210,7 +210,7 @@ public function testHasParameterWithNamespaceAndScope( ] ); - $this->assertSame($expectedResult, $chainConfigResolver->hasParameter($paramName, $namespace, $scope)); + self::assertSame($expectedResult, $chainConfigResolver->hasParameter($paramName, $namespace, $scope)); } private function getGlobalConfigResolver(string $defaultNamespace = self::DEFAULT_NAMESPACE): ConfigResolverInterface diff --git a/tests/bundle/Core/DependencyInjection/Configuration/ConfigResolver/ConfigResolverTest.php b/tests/bundle/Core/DependencyInjection/Configuration/ConfigResolver/ConfigResolverTest.php index a034848891..e0e7e590a2 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/ConfigResolver/ConfigResolverTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/ConfigResolver/ConfigResolverTest.php @@ -48,7 +48,7 @@ public function testGetParameterFailedWithException(): void { $resolver = $this->getResolver(self::DEFAULT_NAMESPACE); $this->containerMock - ->expects($this->once()) + ->expects(self::once()) ->method('hasParameter') ->with(sprintf('%s.%s.undefined', $this->getNamespace(), $this->getScope())) ->willReturn(false); @@ -65,17 +65,17 @@ public function testGetParameterGlobalScope(string $paramName, $expectedValue): { $globalScopeParameter = sprintf('%s.%s.%s', $this->getNamespace(), $this->getScope(), $paramName); $this->containerMock - ->expects($this->once()) + ->expects(self::once()) ->method('hasParameter') ->with($globalScopeParameter) ->willReturn(true); $this->containerMock - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with($globalScopeParameter) ->willReturn($expectedValue); - $this->assertSame($expectedValue, $this->getResolver()->getParameter($paramName)); + self::assertSame($expectedValue, $this->getResolver()->getParameter($paramName)); } public function parameterProvider(): array @@ -109,9 +109,9 @@ public function testGetSetDefaultNamespace(): void { $newDefaultNamespace = 'new'; $configResolver = $this->getResolver(); - $this->assertSame(self::DEFAULT_NAMESPACE, $configResolver->getDefaultNamespace()); + self::assertSame(self::DEFAULT_NAMESPACE, $configResolver->getDefaultNamespace()); $configResolver->setDefaultNamespace($newDefaultNamespace); - $this->assertSame($newDefaultNamespace, $configResolver->getDefaultNamespace()); + self::assertSame($newDefaultNamespace, $configResolver->getDefaultNamespace()); } } diff --git a/tests/bundle/Core/DependencyInjection/Configuration/Parser/AbstractParserTestCase.php b/tests/bundle/Core/DependencyInjection/Configuration/Parser/AbstractParserTestCase.php index c08bd7a501..107007e59c 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/Parser/AbstractParserTestCase.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/Parser/AbstractParserTestCase.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ChainConfigResolver; diff --git a/tests/bundle/Core/DependencyInjection/Configuration/Parser/CommonTest.php b/tests/bundle/Core/DependencyInjection/Configuration/Parser/CommonTest.php index 3831514945..5b5ccb4fbf 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/Parser/CommonTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/Parser/CommonTest.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\Parser\Common; diff --git a/tests/bundle/Core/DependencyInjection/Configuration/Parser/ContentTest.php b/tests/bundle/Core/DependencyInjection/Configuration/Parser/ContentTest.php index 285a0cc2b3..bba6f79c7f 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/Parser/ContentTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/Parser/ContentTest.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\Parser\Content as ContentConfigParser; diff --git a/tests/bundle/Core/DependencyInjection/Configuration/Parser/IOTest.php b/tests/bundle/Core/DependencyInjection/Configuration/Parser/IOTest.php index bcec996124..08ef6e55c9 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/Parser/IOTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/Parser/IOTest.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ComplexSettings\ComplexSettingParser; diff --git a/tests/bundle/Core/DependencyInjection/Configuration/Parser/ImageTest.php b/tests/bundle/Core/DependencyInjection/Configuration/Parser/ImageTest.php index 360af7a6a1..fccf7d2c6d 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/Parser/ImageTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/Parser/ImageTest.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\Parser\Image; @@ -19,7 +20,7 @@ protected function setUp(): void parent::setUp(); if (!isset($_ENV['imagemagickConvertPath']) || !is_executable($_ENV['imagemagickConvertPath'])) { - $this->markTestSkipped('Missing or mis-configured Imagemagick convert path.'); + self::markTestSkipped('Missing or mis-configured Imagemagick convert path.'); } } diff --git a/tests/bundle/Core/DependencyInjection/Configuration/Parser/LanguagesTest.php b/tests/bundle/Core/DependencyInjection/Configuration/Parser/LanguagesTest.php index e7bb6a8aad..b610cd1b5f 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/Parser/LanguagesTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/Parser/LanguagesTest.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\Parser\Languages; @@ -19,7 +20,7 @@ protected function getContainerExtensions(): array protected function getMinimalConfiguration(): array { - return $this->minimalConfig = Yaml::parse(file_get_contents(__DIR__ . '/../../Fixtures/ezpublish_minimal.yml')); + return Yaml::parse(file_get_contents(__DIR__ . '/../../Fixtures/ezpublish_minimal.yml')); } public function testLanguagesSingleSiteaccess() @@ -45,7 +46,7 @@ public function testLanguagesSingleSiteaccess() $this->assertConfigResolverParameterValue('languages', $langFre, 'fre'); $this->assertConfigResolverParameterValue('languages', $langFre, 'fre2'); $this->assertConfigResolverParameterValue('languages', $langEmptyGroup, self::EMPTY_SA_GROUP); - $this->assertSame( + self::assertSame( [ 'eng-GB' => ['ibexa_demo_site'], 'fre-FR' => ['fre', 'fre2'], @@ -72,7 +73,7 @@ public function testLanguagesSiteaccessGroup() $this->assertConfigResolverParameterValue('languages', $langDemoSite, 'ibexa_demo_site'); $this->assertConfigResolverParameterValue('languages', $langDemoSite, 'fre'); $this->assertConfigResolverParameterValue('languages', [], self::EMPTY_SA_GROUP); - $this->assertSame( + self::assertSame( [ 'eng-US' => ['ibexa_demo_frontend_group', 'ibexa_demo_site', 'fre'], ], diff --git a/tests/bundle/Core/DependencyInjection/Configuration/Parser/TemplatesTest.php b/tests/bundle/Core/DependencyInjection/Configuration/Parser/TemplatesTest.php index 2b5a3cfc38..093f0d3bb2 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/Parser/TemplatesTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/Parser/TemplatesTest.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\Parser\FieldDefinitionSettingsTemplates; diff --git a/tests/bundle/Core/DependencyInjection/Configuration/Parser/ViewTest.php b/tests/bundle/Core/DependencyInjection/Configuration/Parser/ViewTest.php index 48f67f5db3..464754cfe4 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/Parser/ViewTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/Parser/ViewTest.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\Core\DependencyInjection\Configuration\Parser; use Ibexa\Bundle\Core\DependencyInjection\Configuration\Parser\ContentView; diff --git a/tests/bundle/Core/DependencyInjection/Configuration/RepositoryConfigParserTest.php b/tests/bundle/Core/DependencyInjection/Configuration/RepositoryConfigParserTest.php index fdcbc72920..adbc0e02be 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/RepositoryConfigParserTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/RepositoryConfigParserTest.php @@ -33,7 +33,7 @@ private function createRepositoryConfigParserMock( ): RepositoryConfigParserInterface { $configParser = $this->createMock(RepositoryConfigParserInterface::class); $configParser - ->expects($this->once()) + ->expects(self::once()) ->method('addSemanticConfig') ->with($nodeBuilder); diff --git a/tests/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ConfigurationProcessorTest.php b/tests/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ConfigurationProcessorTest.php index 6c42de8e00..53179d7301 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ConfigurationProcessorTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ConfigurationProcessorTest.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\Core\DependencyInjection\Configuration\SiteAccessAware; use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\ConfigurationMapperInterface; @@ -34,12 +35,12 @@ public function testConstruct() $processor = new ConfigurationProcessor($container, $namespace, $siteAccessNodeName); $contextualizer = $processor->getContextualizer(); - $this->assertInstanceOf(ContextualizerInterface::class, $contextualizer); - $this->assertSame($container, $contextualizer->getContainer()); - $this->assertSame($namespace, $contextualizer->getNamespace()); - $this->assertSame($siteAccessNodeName, $contextualizer->getSiteAccessNodeName()); - $this->assertSame($siteAccessList, $contextualizer->getAvailableSiteAccesses()); - $this->assertSame($groupsBySa, $contextualizer->getGroupsBySiteAccess()); + self::assertInstanceOf(ContextualizerInterface::class, $contextualizer); + self::assertSame($container, $contextualizer->getContainer()); + self::assertSame($namespace, $contextualizer->getNamespace()); + self::assertSame($siteAccessNodeName, $contextualizer->getSiteAccessNodeName()); + self::assertSame($siteAccessList, $contextualizer->getAvailableSiteAccesses()); + self::assertSame($groupsBySa, $contextualizer->getGroupsBySiteAccess()); } public function testGetSetContextualizer() @@ -49,14 +50,14 @@ public function testGetSetContextualizer() $container = $this->getContainerMock(); $processor = new ConfigurationProcessor($container, $namespace, $siteAccessNodeName); - $this->assertInstanceOf( + self::assertInstanceOf( ContextualizerInterface::class, $processor->getContextualizer() ); $newContextualizer = $this->getContextualizerMock(); $processor->setContextualizer($newContextualizer); - $this->assertSame($newContextualizer, $processor->getContextualizer()); + self::assertSame($newContextualizer, $processor->getContextualizer()); } public function testMapConfigWrongMapper() @@ -143,10 +144,10 @@ public function testMapConfigMapperObject() $mapper = $this->createMock(ConfigurationMapperInterface::class); $mapper - ->expects($this->exactly(count($config[$saNodeName]))) + ->expects(self::exactly(count($config[$saNodeName]))) ->method('mapConfig') ->will( - $this->returnValueMap( + self::returnValueMap( [ [$sa1Config, $sa1Name, $contextualizer, null], [$sa2Config, $sa2Name, $contextualizer, null], @@ -189,18 +190,18 @@ public function testMapConfigHookableMapperObject() $mapper = $this->createMock(HookableConfigurationMapperInterface::class); $mapper - ->expects($this->once()) + ->expects(self::once()) ->method('preMap') ->with($config, $contextualizer); $mapper - ->expects($this->once()) + ->expects(self::once()) ->method('postMap') ->with($config, $contextualizer); $mapper - ->expects($this->exactly(count($config[$saNodeName]))) + ->expects(self::exactly(count($config[$saNodeName]))) ->method('mapConfig') ->will( - $this->returnValueMap( + self::returnValueMap( [ [$sa1Config, $sa1Name, $contextualizer, null], [$sa2Config, $sa2Name, $contextualizer, null], @@ -241,7 +242,7 @@ public function testMapSetting() ]; $contextualizer - ->expects($this->once()) + ->expects(self::once()) ->method('mapSetting') ->with('foo', $config); $processor->mapSetting('foo', $config); @@ -277,7 +278,7 @@ public function testMapConfigArray() ]; $contextualizer - ->expects($this->once()) + ->expects(self::once()) ->method('mapConfigArray') ->with('hello', $config, ContextualizerInterface::MERGE_FROM_SECOND_LEVEL); $processor->mapConfigArray('hello', $config, ContextualizerInterface::MERGE_FROM_SECOND_LEVEL); diff --git a/tests/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ContextualizerTest.php b/tests/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ContextualizerTest.php index d620ed6f96..bf41b0ba60 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ContextualizerTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/ContextualizerTest.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\Core\DependencyInjection\Configuration\SiteAccessAware; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ConfigResolver; @@ -63,7 +64,7 @@ protected function setUp(): void public function testSetContextualParameter($parameterName, $scope, $value) { $this->container - ->expects($this->once()) + ->expects(self::once()) ->method('setParameter') ->with("$this->namespace.$scope.$parameterName", $value); @@ -119,15 +120,15 @@ public function testMapSetting() $this->contextualizer->mapSetting('an_integer', $config); $this->contextualizer->mapSetting('a_bool', $config); - $this->assertSame($fooSa1, $container->getParameter("$this->namespace.sa1.foo")); - $this->assertSame($planetsSa1, $container->getParameter("$this->namespace.sa1.planets")); - $this->assertSame($intSa1, $container->getParameter("$this->namespace.sa1.an_integer")); - $this->assertSame($boolSa1, $container->getParameter("$this->namespace.sa1.a_bool")); + self::assertSame($fooSa1, $container->getParameter("$this->namespace.sa1.foo")); + self::assertSame($planetsSa1, $container->getParameter("$this->namespace.sa1.planets")); + self::assertSame($intSa1, $container->getParameter("$this->namespace.sa1.an_integer")); + self::assertSame($boolSa1, $container->getParameter("$this->namespace.sa1.a_bool")); - $this->assertSame($fooSa2, $container->getParameter("$this->namespace.sa2.foo")); - $this->assertSame($planetsSa2, $container->getParameter("$this->namespace.sa2.planets")); - $this->assertSame($intSa2, $container->getParameter("$this->namespace.sa2.an_integer")); - $this->assertSame($boolSa2, $container->getParameter("$this->namespace.sa2.a_bool")); + self::assertSame($fooSa2, $container->getParameter("$this->namespace.sa2.foo")); + self::assertSame($planetsSa2, $container->getParameter("$this->namespace.sa2.planets")); + self::assertSame($intSa2, $container->getParameter("$this->namespace.sa2.an_integer")); + self::assertSame($boolSa2, $container->getParameter("$this->namespace.sa2.a_bool")); } public function testMapConfigArray() @@ -214,19 +215,19 @@ public function testMapConfigArray() $this->contextualizer->mapConfigArray('foo_setting', $config); - $this->assertSame( + self::assertSame( $expectedMergedSettings['sa1'], $containerBuilder->getParameter("$this->namespace.sa1.foo_setting") ); - $this->assertSame( + self::assertSame( $expectedMergedSettings['sa2'], $containerBuilder->getParameter("$this->namespace.sa2.foo_setting") ); - $this->assertSame( + self::assertSame( $expectedMergedSettings['sa3'], $containerBuilder->getParameter("$this->namespace.sa3.foo_setting") ); - $this->assertSame( + self::assertSame( $expectedMergedSettings['sa_group1'], $containerBuilder->getParameter("$this->namespace.sa_group1.foo_setting") ); @@ -324,19 +325,19 @@ public function testMapConfigArraySecondLevel() $this->contextualizer->mapConfigArray('foo_setting', $config, ContextualizerInterface::MERGE_FROM_SECOND_LEVEL); - $this->assertSame( + self::assertSame( $expectedMergedSettings['sa1'], $containerBuilder->getParameter("$this->namespace.sa1.foo_setting") ); - $this->assertSame( + self::assertSame( $expectedMergedSettings['sa2'], $containerBuilder->getParameter("$this->namespace.sa2.foo_setting") ); - $this->assertSame( + self::assertSame( $expectedMergedSettings['sa3'], $containerBuilder->getParameter("$this->namespace.sa3.foo_setting") ); - $this->assertSame( + self::assertSame( $expectedMergedSettings['sa_group1'], $containerBuilder->getParameter("$this->namespace.sa_group1.foo_setting") ); @@ -377,19 +378,19 @@ public function testMapConfigArrayUnique() $this->contextualizer->mapConfigArray('foo_setting', $config, ContextualizerInterface::UNIQUE); - $this->assertSame( + self::assertSame( $expectedMergedSettings['sa1'], $containerBuilder->getParameter("$this->namespace.sa1.foo_setting") ); - $this->assertSame( + self::assertSame( $expectedMergedSettings['sa2'], $containerBuilder->getParameter("$this->namespace.sa2.foo_setting") ); - $this->assertSame( + self::assertSame( $expectedMergedSettings['sa3'], $containerBuilder->getParameter("$this->namespace.sa3.foo_setting") ); - $this->assertSame( + self::assertSame( $expectedMergedSettings['sa_group1'], $containerBuilder->getParameter("$this->namespace.sa_group1.foo_setting") ); @@ -397,42 +398,42 @@ public function testMapConfigArrayUnique() public function testGetSetContainer() { - $this->assertSame($this->container, $this->contextualizer->getContainer()); + self::assertSame($this->container, $this->contextualizer->getContainer()); $containerBuilder = new ContainerBuilder(); $this->contextualizer->setContainer($containerBuilder); - $this->assertSame($containerBuilder, $this->contextualizer->getContainer()); + self::assertSame($containerBuilder, $this->contextualizer->getContainer()); } public function testGetSetSANodeName() { $nodeName = 'foobarbaz'; - $this->assertSame($this->saNodeName, $this->contextualizer->getSiteAccessNodeName()); + self::assertSame($this->saNodeName, $this->contextualizer->getSiteAccessNodeName()); $this->contextualizer->setSiteAccessNodeName($nodeName); - $this->assertSame($nodeName, $this->contextualizer->getSiteAccessNodeName()); + self::assertSame($nodeName, $this->contextualizer->getSiteAccessNodeName()); } public function testGetSetNamespace() { $ns = 'ibexa'; - $this->assertSame($this->namespace, $this->contextualizer->getNamespace()); + self::assertSame($this->namespace, $this->contextualizer->getNamespace()); $this->contextualizer->setNamespace($ns); - $this->assertSame($ns, $this->contextualizer->getNamespace()); + self::assertSame($ns, $this->contextualizer->getNamespace()); } public function testGetSetAvailableSiteAccesses() { - $this->assertSame($this->availableSAs, $this->contextualizer->getAvailableSiteAccesses()); + self::assertSame($this->availableSAs, $this->contextualizer->getAvailableSiteAccesses()); $sa = ['foo', 'bar', 'baz']; $this->contextualizer->setAvailableSiteAccesses($sa); - $this->assertSame($sa, $this->contextualizer->getAvailableSiteAccesses()); + self::assertSame($sa, $this->contextualizer->getAvailableSiteAccesses()); } public function testGetSetGroupsBySA() { - $this->assertSame($this->groupsBySA, $this->contextualizer->getGroupsBySiteAccess()); + self::assertSame($this->groupsBySA, $this->contextualizer->getGroupsBySiteAccess()); $groups = ['foo' => ['bar', 'baz'], 'group2' => ['some', 'thing']]; $this->contextualizer->setGroupsBySiteAccess($groups); - $this->assertSame($groups, $this->contextualizer->getGroupsBySiteAccess()); + self::assertSame($groups, $this->contextualizer->getGroupsBySiteAccess()); } /** @@ -478,21 +479,21 @@ public function testFullMapConfigArray( ]; $this->container - ->expects($this->any()) + ->expects(self::any()) ->method('hasParameter') - ->will($this->returnValueMap($hasParameterMap)); + ->will(self::returnValueMap($hasParameterMap)); $this->container - ->expects($this->any()) + ->expects(self::any()) ->method('getParameter') - ->will($this->returnValueMap($getParameterMap)); + ->will(self::returnValueMap($getParameterMap)); $this->container - ->expects($this->any()) + ->expects(self::any()) ->method('setParameter') ->with( - $this->equalTo("$this->namespace.$siteaccess.$testId"), - $this->equalTo($expected) + self::equalTo("$this->namespace.$siteaccess.$testId"), + self::equalTo($expected) ); if ($customSANodeKey !== null) { diff --git a/tests/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/DynamicSettingParserTest.php b/tests/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/DynamicSettingParserTest.php index d1629f385e..78792782bc 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/DynamicSettingParserTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/SiteAccessAware/DynamicSettingParserTest.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\Core\DependencyInjection\Configuration\SiteAccessAware; use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\DynamicSettingParser; @@ -17,7 +18,7 @@ class DynamicSettingParserTest extends TestCase public function testIsDynamicSetting($setting, $expected) { $parser = new DynamicSettingParser(); - $this->assertSame($expected, $parser->isDynamicSetting($setting)); + self::assertSame($expected, $parser->isDynamicSetting($setting)); } public function isDynamicSettingProvider() @@ -53,7 +54,7 @@ public function testParseDynamicSettingFail() public function testParseDynamicSetting($setting, array $expected) { $parser = new DynamicSettingParser(); - $this->assertSame($expected, $parser->parseDynamicSetting($setting)); + self::assertSame($expected, $parser->parseDynamicSetting($setting)); } public function parseDynamicSettingProvider() diff --git a/tests/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollectorTest.php b/tests/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollectorTest.php index 93d8b17e5e..b2ea4423a8 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollectorTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/Suggestion/Collector/SuggestionCollectorTest.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\Core\DependencyInjection\Configuration\Suggestion\Collector; use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollector; @@ -20,8 +21,8 @@ public function testAddHasGetSuggestions() $collector->addSuggestion($suggestion); } - $this->assertTrue($collector->hasSuggestions()); - $this->assertSame($suggestions, $collector->getSuggestions()); + self::assertTrue($collector->hasSuggestions()); + self::assertSame($suggestions, $collector->getSuggestions()); } } diff --git a/tests/bundle/Core/DependencyInjection/Configuration/Suggestion/ConfigSuggestionTest.php b/tests/bundle/Core/DependencyInjection/Configuration/Suggestion/ConfigSuggestionTest.php index 90893fc5dc..6e774529f6 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/Suggestion/ConfigSuggestionTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/Suggestion/ConfigSuggestionTest.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\Core\DependencyInjection\Configuration\Suggestion; use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\ConfigSuggestion; @@ -14,9 +15,9 @@ class ConfigSuggestionTest extends TestCase public function testEmptyConstructor() { $suggestion = new ConfigSuggestion(); - $this->assertNull($suggestion->getMessage()); - $this->assertSame([], $suggestion->getSuggestion()); - $this->assertFalse($suggestion->isMandatory()); + self::assertNull($suggestion->getMessage()); + self::assertSame([], $suggestion->getSuggestion()); + self::assertFalse($suggestion->isMandatory()); } public function testConfigSuggestion() @@ -25,20 +26,20 @@ public function testConfigSuggestion() $configArray = ['foo' => 'bar']; $suggestion = new ConfigSuggestion($message, $configArray); - $this->assertSame($message, $suggestion->getMessage()); - $this->assertSame($configArray, $suggestion->getSuggestion()); - $this->assertFalse($suggestion->isMandatory()); + self::assertSame($message, $suggestion->getMessage()); + self::assertSame($configArray, $suggestion->getSuggestion()); + self::assertFalse($suggestion->isMandatory()); $newMessage = 'foo bar'; $suggestion->setMessage($newMessage); - $this->assertSame($newMessage, $suggestion->getMessage()); + self::assertSame($newMessage, $suggestion->getMessage()); $newConfigArray = ['ibexa' => 'publish']; $suggestion->setSuggestion($newConfigArray); - $this->assertSame($newConfigArray, $suggestion->getSuggestion()); + self::assertSame($newConfigArray, $suggestion->getSuggestion()); $suggestion->setMandatory(true); - $this->assertTrue($suggestion->isMandatory()); + self::assertTrue($suggestion->isMandatory()); } } diff --git a/tests/bundle/Core/DependencyInjection/Configuration/Suggestion/Formatter/YamlSuggestionFormatterTest.php b/tests/bundle/Core/DependencyInjection/Configuration/Suggestion/Formatter/YamlSuggestionFormatterTest.php index e468aab9f2..2666ca40ba 100644 --- a/tests/bundle/Core/DependencyInjection/Configuration/Suggestion/Formatter/YamlSuggestionFormatterTest.php +++ b/tests/bundle/Core/DependencyInjection/Configuration/Suggestion/Formatter/YamlSuggestionFormatterTest.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\Core\DependencyInjection\Configuration\Suggestion\Formatter; use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\ConfigSuggestion; @@ -83,7 +84,7 @@ public function testFormat() EOT; $formatter = new YamlSuggestionFormatter(); - $this->assertSame($expectedMessage, trim($formatter->format($suggestion))); + self::assertSame($expectedMessage, trim($formatter->format($suggestion))); } public function testFormatNoSuggestion() @@ -91,7 +92,7 @@ public function testFormatNoSuggestion() $message = 'This is a message'; $suggestion = new ConfigSuggestion($message); $formatter = new YamlSuggestionFormatter(); - $this->assertSame($message, $formatter->format($suggestion)); + self::assertSame($message, $formatter->format($suggestion)); } } diff --git a/tests/bundle/Core/DependencyInjection/IbexaCoreExtensionTest.php b/tests/bundle/Core/DependencyInjection/IbexaCoreExtensionTest.php index f71ba92824..bcfa39caba 100644 --- a/tests/bundle/Core/DependencyInjection/IbexaCoreExtensionTest.php +++ b/tests/bundle/Core/DependencyInjection/IbexaCoreExtensionTest.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\Core\DependencyInjection; use Ibexa\Bundle\Core\DependencyInjection\Compiler\QueryTypePass; @@ -132,7 +133,7 @@ public function testSiteAccessNoConfiguration() public function testImageMagickConfigurationBasic() { if (!isset($_ENV['imagemagickConvertPath']) || !is_executable($_ENV['imagemagickConvertPath'])) { - $this->markTestSkipped('Missing or mis-configured Imagemagick convert path.'); + self::markTestSkipped('Missing or mis-configured Imagemagick convert path.'); } $this->load( @@ -189,7 +190,7 @@ public function translationsConfigurationProvider(): iterable public function testImageMagickConfigurationFilters() { if (!isset($_ENV['imagemagickConvertPath']) || !is_executable($_ENV['imagemagickConvertPath'])) { - $this->markTestSkipped('Missing or mis-configured Imagemagick convert path.'); + self::markTestSkipped('Missing or mis-configured Imagemagick convert path.'); } $customFilters = [ @@ -205,12 +206,12 @@ public function testImageMagickConfigurationFilters() ], ] ); - $this->assertTrue($this->container->hasParameter('ibexa.image.imagemagick.filters')); + self::assertTrue($this->container->hasParameter('ibexa.image.imagemagick.filters')); $filters = $this->container->getParameter('ibexa.image.imagemagick.filters'); - $this->assertArrayHasKey('foobar', $filters); - $this->assertSame($customFilters['foobar'], $filters['foobar']); - $this->assertArrayHasKey('wow', $filters); - $this->assertSame($customFilters['wow'], $filters['wow']); + self::assertArrayHasKey('foobar', $filters); + self::assertSame($customFilters['foobar'], $filters['foobar']); + self::assertArrayHasKey('wow', $filters); + self::assertSame($customFilters['wow'], $filters['wow']); } public function testImagePlaceholderConfiguration() @@ -231,7 +232,7 @@ public function testImagePlaceholderConfiguration() ], ]); - $this->assertEquals([ + self::assertEquals([ 'default' => [ 'provider' => 'generic', 'options' => [ @@ -253,11 +254,11 @@ public function testRoutingConfiguration() $this->load(); $this->assertContainerBuilderHasAlias('router', ChainRouter::class); - $this->assertTrue($this->container->hasParameter('ibexa.default_router.non_site_access_aware_routes')); + self::assertTrue($this->container->hasParameter('ibexa.default_router.non_site_access_aware_routes')); $nonSiteaccessAwareRoutes = $this->container->getParameter('ibexa.default_router.non_site_access_aware_routes'); // See ezpublish_minimal_no_siteaccess.yml fixture - $this->assertContains('foo_route', $nonSiteaccessAwareRoutes); - $this->assertContains('my_prefix_', $nonSiteaccessAwareRoutes); + self::assertContains('foo_route', $nonSiteaccessAwareRoutes); + self::assertContains('my_prefix_', $nonSiteaccessAwareRoutes); } /** @@ -327,8 +328,8 @@ public function testLocaleConfiguration() { $this->load(['locale_conversion' => ['foo' => 'bar']]); $conversionMap = $this->container->getParameter('ibexa.locale.conversion_map'); - $this->assertArrayHasKey('foo', $conversionMap); - $this->assertSame('bar', $conversionMap['foo']); + self::assertArrayHasKey('foo', $conversionMap); + self::assertSame('bar', $conversionMap['foo']); } public function testRepositoriesConfiguration() @@ -372,13 +373,13 @@ public function testRepositoriesConfiguration() ], ]; $this->load(['repositories' => $repositories]); - $this->assertTrue($this->container->hasParameter('ibexa.repositories')); + self::assertTrue($this->container->hasParameter('ibexa.repositories')); foreach ($repositories as &$repositoryConfig) { $repositoryConfig['storage']['config'] = []; $repositoryConfig['search']['config'] = []; } - $this->assertSame($repositories, $this->container->getParameter('ibexa.repositories')); + self::assertSame($repositories, $this->container->getParameter('ibexa.repositories')); } /** @@ -387,15 +388,15 @@ public function testRepositoriesConfiguration() public function testRepositoriesConfigurationFieldGroups($repositories, $expectedRepositories) { $this->load(['repositories' => $repositories]); - $this->assertTrue($this->container->hasParameter('ibexa.repositories')); + self::assertTrue($this->container->hasParameter('ibexa.repositories')); $repositoriesPar = $this->container->getParameter('ibexa.repositories'); - $this->assertEquals(count($repositories), count($repositoriesPar)); + self::assertEquals(count($repositories), count($repositoriesPar)); foreach ($repositoriesPar as $key => $repo) { - $this->assertArrayHasKey($key, $expectedRepositories); - $this->assertArrayHasKey('fields_groups', $repo); - $this->assertEqualsCanonicalizing($expectedRepositories[$key]['fields_groups'], $repo['fields_groups'], 'Invalid fields groups element'); + self::assertArrayHasKey($key, $expectedRepositories); + self::assertArrayHasKey('fields_groups', $repo); + self::assertEqualsCanonicalizing($expectedRepositories[$key]['fields_groups'], $repo['fields_groups'], 'Invalid fields groups element'); } } @@ -547,9 +548,9 @@ public function testRepositoriesConfigurationEmpty() ], ]; $this->load(['repositories' => $repositories]); - $this->assertTrue($this->container->hasParameter('ibexa.repositories')); + self::assertTrue($this->container->hasParameter('ibexa.repositories')); - $this->assertSame( + self::assertSame( $expectedRepositories, $this->container->getParameter('ibexa.repositories') ); @@ -588,9 +589,9 @@ public function testRepositoriesConfigurationStorageEmpty() ], ]; $this->load(['repositories' => $repositories]); - $this->assertTrue($this->container->hasParameter('ibexa.repositories')); + self::assertTrue($this->container->hasParameter('ibexa.repositories')); - $this->assertSame( + self::assertSame( $expectedRepositories, $this->container->getParameter('ibexa.repositories') ); @@ -629,9 +630,9 @@ public function testRepositoriesConfigurationSearchEmpty() ], ]; $this->load(['repositories' => $repositories]); - $this->assertTrue($this->container->hasParameter('ibexa.repositories')); + self::assertTrue($this->container->hasParameter('ibexa.repositories')); - $this->assertSame( + self::assertSame( $expectedRepositories, $this->container->getParameter('ibexa.repositories') ); @@ -700,9 +701,9 @@ public function testRepositoriesConfigurationCompatibility() ], ]; $this->load(['repositories' => $repositories]); - $this->assertTrue($this->container->hasParameter('ibexa.repositories')); + self::assertTrue($this->container->hasParameter('ibexa.repositories')); - $this->assertSame( + self::assertSame( $expectedRepositories, $this->container->getParameter('ibexa.repositories') ); @@ -739,9 +740,9 @@ public function testRepositoriesConfigurationCompatibility2() ], ]; $this->load(['repositories' => $repositories]); - $this->assertTrue($this->container->hasParameter('ibexa.repositories')); + self::assertTrue($this->container->hasParameter('ibexa.repositories')); - $this->assertSame( + self::assertSame( $expectedRepositories, $this->container->getParameter('ibexa.repositories') ); @@ -827,7 +828,7 @@ public function testUrlAliasConfiguration() ], ]); $parsedConfig = $this->container->getParameter('ibexa.url_alias.slug_converter'); - $this->assertSame( + self::assertSame( $configuration, $parsedConfig ); diff --git a/tests/bundle/Core/DependencyInjection/Security/PolicyProvider/PoliciesConfigBuilderTest.php b/tests/bundle/Core/DependencyInjection/Security/PolicyProvider/PoliciesConfigBuilderTest.php index a8c7b11634..2091945493 100644 --- a/tests/bundle/Core/DependencyInjection/Security/PolicyProvider/PoliciesConfigBuilderTest.php +++ b/tests/bundle/Core/DependencyInjection/Security/PolicyProvider/PoliciesConfigBuilderTest.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\Core\DependencyInjection\Security\PolicyProvider; use Ibexa\Bundle\Core\DependencyInjection\Security\PolicyProvider\PoliciesConfigBuilder; diff --git a/tests/bundle/Core/DependencyInjection/Security/PolicyProvider/YamlPolicyProviderTest.php b/tests/bundle/Core/DependencyInjection/Security/PolicyProvider/YamlPolicyProviderTest.php index 29547bd69c..06167b7f5d 100644 --- a/tests/bundle/Core/DependencyInjection/Security/PolicyProvider/YamlPolicyProviderTest.php +++ b/tests/bundle/Core/DependencyInjection/Security/PolicyProvider/YamlPolicyProviderTest.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\Core\DependencyInjection\Security\PolicyProvider; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ConfigBuilderInterface; @@ -31,12 +32,12 @@ public function testSingleYaml() $configBuilder = $this->createMock(ConfigBuilderInterface::class); foreach ($files as $file) { $configBuilder - ->expects($this->once()) + ->expects(self::once()) ->method('addResource') - ->with($this->equalTo(new FileResource($file))); + ->with(self::equalTo(new FileResource($file))); } $configBuilder - ->expects($this->once()) + ->expects(self::once()) ->method('addConfig') ->with($expectedConfig); @@ -67,14 +68,14 @@ public function testMultipleYaml() $configBuilder = $this->createMock(ConfigBuilderInterface::class); $configBuilder - ->expects($this->exactly(count($files))) + ->expects(self::exactly(count($files))) ->method('addResource') ->willReturnMap([ - [$this->equalTo(new FileResource($file1)), null], - [$this->equalTo(new FileResource($file2)), null], + [self::equalTo(new FileResource($file1)), null], + [self::equalTo(new FileResource($file2)), null], ]); $configBuilder - ->expects($this->once()) + ->expects(self::once()) ->method('addConfig') ->with($expectedConfig); diff --git a/tests/bundle/Core/DependencyInjection/Stub/QueryTypeBundle/QueryType/TestQueryType.php b/tests/bundle/Core/DependencyInjection/Stub/QueryTypeBundle/QueryType/TestQueryType.php index 46a6465741..f1bfd78440 100644 --- a/tests/bundle/Core/DependencyInjection/Stub/QueryTypeBundle/QueryType/TestQueryType.php +++ b/tests/bundle/Core/DependencyInjection/Stub/QueryTypeBundle/QueryType/TestQueryType.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\Core\DependencyInjection\Stub\QueryTypeBundle\QueryType; use Ibexa\Core\QueryType\QueryType; diff --git a/tests/bundle/Core/DependencyInjection/Stub/QueryTypeBundle/QueryTypeBundle.php b/tests/bundle/Core/DependencyInjection/Stub/QueryTypeBundle/QueryTypeBundle.php index 0cec57d2b6..3f926a0df8 100644 --- a/tests/bundle/Core/DependencyInjection/Stub/QueryTypeBundle/QueryTypeBundle.php +++ b/tests/bundle/Core/DependencyInjection/Stub/QueryTypeBundle/QueryTypeBundle.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\Core\DependencyInjection\Stub\QueryTypeBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; diff --git a/tests/bundle/Core/DependencyInjection/Stub/StubPolicyProvider.php b/tests/bundle/Core/DependencyInjection/Stub/StubPolicyProvider.php index b0e3251468..411f7d0369 100644 --- a/tests/bundle/Core/DependencyInjection/Stub/StubPolicyProvider.php +++ b/tests/bundle/Core/DependencyInjection/Stub/StubPolicyProvider.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\Core\DependencyInjection\Stub; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ConfigBuilderInterface; diff --git a/tests/bundle/Core/DependencyInjection/Stub/StubYamlPolicyProvider.php b/tests/bundle/Core/DependencyInjection/Stub/StubYamlPolicyProvider.php index 8057d5b2e3..7bc6e421e0 100644 --- a/tests/bundle/Core/DependencyInjection/Stub/StubYamlPolicyProvider.php +++ b/tests/bundle/Core/DependencyInjection/Stub/StubYamlPolicyProvider.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\Core\DependencyInjection\Stub; use Ibexa\Bundle\Core\DependencyInjection\Security\PolicyProvider\YamlPolicyProvider; diff --git a/tests/bundle/Core/EventListener/BackgroundIndexingTerminateListenerTest.php b/tests/bundle/Core/EventListener/BackgroundIndexingTerminateListenerTest.php index c5cfc6ebbf..a7f2cb09bf 100644 --- a/tests/bundle/Core/EventListener/BackgroundIndexingTerminateListenerTest.php +++ b/tests/bundle/Core/EventListener/BackgroundIndexingTerminateListenerTest.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\Core\EventListener; use Ibexa\Bundle\Core\EventListener\BackgroundIndexingTerminateListener; @@ -85,34 +86,34 @@ public function testIndexing(array $values = null, $logger = null) { $contentHandlerMock = $this->createMock(Content\Handler::class); $this->persistenceMock - ->expects($this->once()) + ->expects(self::once()) ->method('contentHandler') ->willReturn($contentHandlerMock); if ($values) { $contentHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadContentInfo') ->with(33) ->willReturn(new ContentInfo(['id' => 33, 'currentVersionNo' => 2, 'isPublished' => true])); $contentHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with(33, 2) ->willReturn(new Content()); $this->searchMock - ->expects($this->once()) + ->expects(self::once()) ->method('indexContent') - ->with($this->isInstanceOf(Content::class)); + ->with(self::isInstanceOf(Content::class)); - $this->searchMock->expects($this->never())->method('indexLocation'); - $this->searchMock->expects($this->never())->method('deleteContent'); - $this->searchMock->expects($this->never())->method('deleteLocation'); + $this->searchMock->expects(self::never())->method('indexLocation'); + $this->searchMock->expects(self::never())->method('deleteContent'); + $this->searchMock->expects(self::never())->method('deleteLocation'); } else { - $contentHandlerMock->expects($this->never())->method($this->anything()); - $this->searchMock->expects($this->never())->method($this->anything()); + $contentHandlerMock->expects(self::never())->method(self::anything()); + $this->searchMock->expects(self::never())->method(self::anything()); } foreach ((array) $values as $value) { @@ -127,11 +128,11 @@ public function testIndexing(array $values = null, $logger = null) $this->listener->setLogger($logger); if ($values) { - $logger->expects($this->once()) + $logger->expects(self::once()) ->method('warning') - ->with($this->isType('string')); + ->with(self::isType('string')); } else { - $logger->expects($this->never()) + $logger->expects(self::never()) ->method('warning'); } } @@ -144,9 +145,9 @@ public function indexDeleteProvider() $location = new Location(['id' => 44, 'contentId' => 33]); $info = new ContentInfo(['id' => 33, 'currentVersionNo' => 2, 'isPublished' => true]); - $infoReturn = $this->returnValue($info); - $infoReturnUnPublished = $this->returnValue(new ContentInfo(['id' => 33, 'currentVersionNo' => 2])); - $returnThrow = $this->throwException(new NotFoundException('content', '33')); + $infoReturn = self::returnValue($info); + $infoReturnUnPublished = self::returnValue(new ContentInfo(['id' => 33, 'currentVersionNo' => 2])); + $returnThrow = self::throwException(new NotFoundException('content', '33')); return [ [$location, $infoReturn, $returnThrow], @@ -170,30 +171,30 @@ public function testIndexDelete($value, $infoReturn, $contentReturn = null) { $contentHandlerMock = $this->createMock(Content\Handler::class); $this->persistenceMock - ->expects($this->once()) + ->expects(self::once()) ->method('contentHandler') ->willReturn($contentHandlerMock); $contentHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadContentInfo') ->with(33) ->will($infoReturn); if ($contentReturn) { $contentHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with(33, 2) ->will($contentReturn); } else { $contentHandlerMock - ->expects($this->never()) + ->expects(self::never()) ->method('load'); } - $this->searchMock->expects($this->never())->method('indexContent'); - $this->searchMock->expects($this->never())->method('indexLocation'); + $this->searchMock->expects(self::never())->method('indexContent'); + $this->searchMock->expects(self::never())->method('indexLocation'); if ($value instanceof Location) { $contentId = $value->contentId; @@ -206,17 +207,17 @@ public function testIndexDelete($value, $infoReturn, $contentReturn = null) } $this->searchMock - ->expects($this->once()) + ->expects(self::once()) ->method('deleteContent') ->with($contentId); if ($locationId) { $this->searchMock - ->expects($this->once()) + ->expects(self::once()) ->method('deleteLocation') ->with($locationId); } else { - $this->searchMock->expects($this->never())->method('deleteLocation'); + $this->searchMock->expects(self::never())->method('deleteLocation'); } $this->listener->reindex(); diff --git a/tests/bundle/Core/EventListener/BackwardCompatibleCommandListenerTest.php b/tests/bundle/Core/EventListener/BackwardCompatibleCommandListenerTest.php index 56288b4132..c42ce15f20 100644 --- a/tests/bundle/Core/EventListener/BackwardCompatibleCommandListenerTest.php +++ b/tests/bundle/Core/EventListener/BackwardCompatibleCommandListenerTest.php @@ -42,7 +42,7 @@ protected function setUp(): void public function testGetSubscribedEvents(): void { - $this->assertSame( + self::assertSame( [ ConsoleEvents::COMMAND => [['onConsoleCommand', 128]], ], @@ -95,14 +95,14 @@ public function testDeprecationWarningIsEmittedForDeprecatedAlias(): void private function assertOutputNotContainsDeprecationWarning(BufferedOutput $output): void { // Output buffer should be empty - $this->assertEquals('', $output->fetch()); + self::assertEquals('', $output->fetch()); } private function assertOutputContainsDeprecationWarning(BufferedOutput $output): void { $outputString = trim(preg_replace(self::MORE_THAN_2_WHITESPACES_AND_NEW_LINES, ' ', $output->fetch())); - $this->assertEquals( + self::assertEquals( '[WARNING] Command alias "ezplatform:command" is deprecated since 3.3 and will be removed in in 4.0. Use "ibexa:command" instead.', $outputString ); diff --git a/tests/bundle/Core/EventListener/ConfigScopeListenerTest.php b/tests/bundle/Core/EventListener/ConfigScopeListenerTest.php index 9fa06d9a31..f1ab814569 100644 --- a/tests/bundle/Core/EventListener/ConfigScopeListenerTest.php +++ b/tests/bundle/Core/EventListener/ConfigScopeListenerTest.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\Core\EventListener; use Ibexa\Bundle\Core\EventListener\ConfigScopeListener; @@ -39,7 +40,7 @@ protected function setUp(): void public function testGetSubscribedEvents() { - $this->assertSame( + self::assertSame( [ MVCEvents::CONFIG_SCOPE_CHANGE => ['onConfigScopeChange', 100], MVCEvents::CONFIG_SCOPE_RESTORE => ['onConfigScopeChange', 100], @@ -53,17 +54,17 @@ public function testOnConfigScopeChange() $siteAccess = new SiteAccess('test'); $event = new ScopeChangeEvent($siteAccess); $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('setDefaultScope') ->with($siteAccess->name); $this->viewManager - ->expects($this->once()) + ->expects(self::once()) ->method('setSiteAccess') ->with($siteAccess); foreach ($this->viewProviders as $viewProvider) { $viewProvider - ->expects($this->once()) + ->expects(self::once()) ->method('setSiteAccess') ->with($siteAccess); } @@ -71,7 +72,7 @@ public function testOnConfigScopeChange() $listener = new ConfigScopeListener([$this->configResolver], $this->viewManager); $listener->setViewProviders($this->viewProviders); $listener->onConfigScopeChange($event); - $this->assertSame($siteAccess, $event->getSiteAccess()); + self::assertSame($siteAccess, $event->getSiteAccess()); } } diff --git a/tests/bundle/Core/EventListener/ConsoleCommandListenerTest.php b/tests/bundle/Core/EventListener/ConsoleCommandListenerTest.php index e622883af0..32a4636527 100644 --- a/tests/bundle/Core/EventListener/ConsoleCommandListenerTest.php +++ b/tests/bundle/Core/EventListener/ConsoleCommandListenerTest.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\Core\EventListener; use Ibexa\Bundle\Core\EventListener\ConsoleCommandListener; @@ -57,7 +58,7 @@ protected function setUp(): void public function testGetSubscribedEvents() { - $this->assertSame( + self::assertSame( [ ConsoleEvents::COMMAND => [['onConsoleCommand', 128]], ], @@ -70,7 +71,7 @@ public function testInvalidSiteAccessDev() $this->expectException(InvalidSiteAccessException::class); $this->expectExceptionMessageMatches('/^Invalid SiteAccess \'foo\', matched by .+\\. Valid SiteAccesses are/'); - $this->dispatcher->expects($this->never()) + $this->dispatcher->expects(self::never()) ->method('dispatch'); $input = new ArrayInput(['--siteaccess' => 'foo'], $this->inputDefinition); $event = new ConsoleCommandEvent($this->command, $input, $this->testOutput); @@ -83,7 +84,7 @@ public function testInvalidSiteAccessProd() $this->expectException(InvalidSiteAccessException::class); $this->expectExceptionMessageMatches('/^Invalid SiteAccess \'foo\', matched by .+\\.$/'); - $this->dispatcher->expects($this->never()) + $this->dispatcher->expects(self::never()) ->method('dispatch'); $input = new ArrayInput(['--siteaccess' => 'foo'], $this->inputDefinition); $event = new ConsoleCommandEvent($this->command, $input, $this->testOutput); @@ -93,22 +94,22 @@ public function testInvalidSiteAccessProd() public function testValidSiteAccess() { - $this->dispatcher->expects($this->once()) + $this->dispatcher->expects(self::once()) ->method('dispatch'); $input = new ArrayInput(['--siteaccess' => 'site1'], $this->inputDefinition); $event = new ConsoleCommandEvent($this->command, $input, $this->testOutput); $this->listener->onConsoleCommand($event); - $this->assertEquals(new SiteAccess('site1', 'cli'), $this->siteAccess); + self::assertEquals(new SiteAccess('site1', 'cli'), $this->siteAccess); } public function testDefaultSiteAccess() { - $this->dispatcher->expects($this->once()) + $this->dispatcher->expects(self::once()) ->method('dispatch'); $input = new ArrayInput([], $this->inputDefinition); $event = new ConsoleCommandEvent($this->command, $input, $this->testOutput); $this->listener->onConsoleCommand($event); - $this->assertEquals(new SiteAccess('default', 'cli'), $this->siteAccess); + self::assertEquals(new SiteAccess('default', 'cli'), $this->siteAccess); } private function getSiteAccessProviderMock(): SiteAccess\SiteAccessProviderInterface diff --git a/tests/bundle/Core/EventListener/ContentDownloadRouteReferenceListenerTest.php b/tests/bundle/Core/EventListener/ContentDownloadRouteReferenceListenerTest.php index 6cc83d5fa6..31761da0cc 100644 --- a/tests/bundle/Core/EventListener/ContentDownloadRouteReferenceListenerTest.php +++ b/tests/bundle/Core/EventListener/ContentDownloadRouteReferenceListenerTest.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\Core\EventListener; use Ibexa\Bundle\Core\EventListener\ContentDownloadRouteReferenceListener; @@ -101,9 +102,9 @@ public function testGeneratesCorrectRouteReference() $this ->translationHelperMock - ->expects($this->once()) + ->expects(self::once()) ->method('getTranslatedField') - ->will($this->returnValue($content->getField('file', 'eng-GB'))); + ->will(self::returnValue($content->getField('file', 'eng-GB'))); $eventListener->onRouteReferenceGeneration($event); self::assertEquals('42', $routeReference->get(ContentDownloadRouteReferenceListener::OPT_CONTENT_ID)); diff --git a/tests/bundle/Core/EventListener/ExceptionListenerTest.php b/tests/bundle/Core/EventListener/ExceptionListenerTest.php index b5588dbd2b..2e4a3a0a04 100644 --- a/tests/bundle/Core/EventListener/ExceptionListenerTest.php +++ b/tests/bundle/Core/EventListener/ExceptionListenerTest.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\Core\EventListener; use Exception; @@ -84,7 +85,7 @@ public function testNotFoundException() $translatedMessage = 'translated message'; $this->translator - ->expects($this->once()) + ->expects(self::once()) ->method('trans') ->with($messageTemplate, $translationParams) ->willReturn($translatedMessage); @@ -107,7 +108,7 @@ public function testUnauthorizedException() $translatedMessage = 'translated message'; $this->translator - ->expects($this->once()) + ->expects(self::once()) ->method('trans') ->with($messageTemplate, $translationParams) ->willReturn($translatedMessage); @@ -134,7 +135,7 @@ public function testBadRequestException(Exception $exception) $translatedMessage = 'translated message'; $this->translator - ->expects($this->once()) + ->expects(self::once()) ->method('trans') ->with($messageTemplate, $translationParams) ->willReturn($translatedMessage); @@ -171,7 +172,7 @@ public function testOtherRepositoryException(Exception $exception) $translatedMessage = 'translated message'; $this->translator - ->expects($this->once()) + ->expects(self::once()) ->method('trans') ->with($messageTemplate, $translationParams) ->willReturn($translatedMessage); @@ -204,7 +205,7 @@ public function testUntouchedException() $exception = new \RuntimeException('foo'); $event = $this->generateExceptionEvent($exception); $this->translator - ->expects($this->never()) + ->expects(self::never()) ->method('trans'); $this->listener->onKernelException($event); diff --git a/tests/bundle/Core/EventListener/IndexRequestListenerTest.php b/tests/bundle/Core/EventListener/IndexRequestListenerTest.php index 9b7ea21ae8..1bf3e56cbd 100644 --- a/tests/bundle/Core/EventListener/IndexRequestListenerTest.php +++ b/tests/bundle/Core/EventListener/IndexRequestListenerTest.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\Core\EventListener; use Ibexa\Bundle\Core\EventListener\IndexRequestListener; @@ -54,7 +55,7 @@ protected function setUp(): void public function testSubscribedEvents() { - $this->assertSame( + self::assertSame( [ KernelEvents::REQUEST => [ ['onKernelRequestIndex', 40], @@ -70,14 +71,14 @@ public function testSubscribedEvents() public function testOnKernelRequestIndexOnIndexPage($requestPath, $configuredIndexPath, $expectedIndexPath) { $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('index_page') - ->will($this->returnValue($configuredIndexPath)); + ->will(self::returnValue($configuredIndexPath)); $this->request->attributes->set('semanticPathinfo', $requestPath); $this->indexRequestEventListener->onKernelRequestIndex($this->event); - $this->assertEquals($expectedIndexPath, $this->request->attributes->get('semanticPathinfo')); - $this->assertTrue($this->request->attributes->get('needsRedirect')); + self::assertEquals($expectedIndexPath, $this->request->attributes->get('semanticPathinfo')); + self::assertTrue($this->request->attributes->get('needsRedirect')); } public function indexPageProvider() @@ -97,7 +98,7 @@ public function testOnKernelRequestIndexNotOnIndexPage() { $this->request->attributes->set('semanticPathinfo', '/anyContent'); $this->indexRequestEventListener->onKernelRequestIndex($this->event); - $this->assertFalse($this->request->attributes->has('needsRedirect')); + self::assertFalse($this->request->attributes->has('needsRedirect')); } } diff --git a/tests/bundle/Core/EventListener/LocaleListenerTest.php b/tests/bundle/Core/EventListener/LocaleListenerTest.php index 0f31f7a755..d361a5323a 100644 --- a/tests/bundle/Core/EventListener/LocaleListenerTest.php +++ b/tests/bundle/Core/EventListener/LocaleListenerTest.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\Core\EventListener; use Ibexa\Bundle\Core\EventListener\LocaleListener; @@ -35,7 +36,7 @@ protected function setUp(): void $this->requestStack = new RequestStack(); $parameterBagMock = $this->createMock(ParameterBag::class); - $parameterBagMock->expects($this->never())->method($this->anything()); + $parameterBagMock->expects(self::never())->method(self::anything()); $requestMock = $this->createMock(Request::class); $requestMock->attributes = $parameterBagMock; @@ -49,16 +50,16 @@ protected function setUp(): void public function testOnKernelRequest(array $configuredLanguages, array $convertedLocalesValueMap, $expectedLocale): void { $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('languages') - ->will($this->returnValue($configuredLanguages)); + ->will(self::returnValue($configuredLanguages)); $this->localeConverter - ->expects($this->atLeastOnce()) + ->expects(self::atLeastOnce()) ->method('convertToPOSIX') ->will( - $this->returnValueMap($convertedLocalesValueMap) + self::returnValueMap($convertedLocalesValueMap) ); $defaultLocale = 'en'; @@ -73,7 +74,7 @@ public function testOnKernelRequest(array $configuredLanguages, array $converted HttpKernelInterface::MASTER_REQUEST ) ); - $this->assertSame($expectedLocale, $request->attributes->get('_locale')); + self::assertSame($expectedLocale, $request->attributes->get('_locale')); } public function onKernelRequestProvider(): array diff --git a/tests/bundle/Core/EventListener/OriginalRequestListenerTest.php b/tests/bundle/Core/EventListener/OriginalRequestListenerTest.php index 9f5fd12a12..392fc4c4e3 100644 --- a/tests/bundle/Core/EventListener/OriginalRequestListenerTest.php +++ b/tests/bundle/Core/EventListener/OriginalRequestListenerTest.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\Core\EventListener; use Ibexa\Bundle\Core\EventListener\OriginalRequestListener; @@ -18,7 +19,7 @@ class OriginalRequestListenerTest extends TestCase { public function testGetSubscribedEvents() { - $this->assertSame( + self::assertSame( [ KernelEvents::REQUEST => ['onKernelRequest', 200], ], @@ -37,7 +38,7 @@ public function testOnKernelRequestNotMaster() $listener = new OriginalRequestListener(); $listener->onKernelRequest($event); - $this->assertFalse($request->attributes->has('_ez_original_request')); + self::assertFalse($request->attributes->has('_ez_original_request')); } public function testOnKernelRequestNoOriginalRequest() @@ -51,7 +52,7 @@ public function testOnKernelRequestNoOriginalRequest() $listener = new OriginalRequestListener(); $listener->onKernelRequest($event); - $this->assertFalse($request->attributes->has('_ez_original_request')); + self::assertFalse($request->attributes->has('_ez_original_request')); } public function testOnKernelRequestWithOriginalRequest() @@ -79,7 +80,7 @@ public function testOnKernelRequestWithOriginalRequest() $listener = new OriginalRequestListener(); $listener->onKernelRequest($event); - $this->assertEquals($expectedOriginalRequest, $request->attributes->get('_ez_original_request')); + self::assertEquals($expectedOriginalRequest, $request->attributes->get('_ez_original_request')); ClockMock::withClockMock(false); } diff --git a/tests/bundle/Core/EventListener/RejectExplicitFrontControllerRequestsListenerTest.php b/tests/bundle/Core/EventListener/RejectExplicitFrontControllerRequestsListenerTest.php index 671d5aa046..d527fee9a2 100644 --- a/tests/bundle/Core/EventListener/RejectExplicitFrontControllerRequestsListenerTest.php +++ b/tests/bundle/Core/EventListener/RejectExplicitFrontControllerRequestsListenerTest.php @@ -34,7 +34,7 @@ protected function setUp(): void public function testSubscribedEvents(): void { - $this->assertSame( + self::assertSame( [ KernelEvents::REQUEST => [ ['onKernelRequest', 255], @@ -46,6 +46,7 @@ public function testSubscribedEvents(): void /** * @dataProvider validRequestDataProvider + * * @doesNotPerformAssertions */ public function testOnKernelRequest(Request $request): void diff --git a/tests/bundle/Core/EventListener/RequestEventListenerTest.php b/tests/bundle/Core/EventListener/RequestEventListenerTest.php index 259c6e390d..47b798c0e5 100644 --- a/tests/bundle/Core/EventListener/RequestEventListenerTest.php +++ b/tests/bundle/Core/EventListener/RequestEventListenerTest.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\Core\EventListener; use Ibexa\Bundle\Core\EventListener\RequestEventListener; @@ -68,7 +69,7 @@ protected function setUp(): void public function testSubscribedEvents() { - $this->assertSame( + self::assertSame( [ KernelEvents::REQUEST => [ ['onKernelRequestForward', 10], @@ -82,7 +83,7 @@ public function testSubscribedEvents() public function testOnKernelRequestForwardSubRequest() { $this->httpKernel - ->expects($this->never()) + ->expects(self::never()) ->method('handle'); $event = new RequestEvent($this->httpKernel, new Request(), HttpKernelInterface::SUB_REQUEST); @@ -107,15 +108,15 @@ public function testOnKernelRequestForward() $response = new Response('Success!'); $this->httpKernel - ->expects($this->once()) + ->expects(self::once()) ->method('handle') - ->with($this->equalTo($expectedForwardRequest)) - ->will($this->returnValue($response)); + ->with(self::equalTo($expectedForwardRequest)) + ->will(self::returnValue($response)); $event = new RequestEvent($this->httpKernel, $request, HttpKernelInterface::MASTER_REQUEST); $this->requestEventListener->onKernelRequestForward($event); - $this->assertSame($response, $event->getResponse()); - $this->assertTrue($event->isPropagationStopped()); + self::assertSame($response, $event->getResponse()); + self::assertTrue($event->isPropagationStopped()); ClockMock::withClockMock(false); } @@ -124,7 +125,7 @@ public function testOnKernelRequestRedirectSubRequest() { $event = new RequestEvent($this->httpKernel, new Request(), HttpKernelInterface::SUB_REQUEST); $this->requestEventListener->onKernelRequestRedirect($event); - $this->assertFalse($event->hasResponse()); + self::assertFalse($event->hasResponse()); } public function testOnKernelRequestRedirect() @@ -139,13 +140,13 @@ public function testOnKernelRequestRedirect() $event = new RequestEvent($this->httpKernel, $request, HttpKernelInterface::MASTER_REQUEST); $this->requestEventListener->onKernelRequestRedirect($event); - $this->assertTrue($event->hasResponse()); + self::assertTrue($event->hasResponse()); /** @var \Symfony\Component\HttpFoundation\RedirectResponse $response */ $response = $event->getResponse(); - $this->assertInstanceOf(RedirectResponse::class, $response); - $this->assertSame("$semanticPathinfo?some=thing", $response->getTargetUrl()); - $this->assertSame(301, $response->getStatusCode()); - $this->assertTrue($event->isPropagationStopped()); + self::assertInstanceOf(RedirectResponse::class, $response); + self::assertSame("$semanticPathinfo?some=thing", $response->getTargetUrl()); + self::assertSame(301, $response->getStatusCode()); + self::assertTrue($event->isPropagationStopped()); } public function testOnKernelRequestRedirectWithLocationId() @@ -161,14 +162,14 @@ public function testOnKernelRequestRedirectWithLocationId() $event = new RequestEvent($this->httpKernel, $request, HttpKernelInterface::MASTER_REQUEST); $this->requestEventListener->onKernelRequestRedirect($event); - $this->assertTrue($event->hasResponse()); + self::assertTrue($event->hasResponse()); /** @var \Symfony\Component\HttpFoundation\RedirectResponse $response */ $response = $event->getResponse(); - $this->assertInstanceOf(RedirectResponse::class, $response); - $this->assertSame("$semanticPathinfo?some=thing", $response->getTargetUrl()); - $this->assertSame(301, $response->getStatusCode()); - $this->assertEquals(123, $response->headers->get('X-Location-Id')); - $this->assertTrue($event->isPropagationStopped()); + self::assertInstanceOf(RedirectResponse::class, $response); + self::assertSame("$semanticPathinfo?some=thing", $response->getTargetUrl()); + self::assertSame(301, $response->getStatusCode()); + self::assertEquals(123, $response->headers->get('X-Location-Id')); + self::assertTrue($event->isPropagationStopped()); } public function testOnKernelRequestRedirectPrependSiteaccess() @@ -187,20 +188,20 @@ public function testOnKernelRequestRedirectPrependSiteaccess() $expectedURI = "/test$semanticPathinfo"; $siteaccessMatcher - ->expects($this->once()) + ->expects(self::once()) ->method('analyseLink') ->with($semanticPathinfo) - ->will($this->returnValue($expectedURI)); + ->will(self::returnValue($expectedURI)); $event = new RequestEvent($this->httpKernel, $request, HttpKernelInterface::MASTER_REQUEST); $this->requestEventListener->onKernelRequestRedirect($event); - $this->assertTrue($event->hasResponse()); + self::assertTrue($event->hasResponse()); /** @var \Symfony\Component\HttpFoundation\RedirectResponse $response */ $response = $event->getResponse(); - $this->assertInstanceOf(RedirectResponse::class, $response); - $this->assertSame("$expectedURI?some=thing", $response->getTargetUrl()); - $this->assertSame(301, $response->getStatusCode()); - $this->assertTrue($event->isPropagationStopped()); + self::assertInstanceOf(RedirectResponse::class, $response); + self::assertSame("$expectedURI?some=thing", $response->getTargetUrl()); + self::assertSame(301, $response->getStatusCode()); + self::assertTrue($event->isPropagationStopped()); } } diff --git a/tests/bundle/Core/EventListener/RoutingListenerTest.php b/tests/bundle/Core/EventListener/RoutingListenerTest.php index f171163834..062022db67 100644 --- a/tests/bundle/Core/EventListener/RoutingListenerTest.php +++ b/tests/bundle/Core/EventListener/RoutingListenerTest.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\Core\EventListener; use Ibexa\Bundle\Core\EventListener\RoutingListener; @@ -14,7 +15,6 @@ use Ibexa\Core\MVC\Symfony\Routing\Generator\UrlAliasGenerator; use Ibexa\Core\MVC\Symfony\SiteAccess; use PHPUnit\Framework\TestCase; -use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\HttpKernelInterface; @@ -32,7 +32,6 @@ class RoutingListenerTest extends TestCase protected function setUp(): void { parent::setUp(); - $this->container = $this->createMock(ContainerInterface::class); $this->configResolver = $this->createMock(ConfigResolverInterface::class); $this->urlAliasRouter = $this->createMock(UrlAliasRouter::class); $this->urlAliasGenerator = $this->createMock(UrlAliasGenerator::class); @@ -41,7 +40,7 @@ protected function setUp(): void public function testGetSubscribedEvents() { $listener = new RoutingListener($this->configResolver, $this->urlAliasRouter, $this->urlAliasGenerator); - $this->assertSame( + self::assertSame( [ MVCEvents::SITEACCESS => ['onSiteAccessMatch', 200], ], @@ -54,10 +53,10 @@ public function testOnSiteAccessMatch() $rootLocationId = 123; $excludedUriPrefixes = ['/foo/bar', '/baz']; $this->configResolver - ->expects($this->any()) + ->expects(self::any()) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['content.tree_root.location_id', null, null, $rootLocationId], ['content.tree_root.excluded_uri_prefixes', null, null, $excludedUriPrefixes], @@ -66,15 +65,15 @@ public function testOnSiteAccessMatch() ); $this->urlAliasRouter - ->expects($this->once()) + ->expects(self::once()) ->method('setRootLocationId') ->with($rootLocationId); $this->urlAliasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('setRootLocationId') ->with($rootLocationId); $this->urlAliasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('setExcludedUriPrefixes') ->with($excludedUriPrefixes); diff --git a/tests/bundle/Core/EventListener/SessionInitByPostListenerTest.php b/tests/bundle/Core/EventListener/SessionInitByPostListenerTest.php index 764624af71..c47cc1f2d4 100644 --- a/tests/bundle/Core/EventListener/SessionInitByPostListenerTest.php +++ b/tests/bundle/Core/EventListener/SessionInitByPostListenerTest.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\Core\EventListener; use Ibexa\Bundle\Core\EventListener\SessionInitByPostListener; @@ -30,7 +31,7 @@ protected function setUp(): void public function testGetSubscribedEvents() { - $this->assertSame( + self::assertSame( [ MVCEvents::SITEACCESS => ['onSiteAccessMatch', 249], ], @@ -45,14 +46,14 @@ public function testOnSiteAccessMatchNoSessionService() $event = new PostSiteAccessMatchEvent(new SiteAccess('test'), $request, HttpKernelInterface::MAIN_REQUEST); $listener = new SessionInitByPostListener(); - $this->assertNull($listener->onSiteAccessMatch($event)); + self::assertNull($listener->onSiteAccessMatch($event)); } public function testOnSiteAccessMatchSubRequest() { $session = $this->createMock(SessionInterface::class); $session - ->expects($this->never()) + ->expects(self::never()) ->method('getName'); $request = new Request(); @@ -69,16 +70,16 @@ public function testOnSiteAccessMatchRequestNoSessionName() $session = $this->createMock(SessionInterface::class); $session ->method('getName') - ->will($this->returnValue($sessionName)); + ->will(self::returnValue($sessionName)); $session - ->expects($this->once()) + ->expects(self::once()) ->method('isStarted') - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $session - ->expects($this->never()) + ->expects(self::never()) ->method('setId'); $session - ->expects($this->never()) + ->expects(self::never()) ->method('start'); $request = new Request(); @@ -97,17 +98,17 @@ public function testOnSiteAccessMatchNewSessionName() $session ->method('getName') - ->will($this->returnValue($sessionName)); + ->will(self::returnValue($sessionName)); $session - ->expects($this->once()) + ->expects(self::once()) ->method('isStarted') - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $session - ->expects($this->once()) + ->expects(self::once()) ->method('setId') ->with($sessionId); $session - ->expects($this->once()) + ->expects(self::once()) ->method('start'); $request = new Request(); diff --git a/tests/bundle/Core/EventListener/SessionSetDynamicNameListenerTest.php b/tests/bundle/Core/EventListener/SessionSetDynamicNameListenerTest.php index e7c93d7a76..9e99dddb69 100644 --- a/tests/bundle/Core/EventListener/SessionSetDynamicNameListenerTest.php +++ b/tests/bundle/Core/EventListener/SessionSetDynamicNameListenerTest.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\Core\EventListener; use Ibexa\Bundle\Core\EventListener\SessionSetDynamicNameListener; @@ -14,7 +15,6 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Session\Session; -use Symfony\Component\HttpFoundation\Session\SessionInterface as SymfonySessionInterface; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageFactoryInterface; @@ -37,9 +37,6 @@ protected function setUp(): void $this->configResolver = $this->getMockBuilder(ConfigResolverInterface::class) ->disableOriginalConstructor() ->getMock(); - $this->session = $this->getMockBuilder(SymfonySessionInterface::class) - ->disableOriginalConstructor() - ->getMock(); $this->sessionStorage = $this->getMockBuilder(NativeSessionStorage::class) ->disableOriginalConstructor() ->getMock(); @@ -52,7 +49,7 @@ protected function setUp(): void public function testGetSubscribedEvents() { $listener = new SessionSetDynamicNameListener($this->configResolver, $this->sessionStorageFactory); - $this->assertSame( + self::assertSame( [ MVCEvents::SITEACCESS => ['onSiteAccessMatch', 250], ], @@ -65,7 +62,7 @@ public function testOnSiteAccessMatchNoSession() $request = new Request(); $this->sessionStorage - ->expects($this->never()) + ->expects(self::never()) ->method('setOptions'); $listener = new SessionSetDynamicNameListener($this->configResolver, $this->sessionStorageFactory); $listener->onSiteAccessMatch(new PostSiteAccessMatchEvent(new SiteAccess('test'), $request, HttpKernelInterface::MASTER_REQUEST)); @@ -74,7 +71,7 @@ public function testOnSiteAccessMatchNoSession() public function testOnSiteAccessMatchSubRequest() { $this->sessionStorage - ->expects($this->never()) + ->expects(self::never()) ->method('setOptions'); $listener = new SessionSetDynamicNameListener($this->configResolver, $this->sessionStorageFactory); $listener->onSiteAccessMatch(new PostSiteAccessMatchEvent(new SiteAccess('test'), new Request(), HttpKernelInterface::SUB_REQUEST)); @@ -83,7 +80,7 @@ public function testOnSiteAccessMatchSubRequest() public function testOnSiteAccessMatchNonNativeSessionStorage() { $this->configResolver - ->expects($this->never()) + ->expects(self::never()) ->method('getParameter'); $listener = new SessionSetDynamicNameListener( $this->configResolver, @@ -101,14 +98,14 @@ public function testOnSiteAccessMatch(SiteAccess $siteAccess, $configuredSession $request->setSession(new Session(new MockArraySessionStorage())); $this->sessionStorage - ->expects($this->once()) + ->expects(self::once()) ->method('setOptions') ->with($expectedSessionStorageOptions); $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('session') - ->will($this->returnValue($configuredSessionStorageOptions)); + ->will(self::returnValue($configuredSessionStorageOptions)); $listener = new SessionSetDynamicNameListener($this->configResolver, $this->sessionStorageFactory); $listener->onSiteAccessMatch(new PostSiteAccessMatchEvent($siteAccess, $request, HttpKernelInterface::MAIN_REQUEST)); @@ -154,14 +151,14 @@ public function testOnSiteAccessMatchNoConfiguredSessionName() $sessionOptions = $configuredSessionStorageOptions + ['name' => "eZSESSID_$sessionName"]; $this->sessionStorage - ->expects($this->once()) + ->expects(self::once()) ->method('setOptions') ->with($sessionOptions); $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('session') - ->will($this->returnValue($configuredSessionStorageOptions)); + ->will(self::returnValue($configuredSessionStorageOptions)); $listener = new SessionSetDynamicNameListener($this->configResolver, $this->sessionStorageFactory); $listener->onSiteAccessMatch(new PostSiteAccessMatchEvent(new SiteAccess('test'), $request, HttpKernelInterface::MAIN_REQUEST)); diff --git a/tests/bundle/Core/EventListener/SiteAccessListenerTest.php b/tests/bundle/Core/EventListener/SiteAccessListenerTest.php index 7f2156b7fd..6f11eae33e 100644 --- a/tests/bundle/Core/EventListener/SiteAccessListenerTest.php +++ b/tests/bundle/Core/EventListener/SiteAccessListenerTest.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\Core\EventListener; use Ibexa\Bundle\Core\EventListener\SiteAccessListener; @@ -33,7 +34,7 @@ protected function setUp(): void public function testGetSubscribedEvents() { - $this->assertSame( + self::assertSame( [ MVCEvents::SITEACCESS => ['onSiteAccessMatch', 255], ], @@ -74,10 +75,10 @@ public function testOnSiteAccessMatchMasterRequest( $semanticPathinfo = substr($uri, $semanticPathinfoPos); $matcher = $this->createMock(SiteAccess\URILexer::class); $matcher - ->expects($this->once()) + ->expects(self::once()) ->method('analyseURI') ->with($uri) - ->will($this->returnValue($semanticPathinfo)); + ->will(self::returnValue($semanticPathinfo)); } else { $matcher = $this->createMock(SiteAccess\Matcher::class); } diff --git a/tests/bundle/Core/EventListener/Stubs/FooServiceInterface.php b/tests/bundle/Core/EventListener/Stubs/FooServiceInterface.php index ae9a05f613..25fe0825eb 100644 --- a/tests/bundle/Core/EventListener/Stubs/FooServiceInterface.php +++ b/tests/bundle/Core/EventListener/Stubs/FooServiceInterface.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\Core\EventListener\Stubs; interface FooServiceInterface diff --git a/tests/bundle/Core/EventListener/Stubs/TestOutput.php b/tests/bundle/Core/EventListener/Stubs/TestOutput.php index 6840ff7ce6..f8c58522d2 100644 --- a/tests/bundle/Core/EventListener/Stubs/TestOutput.php +++ b/tests/bundle/Core/EventListener/Stubs/TestOutput.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\Core\EventListener\Stubs; use Symfony\Component\Console\Output\Output; diff --git a/tests/bundle/Core/EventListener/Stubs/ViewManager.php b/tests/bundle/Core/EventListener/Stubs/ViewManager.php index 5ce6a82cdf..3e64a90b80 100644 --- a/tests/bundle/Core/EventListener/Stubs/ViewManager.php +++ b/tests/bundle/Core/EventListener/Stubs/ViewManager.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\Core\EventListener\Stubs; use Ibexa\Contracts\Core\Repository\Values\Content\Content; diff --git a/tests/bundle/Core/EventListener/Stubs/ViewProvider.php b/tests/bundle/Core/EventListener/Stubs/ViewProvider.php index ed0ce528c3..43911d0643 100644 --- a/tests/bundle/Core/EventListener/Stubs/ViewProvider.php +++ b/tests/bundle/Core/EventListener/Stubs/ViewProvider.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\Core\EventListener\Stubs; use Ibexa\Core\MVC\Symfony\SiteAccess; diff --git a/tests/bundle/Core/EventListener/ViewControllerListenerTest.php b/tests/bundle/Core/EventListener/ViewControllerListenerTest.php index 3bb0e06cf0..eca0f8c9f1 100644 --- a/tests/bundle/Core/EventListener/ViewControllerListenerTest.php +++ b/tests/bundle/Core/EventListener/ViewControllerListenerTest.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\Core\EventListener; use Ibexa\Bundle\Core\EventListener\ViewControllerListener; @@ -75,7 +76,7 @@ protected function setUp(): void public function testGetSubscribedEvents() { - $this->assertSame( + self::assertSame( [KernelEvents::CONTROLLER => ['getController', 10]], $this->controllerListener::getSubscribedEvents() ); @@ -87,7 +88,7 @@ public function testGetControllerNoBuilder() $this->request->attributes->set('_controller', $initialController); $this->viewBuilderRegistry - ->expects($this->once()) + ->expects(self::once()) ->method('getFromRegistry') ->with('Foo::bar') ->willReturn(null); @@ -101,7 +102,7 @@ public function testGetControllerWithClosure() $this->request->attributes->set('_controller', $initialController); $this->viewBuilderRegistry - ->expects($this->once()) + ->expects(self::once()) ->method('getFromRegistry') ->with($initialController) ->willReturn(null); @@ -128,31 +129,31 @@ public function testGetControllerMatchedView() ); $this->viewBuilderRegistry - ->expects($this->once()) + ->expects(self::once()) ->method('getFromRegistry') - ->will($this->returnValue($this->viewBuilderMock)); + ->will(self::returnValue($this->viewBuilderMock)); $viewObject = new ContentView($templateIdentifier); $viewObject->setControllerReference(new ControllerReference($customController)); $this->viewBuilderMock - ->expects($this->once()) + ->expects(self::once()) ->method('buildView') - ->will($this->returnValue($viewObject)); + ->will(self::returnValue($viewObject)); $this->controllerResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getController') - ->will($this->returnValue(static function () {})); + ->will(self::returnValue(static function () {})); $this->controllerListener->getController($this->event); - $this->assertEquals($customController, $this->request->attributes->get('_controller')); + self::assertEquals($customController, $this->request->attributes->get('_controller')); $expectedView = new ContentView(); $expectedView->setTemplateIdentifier($templateIdentifier); $expectedView->setControllerReference(new ControllerReference($customController)); - $this->assertEquals($expectedView, $this->request->attributes->get('view')); + self::assertEquals($expectedView, $this->request->attributes->get('view')); } public function testGetControllerEmitsProperEvents(): void @@ -161,26 +162,26 @@ public function testGetControllerEmitsProperEvents(): void }; $this->viewBuilderRegistry - ->expects($this->once()) + ->expects(self::once()) ->method('getFromRegistry') ->willReturn($this->viewBuilderMock); $this->viewBuilderMock - ->expects($this->once()) + ->expects(self::once()) ->method('buildView') ->willReturn($viewObject); $this->eventDispatcher - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('dispatch') ->withConsecutive( [ - $this->isInstanceOf(FilterViewBuilderParametersEvent::class), - $this->identicalTo(ViewEvents::FILTER_BUILDER_PARAMETERS), + self::isInstanceOf(FilterViewBuilderParametersEvent::class), + self::identicalTo(ViewEvents::FILTER_BUILDER_PARAMETERS), ], [ - $this->isInstanceOf(PostBuildViewEvent::class), - $this->isNull(), + self::isInstanceOf(PostBuildViewEvent::class), + self::isNull(), ] ) ->willReturnArgument(0); diff --git a/tests/bundle/Core/EventSubscriber/CrowdinRequestLocaleSubscriberTest.php b/tests/bundle/Core/EventSubscriber/CrowdinRequestLocaleSubscriberTest.php index e4b73994ee..66e3bc5c14 100644 --- a/tests/bundle/Core/EventSubscriber/CrowdinRequestLocaleSubscriberTest.php +++ b/tests/bundle/Core/EventSubscriber/CrowdinRequestLocaleSubscriberTest.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\Core\EventSubscriber; use Ibexa\Bundle\Core\EventSubscriber\CrowdinRequestLocaleSubscriber; @@ -28,7 +29,7 @@ public function testSetLocale(Request $request, $shouldHaveCustomLocale) $subscriber = new CrowdinRequestLocaleSubscriber(); $subscriber->setInContextAcceptLanguage($event); - $this->assertEquals( + self::assertEquals( $shouldHaveCustomLocale, 'ach_UG' === $event->getRequest()->getPreferredLanguage(), 'The custom ach_UG locale was expected to be set by the event subscriber' diff --git a/tests/bundle/Core/Fragment/DecoratedFragmentRendererTest.php b/tests/bundle/Core/Fragment/DecoratedFragmentRendererTest.php index f43f8e4cd9..f3cc7c9d48 100644 --- a/tests/bundle/Core/Fragment/DecoratedFragmentRendererTest.php +++ b/tests/bundle/Core/Fragment/DecoratedFragmentRendererTest.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\Core\Fragment; use Ibexa\Bundle\Core\Fragment\DecoratedFragmentRenderer; @@ -30,7 +31,7 @@ public function testSetFragmentPathNotRoutableRenderer() $matcher = $this->createMock(SiteAccess\URILexer::class); $siteAccess = new SiteAccess('test', 'test', $matcher); $matcher - ->expects($this->never()) + ->expects(self::never()) ->method('analyseLink'); $renderer = new DecoratedFragmentRenderer($this->innerRenderer); @@ -43,14 +44,14 @@ public function testSetFragmentPath() $matcher = $this->createMock(SiteAccess\URILexer::class); $siteAccess = new SiteAccess('test', 'test', $matcher); $matcher - ->expects($this->once()) + ->expects(self::once()) ->method('analyseLink') ->with('/foo') - ->will($this->returnValue('/bar/foo')); + ->will(self::returnValue('/bar/foo')); $innerRenderer = $this->createMock(RoutableFragmentRenderer::class); $innerRenderer - ->expects($this->once()) + ->expects(self::once()) ->method('setFragmentPath') ->with('/bar/foo'); $renderer = new DecoratedFragmentRenderer($innerRenderer); @@ -62,12 +63,12 @@ public function testGetName() { $name = 'test'; $this->innerRenderer - ->expects($this->once()) + ->expects(self::once()) ->method('getName') - ->will($this->returnValue($name)); + ->will(self::returnValue($name)); $renderer = new DecoratedFragmentRenderer($this->innerRenderer); - $this->assertSame($name, $renderer->getName()); + self::assertSame($name, $renderer->getName()); } public function testRendererAbsoluteUrl() @@ -77,13 +78,13 @@ public function testRendererAbsoluteUrl() $options = ['foo' => 'bar']; $expectedReturn = '/_fragment?foo=bar'; $this->innerRenderer - ->expects($this->once()) + ->expects(self::once()) ->method('render') ->with($url, $request, $options) - ->will($this->returnValue($expectedReturn)); + ->will(self::returnValue($expectedReturn)); $renderer = new DecoratedFragmentRenderer($this->innerRenderer); - $this->assertSame($expectedReturn, $renderer->render($url, $request, $options)); + self::assertSame($expectedReturn, $renderer->render($url, $request, $options)); } public function testRendererControllerReference() @@ -100,18 +101,18 @@ public function testRendererControllerReference() $options = ['foo' => 'bar']; $expectedReturn = '/_fragment?foo=bar'; $this->innerRenderer - ->expects($this->once()) + ->expects(self::once()) ->method('render') ->with($reference, $request, $options) - ->will($this->returnValue($expectedReturn)); + ->will(self::returnValue($expectedReturn)); $renderer = new DecoratedFragmentRenderer($this->innerRenderer); - $this->assertSame($expectedReturn, $renderer->render($reference, $request, $options)); - $this->assertTrue(isset($reference->attributes['serialized_siteaccess'])); + self::assertSame($expectedReturn, $renderer->render($reference, $request, $options)); + self::assertTrue(isset($reference->attributes['serialized_siteaccess'])); $serializedSiteAccess = json_encode($siteAccess); - $this->assertSame($serializedSiteAccess, $reference->attributes['serialized_siteaccess']); - $this->assertTrue(isset($reference->attributes['serialized_siteaccess_matcher'])); - $this->assertSame( + self::assertSame($serializedSiteAccess, $reference->attributes['serialized_siteaccess']); + self::assertTrue(isset($reference->attributes['serialized_siteaccess_matcher'])); + self::assertSame( $this->getSerializer()->serialize( $siteAccess->matcher, 'json', diff --git a/tests/bundle/Core/Fragment/DirectFragmentRendererTest.php b/tests/bundle/Core/Fragment/DirectFragmentRendererTest.php index 8d18c1aacf..821570169d 100644 --- a/tests/bundle/Core/Fragment/DirectFragmentRendererTest.php +++ b/tests/bundle/Core/Fragment/DirectFragmentRendererTest.php @@ -29,9 +29,9 @@ public function testSubRequestBuilding(): void { $controllerResolver = $this->getControllerResolverInterfaceMock(); $controllerResolver - ->expects($this->any()) + ->expects(self::any()) ->method('getController') - ->with($this->callback(function (Request $request) { + ->with(self::callback(function (Request $request) { $this->assertEquals('/_fragment', $request->getPathInfo()); $this->assertEquals('some::controller', $request->attributes->get('_controller')); $this->assertEquals('attribute_value', $request->attributes->get('some')); @@ -65,8 +65,8 @@ public function testSubRequestBuilding(): void $directFragmentRenderer = $this->getDirectFragmentRenderer($controllerResolver); $response = $directFragmentRenderer->render($controllerReference, $request); - $this->assertInstanceOf(Response::class, $response); - $this->assertSame('rendered_response', $response->getContent()); + self::assertInstanceOf(Response::class, $response); + self::assertSame('rendered_response', $response->getContent()); } public function testControllerResponse(): void @@ -82,8 +82,8 @@ public function testControllerResponse(): void $directFragmentRenderer = $this->getDirectFragmentRenderer($controllerResolver); $response = $directFragmentRenderer->render('', new Request(), []); - $this->assertInstanceOf(Response::class, $response); - $this->assertSame('response_body', $response->getContent()); + self::assertInstanceOf(Response::class, $response); + self::assertSame('response_body', $response->getContent()); } public function testControllerViewResponse(): void @@ -102,7 +102,7 @@ public function testControllerViewResponse(): void $templateRendererMock = $this->getTemplateRendererMock(); $templateRendererMock - ->expects($this->once()) + ->expects(self::once()) ->method('render') ->with($contentView) ->willReturn('rendered_' . $contentView->getTemplateIdentifier()); @@ -113,8 +113,8 @@ public function testControllerViewResponse(): void ); $response = $directFragmentRenderer->render('', new Request(), []); - $this->assertInstanceOf(Response::class, $response); - $this->assertSame('rendered_template_identifier', $response->getContent()); + self::assertInstanceOf(Response::class, $response); + self::assertSame('rendered_template_identifier', $response->getContent()); } public function testControllerStringResponse(): void @@ -130,8 +130,8 @@ public function testControllerStringResponse(): void $directFragmentRenderer = $this->getDirectFragmentRenderer($controllerResolver); $response = $directFragmentRenderer->render('', new Request(), []); - $this->assertInstanceOf(Response::class, $response); - $this->assertSame('some_prerendered_response', $response->getContent()); + self::assertInstanceOf(Response::class, $response); + self::assertSame('some_prerendered_response', $response->getContent()); } public function testControllerUnhandledStringResponse(): void diff --git a/tests/bundle/Core/Fragment/FragmentListenerFactoryTest.php b/tests/bundle/Core/Fragment/FragmentListenerFactoryTest.php index b9c9f276e9..c5bd583a58 100644 --- a/tests/bundle/Core/Fragment/FragmentListenerFactoryTest.php +++ b/tests/bundle/Core/Fragment/FragmentListenerFactoryTest.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\Core\Fragment; use Ibexa\Bundle\Core\Fragment\FragmentListenerFactory; @@ -31,15 +32,15 @@ public function testBuildFragmentListener($requestUri, $isFragmentCandidate) $factory = new FragmentListenerFactory(); $factory->setRequestStack($requestStack); $listener = $factory->buildFragmentListener($uriSigner, $baseFragmentPath, $listenerClass); - $this->assertInstanceOf($listenerClass, $listener); + self::assertInstanceOf($listenerClass, $listener); $refListener = new ReflectionObject($listener); $refFragmentPath = $refListener->getProperty('fragmentPath'); $refFragmentPath->setAccessible(true); if ($isFragmentCandidate) { - $this->assertSame($requestUri, $refFragmentPath->getValue($listener)); + self::assertSame($requestUri, $refFragmentPath->getValue($listener)); } else { - $this->assertSame($baseFragmentPath, $refFragmentPath->getValue($listener)); + self::assertSame($baseFragmentPath, $refFragmentPath->getValue($listener)); } } @@ -66,7 +67,7 @@ public function testBuildFragmentListenerNoRequest() FragmentListener::class ); - $this->assertNull($listener); + self::assertNull($listener); } } diff --git a/tests/bundle/Core/Fragment/FragmentRendererBaseTest.php b/tests/bundle/Core/Fragment/FragmentRendererBaseTest.php index c62c68b6df..7687cdc7ec 100644 --- a/tests/bundle/Core/Fragment/FragmentRendererBaseTest.php +++ b/tests/bundle/Core/Fragment/FragmentRendererBaseTest.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\Core\Fragment; use Ibexa\Core\MVC\Symfony\Component\Serializer\SerializerTrait; @@ -37,18 +38,18 @@ public function testRendererControllerReferenceWithCompoundMatcher(): Controller $options = ['foo' => 'bar']; $expectedReturn = '/_fragment?foo=bar'; $this->innerRenderer - ->expects($this->once()) + ->expects(self::once()) ->method('render') ->with($reference, $request, $options) - ->will($this->returnValue($expectedReturn)); + ->will(self::returnValue($expectedReturn)); $renderer = $this->getRenderer(); - $this->assertSame($expectedReturn, $renderer->render($reference, $request, $options)); - $this->assertArrayHasKey('serialized_siteaccess', $reference->attributes); + self::assertSame($expectedReturn, $renderer->render($reference, $request, $options)); + self::assertArrayHasKey('serialized_siteaccess', $reference->attributes); $serializedSiteAccess = json_encode($siteAccess); - $this->assertSame($serializedSiteAccess, $reference->attributes['serialized_siteaccess']); - $this->assertArrayHasKey('serialized_siteaccess_matcher', $reference->attributes); - $this->assertSame( + self::assertSame($serializedSiteAccess, $reference->attributes['serialized_siteaccess']); + self::assertArrayHasKey('serialized_siteaccess_matcher', $reference->attributes); + self::assertSame( $this->getSerializer()->serialize( $siteAccess->matcher, 'json', @@ -56,9 +57,9 @@ public function testRendererControllerReferenceWithCompoundMatcher(): Controller ), $reference->attributes['serialized_siteaccess_matcher'] ); - $this->assertArrayHasKey('serialized_siteaccess_sub_matchers', $reference->attributes); + self::assertArrayHasKey('serialized_siteaccess_sub_matchers', $reference->attributes); foreach ($siteAccess->matcher->getSubMatchers() as $subMatcher) { - $this->assertSame( + self::assertSame( $this->getSerializer()->serialize( $subMatcher, 'json', diff --git a/tests/bundle/Core/Fragment/InlineFragmentRendererTest.php b/tests/bundle/Core/Fragment/InlineFragmentRendererTest.php index 461504678f..9f06e83014 100644 --- a/tests/bundle/Core/Fragment/InlineFragmentRendererTest.php +++ b/tests/bundle/Core/Fragment/InlineFragmentRendererTest.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\Core\Fragment; use Ibexa\Bundle\Core\Fragment\InlineFragmentRenderer; @@ -31,18 +32,18 @@ public function testRendererControllerReference() $options = ['foo' => 'bar']; $expectedReturn = '/_fragment?foo=bar'; $this->innerRenderer - ->expects($this->once()) + ->expects(self::once()) ->method('render') ->with($reference, $request, $options) - ->will($this->returnValue($expectedReturn)); + ->will(self::returnValue($expectedReturn)); $renderer = new InlineFragmentRenderer($this->innerRenderer); - $this->assertSame($expectedReturn, $renderer->render($reference, $request, $options)); - $this->assertTrue(isset($reference->attributes['serialized_siteaccess'])); + self::assertSame($expectedReturn, $renderer->render($reference, $request, $options)); + self::assertTrue(isset($reference->attributes['serialized_siteaccess'])); $serializedSiteAccess = json_encode($siteAccess); - $this->assertSame($serializedSiteAccess, $reference->attributes['serialized_siteaccess']); - $this->assertTrue(isset($reference->attributes['serialized_siteaccess_matcher'])); - $this->assertSame( + self::assertSame($serializedSiteAccess, $reference->attributes['serialized_siteaccess']); + self::assertTrue(isset($reference->attributes['serialized_siteaccess_matcher'])); + self::assertSame( $this->getSerializer()->serialize( $siteAccess->matcher, 'json', @@ -50,20 +51,20 @@ public function testRendererControllerReference() ), $reference->attributes['serialized_siteaccess_matcher'] ); - $this->assertTrue(isset($reference->attributes['semanticPathinfo'])); - $this->assertSame('/foo/bar', $reference->attributes['semanticPathinfo']); - $this->assertTrue(isset($reference->attributes['viewParametersString'])); - $this->assertSame('/(foo)/bar', $reference->attributes['viewParametersString']); + self::assertTrue(isset($reference->attributes['semanticPathinfo'])); + self::assertSame('/foo/bar', $reference->attributes['semanticPathinfo']); + self::assertTrue(isset($reference->attributes['viewParametersString'])); + self::assertSame('/(foo)/bar', $reference->attributes['viewParametersString']); } public function testRendererControllerReferenceWithCompoundMatcher(): ControllerReference { $reference = parent::testRendererControllerReferenceWithCompoundMatcher(); - $this->assertArrayHasKey('semanticPathinfo', $reference->attributes); - $this->assertSame('/foo/bar', $reference->attributes['semanticPathinfo']); - $this->assertArrayHasKey('viewParametersString', $reference->attributes); - $this->assertSame('/(foo)/bar', $reference->attributes['viewParametersString']); + self::assertArrayHasKey('semanticPathinfo', $reference->attributes); + self::assertSame('/foo/bar', $reference->attributes['semanticPathinfo']); + self::assertArrayHasKey('viewParametersString', $reference->attributes); + self::assertSame('/(foo)/bar', $reference->attributes['viewParametersString']); return $reference; } diff --git a/tests/bundle/Core/Imagine/AliasCleanerTest.php b/tests/bundle/Core/Imagine/AliasCleanerTest.php index 87f33fc186..cb1b3b4224 100644 --- a/tests/bundle/Core/Imagine/AliasCleanerTest.php +++ b/tests/bundle/Core/Imagine/AliasCleanerTest.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\Core\Imagine; use Ibexa\Bundle\Core\Imagine\AliasCleaner; @@ -29,7 +30,7 @@ public function testRemoveAliases() { $originalPath = 'foo/bar/test.jpg'; $this->resolver - ->expects($this->once()) + ->expects(self::once()) ->method('remove') ->with([$originalPath], []); diff --git a/tests/bundle/Core/Imagine/AliasGeneratorTest.php b/tests/bundle/Core/Imagine/AliasGeneratorTest.php index 4b7e278ade..6ec452ff9e 100644 --- a/tests/bundle/Core/Imagine/AliasGeneratorTest.php +++ b/tests/bundle/Core/Imagine/AliasGeneratorTest.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\Core\Imagine; use Ibexa\Bundle\Core\Imagine\AliasGenerator; @@ -109,7 +110,7 @@ protected function setUp(): void */ public function testSupportsValue($value, $isSupported) { - $this->assertSame($isSupported, $this->aliasGenerator->supportsValue($value)); + self::assertSame($isSupported, $this->aliasGenerator->supportsValue($value)); } /** @@ -155,28 +156,28 @@ public function testGetVariationNotStored() $expectedUrl = "http://localhost/foo/bar/image_$variationName.jpg"; $this->ioResolver - ->expects($this->once()) + ->expects(self::once()) ->method('isStored') ->with($originalPath, $variationName) - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $this->logger - ->expects($this->once()) + ->expects(self::once()) ->method('debug'); $binary = $this->createMock(BinaryInterface::class); $this->dataLoader - ->expects($this->once()) + ->expects(self::once()) ->method('find') ->with($originalPath) - ->will($this->returnValue($binary)); + ->will(self::returnValue($binary)); $this->filterManager - ->expects($this->once()) + ->expects(self::once()) ->method('applyFilter') ->with($binary, $variationName) - ->will($this->returnValue($binary)); + ->will(self::returnValue($binary)); $this->ioResolver - ->expects($this->once()) + ->expects(self::once()) ->method('store') ->with($binary, $originalPath, $variationName); @@ -210,20 +211,20 @@ public function testGetVariationOriginal() $expectedUrl = 'http://localhost/foo/bar/image.jpg'; $this->ioResolver - ->expects($this->never()) + ->expects(self::never()) ->method('isStored') ->with($originalPath, $variationName) - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $this->logger - ->expects($this->once()) + ->expects(self::once()) ->method('debug'); $this->ioResolver - ->expects($this->once()) + ->expects(self::once()) ->method('resolve') ->with($originalPath, $variationName) - ->will($this->returnValue($expectedUrl)); + ->will(self::returnValue($expectedUrl)); $expected = new ImageVariation( [ @@ -236,7 +237,7 @@ public function testGetVariationOriginal() 'width' => $imageWidth, ] ); - $this->assertEquals($expected, $this->decoratedAliasGenerator->getVariation($field, new VersionInfo(), $variationName)); + self::assertEquals($expected, $this->decoratedAliasGenerator->getVariation($field, new VersionInfo(), $variationName)); } /** @@ -262,41 +263,41 @@ public function testGetVariationNotStoredHavingReferences() $expectedUrl = "http://localhost/foo/bar/image_$variationName.jpg"; $this->ioResolver - ->expects($this->once()) + ->expects(self::once()) ->method('isStored') ->with($originalPath, $variationName) - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $this->logger - ->expects($this->once()) + ->expects(self::once()) ->method('debug'); $binary = $this->createMock(BinaryInterface::class); $this->dataLoader - ->expects($this->once()) + ->expects(self::once()) ->method('find') ->with($originalPath) - ->will($this->returnValue($binary)); + ->will(self::returnValue($binary)); // Filter manager is supposed to be called 3 times to generate references, and then passed variation. $this->filterManager - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('applyFilter') ->with($binary, $reference2) - ->will($this->returnValue($binary)); + ->will(self::returnValue($binary)); $this->filterManager - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('applyFilter') ->with($binary, $reference1) - ->will($this->returnValue($binary)); + ->will(self::returnValue($binary)); $this->filterManager - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('applyFilter') ->with($binary, $variationName) - ->will($this->returnValue($binary)); + ->will(self::returnValue($binary)); $this->ioResolver - ->expects($this->once()) + ->expects(self::once()) ->method('store') ->with($binary, $originalPath, $variationName); @@ -325,23 +326,23 @@ public function testGetVariationAlreadyStored() $expectedUrl = "http://localhost/foo/bar/image_$variationName.jpg"; $this->ioResolver - ->expects($this->once()) + ->expects(self::once()) ->method('isStored') ->with($originalPath, $variationName) - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $this->logger - ->expects($this->once()) + ->expects(self::once()) ->method('debug'); $this->dataLoader - ->expects($this->never()) + ->expects(self::never()) ->method('find'); $this->filterManager - ->expects($this->never()) + ->expects(self::never()) ->method('applyFilter'); $this->ioResolver - ->expects($this->never()) + ->expects(self::never()) ->method('store'); $this->assertImageVariationIsCorrect( @@ -359,9 +360,9 @@ public function testGetVariationOriginalNotFound() $this->expectException(SourceImageNotFoundException::class); $this->dataLoader - ->expects($this->once()) + ->expects(self::once()) ->method('find') - ->will($this->throwException(new NotLoadableException())); + ->will(self::throwException(new NotLoadableException())); $field = new Field(['value' => new ImageValue()]); $this->aliasGenerator->getVariation($field, new VersionInfo(), 'foo'); @@ -378,30 +379,30 @@ public function testGetVariationInvalidVariation() $field = new Field(['value' => $imageValue]); $this->ioResolver - ->expects($this->once()) + ->expects(self::once()) ->method('isStored') ->with($originalPath, $variationName) - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $this->logger - ->expects($this->once()) + ->expects(self::once()) ->method('debug'); $this->dataLoader - ->expects($this->never()) + ->expects(self::never()) ->method('find'); $this->filterManager - ->expects($this->never()) + ->expects(self::never()) ->method('applyFilter'); $this->ioResolver - ->expects($this->never()) + ->expects(self::never()) ->method('store'); $this->ioResolver - ->expects($this->once()) + ->expects(self::once()) ->method('resolve') ->with($originalPath, $variationName) - ->will($this->throwException(new NotResolvableException())); + ->will(self::throwException(new NotResolvableException())); $this->aliasGenerator->getVariation($field, new VersionInfo(), $variationName); } @@ -436,47 +437,47 @@ protected function assertImageVariationIsCorrect( ); $this->ioResolver - ->expects($this->once()) + ->expects(self::once()) ->method('resolve') ->with($originalPath, $variationName) - ->will($this->returnValue($expectedUrl)); + ->will(self::returnValue($expectedUrl)); $this->variationPathGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('getVariationPath') ->with($originalPath, $variationName) ->willReturn($binaryFile->uri); $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFile') ->withAnyParameters() ->willReturn($binaryFile); $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('getFileContents') ->with($binaryFile) ->willReturn('file contents mock'); $this->imagine - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with('file contents mock') - ->will($this->returnValue($this->image)); + ->will(self::returnValue($this->image)); $this->image - ->expects($this->once()) + ->expects(self::once()) ->method('getSize') - ->will($this->returnValue($this->box)); + ->will(self::returnValue($this->box)); $this->box - ->expects($this->once()) + ->expects(self::once()) ->method('getWidth') - ->will($this->returnValue($imageWidth)); + ->will(self::returnValue($imageWidth)); $this->box - ->expects($this->once()) + ->expects(self::once()) ->method('getHeight') - ->will($this->returnValue($imageHeight)); + ->will(self::returnValue($imageHeight)); $expected = new ImageVariation( [ @@ -489,7 +490,7 @@ protected function assertImageVariationIsCorrect( 'width' => $imageWidth, ] ); - $this->assertEquals( + self::assertEquals( $expected, $this->decoratedAliasGenerator->getVariation($field, new VersionInfo(), $variationName) ); diff --git a/tests/bundle/Core/Imagine/BinaryLoaderTest.php b/tests/bundle/Core/Imagine/BinaryLoaderTest.php index 61feb41f99..d3e0dcaffe 100644 --- a/tests/bundle/Core/Imagine/BinaryLoaderTest.php +++ b/tests/bundle/Core/Imagine/BinaryLoaderTest.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\Core\Imagine; use Ibexa\Bundle\Core\Imagine\BinaryLoader; @@ -38,10 +39,10 @@ public function testFindNotFound() $path = 'something.jpg'; $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFile') ->with($path) - ->will($this->throwException(new NotFoundException('foo', 'bar'))); + ->will(self::throwException(new NotFoundException('foo', 'bar'))); $this->binaryLoader->find($path); } @@ -52,10 +53,10 @@ public function testFindMissing() $path = 'something.jpg'; $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFile') ->with($path) - ->will($this->returnValue(new MissingBinaryFile())); + ->will(self::returnValue(new MissingBinaryFile())); $this->binaryLoader->find($path); } @@ -64,15 +65,15 @@ public function testFindBadPathRoot() { $path = 'var/site/storage/images/1/2/3/123-name/name.png'; $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFile') ->with($path) - ->will($this->throwException(new InvalidBinaryFileIdException($path))); + ->will(self::throwException(new InvalidBinaryFileIdException($path))); try { $this->binaryLoader->find($path); } catch (NotLoadableException $e) { - $this->assertStringContainsString( + self::assertStringContainsString( "Suggested value: '1/2/3/123-name/name.png'", $e->getMessage() ); diff --git a/tests/bundle/Core/Imagine/Cache/Resolver/ProxyResolverTest.php b/tests/bundle/Core/Imagine/Cache/Resolver/ProxyResolverTest.php index 8eb840485a..51789640ed 100644 --- a/tests/bundle/Core/Imagine/Cache/Resolver/ProxyResolverTest.php +++ b/tests/bundle/Core/Imagine/Cache/Resolver/ProxyResolverTest.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\Core\Imagine\Cache\Resolver; use Ibexa\Bundle\Core\Imagine\Cache\Resolver\ProxyResolver; @@ -37,14 +38,14 @@ public function testResolveUsingProxyHostWithTrailingSlash() $resolvedPath = 'http://ibexa.co/var/site/storage/images/_aliases/medium/7/4/2/0/247-1-eng-GB/img_0885.jpg'; $this->resolver - ->expects($this->once()) + ->expects(self::once()) ->method('resolve') ->with($this->path, $this->filter) ->willReturn($resolvedPath); $expected = 'http://ezplatform.com/var/site/storage/images/_aliases/medium/7/4/2/0/247-1-eng-GB/img_0885.jpg'; - $this->assertEquals($expected, $proxyResolver->resolve($this->path, $this->filter)); + self::assertEquals($expected, $proxyResolver->resolve($this->path, $this->filter)); } public function testResolveAndRemovePortUsingProxyHost() @@ -55,14 +56,14 @@ public function testResolveAndRemovePortUsingProxyHost() $resolvedPath = 'http://ibexa.co:8060/var/site/storage/images/_aliases/medium/7/4/2/0/247-1-eng-GB/img_0885.jpg'; $this->resolver - ->expects($this->once()) + ->expects(self::once()) ->method('resolve') ->with($this->path, $this->filter) ->willReturn($resolvedPath); $expected = 'http://ibexa.co/var/site/storage/images/_aliases/medium/7/4/2/0/247-1-eng-GB/img_0885.jpg'; - $this->assertEquals($expected, $proxyResolver->resolve($this->path, $this->filter)); + self::assertEquals($expected, $proxyResolver->resolve($this->path, $this->filter)); } public function testResolveAndRemovePortUsingProxyHostWithTrailingSlash() @@ -73,14 +74,14 @@ public function testResolveAndRemovePortUsingProxyHostWithTrailingSlash() $resolvedPath = 'http://ezplatform.com:8080/var/site/storage/images/_aliases/medium/7/4/2/0/247-1-eng-GB/img_0885.jpg'; $this->resolver - ->expects($this->once()) + ->expects(self::once()) ->method('resolve') ->with($this->path, $this->filter) ->willReturn($resolvedPath); $expected = 'http://ibexa.co/var/site/storage/images/_aliases/medium/7/4/2/0/247-1-eng-GB/img_0885.jpg'; - $this->assertEquals($expected, $proxyResolver->resolve($this->path, $this->filter)); + self::assertEquals($expected, $proxyResolver->resolve($this->path, $this->filter)); } } diff --git a/tests/bundle/Core/Imagine/Cache/Resolver/RelativeResolverTest.php b/tests/bundle/Core/Imagine/Cache/Resolver/RelativeResolverTest.php index daeb67a9c6..076a558350 100644 --- a/tests/bundle/Core/Imagine/Cache/Resolver/RelativeResolverTest.php +++ b/tests/bundle/Core/Imagine/Cache/Resolver/RelativeResolverTest.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\Core\Imagine\Cache\Resolver; use Ibexa\Bundle\Core\Imagine\Cache\Resolver\RelativeResolver; @@ -32,12 +33,12 @@ public function testResolve() $expected = '/var/site/storage/images/_aliases/big/7/4/2/0/247-1-eng-GB/test.png'; $this->liipResolver - ->expects($this->once()) + ->expects(self::once()) ->method('resolve') ->with($path, $filter) ->willReturn($absolute); - $this->assertSame($expected, $resolver->resolve($path, $filter)); + self::assertSame($expected, $resolver->resolve($path, $filter)); } } diff --git a/tests/bundle/Core/Imagine/Cache/ResolverFactoryTest.php b/tests/bundle/Core/Imagine/Cache/ResolverFactoryTest.php index be4b5b7529..477e881673 100644 --- a/tests/bundle/Core/Imagine/Cache/ResolverFactoryTest.php +++ b/tests/bundle/Core/Imagine/Cache/ResolverFactoryTest.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\Core\Imagine\Cache; use Ibexa\Bundle\Core\Imagine\Cache\Resolver\RelativeResolver; @@ -40,7 +41,7 @@ protected function setUp(): void public function testCreateProxyCacheResolver() { $this->configResolver - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('hasParameter') ->with('image_host') ->willReturn(true); @@ -48,20 +49,20 @@ public function testCreateProxyCacheResolver() $host = 'http://ibexa.co'; $this->configResolver - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('getParameter') ->with('image_host') ->willReturn($host); $expected = new ProxyResolver($this->resolver, [$host]); - $this->assertEquals($expected, $this->factory->createCacheResolver()); + self::assertEquals($expected, $this->factory->createCacheResolver()); } public function testCreateRelativeCacheResolver() { $this->configResolver - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('hasParameter') ->with('image_host') ->willReturn(true); @@ -69,14 +70,14 @@ public function testCreateRelativeCacheResolver() $host = '/'; $this->configResolver - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('getParameter') ->with('image_host') ->willReturn($host); $expected = new RelativeResolver($this->resolver); - $this->assertEquals($expected, $this->factory->createCacheResolver()); + self::assertEquals($expected, $this->factory->createCacheResolver()); } } diff --git a/tests/bundle/Core/Imagine/Filter/AbstractFilterTest.php b/tests/bundle/Core/Imagine/Filter/AbstractFilterTest.php index e9bef8727f..5773c6490f 100644 --- a/tests/bundle/Core/Imagine/Filter/AbstractFilterTest.php +++ b/tests/bundle/Core/Imagine/Filter/AbstractFilterTest.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\Core\Imagine\Filter; use Ibexa\Bundle\Core\Imagine\Filter\AbstractFilter; @@ -27,10 +28,10 @@ protected function getFilter() public function testGetSetOptions() { - $this->assertSame([], $this->filter->getOptions()); + self::assertSame([], $this->filter->getOptions()); $options = ['foo' => 'bar', 'some' => ['thing']]; $this->filter->setOptions($options); - $this->assertSame($options, $this->filter->getOptions()); + self::assertSame($options, $this->filter->getOptions()); } /** @@ -38,11 +39,11 @@ public function testGetSetOptions() */ public function testGetSetOptionNoDefaultValue($optionName, $value) { - $this->assertFalse($this->filter->hasOption($optionName)); - $this->assertNull($this->filter->getOption($optionName)); + self::assertFalse($this->filter->hasOption($optionName)); + self::assertNull($this->filter->getOption($optionName)); $this->filter->setOption($optionName, $value); - $this->assertTrue($this->filter->hasOption($optionName)); - $this->assertSame($value, $this->filter->getOption($optionName)); + self::assertTrue($this->filter->hasOption($optionName)); + self::assertSame($value, $this->filter->getOption($optionName)); } public function getSetOptionNoDefaulValueProvider() @@ -62,11 +63,11 @@ public function getSetOptionNoDefaulValueProvider() */ public function testGetSetOptionWithDefaultValue($optionName, $value, $defaultValue) { - $this->assertFalse($this->filter->hasOption($optionName)); - $this->assertSame($defaultValue, $this->filter->getOption($optionName, $defaultValue)); + self::assertFalse($this->filter->hasOption($optionName)); + self::assertSame($defaultValue, $this->filter->getOption($optionName, $defaultValue)); $this->filter->setOption($optionName, $value); - $this->assertTrue($this->filter->hasOption($optionName)); - $this->assertSame($value, $this->filter->getOption($optionName)); + self::assertTrue($this->filter->hasOption($optionName)); + self::assertSame($value, $this->filter->getOption($optionName)); } public function getSetOptionWithDefaulValueProvider() diff --git a/tests/bundle/Core/Imagine/Filter/FilterConfigurationTest.php b/tests/bundle/Core/Imagine/Filter/FilterConfigurationTest.php index 9b4f3e0b6f..d3e5383afd 100644 --- a/tests/bundle/Core/Imagine/Filter/FilterConfigurationTest.php +++ b/tests/bundle/Core/Imagine/Filter/FilterConfigurationTest.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\Core\Imagine\Filter; use Ibexa\Bundle\Core\Imagine\Filter\FilterConfiguration; @@ -34,13 +35,13 @@ public function testGetOnlyImagineFilters() $this->filterConfiguration->set('bar', $barConfig); $this->configResolver - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('getParameter') ->with('image_variations') - ->will($this->returnValue([])); + ->will(self::returnValue([])); - $this->assertSame($fooConfig, $this->filterConfiguration->get('foo')); - $this->assertSame($barConfig, $this->filterConfiguration->get('bar')); + self::assertSame($fooConfig, $this->filterConfiguration->get('foo')); + self::assertSame($barConfig, $this->filterConfiguration->get('bar')); } public function testGetNoEzVariationInvalidImagineFilter() @@ -53,10 +54,10 @@ public function testGetNoEzVariationInvalidImagineFilter() $this->filterConfiguration->set('bar', $barConfig); $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('image_variations') - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->filterConfiguration->get('foobar'); } @@ -72,10 +73,10 @@ public function testGetWithEzVariationNullConfiguration(): void 'some_variation' => null, ]; $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('image_variations') - ->will($this->returnValue($variations)); + ->will(self::returnValue($variations)); self::assertSame( [ @@ -101,12 +102,12 @@ public function testGetEzVariationNoReference() 'some_variation' => ['filters' => $filters], ]; $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('image_variations') - ->will($this->returnValue($variations)); + ->will(self::returnValue($variations)); - $this->assertSame( + self::assertSame( [ 'cache' => 'ibexa', 'data_loader' => 'ibexa', @@ -131,12 +132,12 @@ public function testGetEzVariationWithReference() 'some_variation' => ['filters' => $filters, 'reference' => $reference], ]; $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('image_variations') - ->will($this->returnValue($variations)); + ->will(self::returnValue($variations)); - $this->assertSame( + self::assertSame( [ 'cache' => 'ibexa', 'data_loader' => 'ibexa', @@ -159,12 +160,12 @@ public function testGetEzVariationImagineFilters() 'some_variation' => ['reference' => $reference], ]; $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('image_variations') - ->will($this->returnValue($variations)); + ->will(self::returnValue($variations)); - $this->assertSame( + self::assertSame( [ 'cache' => 'ibexa', 'data_loader' => 'ibexa', @@ -190,12 +191,12 @@ public function testGetEzVariationImagineOptions() 'some_variation' => ['reference' => $reference, 'filters' => $filters], ]; $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('image_variations') - ->will($this->returnValue($variations)); + ->will(self::returnValue($variations)); - $this->assertSame( + self::assertSame( [ 'cache' => 'ibexa', 'data_loader' => 'ibexa', @@ -222,12 +223,12 @@ public function testAll() $eZVariationConfig = ['filters' => $filters, 'reference' => $reference]; $variations = ['some_variation' => $eZVariationConfig]; $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('image_variations') - ->will($this->returnValue($variations)); + ->will(self::returnValue($variations)); - $this->assertEquals( + self::assertEquals( [ 'foo' => $fooConfig, 'bar' => $barConfig, diff --git a/tests/bundle/Core/Imagine/Filter/Loader/BorderFilterLoaderTest.php b/tests/bundle/Core/Imagine/Filter/Loader/BorderFilterLoaderTest.php index 2c0e5c33cf..9f24739e42 100644 --- a/tests/bundle/Core/Imagine/Filter/Loader/BorderFilterLoaderTest.php +++ b/tests/bundle/Core/Imagine/Filter/Loader/BorderFilterLoaderTest.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\Core\Imagine\Filter\Loader; use Ibexa\Bundle\Core\Imagine\Filter\Loader\BorderFilterLoader; @@ -44,41 +45,41 @@ public function testLoadDefaultColor() $palette = $this->createMock(PaletteInterface::class); $image - ->expects($this->once()) + ->expects(self::once()) ->method('palette') - ->will($this->returnValue($palette)); + ->will(self::returnValue($palette)); $palette - ->expects($this->once()) + ->expects(self::once()) ->method('color') ->with(BorderFilterLoader::DEFAULT_BORDER_COLOR) - ->will($this->returnValue($this->createMock(ColorInterface::class))); + ->will(self::returnValue($this->createMock(ColorInterface::class))); $box = $this->createMock(BoxInterface::class); $image - ->expects($this->once()) + ->expects(self::once()) ->method('getSize') - ->will($this->returnValue($box)); + ->will(self::returnValue($box)); $box - ->expects($this->any()) + ->expects(self::any()) ->method('getWidth') - ->will($this->returnValue(100)); + ->will(self::returnValue(100)); $box - ->expects($this->any()) + ->expects(self::any()) ->method('getHeight') - ->will($this->returnValue(100)); + ->will(self::returnValue(100)); $drawer = $this->createMock(DrawerInterface::class); $image - ->expects($this->once()) + ->expects(self::once()) ->method('draw') - ->will($this->returnValue($drawer)); + ->will(self::returnValue($drawer)); $drawer - ->expects($this->any()) + ->expects(self::any()) ->method('line') - ->will($this->returnValue($drawer)); + ->will(self::returnValue($drawer)); $loader = new BorderFilterLoader(); - $this->assertSame($image, $loader->load($image, $options)); + self::assertSame($image, $loader->load($image, $options)); } /** @@ -91,41 +92,41 @@ public function testLoad($thickX, $thickY, $color) $palette = $this->createMock(PaletteInterface::class); $image - ->expects($this->once()) + ->expects(self::once()) ->method('palette') - ->will($this->returnValue($palette)); + ->will(self::returnValue($palette)); $palette - ->expects($this->once()) + ->expects(self::once()) ->method('color') ->with($color) - ->will($this->returnValue($this->createMock(ColorInterface::class))); + ->will(self::returnValue($this->createMock(ColorInterface::class))); $box = $this->createMock(BoxInterface::class); $image - ->expects($this->once()) + ->expects(self::once()) ->method('getSize') - ->will($this->returnValue($box)); + ->will(self::returnValue($box)); $box - ->expects($this->any()) + ->expects(self::any()) ->method('getWidth') - ->will($this->returnValue(1000)); + ->will(self::returnValue(1000)); $box - ->expects($this->any()) + ->expects(self::any()) ->method('getHeight') - ->will($this->returnValue(1000)); + ->will(self::returnValue(1000)); $drawer = $this->createMock(DrawerInterface::class); $image - ->expects($this->once()) + ->expects(self::once()) ->method('draw') - ->will($this->returnValue($drawer)); + ->will(self::returnValue($drawer)); $drawer - ->expects($this->any()) + ->expects(self::any()) ->method('line') - ->will($this->returnValue($drawer)); + ->will(self::returnValue($drawer)); $loader = new BorderFilterLoader(); - $this->assertSame($image, $loader->load($image, $options)); + self::assertSame($image, $loader->load($image, $options)); } public function loadProvider() diff --git a/tests/bundle/Core/Imagine/Filter/Loader/CropFilterLoaderTest.php b/tests/bundle/Core/Imagine/Filter/Loader/CropFilterLoaderTest.php index 304560dbb1..20c51c9d99 100644 --- a/tests/bundle/Core/Imagine/Filter/Loader/CropFilterLoaderTest.php +++ b/tests/bundle/Core/Imagine/Filter/Loader/CropFilterLoaderTest.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\Core\Imagine\Filter\Loader; use Ibexa\Bundle\Core\Imagine\Filter\Loader\CropFilterLoader; @@ -58,12 +59,12 @@ public function testLoad() $image = $this->createMock(ImageInterface::class); $this->innerLoader - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with($image, ['size' => [$width, $height], 'start' => [$offsetX, $offsetY]]) - ->will($this->returnValue($image)); + ->will(self::returnValue($image)); - $this->assertSame($image, $this->loader->load($image, [$width, $height, $offsetX, $offsetY])); + self::assertSame($image, $this->loader->load($image, [$width, $height, $offsetX, $offsetY])); } } diff --git a/tests/bundle/Core/Imagine/Filter/Loader/GrayscaleFilterLoaderTest.php b/tests/bundle/Core/Imagine/Filter/Loader/GrayscaleFilterLoaderTest.php index 5dbb38fe79..3130af9172 100644 --- a/tests/bundle/Core/Imagine/Filter/Loader/GrayscaleFilterLoaderTest.php +++ b/tests/bundle/Core/Imagine/Filter/Loader/GrayscaleFilterLoaderTest.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\Core\Imagine\Filter\Loader; use Ibexa\Bundle\Core\Imagine\Filter\Loader\GrayscaleFilterLoader; @@ -18,16 +19,16 @@ public function testLoad() $image = $this->createMock(ImageInterface::class); $effects = $this->createMock(EffectsInterface::class); $image - ->expects($this->once()) + ->expects(self::once()) ->method('effects') - ->will($this->returnValue($effects)); + ->will(self::returnValue($effects)); $effects - ->expects($this->once()) + ->expects(self::once()) ->method('grayscale') - ->will($this->returnValue($effects)); + ->will(self::returnValue($effects)); $loader = new GrayscaleFilterLoader(); - $this->assertSame($image, $loader->load($image)); + self::assertSame($image, $loader->load($image)); } } diff --git a/tests/bundle/Core/Imagine/Filter/Loader/ReduceNoiseFilterLoaderTest.php b/tests/bundle/Core/Imagine/Filter/Loader/ReduceNoiseFilterLoaderTest.php index 4a12e39d21..12bb24086a 100644 --- a/tests/bundle/Core/Imagine/Filter/Loader/ReduceNoiseFilterLoaderTest.php +++ b/tests/bundle/Core/Imagine/Filter/Loader/ReduceNoiseFilterLoaderTest.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\Core\Imagine\Filter\Loader; use Ibexa\Bundle\Core\Imagine\Filter\FilterInterface; diff --git a/tests/bundle/Core/Imagine/Filter/Loader/ScaleDownOnlyFilterLoaderTest.php b/tests/bundle/Core/Imagine/Filter/Loader/ScaleDownOnlyFilterLoaderTest.php index e831ea28a8..b673faae5d 100644 --- a/tests/bundle/Core/Imagine/Filter/Loader/ScaleDownOnlyFilterLoaderTest.php +++ b/tests/bundle/Core/Imagine/Filter/Loader/ScaleDownOnlyFilterLoaderTest.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\Core\Imagine\Filter\Loader; use Ibexa\Bundle\Core\Imagine\Filter\Loader\ScaleDownOnlyFilterLoader; @@ -52,12 +53,12 @@ public function testLoad() $options = [123, 456]; $image = $this->createMock(ImageInterface::class); $this->innerLoader - ->expects($this->once()) + ->expects(self::once()) ->method('load') - ->with($image, $this->equalTo(['size' => $options, 'mode' => 'inset'])) - ->will($this->returnValue($image)); + ->with($image, self::equalTo(['size' => $options, 'mode' => 'inset'])) + ->will(self::returnValue($image)); - $this->assertSame($image, $this->loader->load($image, $options)); + self::assertSame($image, $this->loader->load($image, $options)); } } diff --git a/tests/bundle/Core/Imagine/Filter/Loader/ScaleExactFilterLoaderTest.php b/tests/bundle/Core/Imagine/Filter/Loader/ScaleExactFilterLoaderTest.php index c0b197c55d..18fb21d62f 100644 --- a/tests/bundle/Core/Imagine/Filter/Loader/ScaleExactFilterLoaderTest.php +++ b/tests/bundle/Core/Imagine/Filter/Loader/ScaleExactFilterLoaderTest.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\Core\Imagine\Filter\Loader; use Ibexa\Bundle\Core\Imagine\Filter\Loader\ScaleExactFilterLoader; @@ -52,12 +53,12 @@ public function testLoad() $options = [123, 456]; $image = $this->createMock(ImageInterface::class); $this->innerLoader - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with($image, ['size' => $options]) - ->will($this->returnValue($image)); + ->will(self::returnValue($image)); - $this->assertSame($image, $this->loader->load($image, $options)); + self::assertSame($image, $this->loader->load($image, $options)); } } diff --git a/tests/bundle/Core/Imagine/Filter/Loader/ScaleFilterLoaderTest.php b/tests/bundle/Core/Imagine/Filter/Loader/ScaleFilterLoaderTest.php index 2e1b0565d1..4694a13611 100644 --- a/tests/bundle/Core/Imagine/Filter/Loader/ScaleFilterLoaderTest.php +++ b/tests/bundle/Core/Imagine/Filter/Loader/ScaleFilterLoaderTest.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\Core\Imagine\Filter\Loader; use Ibexa\Bundle\Core\Imagine\Filter\Loader\ScaleFilterLoader; @@ -58,17 +59,17 @@ public function testLoadHeighten() $image = $this->createMock(ImageInterface::class); $image - ->expects($this->once()) + ->expects(self::once()) ->method('getSize') - ->will($this->returnValue($box)); + ->will(self::returnValue($box)); $this->innerLoader - ->expects($this->once()) + ->expects(self::once()) ->method('load') - ->with($image, $this->equalTo(['heighten' => $height])) - ->will($this->returnValue($image)); + ->with($image, self::equalTo(['heighten' => $height])) + ->will(self::returnValue($image)); - $this->assertSame($image, $this->loader->load($image, [$width, $height])); + self::assertSame($image, $this->loader->load($image, [$width, $height])); } public function testLoadWiden() @@ -81,17 +82,17 @@ public function testLoadWiden() $image = $this->createMock(ImageInterface::class); $image - ->expects($this->once()) + ->expects(self::once()) ->method('getSize') - ->will($this->returnValue($box)); + ->will(self::returnValue($box)); $this->innerLoader - ->expects($this->once()) + ->expects(self::once()) ->method('load') - ->with($image, $this->equalTo(['widen' => $width])) - ->will($this->returnValue($image)); + ->with($image, self::equalTo(['widen' => $width])) + ->will(self::returnValue($image)); - $this->assertSame($image, $this->loader->load($image, [$width, $height])); + self::assertSame($image, $this->loader->load($image, [$width, $height])); } } diff --git a/tests/bundle/Core/Imagine/Filter/Loader/ScaleHeightDownOnlyFilterLoaderTest.php b/tests/bundle/Core/Imagine/Filter/Loader/ScaleHeightDownOnlyFilterLoaderTest.php index 1ef1db37cc..66eb355e5f 100644 --- a/tests/bundle/Core/Imagine/Filter/Loader/ScaleHeightDownOnlyFilterLoaderTest.php +++ b/tests/bundle/Core/Imagine/Filter/Loader/ScaleHeightDownOnlyFilterLoaderTest.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\Core\Imagine\Filter\Loader; use Ibexa\Bundle\Core\Imagine\Filter\Loader\ScaleHeightDownOnlyFilterLoader; @@ -40,12 +41,12 @@ public function testLoad() $height = 123; $image = $this->createMock(ImageInterface::class); $this->innerLoader - ->expects($this->once()) + ->expects(self::once()) ->method('load') - ->with($image, $this->equalTo(['size' => [null, $height], 'mode' => 'inset'])) - ->will($this->returnValue($image)); + ->with($image, self::equalTo(['size' => [null, $height], 'mode' => 'inset'])) + ->will(self::returnValue($image)); - $this->assertSame($image, $this->loader->load($image, [$height])); + self::assertSame($image, $this->loader->load($image, [$height])); } } diff --git a/tests/bundle/Core/Imagine/Filter/Loader/ScaleHeightFilterLoaderTest.php b/tests/bundle/Core/Imagine/Filter/Loader/ScaleHeightFilterLoaderTest.php index eb5c7a1c79..01ee8ee52f 100644 --- a/tests/bundle/Core/Imagine/Filter/Loader/ScaleHeightFilterLoaderTest.php +++ b/tests/bundle/Core/Imagine/Filter/Loader/ScaleHeightFilterLoaderTest.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\Core\Imagine\Filter\Loader; use Ibexa\Bundle\Core\Imagine\Filter\Loader\ScaleHeightFilterLoader; @@ -40,12 +41,12 @@ public function testLoad() $height = 123; $image = $this->createMock(ImageInterface::class); $this->innerLoader - ->expects($this->once()) + ->expects(self::once()) ->method('load') - ->with($image, $this->equalTo(['heighten' => $height])) - ->will($this->returnValue($image)); + ->with($image, self::equalTo(['heighten' => $height])) + ->will(self::returnValue($image)); - $this->assertSame($image, $this->loader->load($image, [$height])); + self::assertSame($image, $this->loader->load($image, [$height])); } } diff --git a/tests/bundle/Core/Imagine/Filter/Loader/ScalePercentFilterLoaderTest.php b/tests/bundle/Core/Imagine/Filter/Loader/ScalePercentFilterLoaderTest.php index 386701ad92..8f864ed075 100644 --- a/tests/bundle/Core/Imagine/Filter/Loader/ScalePercentFilterLoaderTest.php +++ b/tests/bundle/Core/Imagine/Filter/Loader/ScalePercentFilterLoaderTest.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\Core\Imagine\Filter\Loader; use Ibexa\Bundle\Core\Imagine\Filter\Loader\ScalePercentFilterLoader; @@ -60,17 +61,17 @@ public function testLoad() $box = new Box($origWidth, $origHeight); $image = $this->createMock(ImageInterface::class); $image - ->expects($this->once()) + ->expects(self::once()) ->method('getSize') - ->will($this->returnValue($box)); + ->will(self::returnValue($box)); $this->innerLoader - ->expects($this->once()) + ->expects(self::once()) ->method('load') - ->with($image, $this->equalTo(['size' => [$expectedWidth, $expectedHeight]])) - ->will($this->returnValue($image)); + ->with($image, self::equalTo(['size' => [$expectedWidth, $expectedHeight]])) + ->will(self::returnValue($image)); - $this->assertSame($image, $this->loader->load($image, [$widthPercent, $heightPercent])); + self::assertSame($image, $this->loader->load($image, [$widthPercent, $heightPercent])); } } diff --git a/tests/bundle/Core/Imagine/Filter/Loader/ScaleWidthDownOnlyFilterLoaderTest.php b/tests/bundle/Core/Imagine/Filter/Loader/ScaleWidthDownOnlyFilterLoaderTest.php index 215d771d03..d9b8cb51a4 100644 --- a/tests/bundle/Core/Imagine/Filter/Loader/ScaleWidthDownOnlyFilterLoaderTest.php +++ b/tests/bundle/Core/Imagine/Filter/Loader/ScaleWidthDownOnlyFilterLoaderTest.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\Core\Imagine\Filter\Loader; use Ibexa\Bundle\Core\Imagine\Filter\Loader\ScaleWidthDownOnlyFilterLoader; @@ -40,12 +41,12 @@ public function testLoad() $width = 123; $image = $this->createMock(ImageInterface::class); $this->innerLoader - ->expects($this->once()) + ->expects(self::once()) ->method('load') - ->with($image, $this->equalTo(['size' => [$width, null], 'mode' => 'inset'])) - ->will($this->returnValue($image)); + ->with($image, self::equalTo(['size' => [$width, null], 'mode' => 'inset'])) + ->will(self::returnValue($image)); - $this->assertSame($image, $this->loader->load($image, [$width])); + self::assertSame($image, $this->loader->load($image, [$width])); } } diff --git a/tests/bundle/Core/Imagine/Filter/Loader/ScaleWidthFilterLoaderTest.php b/tests/bundle/Core/Imagine/Filter/Loader/ScaleWidthFilterLoaderTest.php index 5cfd9a4bd6..e253d70dd7 100644 --- a/tests/bundle/Core/Imagine/Filter/Loader/ScaleWidthFilterLoaderTest.php +++ b/tests/bundle/Core/Imagine/Filter/Loader/ScaleWidthFilterLoaderTest.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\Core\Imagine\Filter\Loader; use Ibexa\Bundle\Core\Imagine\Filter\Loader\ScaleWidthFilterLoader; @@ -40,12 +41,12 @@ public function testLoad() $width = 123; $image = $this->createMock(ImageInterface::class); $this->innerLoader - ->expects($this->once()) + ->expects(self::once()) ->method('load') - ->with($image, $this->equalTo(['widen' => $width])) - ->will($this->returnValue($image)); + ->with($image, self::equalTo(['widen' => $width])) + ->will(self::returnValue($image)); - $this->assertSame($image, $this->loader->load($image, [$width])); + self::assertSame($image, $this->loader->load($image, [$width])); } } diff --git a/tests/bundle/Core/Imagine/Filter/Loader/SwirlFilterLoaderTest.php b/tests/bundle/Core/Imagine/Filter/Loader/SwirlFilterLoaderTest.php index e750a7d828..22c75881cf 100644 --- a/tests/bundle/Core/Imagine/Filter/Loader/SwirlFilterLoaderTest.php +++ b/tests/bundle/Core/Imagine/Filter/Loader/SwirlFilterLoaderTest.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\Core\Imagine\Filter\Loader; use Ibexa\Bundle\Core\Imagine\Filter\FilterInterface; @@ -30,16 +31,16 @@ public function testLoadNoOption() { $image = $this->createMock(ImageInterface::class); $this->filter - ->expects($this->never()) + ->expects(self::never()) ->method('setOption'); $this->filter - ->expects($this->once()) + ->expects(self::once()) ->method('apply') ->with($image) - ->will($this->returnValue($image)); + ->will(self::returnValue($image)); - $this->assertSame($image, $this->loader->load($image)); + self::assertSame($image, $this->loader->load($image)); } /** @@ -49,17 +50,17 @@ public function testLoadWithOption($degrees) { $image = $this->createMock(ImageInterface::class); $this->filter - ->expects($this->once()) + ->expects(self::once()) ->method('setOption') ->with('degrees', $degrees); $this->filter - ->expects($this->once()) + ->expects(self::once()) ->method('apply') ->with($image) - ->will($this->returnValue($image)); + ->will(self::returnValue($image)); - $this->assertSame($image, $this->loader->load($image, [$degrees])); + self::assertSame($image, $this->loader->load($image, [$degrees])); } public function loadWithOptionProvider() diff --git a/tests/bundle/Core/Imagine/Filter/UnsupportedFilterTest.php b/tests/bundle/Core/Imagine/Filter/UnsupportedFilterTest.php index 3f77e33bee..f98a59d847 100644 --- a/tests/bundle/Core/Imagine/Filter/UnsupportedFilterTest.php +++ b/tests/bundle/Core/Imagine/Filter/UnsupportedFilterTest.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\Core\Imagine\Filter; use Ibexa\Bundle\Core\Imagine\Filter\UnsupportedFilter; diff --git a/tests/bundle/Core/Imagine/IORepositoryResolverTest.php b/tests/bundle/Core/Imagine/IORepositoryResolverTest.php index aac66be802..5ca63f16e4 100644 --- a/tests/bundle/Core/Imagine/IORepositoryResolverTest.php +++ b/tests/bundle/Core/Imagine/IORepositoryResolverTest.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\Core\Imagine; use Ibexa\Bundle\Core\Imagine\Filter\FilterConfiguration; @@ -70,11 +71,11 @@ protected function setUp(): void public function testGetFilePath($path, $filter, $expected) { $this->variationPathGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('getVariationPath') ->with($path, $filter) ->willReturn($expected); - $this->assertSame($expected, $this->imageResolver->getFilePath($path, $filter)); + self::assertSame($expected, $this->imageResolver->getFilePath($path, $filter)); } public function getFilePathProvider() @@ -94,18 +95,18 @@ public function testIsStoredImageExists() $aliasPath = 'Tardis/bigger/in-the-inside/RiverSong_thumbnail.jpg'; $this->variationPathGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('getVariationPath') ->with($path, $filter) ->willReturn($aliasPath); $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('exists') ->with($aliasPath) - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); - $this->assertTrue($this->imageResolver->isStored($path, $filter)); + self::assertTrue($this->imageResolver->isStored($path, $filter)); } public function testIsStoredImageDoesntExist() @@ -115,18 +116,18 @@ public function testIsStoredImageDoesntExist() $aliasPath = 'Tardis/bigger/in-the-inside/RiverSong_thumbnail.jpg'; $this->variationPathGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('getVariationPath') ->with($path, $filter) ->willReturn($aliasPath); $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('exists') ->with($aliasPath) - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); - $this->assertFalse($this->imageResolver->isStored($path, $filter)); + self::assertFalse($this->imageResolver->isStored($path, $filter)); } /** @@ -139,17 +140,17 @@ public function testResolve($path, $filter, $variationPath, $requestUrl, $expect } $this->ioService - ->expects($this->any()) + ->expects(self::any()) ->method('loadBinaryFile') - ->will($this->returnValue(new BinaryFile(['uri' => $variationPath]))); + ->will(self::returnValue(new BinaryFile(['uri' => $variationPath]))); $this->variationPathGenerator - ->expects($this->any()) + ->expects(self::any()) ->method('getVariationPath') ->willReturn($variationPath); $result = $this->imageResolver->resolve($path, $filter); - $this->assertSame($expected, $result); + self::assertSame($expected, $result); } public function testResolveMissing() @@ -158,10 +159,10 @@ public function testResolveMissing() $path = 'foo/something.jpg'; $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFile') ->with($path) - ->will($this->returnValue(new MissingBinaryFile())); + ->will(self::returnValue(new MissingBinaryFile())); $this->imageResolver->resolve($path, 'some_filter'); } @@ -172,10 +173,10 @@ public function testResolveNotFound() $path = 'foo/something.jpg'; $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFile') ->with($path) - ->will($this->throwException(new NotFoundException('foo', 'bar'))); + ->will(self::throwException(new NotFoundException('foo', 'bar'))); $this->imageResolver->resolve($path, 'some_filter'); } @@ -244,12 +245,12 @@ public function testStore() $createStruct = new BinaryFileCreateStruct(); $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('newBinaryCreateStructFromLocalFile') - ->will($this->returnValue($createStruct)); + ->will(self::returnValue($createStruct)); $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('createBinaryFile'); $this->imageResolver->store($binary, $path, $filter); @@ -261,16 +262,16 @@ public function testRemoveEmptyFilters() $filters = ['filter1' => true, 'filter2' => true, 'chaud_cacao' => true]; $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('image_variations') - ->will($this->returnValue($filters)); + ->will(self::returnValue($filters)); $this->variationPathGenerator - ->expects($this->exactly(count($filters))) + ->expects(self::exactly(count($filters))) ->method('getVariationPath') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['foo/bar/test.jpg', 'filter1', 'foo/bar/test_filter1.jpg '], ['foo/bar/test.jpg', 'filter2', 'foo/bar/test_filter2.jpg '], @@ -281,10 +282,10 @@ public function testRemoveEmptyFilters() $fileToDelete = 'foo/bar/test_chaud_cacao.jpg'; $this->ioService - ->expects($this->exactly(count($filters))) + ->expects(self::exactly(count($filters))) ->method('exists') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['foo/bar/test_filter1.jpg', false], ['foo/bar/test_filter2.jpg', false], @@ -295,13 +296,13 @@ public function testRemoveEmptyFilters() $binaryFile = new BinaryFile(['id' => $fileToDelete]); $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFile') ->with($fileToDelete) - ->will($this->returnValue($binaryFile)); + ->will(self::returnValue($binaryFile)); $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('deleteBinaryFile') ->with($binaryFile); @@ -314,16 +315,16 @@ public function testRemoveWithFilters() $filters = ['filter1', 'filter2', 'chaud_cacao']; $this->configResolver - ->expects($this->never()) + ->expects(self::never()) ->method('getParameter') ->with('image_variations') - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->variationPathGenerator - ->expects($this->exactly(count($filters))) + ->expects(self::exactly(count($filters))) ->method('getVariationPath') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['foo/bar/test.jpg', 'filter1', 'foo/bar/test_filter1.jpg '], ['foo/bar/test.jpg', 'filter2', 'foo/bar/test_filter2.jpg '], @@ -334,10 +335,10 @@ public function testRemoveWithFilters() $fileToDelete = 'foo/bar/test_chaud_cacao.jpg'; $this->ioService - ->expects($this->exactly(count($filters))) + ->expects(self::exactly(count($filters))) ->method('exists') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['foo/bar/test_filter1.jpg', false], ['foo/bar/test_filter2.jpg', false], @@ -348,13 +349,13 @@ public function testRemoveWithFilters() $binaryFile = new BinaryFile(['id' => $fileToDelete]); $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFile') ->with($fileToDelete) - ->will($this->returnValue($binaryFile)); + ->will(self::returnValue($binaryFile)); $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('deleteBinaryFile') ->with($binaryFile); diff --git a/tests/bundle/Core/Imagine/ImageAsset/AliasGeneratorTest.php b/tests/bundle/Core/Imagine/ImageAsset/AliasGeneratorTest.php index 2ac431b7e4..516b901a50 100644 --- a/tests/bundle/Core/Imagine/ImageAsset/AliasGeneratorTest.php +++ b/tests/bundle/Core/Imagine/ImageAsset/AliasGeneratorTest.php @@ -69,19 +69,19 @@ public function testGetVariationOfImageAsset() $expectedVariation = new Variation(); $this->contentService - ->expects($this->once()) + ->expects(self::once()) ->method('loadContent') ->with($assetField->value->destinationContentId) ->willReturn($imageContent); $this->assetMapper - ->expects($this->once()) + ->expects(self::once()) ->method('getAssetField') ->with($imageContent) ->willReturn($imageField); $this->innerAliasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('getVariation') ->with($imageField, $imageVersionInfo, $variationName, $parameters) ->willReturn($expectedVariation); @@ -93,7 +93,7 @@ public function testGetVariationOfImageAsset() $parameters ); - $this->assertEquals($expectedVariation, $actualVariation); + self::assertEquals($expectedVariation, $actualVariation); } public function testGetVariationOfNonImageAsset() @@ -111,15 +111,15 @@ public function testGetVariationOfNonImageAsset() $expectedVariation = new Variation(); $this->contentService - ->expects($this->never()) + ->expects(self::never()) ->method('loadContent'); $this->assetMapper - ->expects($this->never()) + ->expects(self::never()) ->method('getAssetField'); $this->innerAliasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('getVariation') ->with($imageField, $imageVersionInfo, $variationName, $parameters) ->willReturn($expectedVariation); @@ -131,13 +131,13 @@ public function testGetVariationOfNonImageAsset() $parameters ); - $this->assertEquals($expectedVariation, $actualVariation); + self::assertEquals($expectedVariation, $actualVariation); } public function testSupport() { - $this->assertTrue($this->aliasGenerator->supportsValue(new ImageAsset\Value())); - $this->assertFalse($this->aliasGenerator->supportsValue(new Image\Value())); + self::assertTrue($this->aliasGenerator->supportsValue(new ImageAsset\Value())); + self::assertFalse($this->aliasGenerator->supportsValue(new Image\Value())); } } diff --git a/tests/bundle/Core/Imagine/PlaceholderAliasGeneratorConfiguratorTest.php b/tests/bundle/Core/Imagine/PlaceholderAliasGeneratorConfiguratorTest.php index d23754057f..eab3f721da 100644 --- a/tests/bundle/Core/Imagine/PlaceholderAliasGeneratorConfiguratorTest.php +++ b/tests/bundle/Core/Imagine/PlaceholderAliasGeneratorConfiguratorTest.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\Core\Imagine; use Ibexa\Bundle\Core\Imagine\PlaceholderAliasGenerator; @@ -27,7 +28,7 @@ public function testConfigure() { $configResolver = $this->createMock(ConfigResolverInterface::class); $configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('io.binarydata_handler') ->willReturn(self::BINARY_HANDLER_NAME); @@ -36,7 +37,7 @@ public function testConfigure() $providerRegistry = $this->createMock(PlaceholderProviderRegistry::class); $providerRegistry - ->expects($this->once()) + ->expects(self::once()) ->method('getProvider') ->with(self::PROVIDER_TYPE) ->willReturn($provider); @@ -50,7 +51,7 @@ public function testConfigure() $generator = $this->createMock(PlaceholderAliasGenerator::class); $generator - ->expects($this->once()) + ->expects(self::once()) ->method('setPlaceholderProvider') ->with($provider, self::PROVIDER_OPTIONS); diff --git a/tests/bundle/Core/Imagine/PlaceholderAliasGeneratorTest.php b/tests/bundle/Core/Imagine/PlaceholderAliasGeneratorTest.php index dbd3586c73..cc4719c933 100644 --- a/tests/bundle/Core/Imagine/PlaceholderAliasGeneratorTest.php +++ b/tests/bundle/Core/Imagine/PlaceholderAliasGeneratorTest.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\Core\Imagine; use Ibexa\Bundle\Core\Imagine\IORepositoryResolver; @@ -86,17 +87,17 @@ public function testGetVariationSkipsPlaceholderGeneration(Field $field, APIVers $expectedVariation = $this->createMock(ImageVariation::class); $this->ioResolver - ->expects($this->never()) + ->expects(self::never()) ->method('resolve') ->with($field->value->id, IORepositoryResolver::VARIATION_ORIGINAL); $this->placeholderProvider - ->expects($this->never()) + ->expects(self::never()) ->method('getPlaceholder') ->with($field->value, $this->placeholderOptions); $this->innerAliasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('getVariation') ->with($field, $versionInfo, $variationName, $parameters) ->willReturn($expectedVariation); @@ -108,7 +109,7 @@ public function testGetVariationSkipsPlaceholderGeneration(Field $field, APIVers $parameters ); - $this->assertEquals($expectedVariation, $actualVariation); + self::assertEquals($expectedVariation, $actualVariation); } /** @@ -119,12 +120,12 @@ public function testGetVariationOriginalFound(Field $field, APIVersionInfo $vers $expectedVariation = $this->createMock(ImageVariation::class); $this->ioResolver - ->expects($this->once()) + ->expects(self::once()) ->method('resolve') ->with($field->value->id, IORepositoryResolver::VARIATION_ORIGINAL); $this->innerAliasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('getVariation') ->with($field, $versionInfo, $variationName, $parameters) ->willReturn($expectedVariation); @@ -141,7 +142,7 @@ public function testGetVariationOriginalFound(Field $field, APIVersionInfo $vers $parameters ); - $this->assertEquals($expectedVariation, $actualVariation); + self::assertEquals($expectedVariation, $actualVariation); } /** @@ -154,25 +155,25 @@ public function testGetVariationOriginalNotFound(Field $field, APIVersionInfo $v $expectedVariation = $this->createMock(ImageVariation::class); $this->ioResolver - ->expects($this->once()) + ->expects(self::once()) ->method('resolve') ->with($field->value->id, IORepositoryResolver::VARIATION_ORIGINAL) ->willThrowException($this->createMock(NotResolvableException::class)); $this->placeholderProvider - ->expects($this->once()) + ->expects(self::once()) ->method('getPlaceholder') ->with($field->value, $this->placeholderOptions) ->willReturn($placeholderPath); $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('newBinaryCreateStructFromLocalFile') ->with($placeholderPath) ->willReturn($binaryCreateStruct); $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('createBinaryFile') ->with($binaryCreateStruct); @@ -182,7 +183,7 @@ public function testGetVariationOriginalNotFound(Field $field, APIVersionInfo $v ); $this->innerAliasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('getVariation') ->with($field, $versionInfo, $variationName, $parameters) ->willReturn($expectedVariation); @@ -194,8 +195,8 @@ public function testGetVariationOriginalNotFound(Field $field, APIVersionInfo $v $parameters ); - $this->assertEquals($field->value->id, $binaryCreateStruct->id); - $this->assertEquals($expectedVariation, $actualVariation); + self::assertEquals($field->value->id, $binaryCreateStruct->id); + self::assertEquals($expectedVariation, $actualVariation); } /** @@ -215,7 +216,7 @@ public function testGetVariationReturnsPlaceholderIfBinaryDataIsNotAvailable( $binaryFile = $this->createMock(BinaryFile::class); $this->ioResolver - ->expects($this->once()) + ->expects(self::once()) ->method('resolve') ->with($field->value->id, IORepositoryResolver::VARIATION_ORIGINAL) ->willReturn('/path/to/original/image.png'); @@ -231,19 +232,19 @@ public function testGetVariationReturnsPlaceholderIfBinaryDataIsNotAvailable( ->willThrowException($this->createMock(NotFoundException::class)); $this->placeholderProvider - ->expects($this->once()) + ->expects(self::once()) ->method('getPlaceholder') ->with($field->value, $this->placeholderOptions) ->willReturn($placeholderPath); $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('newBinaryCreateStructFromLocalFile') ->with($placeholderPath) ->willReturn($binaryCreateStruct); $this->ioService - ->expects($this->once()) + ->expects(self::once()) ->method('createBinaryFile') ->with($binaryCreateStruct); @@ -253,7 +254,7 @@ public function testGetVariationReturnsPlaceholderIfBinaryDataIsNotAvailable( ); $this->innerAliasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('getVariation') ->with($field, $versionInfo, $variationName, $parameters) ->willReturn($expectedVariation); @@ -265,8 +266,8 @@ public function testGetVariationReturnsPlaceholderIfBinaryDataIsNotAvailable( $parameters ); - $this->assertEquals($field->value->id, $binaryCreateStruct->id); - $this->assertEquals($expectedVariation, $actualVariation); + self::assertEquals($field->value->id, $binaryCreateStruct->id); + self::assertEquals($expectedVariation, $actualVariation); } /** @@ -274,7 +275,7 @@ public function testGetVariationReturnsPlaceholderIfBinaryDataIsNotAvailable( */ public function testSupportsValue(Value $value, bool $isSupported) { - $this->assertSame($isSupported, $this->aliasGenerator->supportsValue($value)); + self::assertSame($isSupported, $this->aliasGenerator->supportsValue($value)); } public function supportsValueProvider(): array diff --git a/tests/bundle/Core/Imagine/PlaceholderProvider/GenericProviderTest.php b/tests/bundle/Core/Imagine/PlaceholderProvider/GenericProviderTest.php index 61a160d593..3954c82f7b 100644 --- a/tests/bundle/Core/Imagine/PlaceholderProvider/GenericProviderTest.php +++ b/tests/bundle/Core/Imagine/PlaceholderProvider/GenericProviderTest.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\Core\Imagine\PlaceholderProvider; use Ibexa\Bundle\Core\Imagine\PlaceholderProvider\GenericProvider; @@ -27,7 +28,7 @@ public function testGetPlaceholder(ImageValue $value, $expectedText, array $opti $imagine = $this->createMock(ImagineInterface::class); $imagine - ->expects($this->atLeastOnce()) + ->expects(self::atLeastOnce()) ->method('font') ->willReturnCallback(function ($fontpath, $fontsize, ColorInterface $foreground) use ($options, $font) { $this->assertEquals($options['fontpath'], $fontpath); @@ -38,14 +39,14 @@ public function testGetPlaceholder(ImageValue $value, $expectedText, array $opti }); $font - ->expects($this->any()) + ->expects(self::any()) ->method('box') ->willReturn($this->createMock(BoxInterface::class)); $image = $this->createMock(ImageInterface::class); $imagine - ->expects($this->atLeastOnce()) + ->expects(self::atLeastOnce()) ->method('create') ->willReturnCallback(function (BoxInterface $size, ColorInterface $background) use ($value, $options, $image) { $this->assertSizeEquals([$value->width, $value->height], $size); @@ -56,12 +57,12 @@ public function testGetPlaceholder(ImageValue $value, $expectedText, array $opti $drawer = $this->createMock(DrawerInterface::class); $image - ->expects($this->any()) + ->expects(self::any()) ->method('draw') ->willReturn($drawer); $drawer - ->expects($this->atLeastOnce()) + ->expects(self::atLeastOnce()) ->method('text') ->with($expectedText, $font); @@ -92,13 +93,13 @@ public function getPlaceholderDataProvider() private function assertSizeEquals(array $expected, BoxInterface $actual) { - $this->assertEquals($expected[0], $actual->getWidth()); - $this->assertEquals($expected[1], $actual->getHeight()); + self::assertEquals($expected[0], $actual->getWidth()); + self::assertEquals($expected[1], $actual->getHeight()); } private function assertColorEquals($expected, ColorInterface $actual) { - $this->assertEquals(strtolower($expected), strtolower((string)$actual)); + self::assertEquals(strtolower($expected), strtolower((string)$actual)); } } diff --git a/tests/bundle/Core/Imagine/PlaceholderProviderRegistryTest.php b/tests/bundle/Core/Imagine/PlaceholderProviderRegistryTest.php index f42f68926e..961f088dfe 100644 --- a/tests/bundle/Core/Imagine/PlaceholderProviderRegistryTest.php +++ b/tests/bundle/Core/Imagine/PlaceholderProviderRegistryTest.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\Core\Imagine; use Ibexa\Bundle\Core\Imagine\PlaceholderProvider; @@ -30,8 +31,8 @@ public function testConstructor() $registry = new PlaceholderProviderRegistry($providers); - $this->assertSame($providers[self::FOO], $registry->getProvider(self::FOO)); - $this->assertSame($providers[self::BAR], $registry->getProvider(self::BAR)); + self::assertSame($providers[self::FOO], $registry->getProvider(self::FOO)); + self::assertSame($providers[self::BAR], $registry->getProvider(self::BAR)); } /** @@ -44,7 +45,7 @@ public function testAddProvider(): void $registry = new PlaceholderProviderRegistry(); $registry->addProvider(self::FOO, $provider); - $this->assertSame($provider, $registry->getProvider(self::FOO)); + self::assertSame($provider, $registry->getProvider(self::FOO)); } public function testSupports() @@ -53,8 +54,8 @@ public function testSupports() 'supported' => $this->getPlaceholderProviderMock(), ]); - $this->assertTrue($registry->supports('supported')); - $this->assertFalse($registry->supports('unsupported')); + self::assertTrue($registry->supports('supported')); + self::assertFalse($registry->supports('unsupported')); } public function testGetProviderKnown() @@ -65,7 +66,7 @@ public function testGetProviderKnown() self::FOO => $provider, ]); - $this->assertEquals($provider, $registry->getProvider(self::FOO)); + self::assertEquals($provider, $registry->getProvider(self::FOO)); } public function testGetProviderUnknown() diff --git a/tests/bundle/Core/Imagine/VariationPathGenerator/AliasDirectoryVariationPathGeneratorTest.php b/tests/bundle/Core/Imagine/VariationPathGenerator/AliasDirectoryVariationPathGeneratorTest.php index 59d2911a3b..93d25717de 100644 --- a/tests/bundle/Core/Imagine/VariationPathGenerator/AliasDirectoryVariationPathGeneratorTest.php +++ b/tests/bundle/Core/Imagine/VariationPathGenerator/AliasDirectoryVariationPathGeneratorTest.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\Core\Imagine\VariationPathGenerator; use Ibexa\Bundle\Core\Imagine\VariationPathGenerator\AliasDirectoryVariationPathGenerator; diff --git a/tests/bundle/Core/Imagine/VariationPathGenerator/OriginalDirectoryVariationPathGeneratorTest.php b/tests/bundle/Core/Imagine/VariationPathGenerator/OriginalDirectoryVariationPathGeneratorTest.php index 010a1d46b2..bfa3ddbf0b 100644 --- a/tests/bundle/Core/Imagine/VariationPathGenerator/OriginalDirectoryVariationPathGeneratorTest.php +++ b/tests/bundle/Core/Imagine/VariationPathGenerator/OriginalDirectoryVariationPathGeneratorTest.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\Core\Imagine\VariationPathGenerator; use Ibexa\Bundle\Core\Imagine\VariationPathGenerator\OriginalDirectoryVariationPathGenerator; diff --git a/tests/bundle/Core/Imagine/VariationPurger/IOVariationPurgerTest.php b/tests/bundle/Core/Imagine/VariationPurger/IOVariationPurgerTest.php index c171551138..46123cfb62 100644 --- a/tests/bundle/Core/Imagine/VariationPurger/IOVariationPurgerTest.php +++ b/tests/bundle/Core/Imagine/VariationPurger/IOVariationPurgerTest.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\Core\Imagine\VariationPurger; use Ibexa\Bundle\Core\Imagine\Cache\AliasGeneratorDecorator; diff --git a/tests/bundle/Core/Imagine/VariationPurger/ImageFileVariationPurgerTest.php b/tests/bundle/Core/Imagine/VariationPurger/ImageFileVariationPurgerTest.php index 5282d7d070..b4e8d77490 100644 --- a/tests/bundle/Core/Imagine/VariationPurger/ImageFileVariationPurgerTest.php +++ b/tests/bundle/Core/Imagine/VariationPurger/ImageFileVariationPurgerTest.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\Core\Imagine\VariationPurger; use ArrayIterator; @@ -40,7 +41,7 @@ public function testIteratesOverItems() ); $this->pathGeneratorMock - ->expects($this->exactly(4)) + ->expects(self::exactly(4)) ->method('getVariationPath') ->withConsecutive( ['path/to/1st/image.jpg', 'large'], @@ -59,24 +60,24 @@ public function testPurgesExistingItem() ); $this->pathGeneratorMock - ->expects($this->once()) + ->expects(self::once()) ->method('getVariationPath') - ->will($this->returnValue('path/to/file_large.png')); + ->will(self::returnValue('path/to/file_large.png')); $this->ioServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('exists') - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $this->ioServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFile') - ->will($this->returnValue(new BinaryFile())); + ->will(self::returnValue(new BinaryFile())); $this->ioServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('deleteBinaryFile') - ->with($this->isInstanceOf(BinaryFile::class)); + ->with(self::isInstanceOf(BinaryFile::class)); $purger->purge(['large']); } @@ -88,21 +89,21 @@ public function testDoesNotPurgeNotExistingItem() ); $this->pathGeneratorMock - ->expects($this->once()) + ->expects(self::once()) ->method('getVariationPath') - ->will($this->returnValue('path/to/file_large.png')); + ->will(self::returnValue('path/to/file_large.png')); $this->ioServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('exists') - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $this->ioServiceMock - ->expects($this->never()) + ->expects(self::never()) ->method('loadBinaryFile'); $this->ioServiceMock - ->expects($this->never()) + ->expects(self::never()) ->method('deleteBinaryFile'); $purger->purge(['large']); diff --git a/tests/bundle/Core/Imagine/VariationPurger/LegacyStorageImageFileListTest.php b/tests/bundle/Core/Imagine/VariationPurger/LegacyStorageImageFileListTest.php index 83f76265cc..854d565624 100644 --- a/tests/bundle/Core/Imagine/VariationPurger/LegacyStorageImageFileListTest.php +++ b/tests/bundle/Core/Imagine/VariationPurger/LegacyStorageImageFileListTest.php @@ -74,10 +74,10 @@ public function testImageIdTransformation() private function configureRowReaderMock(array $fileList) { - $mockInvocator = $this->rowReaderMock->expects($this->any())->method('getRow'); + $mockInvocator = $this->rowReaderMock->expects(self::any())->method('getRow'); call_user_func_array([$mockInvocator, 'willReturnOnConsecutiveCalls'], $fileList); - $this->rowReaderMock->expects($this->any())->method('getCount')->willReturn(count($fileList)); + $this->rowReaderMock->expects(self::any())->method('getCount')->willReturn(count($fileList)); } } diff --git a/tests/bundle/Core/Matcher/ViewMatcherRegistryTest.php b/tests/bundle/Core/Matcher/ViewMatcherRegistryTest.php index 93bb44aba6..5ff4fb7b81 100644 --- a/tests/bundle/Core/Matcher/ViewMatcherRegistryTest.php +++ b/tests/bundle/Core/Matcher/ViewMatcherRegistryTest.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\Core\Matcher; use Ibexa\Bundle\Core\Matcher\ViewMatcherRegistry; diff --git a/tests/bundle/Core/Routing/DefaultRouterTest.php b/tests/bundle/Core/Routing/DefaultRouterTest.php index 8b288e069a..5f14dbb6e4 100644 --- a/tests/bundle/Core/Routing/DefaultRouterTest.php +++ b/tests/bundle/Core/Routing/DefaultRouterTest.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\Core\Routing; use Ibexa\Bundle\Core\Routing\DefaultRouter; @@ -86,7 +87,7 @@ public function testMatchRequestWithSemanticPathinfo() ->method('getMatcher') ->willReturn($matcher); - $this->assertSame($matchedParameters, $router->matchRequest($request)); + self::assertSame($matchedParameters, $router->matchRequest($request)); } public function testMatchRequestRegularPathinfo() @@ -96,7 +97,7 @@ public function testMatchRequestRegularPathinfo() $request = Request::create($pathinfo); - $this->configResolver->expects($this->never())->method('getParameter'); + $this->configResolver->expects(self::never())->method('getParameter'); /** @var \PHPUnit\Framework\MockObject\MockObject&\Ibexa\Bundle\Core\Routing\DefaultRouter $router */ $router = $this->generateRouter(['getMatcher']); @@ -112,7 +113,7 @@ public function testMatchRequestRegularPathinfo() ->method('getMatcher') ->willReturn($matcher); - $this->assertSame($matchedParameters, $router->matchRequest($request)); + self::assertSame($matchedParameters, $router->matchRequest($request)); } /** @@ -134,7 +135,7 @@ public function testGenerateNoSiteAccess($url) ->method('getGenerator') ->willReturn($generator); - $this->assertSame($url, $router->generate(__METHOD__)); + self::assertSame($url, $router->generate(__METHOD__)); } public function providerGenerateNoSiteAccess() @@ -189,7 +190,7 @@ public function testGenerateWithSiteAccess($urlGenerated, $relevantUri, $expecte } else { // Non-siteaccess aware route, it's not supposed to be analysed $matcher - ->expects($this->never()) + ->expects(self::never()) ->method('analyseLink'); } } else { @@ -216,7 +217,7 @@ public function testGenerateWithSiteAccess($urlGenerated, $relevantUri, $expecte $router->setContext($requestContext); $router->setNonSiteAccessAwareRoutes($nonSiteAccessAwareRoutes); - $this->assertSame($expectedUrl, $router->generate($routeName, [], $referenceType)); + self::assertSame($expectedUrl, $router->generate($routeName, [], $referenceType)); } public function providerGenerateWithSiteAccess() @@ -285,7 +286,7 @@ public function testGenerateReverseSiteAccessMatch() $refGenerator->setAccessible(true); $refGenerator->setValue($router, $generator); - $this->assertSame( + self::assertSame( $urlGenerated, $router->generate($routeName, ['siteaccess' => $siteAccessName], DefaultRouter::ABSOLUTE_PATH) ); diff --git a/tests/bundle/Core/Routing/UrlAliasRouterTest.php b/tests/bundle/Core/Routing/UrlAliasRouterTest.php index 97b86e88d4..39f8c8c626 100644 --- a/tests/bundle/Core/Routing/UrlAliasRouterTest.php +++ b/tests/bundle/Core/Routing/UrlAliasRouterTest.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\Core\Routing; use Ibexa\Bundle\Core\Routing\UrlAliasRouter; @@ -17,7 +18,6 @@ use Ibexa\Core\MVC\Symfony\View\Manager as ViewManager; use Ibexa\Core\Repository\Values\Content\Location; use Ibexa\Tests\Core\MVC\Symfony\Routing\UrlAliasRouterTest as BaseUrlAliasRouterTest; -use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Routing\Exception\ResourceNotFoundException; use Symfony\Component\Routing\RequestContext; @@ -30,10 +30,10 @@ protected function setUp(): void { $this->configResolver = $this->createMock(ConfigResolverInterface::class); $this->configResolver - ->expects($this->any()) + ->expects(self::any()) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['url_alias_router', null, null, true], ['content.tree_root.location_id', null, null, null], @@ -58,7 +58,6 @@ protected function getRouter(LocationService $locationService, URLAliasService $ protected function resetConfigResolver() { $this->configResolver = $this->createMock(ConfigResolverInterface::class); - $this->container = $this->createMock(ContainerInterface::class); $this->router->setConfigResolver($this->configResolver); } @@ -68,10 +67,10 @@ public function testMatchRequestDeactivatedUrlAlias() $this->resetConfigResolver(); $this->configResolver - ->expects($this->any()) + ->expects(self::any()) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['url_alias_router', null, null, false], ] @@ -85,10 +84,10 @@ public function testMatchRequestWithRootLocation() $rootLocationId = 123; $this->resetConfigResolver(); $this->configResolver - ->expects($this->any()) + ->expects(self::any()) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['url_alias_router', null, null, true], ] @@ -98,10 +97,10 @@ public function testMatchRequestWithRootLocation() $prefix = '/root/prefix'; $this->urlALiasGenerator - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('getPathPrefixByRootLocationId') ->with($rootLocationId) - ->will($this->returnValue($prefix)); + ->will(self::returnValue($prefix)); $locationId = 789; $path = '/foo/bar'; @@ -114,15 +113,15 @@ public function testMatchRequestWithRootLocation() ] ); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($prefix . $path) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') - ->will($this->returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); + ->will(self::returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -133,7 +132,7 @@ public function testMatchRequestWithRootLocation() 'layout' => true, ]; $request = $this->getRequestByPathInfo($path); - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testMatchRequestLocationCaseRedirectWithRootLocation() @@ -141,10 +140,10 @@ public function testMatchRequestLocationCaseRedirectWithRootLocation() $rootLocationId = 123; $this->resetConfigResolver(); $this->configResolver - ->expects($this->any()) + ->expects(self::any()) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['url_alias_router', null, null, true], ] @@ -154,14 +153,14 @@ public function testMatchRequestLocationCaseRedirectWithRootLocation() $prefix = '/root/prefix'; $this->urlALiasGenerator - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('getPathPrefixByRootLocationId') ->with($rootLocationId) - ->will($this->returnValue($prefix)); + ->will(self::returnValue($prefix)); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') - ->will($this->returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); + ->will(self::returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); $locationId = 789; $path = '/foo/bar'; @@ -175,10 +174,10 @@ public function testMatchRequestLocationCaseRedirectWithRootLocation() ] ); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($prefix . $requestedPath) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -191,7 +190,7 @@ public function testMatchRequestLocationCaseRedirectWithRootLocation() 'needsRedirect' => true, ]; $request = $this->getRequestByPathInfo($requestedPath); - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testMatchRequestLocationCaseRedirectWithRootRootLocation() @@ -199,10 +198,10 @@ public function testMatchRequestLocationCaseRedirectWithRootRootLocation() $rootLocationId = 123; $this->resetConfigResolver(); $this->configResolver - ->expects($this->any()) + ->expects(self::any()) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['url_alias_router', null, null, true], ] @@ -212,10 +211,10 @@ public function testMatchRequestLocationCaseRedirectWithRootRootLocation() $prefix = '/'; $this->urlALiasGenerator - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('getPathPrefixByRootLocationId') ->with($rootLocationId) - ->will($this->returnValue($prefix)); + ->will(self::returnValue($prefix)); $locationId = 789; $path = '/foo/bar'; @@ -229,14 +228,14 @@ public function testMatchRequestLocationCaseRedirectWithRootRootLocation() ] ); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($requestedPath) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') - ->will($this->returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); + ->will(self::returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -249,7 +248,7 @@ public function testMatchRequestLocationCaseRedirectWithRootRootLocation() 'needsRedirect' => true, ]; $request = $this->getRequestByPathInfo($requestedPath); - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testMatchRequestResourceCaseRedirectWithRootLocation() @@ -257,10 +256,10 @@ public function testMatchRequestResourceCaseRedirectWithRootLocation() $rootLocationId = 123; $this->resetConfigResolver(); $this->configResolver - ->expects($this->any()) + ->expects(self::any()) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['url_alias_router', null, null, true], ] @@ -270,10 +269,10 @@ public function testMatchRequestResourceCaseRedirectWithRootLocation() $prefix = '/root/prefix'; $this->urlALiasGenerator - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('getPathPrefixByRootLocationId') ->with($rootLocationId) - ->will($this->returnValue($prefix)); + ->will(self::returnValue($prefix)); $path = '/foo/bar'; $requestedPath = '/Foo/Bar'; @@ -286,10 +285,10 @@ public function testMatchRequestResourceCaseRedirectWithRootLocation() ] ); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($prefix . $requestedPath) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -297,7 +296,7 @@ public function testMatchRequestResourceCaseRedirectWithRootLocation() 'needsRedirect' => true, ]; $request = $this->getRequestByPathInfo($requestedPath); - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testMatchRequestVirtualCaseRedirectWithRootLocation() @@ -305,10 +304,10 @@ public function testMatchRequestVirtualCaseRedirectWithRootLocation() $rootLocationId = 123; $this->resetConfigResolver(); $this->configResolver - ->expects($this->any()) + ->expects(self::any()) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['url_alias_router', null, null, true], ] @@ -318,10 +317,10 @@ public function testMatchRequestVirtualCaseRedirectWithRootLocation() $prefix = '/root/prefix'; $this->urlALiasGenerator - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('getPathPrefixByRootLocationId') ->with($rootLocationId) - ->will($this->returnValue($prefix)); + ->will(self::returnValue($prefix)); $path = '/foo/bar'; $requestedPath = '/Foo/Bar'; @@ -332,10 +331,10 @@ public function testMatchRequestVirtualCaseRedirectWithRootLocation() ] ); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($prefix . $requestedPath) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -343,17 +342,17 @@ public function testMatchRequestVirtualCaseRedirectWithRootLocation() 'needsRedirect' => true, ]; $request = $this->getRequestByPathInfo($requestedPath); - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testMatchRequestWithRootLocationAndExclusion() { $this->resetConfigResolver(); $this->configResolver - ->expects($this->any()) + ->expects(self::any()) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['url_alias_router', null, null, true], ['content.tree_root.location_id', null, null, 123], @@ -366,10 +365,10 @@ public function testMatchRequestWithRootLocationAndExclusion() $pathInfo = '/shared/content/foo-bar'; $destinationId = 789; $this->urlALiasGenerator - ->expects($this->any()) + ->expects(self::any()) ->method('isUriPrefixExcluded') ->with($pathInfo) - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $urlAlias = new URLAlias( [ @@ -381,14 +380,14 @@ public function testMatchRequestWithRootLocationAndExclusion() ); $request = $this->getRequestByPathInfo($pathInfo); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($pathInfo) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') - ->will($this->returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); + ->will(self::returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -398,7 +397,7 @@ public function testMatchRequestWithRootLocationAndExclusion() 'viewType' => ViewManager::VIEW_TYPE_FULL, 'layout' => true, ]; - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } } diff --git a/tests/bundle/Core/SiteAccess/Config/IOConfigResolverTest.php b/tests/bundle/Core/SiteAccess/Config/IOConfigResolverTest.php index 127aa52df6..3d79a05889 100644 --- a/tests/bundle/Core/SiteAccess/Config/IOConfigResolverTest.php +++ b/tests/bundle/Core/SiteAccess/Config/IOConfigResolverTest.php @@ -62,7 +62,7 @@ public function testGetUrlPrefix(): void $complexConfigProcessor ); - $this->assertEquals('var/demo_site/storage', $ioConfigResolver->getUrlPrefix()); + self::assertEquals('var/demo_site/storage', $ioConfigResolver->getUrlPrefix()); } public function testGetLegacyUrlPrefix(): void @@ -92,7 +92,7 @@ public function testGetLegacyUrlPrefix(): void $complexConfigProcessor ); - $this->assertEquals('var/demo_site/legacy_storage', $ioConfigResolver->getLegacyUrlPrefix()); + self::assertEquals('var/demo_site/legacy_storage', $ioConfigResolver->getLegacyUrlPrefix()); } public function testGetRootDir(): void @@ -122,7 +122,7 @@ public function testGetRootDir(): void $complexConfigProcessor ); - $this->assertEquals('/path/to/ibexa/web/var/demo_site/legacy_storage', $ioConfigResolver->getRootDir()); + self::assertEquals('/path/to/ibexa/web/var/demo_site/legacy_storage', $ioConfigResolver->getRootDir()); } } diff --git a/tests/bundle/Core/SiteAccess/MatcherBuilderTest.php b/tests/bundle/Core/SiteAccess/MatcherBuilderTest.php index bbbfa0ae4c..302ab0cf0d 100644 --- a/tests/bundle/Core/SiteAccess/MatcherBuilderTest.php +++ b/tests/bundle/Core/SiteAccess/MatcherBuilderTest.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\Core\SiteAccess; use Ibexa\Bundle\Core\SiteAccess\Matcher as CoreMatcher; @@ -30,12 +31,12 @@ protected function setUp(): void public function testBuildMatcherNoService() { $this->siteAccessMatcherRegistry - ->expects($this->never()) + ->expects(self::never()) ->method('getMatcher'); $matcherBuilder = new MatcherBuilder($this->siteAccessMatcherRegistry); $matcher = $this->createMock(Matcher::class); $builtMatcher = $matcherBuilder->buildMatcher('\\' . get_class($matcher), [], new SimplifiedRequest()); - $this->assertInstanceOf(get_class($matcher), $builtMatcher); + self::assertInstanceOf(get_class($matcher), $builtMatcher); } public function testBuildMatcherServiceWrongInterface() @@ -44,10 +45,10 @@ public function testBuildMatcherServiceWrongInterface() $serviceId = 'foo'; $this->siteAccessMatcherRegistry - ->expects($this->once()) + ->expects(self::once()) ->method('getMatcher') ->with($serviceId) - ->will($this->returnValue($this->createMock(Matcher::class))); + ->will(self::returnValue($this->createMock(Matcher::class))); $matcherBuilder = new MatcherBuilder($this->siteAccessMatcherRegistry); $matcherBuilder->buildMatcher("@$serviceId", [], new SimplifiedRequest()); } @@ -57,19 +58,19 @@ public function testBuildMatcherService() $serviceId = 'foo'; $matcher = $this->createMock(CoreMatcher::class); $this->siteAccessMatcherRegistry - ->expects($this->once()) + ->expects(self::once()) ->method('getMatcher') ->with($serviceId) - ->will($this->returnValue($matcher)); + ->will(self::returnValue($matcher)); $matchingConfig = ['foo' => 'bar']; $request = new SimplifiedRequest(); $matcher - ->expects($this->once()) + ->expects(self::once()) ->method('setMatchingConfiguration') ->with($matchingConfig); $matcher - ->expects($this->once()) + ->expects(self::once()) ->method('setRequest') ->with($request); diff --git a/tests/bundle/Core/SiteAccess/SiteAccessMatcherRegistryTest.php b/tests/bundle/Core/SiteAccess/SiteAccessMatcherRegistryTest.php index 167f30e62c..3fb7f56d7e 100644 --- a/tests/bundle/Core/SiteAccess/SiteAccessMatcherRegistryTest.php +++ b/tests/bundle/Core/SiteAccess/SiteAccessMatcherRegistryTest.php @@ -22,7 +22,7 @@ public function testGetMatcher(): void $matcher = $this->getMatcherMock(); $registry = new SiteAccessMatcherRegistry([self::MATCHER_NAME => $matcher]); - $this->assertSame($matcher, $registry->getMatcher(self::MATCHER_NAME)); + self::assertSame($matcher, $registry->getMatcher(self::MATCHER_NAME)); } public function testSetMatcher(): void @@ -32,7 +32,7 @@ public function testSetMatcher(): void $registry->setMatcher(self::MATCHER_NAME, $matcher); - $this->assertSame($matcher, $registry->getMatcher(self::MATCHER_NAME)); + self::assertSame($matcher, $registry->getMatcher(self::MATCHER_NAME)); } public function testSetMatcherOverride(): void @@ -43,7 +43,7 @@ public function testSetMatcherOverride(): void $registry->setMatcher(self::MATCHER_NAME, $newMatcher); - $this->assertSame($newMatcher, $registry->getMatcher(self::MATCHER_NAME)); + self::assertSame($newMatcher, $registry->getMatcher(self::MATCHER_NAME)); } public function testGetMatcherNotFound(): void diff --git a/tests/bundle/Core/Translation/GlobCollectorTest.php b/tests/bundle/Core/Translation/GlobCollectorTest.php index 059bc6c0f1..7ea44df31c 100644 --- a/tests/bundle/Core/Translation/GlobCollectorTest.php +++ b/tests/bundle/Core/Translation/GlobCollectorTest.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\Core\Translation; use Ibexa\Bundle\Core\Translation\GlobCollector; diff --git a/tests/bundle/Core/URLChecker/URLCheckerTest.php b/tests/bundle/Core/URLChecker/URLCheckerTest.php index 3290c6e75c..34fedb03cf 100644 --- a/tests/bundle/Core/URLChecker/URLCheckerTest.php +++ b/tests/bundle/Core/URLChecker/URLCheckerTest.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\Core\URLChecker; use Ibexa\Bundle\Core\URLChecker\URLChecker; @@ -32,7 +33,7 @@ protected function setUp(): void { $this->urlService = $this->createMock(URLService::class); $this->urlService - ->expects($this->any()) + ->expects(self::any()) ->method('createUpdateStruct') ->willReturnCallback(static function () { return new URLUpdateStruct(); @@ -48,7 +49,7 @@ public function testCheck() $groups = $this->createGroupedUrls(['http', 'https']); $this->urlService - ->expects($this->once()) + ->expects(self::once()) ->method('findUrls') ->with($query) ->willReturn($this->createSearchResults($groups)); @@ -60,7 +61,7 @@ public function testCheck() foreach ($handlers as $scheme => $handler) { $handler - ->expects($this->once()) + ->expects(self::once()) ->method('validate') ->willReturnCallback(function (array $urls) use ($scheme, $groups) { $this->assertEqualsCanonicalizing($groups[$scheme], $urls); @@ -79,13 +80,13 @@ public function testCheckUnsupported() $groups = $this->createGroupedUrls(['http', 'https'], 10); $this->urlService - ->expects($this->once()) + ->expects(self::once()) ->method('findUrls') ->with($query) ->willReturn($this->createSearchResults($groups)); $this->logger - ->expects($this->atLeastOnce()) + ->expects(self::atLeastOnce()) ->method('error') ->with('Unsupported URL schema: https'); @@ -95,7 +96,7 @@ public function testCheckUnsupported() foreach ($handlers as $scheme => $handler) { $handler - ->expects($this->once()) + ->expects(self::once()) ->method('validate') ->willReturnCallback(function (array $urls) use ($scheme, $groups) { $this->assertEqualsCanonicalizing($groups[$scheme], $urls); diff --git a/tests/bundle/Debug/Collector/IbexaCoreCollectorTest.php b/tests/bundle/Debug/Collector/IbexaCoreCollectorTest.php index 23cc5756cc..854e8f185e 100644 --- a/tests/bundle/Debug/Collector/IbexaCoreCollectorTest.php +++ b/tests/bundle/Debug/Collector/IbexaCoreCollectorTest.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\Debug\Collector; use Exception; @@ -29,12 +30,12 @@ public function testAddGetCollector() $collector = $this->getDataCollectorMock(); $name = 'foobar'; $collector - ->expects($this->once()) + ->expects(self::once()) ->method('getName') - ->will($this->returnValue($name)); + ->will(self::returnValue($name)); $this->mainCollector->addCollector($collector); - $this->assertSame($collector, $this->mainCollector->getCollector($name)); + self::assertSame($collector, $this->mainCollector->getCollector($name)); } public function testGetInvalidCollector() @@ -43,7 +44,7 @@ public function testGetInvalidCollector() $collector = $this->getDataCollectorMock(); $this->mainCollector->addCollector($collector); - $this->assertSame($collector, $this->mainCollector->getCollector('foo')); + self::assertSame($collector, $this->mainCollector->getCollector('foo')); } public function testGetAllCollectors() @@ -51,15 +52,15 @@ public function testGetAllCollectors() $collector1 = $this->getDataCollectorMock(); $nameCollector1 = 'collector1'; $collector1 - ->expects($this->once()) + ->expects(self::once()) ->method('getName') - ->will($this->returnValue($nameCollector1)); + ->will(self::returnValue($nameCollector1)); $collector2 = $this->getDataCollectorMock(); $nameCollector2 = 'collector2'; $collector2 - ->expects($this->once()) + ->expects(self::once()) ->method('getName') - ->will($this->returnValue($nameCollector2)); + ->will(self::returnValue($nameCollector2)); $allCollectors = [ $nameCollector1 => $collector1, @@ -70,7 +71,7 @@ public function testGetAllCollectors() $this->mainCollector->addCollector($collector); } - $this->assertSame($allCollectors, $this->mainCollector->getAllCollectors()); + self::assertSame($allCollectors, $this->mainCollector->getAllCollectors()); } public function testGetToolbarTemplateNothing() @@ -78,11 +79,11 @@ public function testGetToolbarTemplateNothing() $collector = $this->getDataCollectorMock(); $name = 'foobar'; $collector - ->expects($this->once()) + ->expects(self::once()) ->method('getName') - ->will($this->returnValue($name)); + ->will(self::returnValue($name)); $this->mainCollector->addCollector($collector); - $this->assertNull($this->mainCollector->getToolbarTemplate($name)); + self::assertNull($this->mainCollector->getToolbarTemplate($name)); } public function testGetToolbarTemplate() @@ -90,13 +91,13 @@ public function testGetToolbarTemplate() $collector = $this->getDataCollectorMock(); $name = 'foobar'; $collector - ->expects($this->once()) + ->expects(self::once()) ->method('getName') - ->will($this->returnValue($name)); + ->will(self::returnValue($name)); $toolbarTemplate = 'toolbar.html.twig'; $this->mainCollector->addCollector($collector, 'foo', $toolbarTemplate); - $this->assertSame($toolbarTemplate, $this->mainCollector->getToolbarTemplate($name)); + self::assertSame($toolbarTemplate, $this->mainCollector->getToolbarTemplate($name)); } public function testGetPanelTemplateNothing() @@ -104,11 +105,11 @@ public function testGetPanelTemplateNothing() $collector = $this->getDataCollectorMock(); $name = 'foobar'; $collector - ->expects($this->once()) + ->expects(self::once()) ->method('getName') - ->will($this->returnValue($name)); + ->will(self::returnValue($name)); $this->mainCollector->addCollector($collector); - $this->assertNull($this->mainCollector->getPanelTemplate($name)); + self::assertNull($this->mainCollector->getPanelTemplate($name)); } public function testGetPanelTemplate() @@ -116,13 +117,13 @@ public function testGetPanelTemplate() $collector = $this->getDataCollectorMock(); $name = 'foobar'; $collector - ->expects($this->once()) + ->expects(self::once()) ->method('getName') - ->will($this->returnValue($name)); + ->will(self::returnValue($name)); $panelTemplate = 'toolbar.html.twig'; $this->mainCollector->addCollector($collector, $panelTemplate, 'foo'); - $this->assertSame($panelTemplate, $this->mainCollector->getPanelTemplate($name)); + self::assertSame($panelTemplate, $this->mainCollector->getPanelTemplate($name)); } public function testCollect() @@ -130,15 +131,15 @@ public function testCollect() $collector1 = $this->getDataCollectorMock(); $nameCollector1 = 'collector1'; $collector1 - ->expects($this->once()) + ->expects(self::once()) ->method('getName') - ->will($this->returnValue($nameCollector1)); + ->will(self::returnValue($nameCollector1)); $collector2 = $this->getDataCollectorMock(); $nameCollector2 = 'collector2'; $collector2 - ->expects($this->once()) + ->expects(self::once()) ->method('getName') - ->will($this->returnValue($nameCollector2)); + ->will(self::returnValue($nameCollector2)); $allCollectors = [ $nameCollector1 => $collector1, @@ -153,7 +154,7 @@ public function testCollect() foreach ($allCollectors as $name => $collector) { $this->mainCollector->addCollector($collector); $collector - ->expects($this->once()) + ->expects(self::once()) ->method('collect') ->with($request, $response, $exception); } diff --git a/tests/bundle/Debug/DependencyInjection/Compiler/DataCollectorPassTest.php b/tests/bundle/Debug/DependencyInjection/Compiler/DataCollectorPassTest.php index c42e41f2e2..1e0d69cc99 100644 --- a/tests/bundle/Debug/DependencyInjection/Compiler/DataCollectorPassTest.php +++ b/tests/bundle/Debug/DependencyInjection/Compiler/DataCollectorPassTest.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\Debug\DependencyInjection\Compiler; use Ibexa\Bundle\Debug\Collector\IbexaCoreCollector; diff --git a/tests/bundle/IO/DependencyInjection/Compiler/IOConfigurationPassTest.php b/tests/bundle/IO/DependencyInjection/Compiler/IOConfigurationPassTest.php index 78d0c633e3..61842ffb75 100644 --- a/tests/bundle/IO/DependencyInjection/Compiler/IOConfigurationPassTest.php +++ b/tests/bundle/IO/DependencyInjection/Compiler/IOConfigurationPassTest.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\IO\DependencyInjection\Compiler; use ArrayObject; @@ -79,9 +80,9 @@ public function testBinarydataHandler() ); $this->binarydataConfigurationFactoryMock - ->expects($this->once()) + ->expects(self::once()) ->method('getParentServiceId') - ->will($this->returnValue('test.io.binarydata_handler.test_handler')); + ->will(self::returnValue('test.io.binarydata_handler.test_handler')); $this->compile(); @@ -99,9 +100,9 @@ public function testMetadataHandler() ); $this->metadataConfigurationFactoryMock - ->expects($this->once()) + ->expects(self::once()) ->method('getParentServiceId') - ->will($this->returnValue('test.io.metadata_handler.test_handler')); + ->will(self::returnValue('test.io.metadata_handler.test_handler')); $this->compile(); diff --git a/tests/bundle/IO/DependencyInjection/ConfigurationFactory/BaseFlysystemTest.php b/tests/bundle/IO/DependencyInjection/ConfigurationFactory/BaseFlysystemTest.php index bb6236d146..ede0f45304 100644 --- a/tests/bundle/IO/DependencyInjection/ConfigurationFactory/BaseFlysystemTest.php +++ b/tests/bundle/IO/DependencyInjection/ConfigurationFactory/BaseFlysystemTest.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\IO\DependencyInjection\ConfigurationFactory; use Ibexa\Tests\Bundle\IO\DependencyInjection\ConfigurationFactoryTest; diff --git a/tests/bundle/IO/DependencyInjection/ConfigurationFactory/BinarydataHandler/FlysystemTest.php b/tests/bundle/IO/DependencyInjection/ConfigurationFactory/BinarydataHandler/FlysystemTest.php index fbfea92f59..9653f1ff76 100644 --- a/tests/bundle/IO/DependencyInjection/ConfigurationFactory/BinarydataHandler/FlysystemTest.php +++ b/tests/bundle/IO/DependencyInjection/ConfigurationFactory/BinarydataHandler/FlysystemTest.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\IO\DependencyInjection\ConfigurationFactory\BinarydataHandler; use Ibexa\Bundle\IO\DependencyInjection\ConfigurationFactory\BinarydataHandler\Flysystem; diff --git a/tests/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/FlysystemTest.php b/tests/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/FlysystemTest.php index 237f59c86e..ea78f2e86a 100644 --- a/tests/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/FlysystemTest.php +++ b/tests/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/FlysystemTest.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\IO\DependencyInjection\ConfigurationFactory\MetadataHandler; use Ibexa\Bundle\IO\DependencyInjection\ConfigurationFactory\MetadataHandler\Flysystem; diff --git a/tests/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/LegacyDFSClusterTest.php b/tests/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/LegacyDFSClusterTest.php index cbfec45317..8a64a14d1a 100644 --- a/tests/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/LegacyDFSClusterTest.php +++ b/tests/bundle/IO/DependencyInjection/ConfigurationFactory/MetadataHandler/LegacyDFSClusterTest.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\IO\DependencyInjection\ConfigurationFactory\MetadataHandler; use Ibexa\Bundle\IO\DependencyInjection\ConfigurationFactory\MetadataHandler\LegacyDFSCluster; diff --git a/tests/bundle/IO/DependencyInjection/ConfigurationFactoryTest.php b/tests/bundle/IO/DependencyInjection/ConfigurationFactoryTest.php index fd7c0d0a1a..68b751123e 100644 --- a/tests/bundle/IO/DependencyInjection/ConfigurationFactoryTest.php +++ b/tests/bundle/IO/DependencyInjection/ConfigurationFactoryTest.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\IO\DependencyInjection; use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractContainerBuilderTestCase; @@ -46,7 +47,7 @@ public function testAddConfiguration() { $node = new ArrayNodeDefinition('handler'); $this->factory->addConfiguration($node); - $this->assertInstanceOf(ArrayNodeDefinition::class, $node); + self::assertInstanceOf(ArrayNodeDefinition::class, $node); // @todo customized testing of configuration node ? } diff --git a/tests/bundle/IO/DependencyInjection/IbexaIOExtensionTest.php b/tests/bundle/IO/DependencyInjection/IbexaIOExtensionTest.php index 42585c5fab..2e8e905679 100644 --- a/tests/bundle/IO/DependencyInjection/IbexaIOExtensionTest.php +++ b/tests/bundle/IO/DependencyInjection/IbexaIOExtensionTest.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\IO\DependencyInjection; use Ibexa\Bundle\Core\DependencyInjection\Compiler\ChainConfigResolverPass; diff --git a/tests/bundle/IO/EventListener/StreamFileListenerTest.php b/tests/bundle/IO/EventListener/StreamFileListenerTest.php index 89f0072961..dba3fdf215 100644 --- a/tests/bundle/IO/EventListener/StreamFileListenerTest.php +++ b/tests/bundle/IO/EventListener/StreamFileListenerTest.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\IO\EventListener; use DateTime; @@ -44,7 +45,7 @@ public function testDoesNotRespondToNonIoUri() $this->configureIoUrlPrefix('var/test/storage'); $this->ioServiceMock - ->expects($this->never()) + ->expects(self::never()) ->method('loadBinaryFileByUri'); $this->eventListener->onKernelRequest($event); @@ -59,7 +60,7 @@ public function testDoesNotRespondToNoIoRequest() $this->configureIoUrlPrefix('http://foo.com/var/test/storage'); $this->ioServiceMock - ->expects($this->never()) + ->expects(self::never()) ->method('loadBinaryFileByUri'); $this->eventListener->onKernelRequest($event); @@ -78,10 +79,10 @@ public function testRespondsToIoUri() $binaryFile = new BinaryFile(['mtime' => new DateTime()]); $this->ioServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFileByUri') ->with($uri) - ->will($this->returnValue($binaryFile)); + ->will(self::returnValue($binaryFile)); $this->eventListener->onKernelRequest($event); @@ -110,10 +111,10 @@ public function testRespondsToIoRequest() $binaryFile = new BinaryFile(['mtime' => new DateTime()]); $this->ioServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFileByUri') ->with(sprintf('http://%s%s', $host, $uri)) - ->will($this->returnValue($binaryFile)); + ->will(self::returnValue($binaryFile)); $this->eventListener->onKernelRequest($event); diff --git a/tests/integration/Core/BaseCoreFieldTypeIntegrationTest.php b/tests/integration/Core/BaseCoreFieldTypeIntegrationTest.php index f82d97aa64..27323e8659 100644 --- a/tests/integration/Core/BaseCoreFieldTypeIntegrationTest.php +++ b/tests/integration/Core/BaseCoreFieldTypeIntegrationTest.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\Integration\Core; use Doctrine\DBAL\Connection; diff --git a/tests/integration/Core/BinaryBase/BinaryBaseStorage/BinaryBaseStorageTest.php b/tests/integration/Core/BinaryBase/BinaryBaseStorage/BinaryBaseStorageTest.php index 468fcc2562..df7e0aa385 100644 --- a/tests/integration/Core/BinaryBase/BinaryBaseStorage/BinaryBaseStorageTest.php +++ b/tests/integration/Core/BinaryBase/BinaryBaseStorage/BinaryBaseStorageTest.php @@ -88,7 +88,7 @@ public function testStoreFieldData(VersionInfo $versionInfo, Field $field): void $this->ioServiceMock ->expects(self::once()) ->method('newBinaryCreateStructFromLocalFile') - ->will($this->returnValue($binaryFileCreateStruct)); + ->will(self::returnValue($binaryFileCreateStruct)); $this->pathGeneratorMock ->expects(self::once()) diff --git a/tests/integration/Core/Repository/BaseContentServiceTest.php b/tests/integration/Core/Repository/BaseContentServiceTest.php index ba8bb49f25..d8e0c29954 100644 --- a/tests/integration/Core/Repository/BaseContentServiceTest.php +++ b/tests/integration/Core/Repository/BaseContentServiceTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Values\Content\Location; diff --git a/tests/integration/Core/Repository/BaseContentTypeServiceTest.php b/tests/integration/Core/Repository/BaseContentTypeServiceTest.php index 7c59c01cf9..c7089d440d 100644 --- a/tests/integration/Core/Repository/BaseContentTypeServiceTest.php +++ b/tests/integration/Core/Repository/BaseContentTypeServiceTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Values\Content\Location; diff --git a/tests/integration/Core/Repository/BaseNonRedundantFieldSetTest.php b/tests/integration/Core/Repository/BaseNonRedundantFieldSetTest.php index 857905bb5c..87a0b41252 100644 --- a/tests/integration/Core/Repository/BaseNonRedundantFieldSetTest.php +++ b/tests/integration/Core/Repository/BaseNonRedundantFieldSetTest.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\Integration\Core\Repository; use Ibexa\Core\FieldType\TextLine\Value as TextLineValue; diff --git a/tests/integration/Core/Repository/BaseTest.php b/tests/integration/Core/Repository/BaseTest.php index ccad7d3862..834fc0c696 100644 --- a/tests/integration/Core/Repository/BaseTest.php +++ b/tests/integration/Core/Repository/BaseTest.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\Integration\Core\Repository; use ArrayObject; @@ -55,13 +56,13 @@ protected function setUp(): void // Use setup factory instance here w/o clearing data in case test don't need to $this->getSetupFactory()->getRepository(false); } catch (PDOException $e) { - $this->fail( + self::fail( 'The communication with the database cannot be established. ' . "This is required in order to perform the tests.\n\n" . 'Exception: ' . $e ); } catch (Exception $e) { - $this->fail( + self::fail( 'Cannot create a repository with predefined user. ' . 'Check the UserService or RoleService implementation. ' . PHP_EOL . PHP_EOL . @@ -302,7 +303,7 @@ private function assertPropertiesEqual($propertyName, $expectedValue, $actualVal $this->sortItems($expectedValue); } - $this->assertEquals( + self::assertEquals( $expectedValue, $actualValue, sprintf('Object property "%s" incorrect.', $propertyName) diff --git a/tests/integration/Core/Repository/BaseTrashServiceTest.php b/tests/integration/Core/Repository/BaseTrashServiceTest.php index ecdad092a0..78ad78a3f7 100644 --- a/tests/integration/Core/Repository/BaseTrashServiceTest.php +++ b/tests/integration/Core/Repository/BaseTrashServiceTest.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\Integration\Core\Repository; use Doctrine\DBAL\ParameterType; diff --git a/tests/integration/Core/Repository/BaseURLServiceTest.php b/tests/integration/Core/Repository/BaseURLServiceTest.php index bd98cd5201..dd4ce0443e 100644 --- a/tests/integration/Core/Repository/BaseURLServiceTest.php +++ b/tests/integration/Core/Repository/BaseURLServiceTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\ContentTypeService; @@ -30,20 +31,20 @@ protected function doTestFindUrls(URLQuery $query, array $expectedUrls, ?int $ex $searchResult = $repository->getURLService()->findUrls($query); /* END: Use Case */ - $this->assertInstanceOf(SearchResult::class, $searchResult); - $this->assertSame($expectedTotalCount, $searchResult->totalCount); + self::assertInstanceOf(SearchResult::class, $searchResult); + self::assertSame($expectedTotalCount, $searchResult->totalCount); $this->assertSearchResultItems($searchResult, $expectedUrls, $ignoreOrder); } protected function assertSearchResultItems(SearchResult $searchResult, array $expectedUrls, $ignoreOrder) { - $this->assertCount(count($expectedUrls), $searchResult->items); + self::assertCount(count($expectedUrls), $searchResult->items); foreach ($searchResult->items as $i => $item) { if ($ignoreOrder) { - $this->assertContains($item->url, $expectedUrls); + self::assertContains($item->url, $expectedUrls); } else { - $this->assertEquals($expectedUrls[$i], $item->url); + self::assertEquals($expectedUrls[$i], $item->url); } } } @@ -53,7 +54,7 @@ protected function assertSearchResultItemsAreUnique(SearchResult $results): void $visitedUrls = []; foreach ($results->items as $item) { - $this->assertNotContains( + self::assertNotContains( $item->url, $visitedUrls, 'Search results contains duplicated url: ' . $item->url @@ -65,9 +66,9 @@ protected function assertSearchResultItemsAreUnique(SearchResult $results): void protected function assertUsagesSearchResultItems(UsageSearchResult $searchResult, array $expectedContentInfoIds) { - $this->assertCount(count($expectedContentInfoIds), $searchResult->items); + self::assertCount(count($expectedContentInfoIds), $searchResult->items); foreach ($searchResult->items as $contentInfo) { - $this->assertContains($contentInfo->id, $expectedContentInfoIds); + self::assertContains($contentInfo->id, $expectedContentInfoIds); } } diff --git a/tests/integration/Core/Repository/BookmarkServiceTest.php b/tests/integration/Core/Repository/BookmarkServiceTest.php index b4d1542d59..1464a5f3a9 100644 --- a/tests/integration/Core/Repository/BookmarkServiceTest.php +++ b/tests/integration/Core/Repository/BookmarkServiceTest.php @@ -33,7 +33,7 @@ public function testIsBookmarked() $isBookmarked = $repository->getBookmarkService()->isBookmarked($location); /* END: Use Case */ - $this->assertTrue($isBookmarked); + self::assertTrue($isBookmarked); } /** @@ -48,7 +48,7 @@ public function testIsNotBookmarked() $isBookmarked = $repository->getBookmarkService()->isBookmarked($location); /* END: Use Case */ - $this->assertFalse($isBookmarked); + self::assertFalse($isBookmarked); } /** @@ -68,12 +68,13 @@ public function testCreateBookmark() $afterCreateBookmark = $bookmarkService->isBookmarked($location); /* END: Use Case */ - $this->assertFalse($beforeCreateBookmark); - $this->assertTrue($afterCreateBookmark); + self::assertFalse($beforeCreateBookmark); + self::assertTrue($afterCreateBookmark); } /** * @covers \Ibexa\Contracts\Core\Repository\BookmarkService::createBookmark + * * @depends testCreateBookmark */ public function testCreateBookmarkThrowsInvalidArgumentException() @@ -109,12 +110,13 @@ public function testDeleteBookmark() $afterDeleteBookmark = $bookmarkService->isBookmarked($location); /* END: Use Case */ - $this->assertTrue($beforeDeleteBookmark); - $this->assertFalse($afterDeleteBookmark); + self::assertTrue($beforeDeleteBookmark); + self::assertFalse($afterDeleteBookmark); } /** * @covers \Ibexa\Contracts\Core\Repository\BookmarkService::deleteBookmark + * * @depends testDeleteBookmark */ public function testDeleteBookmarkThrowsInvalidArgumentException() @@ -143,10 +145,10 @@ public function testLoadBookmarks() $bookmarks = $repository->getBookmarkService()->loadBookmarks(1, 3); /* END: Use Case */ - $this->assertInstanceOf(BookmarkList::class, $bookmarks); - $this->assertEquals($bookmarks->totalCount, 5); + self::assertInstanceOf(BookmarkList::class, $bookmarks); + self::assertEquals($bookmarks->totalCount, 5); // Assert bookmarks order: recently added should be first - $this->assertEquals([15, 13, 12], array_map(static function ($location) { + self::assertEquals([15, 13, 12], array_map(static function ($location) { return $location->id; }, $bookmarks->items)); } diff --git a/tests/integration/Core/Repository/Common/SlugConverter.php b/tests/integration/Core/Repository/Common/SlugConverter.php index 0a84515e43..e0b3c1d890 100644 --- a/tests/integration/Core/Repository/Common/SlugConverter.php +++ b/tests/integration/Core/Repository/Common/SlugConverter.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\Integration\Core\Repository\Common; use Ibexa\Core\Persistence\Legacy\Content\UrlAlias\SlugConverter as LegacySlugConverter; diff --git a/tests/integration/Core/Repository/Container/Compiler/SetAllServicesPublicPass.php b/tests/integration/Core/Repository/Container/Compiler/SetAllServicesPublicPass.php index 268d7c4ae3..898f5423f4 100644 --- a/tests/integration/Core/Repository/Container/Compiler/SetAllServicesPublicPass.php +++ b/tests/integration/Core/Repository/Container/Compiler/SetAllServicesPublicPass.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\Integration\Core\Repository\Container\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; diff --git a/tests/integration/Core/Repository/ContentServiceAuthorizationTest.php b/tests/integration/Core/Repository/ContentServiceAuthorizationTest.php index 37b17d95c3..2c97cba252 100644 --- a/tests/integration/Core/Repository/ContentServiceAuthorizationTest.php +++ b/tests/integration/Core/Repository/ContentServiceAuthorizationTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -18,7 +19,9 @@ * Test case for operations in the ContentServiceAuthorization using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\ContentService + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testLoadUser + * * @group integration * @group authorization */ @@ -62,6 +65,7 @@ public function setUp(): void * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContent */ public function testCreateContentThrowsUnauthorizedException() @@ -88,6 +92,7 @@ public function testCreateContentThrowsUnauthorizedException() * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent($contentCreateStruct, $locationCreateStructs) + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContent */ public function testCreateContentThrowsUnauthorizedExceptionWithSecondParameter() @@ -104,6 +109,7 @@ public function testCreateContentThrowsUnauthorizedExceptionWithSecondParameter( * Test for the loadContentInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentInfo() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentInfo */ public function testLoadContentInfoThrowsUnauthorizedException() @@ -122,6 +128,7 @@ public function testLoadContentInfoThrowsUnauthorizedException() * Test for the sudo() method. * * @covers \Ibexa\Contracts\Core\Repository\Repository::sudo() + * * @depends testLoadContentInfoThrowsUnauthorizedException */ public function testSudo() @@ -134,7 +141,7 @@ public function testSudo() return $repository->getContentService()->loadContentInfo($contentId); }); - $this->assertInstanceOf( + self::assertInstanceOf( ContentInfo::class, $contentInfo ); @@ -144,6 +151,7 @@ public function testSudo() * Test for the loadContentInfoList() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentInfoList() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentInfoList */ public function testLoadContentInfoListSkipsUnauthorizedItems() @@ -151,13 +159,14 @@ public function testLoadContentInfoListSkipsUnauthorizedItems() $contentId = $this->generateId('object', 10); $this->setRestrictedEditorUser(); - $this->assertCount(0, $this->contentService->loadContentInfoList([$contentId])); + self::assertCount(0, $this->contentService->loadContentInfoList([$contentId])); } /** * Test for the loadContentInfoByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentInfoByRemoteId() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentInfoByRemoteId */ public function testLoadContentInfoByRemoteIdThrowsUnauthorizedException() @@ -176,6 +185,7 @@ public function testLoadContentInfoByRemoteIdThrowsUnauthorizedException() * Test for the loadVersionInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersionInfo() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadVersionInfo */ public function testLoadVersionInfoThrowsUnauthorizedException() @@ -194,6 +204,7 @@ public function testLoadVersionInfoThrowsUnauthorizedException() * Test for the loadVersionInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersionInfo($contentInfo, $versionNo) + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadVersionInfoWithSecondParameter */ public function testLoadVersionInfoThrowsUnauthorizedExceptionWithSecondParameter() @@ -212,6 +223,7 @@ public function testLoadVersionInfoThrowsUnauthorizedExceptionWithSecondParamete * Test for the loadVersionInfoById() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersionInfoById() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadVersionInfoById */ public function testLoadVersionInfoByIdThrowsUnauthorizedException() @@ -229,6 +241,7 @@ public function testLoadVersionInfoByIdThrowsUnauthorizedException() * Test for the loadVersionInfoById() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersionInfoById($contentId, $versionNo) + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadVersionInfoByIdWithSecondParameter */ public function testLoadVersionInfoByIdThrowsUnauthorizedExceptionWithSecondParameter() @@ -246,6 +259,7 @@ public function testLoadVersionInfoByIdThrowsUnauthorizedExceptionWithSecondPara * Test for the loadVersionInfoById() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersionInfoById($contentId, $versionNo) + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadVersionInfoById */ public function testLoadVersionInfoByIdThrowsUnauthorizedExceptionForFirstDraft() @@ -268,6 +282,7 @@ public function testLoadVersionInfoByIdThrowsUnauthorizedExceptionForFirstDraft( * Test for the loadContentByContentInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByContentInfo() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentByContentInfo */ public function testLoadContentByContentInfoThrowsUnauthorizedException() @@ -286,6 +301,7 @@ public function testLoadContentByContentInfoThrowsUnauthorizedException() * Test for the loadContentByContentInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByContentInfo($contentInfo, $languages) + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentByContentInfoWithLanguageParameters */ public function testLoadContentByContentInfoThrowsUnauthorizedExceptionWithSecondParameter() @@ -304,6 +320,7 @@ public function testLoadContentByContentInfoThrowsUnauthorizedExceptionWithSecon * Test for the loadContentByContentInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByContentInfo($contentInfo, $languages, $versionNo) + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentByContentInfoWithVersionNumberParameter */ public function testLoadContentByContentInfoThrowsUnauthorizedExceptionWithThirdParameter() @@ -322,6 +339,7 @@ public function testLoadContentByContentInfoThrowsUnauthorizedExceptionWithThird * Test for the loadContentByVersionInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByVersionInfo() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentByVersionInfo */ public function testLoadContentByVersionInfoThrowsUnauthorizedException() @@ -342,6 +360,7 @@ public function testLoadContentByVersionInfoThrowsUnauthorizedException() * Test for the loadContentByVersionInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByVersionInfo($versionInfo, $languages) + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentByVersionInfoWithSecondParameter */ public function testLoadContentByVersionInfoThrowsUnauthorizedExceptionWithSecondParameter() @@ -362,6 +381,7 @@ public function testLoadContentByVersionInfoThrowsUnauthorizedExceptionWithSecon * Test for the loadContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContent */ public function testLoadContentThrowsUnauthorizedException() @@ -379,6 +399,7 @@ public function testLoadContentThrowsUnauthorizedException() * Test for the loadContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContent($contentId, $languages) + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentWithPrioritizedLanguages */ public function testLoadContentThrowsUnauthorizedExceptionWithSecondParameter() @@ -396,6 +417,7 @@ public function testLoadContentThrowsUnauthorizedExceptionWithSecondParameter() * Test for the loadContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContent($contentId, $languages, $versionNo) + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentWithThirdParameter */ public function testLoadContentThrowsUnauthorizedExceptionWithThirdParameter() @@ -413,6 +435,7 @@ public function testLoadContentThrowsUnauthorizedExceptionWithThirdParameter() * Test for the loadContent() method on a draft. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContent */ public function testLoadContentThrowsUnauthorizedExceptionOnDrafts() @@ -440,6 +463,7 @@ public function testLoadContentThrowsUnauthorizedExceptionOnDrafts() * This test the version permission on loading archived versions * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContent */ public function testLoadContentThrowsUnauthorizedExceptionsOnArchives() @@ -484,6 +508,7 @@ public function testLoadContentThrowsUnauthorizedExceptionsOnArchives() * Test for the loadContentByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByRemoteId() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentByRemoteId */ public function testLoadContentByRemoteIdThrowsUnauthorizedException() @@ -502,6 +527,7 @@ public function testLoadContentByRemoteIdThrowsUnauthorizedException() * Test for the loadContentByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByRemoteId($remoteId, $languages) + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentByRemoteIdWithSecondParameter */ public function testLoadContentByRemoteIdThrowsUnauthorizedExceptionWithSecondParameter() @@ -520,6 +546,7 @@ public function testLoadContentByRemoteIdThrowsUnauthorizedExceptionWithSecondPa * Test for the loadContentByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByRemoteId($remoteId, $languages, $versionNo) + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentByRemoteIdWithThirdParameter */ public function testLoadContentByRemoteIdThrowsUnauthorizedExceptionWithThirdParameter() @@ -538,6 +565,7 @@ public function testLoadContentByRemoteIdThrowsUnauthorizedExceptionWithThirdPar * Test for the updateContentMetadata() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContentMetadata() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testUpdateContentMetadata */ public function testUpdateContentMetadataThrowsUnauthorizedException() @@ -569,6 +597,7 @@ public function testUpdateContentMetadataThrowsUnauthorizedException() * Test for the deleteContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::deleteContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testDeleteContent */ public function testDeleteContentThrowsUnauthorizedException() @@ -639,6 +668,7 @@ public function testDeleteContentWithLanguageLimitation(): void * Test for the createContentDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContentDraft */ public function testCreateContentDraftThrowsUnauthorizedException() @@ -659,6 +689,7 @@ public function testCreateContentDraftThrowsUnauthorizedException() * Test for the createContentDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft($contentInfo, $versionInfo) + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContentDraftWithSecondParameter */ public function testCreateContentDraftThrowsUnauthorizedExceptionWithSecondParameter() @@ -685,13 +716,14 @@ public function testCountContentDraftsReturnZero() { $this->permissionResolver->setCurrentUserReference($this->anonymousUser); - $this->assertSame(0, $this->contentService->countContentDrafts()); + self::assertSame(0, $this->contentService->countContentDrafts()); } /** * Test for the loadContentDrafts() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentDrafts() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentDrafts * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentDrafts */ @@ -709,6 +741,7 @@ public function testLoadContentDraftsThrowsUnauthorizedException() * Test for the loadContentDrafts() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentDrafts($user) + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentDrafts */ public function testLoadContentDraftsThrowsUnauthorizedExceptionWithUser() @@ -725,6 +758,7 @@ public function testLoadContentDraftsThrowsUnauthorizedExceptionWithUser() * Test for the updateContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testUpdateContent */ public function testUpdateContentThrowsUnauthorizedException() @@ -753,6 +787,7 @@ public function testUpdateContentThrowsUnauthorizedException() * Test for the publishVersion() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::publishVersion() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testPublishVersion */ public function testPublishVersionThrowsUnauthorizedException() @@ -771,6 +806,7 @@ public function testPublishVersionThrowsUnauthorizedException() * Test for the deleteVersion() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::deleteVersion() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testDeleteVersion */ public function testDeleteVersionThrowsUnauthorizedException() @@ -789,6 +825,7 @@ public function testDeleteVersionThrowsUnauthorizedException() * Test for the loadVersions() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersions() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadVersions */ public function testLoadVersionsThrowsUnauthorizedException() @@ -809,6 +846,7 @@ public function testLoadVersionsThrowsUnauthorizedException() * Test for the copyContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::copyContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCopyContent */ public function testCopyContentThrowsUnauthorizedException() @@ -845,6 +883,7 @@ public function testCopyContentThrowsUnauthorizedException() * Test for the copyContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::copyContent($contentInfo, $destinationLocationCreateStruct, $versionInfo) + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCopyContentWithGivenVersion */ public function testCopyContentThrowsUnauthorizedExceptionWithGivenVersion() @@ -878,6 +917,7 @@ public function testCopyContentThrowsUnauthorizedExceptionWithGivenVersion() * Test for the loadRelations() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadRelations() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadRelations */ public function testLoadRelationsThrowsUnauthorizedException() @@ -904,6 +944,7 @@ public function testLoadRelationsThrowsUnauthorizedException() * Test for the loadRelations() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadRelations() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadRelations */ public function testLoadRelationsForDraftVersionThrowsUnauthorizedException() @@ -922,6 +963,7 @@ public function testLoadRelationsForDraftVersionThrowsUnauthorizedException() * Test for the loadReverseRelations() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadReverseRelations() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadReverseRelations */ public function testLoadReverseRelationsThrowsUnauthorizedException() @@ -944,6 +986,7 @@ public function testLoadReverseRelationsThrowsUnauthorizedException() * Test for the addRelation() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::addRelation() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testAddRelation */ public function testAddRelationThrowsUnauthorizedException() @@ -971,6 +1014,7 @@ public function testAddRelationThrowsUnauthorizedException() * Test for the deleteRelation() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::deleteRelation() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testDeleteRelation */ public function testDeleteRelationThrowsUnauthorizedException() @@ -1030,6 +1074,7 @@ private function createAnonymousWithEditorRole() * only that the non-readable related object(s) won't be loaded. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadRelations() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testAddRelation */ public function testLoadRelationsWithUnauthorizedRelations() @@ -1146,7 +1191,7 @@ public function testLoadRelationsWithUnauthorizedRelations() ]; // assert there are as many expected relations as actual ones - $this->assertEquals( + self::assertEquals( count($expectedRelations), count($actualRelations), "Expected '" . count($expectedRelations) @@ -1157,13 +1202,13 @@ public function testLoadRelationsWithUnauthorizedRelations() foreach ($actualRelations as $relation) { $destination = $relation->destinationContentInfo; $expected = $expectedRelations[$destination->id]->destinationContentInfo; - $this->assertNotEmpty($expected, "Non expected relation with '{$destination->id}' id found"); - $this->assertEquals( + self::assertNotEmpty($expected, "Non expected relation with '{$destination->id}' id found"); + self::assertEquals( $expected->id, $destination->id, "Expected relation with '{$expected->id}' id found '{$destination->id}' id" ); - $this->assertEquals( + self::assertEquals( $expected->name, $destination->name, "Expected relation with '{$expected->name}' name found '{$destination->name}' name" @@ -1174,7 +1219,7 @@ public function testLoadRelationsWithUnauthorizedRelations() } // verify all expected relations were found - $this->assertCount( + self::assertCount( 0, $expectedRelations, "Expected to find '" . (count($expectedRelations) + count($actualRelations)) diff --git a/tests/integration/Core/Repository/ContentServiceTest.php b/tests/integration/Core/Repository/ContentServiceTest.php index 91f42c9438..ff46b4e9c2 100644 --- a/tests/integration/Core/Repository/ContentServiceTest.php +++ b/tests/integration/Core/Repository/ContentServiceTest.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\Integration\Core\Repository; use Exception; @@ -37,6 +38,7 @@ * Test case for operations in the ContentService using in memory storage. * * @see \Ibexa\Contracts\Core\Repository\ContentService + * * @group content */ class ContentServiceTest extends BaseContentServiceTest @@ -83,7 +85,9 @@ public function setUp(): void * Test for the newContentCreateStruct() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::newContentCreateStruct() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testLoadContentTypeByIdentifier + * * @group user * @group field-type */ @@ -94,7 +98,7 @@ public function testNewContentCreateStruct() $contentCreate = $this->contentService->newContentCreateStruct($contentType, self::ENG_US); - $this->assertInstanceOf(ContentCreateStruct::class, $contentCreate); + self::assertInstanceOf(ContentCreateStruct::class, $contentCreate); } /** @@ -103,7 +107,9 @@ public function testNewContentCreateStruct() * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testNewContentCreateStruct + * * @group user * @group field-type */ @@ -121,7 +127,7 @@ public function testCreateContent() $content = $this->contentService->createContent($contentCreate); - $this->assertInstanceOf(Content::class, $content); + self::assertInstanceOf(Content::class, $content); return $content; } @@ -133,6 +139,7 @@ public function testCreateContent() * and should have access to do that. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent + * * @group user * @group field-type */ @@ -189,11 +196,12 @@ public function testCreateContentAndPublishWithPrivilegedAnonymousUser(): void * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContent */ public function testCreateContentSetsContentInfo($content) { - $this->assertInstanceOf(ContentInfo::class, $content->contentInfo); + self::assertInstanceOf(ContentInfo::class, $content->contentInfo); return $content; } @@ -204,13 +212,14 @@ public function testCreateContentSetsContentInfo($content) * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContentSetsContentInfo */ public function testCreateContentSetsExpectedContentInfo($content) { $permissionResolver = $this->getRepository()->getPermissionResolver(); - $this->assertEquals( + self::assertEquals( [ $content->id, 28, // id of content type "forum" @@ -247,11 +256,12 @@ public function testCreateContentSetsExpectedContentInfo($content) * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContent */ public function testCreateContentSetsVersionInfo($content) { - $this->assertInstanceOf(VersionInfo::class, $content->getVersionInfo()); + self::assertInstanceOf(VersionInfo::class, $content->getVersionInfo()); return $content; } @@ -262,13 +272,14 @@ public function testCreateContentSetsVersionInfo($content) * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContentSetsVersionInfo */ public function testCreateContentSetsExpectedVersionInfo($content) { $currentUserReference = $this->getRepository()->getPermissionResolver()->getCurrentUserReference(); - $this->assertEquals( + self::assertEquals( [ 'status' => VersionInfo::STATUS_DRAFT, 'versionNo' => 1, @@ -282,9 +293,9 @@ public function testCreateContentSetsExpectedVersionInfo($content) 'initialLanguageCode' => $content->getVersionInfo()->initialLanguageCode, ] ); - $this->assertTrue($content->getVersionInfo()->isDraft()); - $this->assertFalse($content->getVersionInfo()->isPublished()); - $this->assertFalse($content->getVersionInfo()->isArchived()); + self::assertTrue($content->getVersionInfo()->isDraft()); + self::assertFalse($content->getVersionInfo()->isPublished()); + self::assertFalse($content->getVersionInfo()->isArchived()); } /** @@ -293,13 +304,14 @@ public function testCreateContentSetsExpectedVersionInfo($content) * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContent */ public function testCreateContentSetsExpectedContentType($content) { $contentType = $content->getContentType(); - $this->assertEquals( + self::assertEquals( [ $contentType->id, // Won't match as it's set to true in createContentDraftVersion1() @@ -337,15 +349,16 @@ public function testCreateContentWithContentTypeDefaultOptions(): void $location = $publishedContent->contentInfo->getMainLocation(); - $this->assertEquals($contentType->defaultSortField, $location->sortField); - $this->assertEquals($contentType->defaultSortOrder, $location->sortOrder); - $this->assertEquals($contentType->defaultAlwaysAvailable, $publishedContent->contentInfo->alwaysAvailable); + self::assertEquals($contentType->defaultSortField, $location->sortField); + self::assertEquals($contentType->defaultSortOrder, $location->sortOrder); + self::assertEquals($contentType->defaultAlwaysAvailable, $publishedContent->contentInfo->alwaysAvailable); } /** * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContent */ public function testCreateContentThrowsInvalidArgumentException() @@ -377,6 +390,7 @@ public function testCreateContentThrowsInvalidArgumentException() * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContent */ public function testCreateContentThrowsInvalidArgumentExceptionOnFieldTypeNotAccept() @@ -397,6 +411,7 @@ public function testCreateContentThrowsInvalidArgumentExceptionOnFieldTypeNotAcc * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContent */ public function testCreateContentThrowsContentFieldValidationException() @@ -420,6 +435,7 @@ public function testCreateContentThrowsContentFieldValidationException() * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContent */ public function testCreateContentRequiredFieldMissing() @@ -444,7 +460,9 @@ public function testCreateContentRequiredFieldMissing() * here. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent + * * @depends testCreateContent + * * @group user */ public function testCreateContentWithLocationCreateParameterDoesNotCreateLocationImmediately() @@ -461,6 +479,7 @@ public function testCreateContentWithLocationCreateParameterDoesNotCreateLocatio * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent($contentCreateStruct, $locationCreateStructs) + * * @depends testCreateContentWithLocationCreateParameterDoesNotCreateLocationImmediately */ public function testCreateContentThrowsInvalidArgumentExceptionWithLocationCreateParameter() @@ -515,6 +534,7 @@ public function testCreateContentThrowsInvalidArgumentExceptionWithLocationCreat * Test for the loadContentInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentInfo() + * * @group user */ public function testLoadContentInfo() @@ -524,7 +544,7 @@ public function testLoadContentInfo() // Load the ContentInfo for "Media" folder $contentInfo = $this->contentService->loadContentInfo($mediaFolderId); - $this->assertInstanceOf(ContentInfo::class, $contentInfo); + self::assertInstanceOf(ContentInfo::class, $contentInfo); return $contentInfo; } @@ -533,6 +553,7 @@ public function testLoadContentInfo() * Test for the returned value of the loadContentInfo() method. * * @depends testLoadContentInfo + * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentInfo * * @param \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo @@ -547,6 +568,7 @@ public function testLoadContentInfoSetsExpectedContentInfo(ContentInfo $contentI /** * @depends testLoadContentInfo + * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentInfo * * @param \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo @@ -555,12 +577,13 @@ public function testLoadContentInfoGetContentType(ContentInfo $contentInfo): voi { $contentType = $contentInfo->getContentType(); - $this->assertInstanceOf(ContentType::class, $contentType); - $this->assertEquals('folder', $contentType->identifier); + self::assertInstanceOf(ContentType::class, $contentType); + self::assertEquals('folder', $contentType->identifier); } /** * @depends testLoadContentInfo + * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentInfo * * @param \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo @@ -569,12 +592,13 @@ public function testLoadContentInfoGetSection(ContentInfo $contentInfo): void { $section = $contentInfo->getSection(); - $this->assertInstanceOf(Section::class, $section); - $this->assertEquals('media', $section->identifier); + self::assertInstanceOf(Section::class, $section); + self::assertEquals('media', $section->identifier); } /** * @depends testLoadContentInfo + * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentInfo * * @param \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo @@ -583,12 +607,13 @@ public function testLoadContentInfoGetMainLanguage(ContentInfo $contentInfo): vo { $language = $contentInfo->getMainLanguage(); - $this->assertInstanceOf(Language::class, $language); - $this->assertEquals('eng-US', $language->languageCode); + self::assertInstanceOf(Language::class, $language); + self::assertEquals('eng-US', $language->languageCode); } /** * @depends testLoadContentInfo + * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentInfo * * @param \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo @@ -597,12 +622,13 @@ public function testLoadContentInfoGetMainLocation(ContentInfo $contentInfo): vo { $mainLocation = $contentInfo->getMainLocation(); - $this->assertInstanceOf(Location::class, $mainLocation); - $this->assertEquals('75c715a51699d2d309a924eca6a95145', $mainLocation->remoteId); + self::assertInstanceOf(Location::class, $mainLocation); + self::assertEquals('75c715a51699d2d309a924eca6a95145', $mainLocation->remoteId); } /** * @depends testLoadContentInfo + * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentInfo * * @param \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo @@ -611,14 +637,15 @@ public function testLoadContentInfoSetsExpectedOwnerProxy(ContentInfo $contentIn { $owner = $contentInfo->getOwner(); - $this->assertInstanceOf(User::class, $owner); - $this->assertEquals('Administrator User', $owner->getName()); + self::assertInstanceOf(User::class, $owner); + self::assertEquals('Administrator User', $owner->getName()); } /** * Test for the loadContentInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentInfo() + * * @depends testLoadContentInfo */ public function testLoadContentInfoThrowsNotFoundException() @@ -640,9 +667,9 @@ public function testLoadContentInfoList() $mediaFolderId = $this->generateId('object', self::MEDIA_CONTENT_ID); $list = $this->contentService->loadContentInfoList([$mediaFolderId]); - $this->assertCount(1, $list); - $this->assertEquals([$mediaFolderId], array_keys($list), 'Array key was not content id'); - $this->assertInstanceOf( + self::assertCount(1, $list); + self::assertEquals([$mediaFolderId], array_keys($list), 'Array key was not content id'); + self::assertInstanceOf( ContentInfo::class, $list[$mediaFolderId] ); @@ -652,6 +679,7 @@ public function testLoadContentInfoList() * Test for the loadContentInfoList() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentInfoList() + * * @depends testLoadContentInfoList */ public function testLoadContentInfoListSkipsNotFoundItems() @@ -659,7 +687,7 @@ public function testLoadContentInfoListSkipsNotFoundItems() $nonExistentContentId = $this->generateId('object', self::DB_INT_MAX); $list = $this->contentService->loadContentInfoList([$nonExistentContentId]); - $this->assertCount(0, $list); + self::assertCount(0, $list); } /** @@ -672,7 +700,7 @@ public function testLoadContentInfoByRemoteId() // Load the ContentInfo for "Media" folder $contentInfo = $this->contentService->loadContentInfoByRemoteId('faaeb9be3bd98ed09f606fc16d144eca'); - $this->assertInstanceOf(ContentInfo::class, $contentInfo); + self::assertInstanceOf(ContentInfo::class, $contentInfo); return $contentInfo; } @@ -681,6 +709,7 @@ public function testLoadContentInfoByRemoteId() * Test for the returned value of the loadContentInfoByRemoteId() method. * * @depends testLoadContentInfoByRemoteId + * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentInfoByRemoteId * * @param \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo @@ -711,6 +740,7 @@ public function testLoadContentInfoByRemoteIdSetsExpectedContentInfo(ContentInfo * Test for the loadContentInfoByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentInfoByRemoteId() + * * @depends testLoadContentInfoByRemoteId */ public function testLoadContentInfoByRemoteIdThrowsNotFoundException() @@ -724,7 +754,9 @@ public function testLoadContentInfoByRemoteIdThrowsNotFoundException() * Test for the loadVersionInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersionInfo() + * * @depends testLoadContentInfo + * * @group user */ public function testLoadVersionInfo() @@ -738,7 +770,7 @@ public function testLoadVersionInfo() // Now load the current version info of the "Media" folder $versionInfo = $this->contentService->loadVersionInfo($contentInfo); - $this->assertInstanceOf( + self::assertInstanceOf( VersionInfo::class, $versionInfo ); @@ -757,7 +789,7 @@ public function testLoadVersionInfoById() // Load the VersionInfo for "Media" folder $versionInfo = $this->contentService->loadVersionInfoById($mediaFolderId); - $this->assertInstanceOf( + self::assertInstanceOf( VersionInfo::class, $versionInfo ); @@ -769,6 +801,7 @@ public function testLoadVersionInfoById() * Test for the returned value of the loadVersionInfoById() method. * * @depends testLoadVersionInfoById + * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersionInfoById * * @param \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo $versionInfo @@ -794,9 +827,9 @@ public function testLoadVersionInfoByIdSetsExpectedVersionInfo(VersionInfo $vers ], $versionInfo ); - $this->assertTrue($versionInfo->isPublished()); - $this->assertFalse($versionInfo->isDraft()); - $this->assertFalse($versionInfo->isArchived()); + self::assertTrue($versionInfo->isPublished()); + self::assertFalse($versionInfo->isDraft()); + self::assertFalse($versionInfo->isArchived()); } /** @@ -808,12 +841,13 @@ public function testLoadVersionInfoByIdGetCreator(VersionInfo $versionInfo): voi { $creator = $versionInfo->getCreator(); - $this->assertInstanceOf(User::class, $creator); - $this->assertEquals('Administrator User', $creator->getName()); + self::assertInstanceOf(User::class, $creator); + self::assertEquals('Administrator User', $creator->getName()); } /** * @depends testLoadVersionInfoById + * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersionInfoById * * @param \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo $versionInfo @@ -822,8 +856,8 @@ public function testLoadVersionInfoByIdGetInitialLanguage(VersionInfo $versionIn { $initialLanguage = $versionInfo->getInitialLanguage(); - $this->assertInstanceOf(Language::class, $initialLanguage); - $this->assertEquals('eng-US', $initialLanguage->languageCode); + self::assertInstanceOf(Language::class, $initialLanguage); + self::assertEquals('eng-US', $initialLanguage->languageCode); } /** @@ -837,7 +871,7 @@ public function testLoadVersionInfoByIdGetLanguages(VersionInfo $versionInfo): v $expectedLanguages = ['eng-US']; foreach ($expectedLanguages as $i => $expectedLanguage) { - $this->assertEquals($expectedLanguage, $actualLanguages[$i]->languageCode); + self::assertEquals($expectedLanguage, $actualLanguages[$i]->languageCode); } } @@ -845,6 +879,7 @@ public function testLoadVersionInfoByIdGetLanguages(VersionInfo $versionInfo): v * Test for the loadVersionInfoById() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersionInfoById() + * * @depends testLoadVersionInfoById */ public function testLoadVersionInfoByIdThrowsNotFoundException() @@ -860,6 +895,7 @@ public function testLoadVersionInfoByIdThrowsNotFoundException() * Test for the loadContentByContentInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByContentInfo() + * * @depends testLoadContentInfo */ public function testLoadContentByContentInfo() @@ -873,7 +909,7 @@ public function testLoadContentByContentInfo() // Now load the current content version for the info instance $content = $this->contentService->loadContentByContentInfo($contentInfo); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $content ); @@ -883,6 +919,7 @@ public function testLoadContentByContentInfo() * Test for the loadContentByVersionInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByVersionInfo() + * * @depends testLoadVersionInfo */ public function testLoadContentByVersionInfo() @@ -899,7 +936,7 @@ public function testLoadContentByVersionInfo() // Now load the current content version for the info instance $content = $this->contentService->loadContentByVersionInfo($versionInfo); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $content ); @@ -909,6 +946,7 @@ public function testLoadContentByVersionInfo() * Test for the loadContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContent() + * * @group user * @group field-type */ @@ -920,7 +958,7 @@ public function testLoadContent() // Load the Content for "Media" folder, any language and current version $content = $this->contentService->loadContent($mediaFolderId); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $content ); @@ -930,6 +968,7 @@ public function testLoadContent() * Test for the loadContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContent() + * * @depends testLoadContent */ public function testLoadContentThrowsNotFoundException() @@ -964,6 +1003,7 @@ public function contentRemoteIdVersionLanguageProvider() * Test for the loadContentByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByRemoteId + * * @dataProvider contentRemoteIdVersionLanguageProvider * * @param string $remoteId @@ -974,22 +1014,23 @@ public function testLoadContentByRemoteId($remoteId, $languages, $versionNo) { $content = $this->contentService->loadContentByRemoteId($remoteId, $languages, $versionNo); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $content ); - $this->assertEquals($remoteId, $content->contentInfo->remoteId); + self::assertEquals($remoteId, $content->contentInfo->remoteId); if ($languages !== null) { - $this->assertEquals($languages, $content->getVersionInfo()->languageCodes); + self::assertEquals($languages, $content->getVersionInfo()->languageCodes); } - $this->assertEquals($versionNo ?: 1, $content->getVersionInfo()->versionNo); + self::assertEquals($versionNo ?: 1, $content->getVersionInfo()->versionNo); } /** * Test for the loadContentByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByRemoteId() + * * @depends testLoadContentByRemoteId */ public function testLoadContentByRemoteIdThrowsNotFoundException() @@ -1006,10 +1047,12 @@ public function testLoadContentByRemoteIdThrowsNotFoundException() * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::publishVersion() + * * @depends testLoadContent * @depends testLoadContentInfo * @depends testLoadVersionInfo * @depends testCreateContentWithLocationCreateParameterDoesNotCreateLocationImmediately + * * @group user * @group field-type */ @@ -1018,14 +1061,14 @@ public function testPublishVersion() $time = time(); $content = $this->createContentVersion1(); - $this->assertInstanceOf(Content::class, $content); - $this->assertTrue($content->contentInfo->published); - $this->assertEquals(VersionInfo::STATUS_PUBLISHED, $content->versionInfo->status); - $this->assertGreaterThanOrEqual($time, $content->contentInfo->publishedDate->getTimestamp()); - $this->assertGreaterThanOrEqual($time, $content->contentInfo->modificationDate->getTimestamp()); - $this->assertTrue($content->versionInfo->isPublished()); - $this->assertFalse($content->versionInfo->isDraft()); - $this->assertFalse($content->versionInfo->isArchived()); + self::assertInstanceOf(Content::class, $content); + self::assertTrue($content->contentInfo->published); + self::assertEquals(VersionInfo::STATUS_PUBLISHED, $content->versionInfo->status); + self::assertGreaterThanOrEqual($time, $content->contentInfo->publishedDate->getTimestamp()); + self::assertGreaterThanOrEqual($time, $content->contentInfo->modificationDate->getTimestamp()); + self::assertTrue($content->versionInfo->isPublished()); + self::assertFalse($content->versionInfo->isDraft()); + self::assertFalse($content->versionInfo->isArchived()); return $content; } @@ -1036,13 +1079,14 @@ public function testPublishVersion() * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::publishVersion() + * * @depends testPublishVersion */ public function testPublishVersionSetsExpectedContentInfo($content) { $userReference = $this->getRepository()->getPermissionResolver()->getCurrentUserReference(); - $this->assertEquals( + self::assertEquals( [ $content->id, true, @@ -1063,9 +1107,9 @@ public function testPublishVersionSetsExpectedContentInfo($content) ] ); - $this->assertNotNull($content->contentInfo->mainLocationId); + self::assertNotNull($content->contentInfo->mainLocationId); $date = new \DateTime('1984/01/01'); - $this->assertGreaterThan( + self::assertGreaterThan( $date->getTimestamp(), $content->contentInfo->publishedDate->getTimestamp() ); @@ -1077,13 +1121,14 @@ public function testPublishVersionSetsExpectedContentInfo($content) * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::publishVersion() + * * @depends testPublishVersion */ public function testPublishVersionSetsExpectedVersionInfo($content) { $currentUserReference = $this->getRepository()->getPermissionResolver()->getCurrentUserReference(); - $this->assertEquals( + self::assertEquals( [ $currentUserReference->getUserId(), self::ENG_US, @@ -1099,15 +1144,15 @@ public function testPublishVersionSetsExpectedVersionInfo($content) ); $date = new \DateTime('1984/01/01'); - $this->assertGreaterThan( + self::assertGreaterThan( $date->getTimestamp(), $content->getVersionInfo()->modificationDate->getTimestamp() ); - $this->assertNotNull($content->getVersionInfo()->modificationDate); - $this->assertTrue($content->getVersionInfo()->isPublished()); - $this->assertFalse($content->getVersionInfo()->isDraft()); - $this->assertFalse($content->getVersionInfo()->isArchived()); + self::assertNotNull($content->getVersionInfo()->modificationDate); + self::assertTrue($content->getVersionInfo()->isPublished()); + self::assertFalse($content->getVersionInfo()->isDraft()); + self::assertFalse($content->getVersionInfo()->isArchived()); } /** @@ -1116,13 +1161,14 @@ public function testPublishVersionSetsExpectedVersionInfo($content) * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::publishVersion() + * * @depends testPublishVersion */ public function testPublishVersionSetsExpectedContentType($content) { $contentType = $content->getContentType(); - $this->assertEquals( + self::assertEquals( [ $contentType->id, // won't be a match as it's set to true in createContentDraftVersion1() @@ -1152,7 +1198,7 @@ public function testPublishVersionCreatesLocationsDefinedOnCreate(): array '0123456789abcdef0123456789abcdef' ); - $this->assertEquals( + self::assertEquals( $location->getContentInfo(), $content->getVersionInfo()->getContentInfo() ); @@ -1164,6 +1210,7 @@ public function testPublishVersionCreatesLocationsDefinedOnCreate(): array * Test for the publishVersion() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::publishVersion() + * * @depends testPublishVersionCreatesLocationsDefinedOnCreate */ public function testCreateContentWithLocationCreateParameterCreatesExpectedLocation(array $testData) @@ -1197,6 +1244,7 @@ public function testCreateContentWithLocationCreateParameterCreatesExpectedLocat * Test for the publishVersion() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::publishVersion() + * * @depends testPublishVersion */ public function testPublishVersionThrowsBadStateException() @@ -1230,11 +1278,11 @@ public function testPublishVersionDoesNotChangePublishedDate() $contentDraft = $this->contentService->updateContent($contentDraft->versionInfo, $contentUpdateStruct); $republishedContent = $this->contentService->publishVersion($contentDraft->versionInfo); - $this->assertEquals( + self::assertEquals( $publishedContent->contentInfo->publishedDate->getTimestamp(), $republishedContent->contentInfo->publishedDate->getTimestamp() ); - $this->assertGreaterThan( + self::assertGreaterThan( $publishedContent->contentInfo->modificationDate->getTimestamp(), $republishedContent->contentInfo->modificationDate->getTimestamp() ); @@ -1246,7 +1294,9 @@ public function testPublishVersionDoesNotChangePublishedDate() * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft() + * * @depends testPublishVersion + * * @group user */ public function testCreateContentDraft() @@ -1256,7 +1306,7 @@ public function testCreateContentDraft() // Now we create a new draft from the published content $draftedContent = $this->contentService->createContentDraft($content->contentInfo); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $draftedContent ); @@ -1283,8 +1333,8 @@ public function testCreateContentDraftInOtherLanguage() $language ); - $this->assertEquals('eng-US', $content->versionInfo->initialLanguageCode); - $this->assertEquals('eng-GB', $draftedContent->versionInfo->initialLanguageCode); + self::assertEquals('eng-US', $content->versionInfo->initialLanguageCode); + self::assertEquals('eng-GB', $draftedContent->versionInfo->initialLanguageCode); } /** @@ -1294,7 +1344,9 @@ public function testCreateContentDraftInOtherLanguage() * Note: Editors have access to version_read, which is needed to load content drafts. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft() + * * @depends testPublishVersion + * * @group user */ public function testCreateContentDraftAndLoadAccess() @@ -1310,7 +1362,7 @@ public function testCreateContentDraftAndLoadAccess() // Try to load the draft $loadedDraft = $this->contentService->loadContent($draft->id); - $this->assertEquals($draft->id, $loadedDraft->id); + self::assertEquals($draft->id, $loadedDraft->id); } /** @@ -1319,11 +1371,12 @@ public function testCreateContentDraftAndLoadAccess() * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $draft * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft() + * * @depends testCreateContentDraft */ public function testCreateContentDraftSetsExpectedProperties($draft) { - $this->assertEquals( + self::assertEquals( [ 'fieldCount' => 1, 'relationCount' => 0, @@ -1341,6 +1394,7 @@ public function testCreateContentDraftSetsExpectedProperties($draft) * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $draft * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft() + * * @depends testCreateContentDraft */ public function testCreateContentDraftSetsContentInfo($draft) @@ -1348,7 +1402,7 @@ public function testCreateContentDraftSetsContentInfo($draft) $contentInfo = $draft->contentInfo; $currentUserReference = $this->getRepository()->getPermissionResolver()->getCurrentUserReference(); - $this->assertEquals( + self::assertEquals( [ $draft->id, true, @@ -1376,6 +1430,7 @@ public function testCreateContentDraftSetsContentInfo($draft) * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $draft * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft() + * * @depends testCreateContentDraft */ public function testCreateContentDraftSetsVersionInfo($draft) @@ -1383,7 +1438,7 @@ public function testCreateContentDraftSetsVersionInfo($draft) $versionInfo = $draft->getVersionInfo(); $currentUserReference = $this->getRepository()->getPermissionResolver()->getCurrentUserReference(); - $this->assertEquals( + self::assertEquals( [ 'creatorId' => $currentUserReference->getUserId(), 'initialLanguageCode' => self::ENG_US, @@ -1399,9 +1454,9 @@ public function testCreateContentDraftSetsVersionInfo($draft) 'versionNo' => $versionInfo->versionNo, ] ); - $this->assertTrue($versionInfo->isDraft()); - $this->assertFalse($versionInfo->isPublished()); - $this->assertFalse($versionInfo->isArchived()); + self::assertTrue($versionInfo->isDraft()); + self::assertFalse($versionInfo->isPublished()); + self::assertFalse($versionInfo->isArchived()); } /** @@ -1410,6 +1465,7 @@ public function testCreateContentDraftSetsVersionInfo($draft) * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $draft * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft() + * * @depends testCreateContentDraft * @depends testLoadVersionInfo */ @@ -1423,13 +1479,14 @@ public function testCreateContentDraftLoadVersionInfoStillLoadsPublishedVersion( // This call will still load the published version $versionInfoPublished = $this->contentService->loadVersionInfo($content->contentInfo); - $this->assertEquals(1, $versionInfoPublished->versionNo); + self::assertEquals(1, $versionInfoPublished->versionNo); } /** * Test for the createContentDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft() + * * @depends testLoadContent * @depends testCreateContentDraft */ @@ -1443,13 +1500,14 @@ public function testCreateContentDraftLoadContentStillLoadsPublishedVersion() // This call will still load the published content version $contentPublished = $this->contentService->loadContent($content->id); - $this->assertEquals(1, $contentPublished->getVersionInfo()->versionNo); + self::assertEquals(1, $contentPublished->getVersionInfo()->versionNo); } /** * Test for the createContentDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft() + * * @depends testLoadContentByRemoteId * @depends testCreateContentDraft */ @@ -1463,13 +1521,14 @@ public function testCreateContentDraftLoadContentByRemoteIdStillLoadsPublishedVe // This call will still load the published content version $contentPublished = $this->contentService->loadContentByRemoteId('abcdef0123456789abcdef0123456789'); - $this->assertEquals(1, $contentPublished->getVersionInfo()->versionNo); + self::assertEquals(1, $contentPublished->getVersionInfo()->versionNo); } /** * Test for the createContentDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft() + * * @depends testLoadContentByContentInfo * @depends testCreateContentDraft */ @@ -1483,20 +1542,21 @@ public function testCreateContentDraftLoadContentByContentInfoStillLoadsPublishe // This call will still load the published content version $contentPublished = $this->contentService->loadContentByContentInfo($content->contentInfo); - $this->assertEquals(1, $contentPublished->getVersionInfo()->versionNo); + self::assertEquals(1, $contentPublished->getVersionInfo()->versionNo); } /** * Test for the newContentUpdateStruct() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::newContentUpdateStruct + * * @group user */ public function testNewContentUpdateStruct() { $updateStruct = $this->contentService->newContentUpdateStruct(); - $this->assertInstanceOf( + self::assertInstanceOf( ContentUpdateStruct::class, $updateStruct ); @@ -1516,8 +1576,10 @@ public function testNewContentUpdateStruct() * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testNewContentUpdateStruct * @depends testCreateContentDraft + * * @group user * @group field-type */ @@ -1525,12 +1587,12 @@ public function testUpdateContent() { $draftVersion2 = $this->createUpdatedDraftVersion2(); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $draftVersion2 ); - $this->assertEquals( + self::assertEquals( $this->generateId('user', 10), $draftVersion2->versionInfo->creatorId, 'creatorId is not properly set on new Version' @@ -1545,8 +1607,10 @@ public function testUpdateContent() * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testNewContentUpdateStruct * @depends testCreateContentDraft + * * @group user * @group field-type */ @@ -1554,12 +1618,12 @@ public function testUpdateContentWithDifferentUser() { $arrayWithDraftVersion2 = $this->createUpdatedDraftVersion2NotAdmin(); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $arrayWithDraftVersion2[0] ); - $this->assertEquals( + self::assertEquals( $this->generateId('user', $arrayWithDraftVersion2[1]), $arrayWithDraftVersion2[0]->versionInfo->creatorId, 'creatorId is not properly set on new Version' @@ -1574,6 +1638,7 @@ public function testUpdateContentWithDifferentUser() * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testUpdateContent */ public function testUpdateContentSetsExpectedFields($content) @@ -1601,13 +1666,14 @@ public function testUpdateContentSetsExpectedFields($content) ), ]; - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } /** * Test for the updateContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testUpdateContent */ public function testUpdateContentThrowsBadStateException() @@ -1634,6 +1700,7 @@ public function testUpdateContentThrowsBadStateException() * Test for the updateContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testUpdateContent */ public function testUpdateContentThrowsInvalidArgumentExceptionWhenFieldTypeDoesNotAccept() @@ -1657,6 +1724,7 @@ public function testUpdateContentThrowsInvalidArgumentExceptionWhenFieldTypeDoes * Test for the updateContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testUpdateContent */ public function testUpdateContentWhenMandatoryFieldIsEmpty() @@ -1683,6 +1751,7 @@ public function testUpdateContentWhenMandatoryFieldIsEmpty() * Test for the updateContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testUpdateContent */ public function testUpdateContentThrowsContentFieldValidationException() @@ -1709,6 +1778,7 @@ public function testUpdateContentThrowsContentFieldValidationException() * Test for the updateContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testUpdateContent */ public function testUpdateContentValidatorIgnoresRequiredFieldsOfNotUpdatedLanguages() @@ -1750,6 +1820,7 @@ public function testUpdateContentValidatorIgnoresRequiredFieldsOfNotUpdatedLangu * Test for the updateContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testUpdateContent */ public function testUpdateContentWithNotUpdatingMandatoryField() @@ -1775,7 +1846,7 @@ public function testUpdateContentWithNotUpdatingMandatoryField() return; } } - $this->fail( + self::fail( 'Field with identifier "name" in language "eng-US" could not be found or has empty value.' ); } @@ -1784,6 +1855,7 @@ public function testUpdateContentWithNotUpdatingMandatoryField() * Test for the createContentDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft($contentInfo, $versionInfo) + * * @depends testUpdateContent */ public function testCreateContentDraftWithSecondParameter() @@ -1796,7 +1868,7 @@ public function testCreateContentDraftWithSecondParameter() $contentVersion2->getVersionInfo() ); - $this->assertEquals(3, $draftedContentReloaded->getVersionInfo()->versionNo); + self::assertEquals(3, $draftedContentReloaded->getVersionInfo()->versionNo); } /** @@ -1815,7 +1887,7 @@ public function testCreateContentDraftWithThirdParameter() $user ); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $draftContent ); @@ -1825,6 +1897,7 @@ public function testCreateContentDraftWithThirdParameter() * Test for the publishVersion() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::publishVersion() + * * @depends testPublishVersion * @depends testUpdateContent */ @@ -1834,7 +1907,7 @@ public function testPublishVersionFromContentDraft() $versionInfo = $this->contentService->loadVersionInfo($contentVersion2->contentInfo); - $this->assertEquals( + self::assertEquals( [ 'status' => VersionInfo::STATUS_PUBLISHED, 'versionNo' => 2, @@ -1844,15 +1917,16 @@ public function testPublishVersionFromContentDraft() 'versionNo' => $versionInfo->versionNo, ] ); - $this->assertTrue($versionInfo->isPublished()); - $this->assertFalse($versionInfo->isDraft()); - $this->assertFalse($versionInfo->isArchived()); + self::assertTrue($versionInfo->isPublished()); + self::assertFalse($versionInfo->isDraft()); + self::assertFalse($versionInfo->isArchived()); } /** * Test for the publishVersion() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::publishVersion() + * * @depends testPublishVersionFromContentDraft */ public function testPublishVersionFromContentDraftArchivesOldVersion() @@ -1861,7 +1935,7 @@ public function testPublishVersionFromContentDraftArchivesOldVersion() $versionInfo = $this->contentService->loadVersionInfo($contentVersion2->contentInfo, 1); - $this->assertEquals( + self::assertEquals( [ 'status' => VersionInfo::STATUS_ARCHIVED, 'versionNo' => 1, @@ -1871,28 +1945,30 @@ public function testPublishVersionFromContentDraftArchivesOldVersion() 'versionNo' => $versionInfo->versionNo, ] ); - $this->assertTrue($versionInfo->isArchived()); - $this->assertFalse($versionInfo->isDraft()); - $this->assertFalse($versionInfo->isPublished()); + self::assertTrue($versionInfo->isArchived()); + self::assertFalse($versionInfo->isDraft()); + self::assertFalse($versionInfo->isPublished()); } /** * Test for the publishVersion() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::publishVersion() + * * @depends testPublishVersionFromContentDraft */ public function testPublishVersionFromContentDraftUpdatesContentInfoCurrentVersion() { $contentVersion2 = $this->createContentVersion2(); - $this->assertEquals(2, $contentVersion2->contentInfo->currentVersionNo); + self::assertEquals(2, $contentVersion2->contentInfo->currentVersionNo); } /** * Test for the publishVersion() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::publishVersion() + * * @depends testPublishVersionFromContentDraft */ public function testPublishVersionFromOldContentDraftArchivesNewerVersionNo() @@ -1912,7 +1988,7 @@ public function testPublishVersionFromOldContentDraftArchivesNewerVersionNo() // currentVersionNo is now 2, versionNo 3 will be archived $publishedDraft = $this->contentService->publishVersion($draftedContentVersion2->getVersionInfo()); - $this->assertEquals(2, $publishedDraft->contentInfo->currentVersionNo); + self::assertEquals(2, $publishedDraft->contentInfo->currentVersionNo); } /** @@ -1921,6 +1997,7 @@ public function testPublishVersionFromOldContentDraftArchivesNewerVersionNo() * @todo Adapt this when per content type archive limited is added on repository content type model. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::publishVersion() + * * @depends testPublishVersionFromContentDraft */ public function testPublishVersionNotCreatingUnlimitedArchives() @@ -1929,8 +2006,8 @@ public function testPublishVersionNotCreatingUnlimitedArchives() // load first to make sure list gets updated also (cache) $versionInfoList = $this->contentService->loadVersions($content->contentInfo); - $this->assertCount(1, $versionInfoList); - $this->assertEquals(1, $versionInfoList[0]->versionNo); + self::assertCount(1, $versionInfoList); + self::assertEquals(1, $versionInfoList[0]->versionNo); // Create a new draft with versionNo = 2 $draftedContentVersion = $this->contentService->createContentDraft($content->contentInfo); @@ -1958,11 +2035,11 @@ public function testPublishVersionNotCreatingUnlimitedArchives() $versionInfoList = $this->contentService->loadVersions($content->contentInfo); - $this->assertCount(6, $versionInfoList); - $this->assertEquals(2, $versionInfoList[0]->versionNo); - $this->assertEquals(7, $versionInfoList[5]->versionNo); + self::assertCount(6, $versionInfoList); + self::assertEquals(2, $versionInfoList[0]->versionNo); + self::assertEquals(7, $versionInfoList[5]->versionNo); - $this->assertEquals( + self::assertEquals( [ VersionInfo::STATUS_ARCHIVED, VersionInfo::STATUS_ARCHIVED, @@ -1986,6 +2063,7 @@ public function testPublishVersionNotCreatingUnlimitedArchives() * Test for the newContentMetadataUpdateStruct() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::newContentMetadataUpdateStruct + * * @group user */ public function testNewContentMetadataUpdateStruct() @@ -1994,14 +2072,14 @@ public function testNewContentMetadataUpdateStruct() $metadataUpdate = $this->contentService->newContentMetadataUpdateStruct(); foreach ($metadataUpdate as $propertyName => $propertyValue) { - $this->assertNull($propertyValue, "Property '{$propertyName}' initial value should be null'"); + self::assertNull($propertyValue, "Property '{$propertyName}' initial value should be null'"); } $metadataUpdate->remoteId = 'aaaabbbbccccddddeeeeffff11112222'; $metadataUpdate->mainLanguageCode = self::ENG_GB; $metadataUpdate->alwaysAvailable = false; - $this->assertInstanceOf( + self::assertInstanceOf( ContentMetadataUpdateStruct::class, $metadataUpdate ); @@ -2013,8 +2091,10 @@ public function testNewContentMetadataUpdateStruct() * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContentMetadata() + * * @depends testPublishVersion * @depends testNewContentMetadataUpdateStruct + * * @group user */ public function testUpdateContentMetadata() @@ -2036,7 +2116,7 @@ public function testUpdateContentMetadata() $metadataUpdate ); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $content ); @@ -2050,6 +2130,7 @@ public function testUpdateContentMetadata() * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContentMetadata() + * * @depends testUpdateContentMetadata */ public function testUpdateContentMetadataSetsExpectedProperties($content) @@ -2057,7 +2138,7 @@ public function testUpdateContentMetadataSetsExpectedProperties($content) $contentInfo = $content->contentInfo; $currentUserReference = $this->getRepository()->getPermissionResolver()->getCurrentUserReference(); - $this->assertEquals( + self::assertEquals( [ 'remoteId' => 'aaaabbbbccccddddeeeeffff11112222', 'sectionId' => $this->generateId('section', 1), @@ -2089,17 +2170,19 @@ public function testUpdateContentMetadataSetsExpectedProperties($content) * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContentMetadata() + * * @depends testUpdateContentMetadata */ public function testUpdateContentMetadataNotUpdatesContentVersion($content) { - $this->assertEquals(1, $content->getVersionInfo()->versionNo); + self::assertEquals(1, $content->getVersionInfo()->versionNo); } /** * Test for the updateContentMetadata() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContentMetadata() + * * @depends testUpdateContentMetadata */ public function testUpdateContentMetadataThrowsInvalidArgumentExceptionOnDuplicateRemoteId() @@ -2226,6 +2309,7 @@ public function testUpdateContentMainTranslation(): void * Test for the deleteContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::deleteContent() + * * @depends testPublishVersionFromContentDraft */ public function testDeleteContent() @@ -2252,6 +2336,7 @@ public function testDeleteContent() * "contentService: Unable to delete a content with an empty file attribute" * * @covers \Ibexa\Contracts\Core\Repository\ContentService::deleteContent() + * * @depends testPublishVersionFromContentDraft */ public function testDeleteContentWithEmptyBinaryField() @@ -2273,7 +2358,7 @@ public function testDeleteContentWithEmptyBinaryField() public function testCountContentDraftsReturnsZeroByDefault(): void { - $this->assertSame(0, $this->contentService->countContentDrafts()); + self::assertSame(0, $this->contentService->countContentDrafts()); } public function testCountContentDrafts(): void @@ -2281,7 +2366,7 @@ public function testCountContentDrafts(): void // Create 5 drafts $this->createContentDrafts(5); - $this->assertSame(5, $this->contentService->countContentDrafts()); + self::assertSame(5, $this->contentService->countContentDrafts()); } public function testCountContentDraftsForUsers(): void @@ -2312,8 +2397,8 @@ public function testCountContentDraftsForUsers(): void $newUserDrafts = $this->contentService->countContentDrafts($newUser); $previousUserDrafts = $this->contentService->countContentDrafts(); - $this->assertSame(1, $newUserDrafts); - $this->assertSame(0, $previousUserDrafts); + self::assertSame(1, $newUserDrafts); + self::assertSame(0, $previousUserDrafts); } /** @@ -2325,13 +2410,14 @@ public function testLoadContentDraftsReturnsEmptyArrayByDefault() { $contentDrafts = $this->contentService->loadContentDrafts(); - $this->assertSame([], $contentDrafts); + self::assertSame([], $contentDrafts); } /** * Test for the loadContentDrafts() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentDrafts() + * * @depends testCreateContentDraft */ public function testLoadContentDrafts() @@ -2357,7 +2443,7 @@ public function testLoadContentDrafts() ]; sort($actual, SORT_STRING); - $this->assertEquals( + self::assertEquals( [ VersionInfo::STATUS_DRAFT, VersionInfo::STATUS_DRAFT, @@ -2396,9 +2482,9 @@ public function testLoadContentDraftsWithFirstParameter() $newCurrentUserDrafts = $this->contentService->loadContentDrafts($user); $oldCurrentUserDrafts = $this->contentService->loadContentDrafts(); - $this->assertSame([], $oldCurrentUserDrafts); + self::assertSame([], $oldCurrentUserDrafts); - $this->assertEquals( + self::assertEquals( [ VersionInfo::STATUS_DRAFT, self::MEDIA_REMOTE_ID, @@ -2408,9 +2494,9 @@ public function testLoadContentDraftsWithFirstParameter() $newCurrentUserDrafts[0]->getContentInfo()->remoteId, ] ); - $this->assertTrue($newCurrentUserDrafts[0]->isDraft()); - $this->assertFalse($newCurrentUserDrafts[0]->isArchived()); - $this->assertFalse($newCurrentUserDrafts[0]->isPublished()); + self::assertTrue($newCurrentUserDrafts[0]->isDraft()); + self::assertFalse($newCurrentUserDrafts[0]->isArchived()); + self::assertFalse($newCurrentUserDrafts[0]->isPublished()); } /** @@ -2431,12 +2517,12 @@ public function testLoadContentDraftListWithPaginationParameters() $draftsOnPage1 = $this->contentService->loadContentDraftList(null, 0, 2); $draftsOnPage2 = $this->contentService->loadContentDraftList(null, 2, 2); - $this->assertSame(5, $draftsOnPage1->totalCount); - $this->assertSame(5, $draftsOnPage2->totalCount); - $this->assertEquals($draftContentE->getVersionInfo(), $draftsOnPage1->items[0]->getVersionInfo()); - $this->assertEquals($draftContentD->getVersionInfo(), $draftsOnPage1->items[1]->getVersionInfo()); - $this->assertEquals($draftContentC->getVersionInfo(), $draftsOnPage2->items[0]->getVersionInfo()); - $this->assertEquals($draftContentB->getVersionInfo(), $draftsOnPage2->items[1]->getVersionInfo()); + self::assertSame(5, $draftsOnPage1->totalCount); + self::assertSame(5, $draftsOnPage2->totalCount); + self::assertEquals($draftContentE->getVersionInfo(), $draftsOnPage1->items[0]->getVersionInfo()); + self::assertEquals($draftContentD->getVersionInfo(), $draftsOnPage1->items[1]->getVersionInfo()); + self::assertEquals($draftContentC->getVersionInfo(), $draftsOnPage2->items[0]->getVersionInfo()); + self::assertEquals($draftContentB->getVersionInfo(), $draftsOnPage2->items[1]->getVersionInfo()); } /** @@ -2461,10 +2547,10 @@ public function testLoadContentDraftListWithForUserWithLimitation() $contentDraftB = $this->contentService->createContentDraft($content->contentInfo); $newUserDraftList = $this->contentService->loadContentDraftList($newUser, 0); - $this->assertSame(3, $newUserDraftList->totalCount); - $this->assertEquals($contentDraftB->getVersionInfo(), $newUserDraftList->items[0]->getVersionInfo()); - $this->assertEquals($contentDraftA->getVersionInfo(), $newUserDraftList->items[1]->getVersionInfo()); - $this->assertEquals( + self::assertSame(3, $newUserDraftList->totalCount); + self::assertEquals($contentDraftB->getVersionInfo(), $newUserDraftList->items[0]->getVersionInfo()); + self::assertEquals($contentDraftA->getVersionInfo(), $newUserDraftList->items[1]->getVersionInfo()); + self::assertEquals( new UnauthorizedContentDraftListItem('content', 'versionread', ['contentId' => $contentDraftUnauthorized->id]), $newUserDraftList->items[2] ); @@ -2474,8 +2560,8 @@ public function testLoadContentDraftListWithForUserWithLimitation() $oldUserDraftList = $this->contentService->loadContentDraftList(); - $this->assertSame(0, $oldUserDraftList->totalCount); - $this->assertSame([], $oldUserDraftList->items); + self::assertSame(0, $oldUserDraftList->totalCount); + self::assertSame([], $oldUserDraftList->items); } /** @@ -2488,13 +2574,14 @@ public function testLoadAllContentDrafts() // Create more drafts then default pagination limit $this->createContentDrafts(12); - $this->assertCount(12, $this->contentService->loadContentDraftList()); + self::assertCount(12, $this->contentService->loadContentDraftList()); } /** * Test for the loadVersionInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersionInfo($contentInfo, $versionNo) + * * @depends testPublishVersionFromContentDraft */ public function testLoadVersionInfoWithSecondParameter() @@ -2506,10 +2593,10 @@ public function testLoadVersionInfoWithSecondParameter() // Will return the VersionInfo of the $draftContent $versionInfo = $this->contentService->loadVersionInfoById($publishedContent->id, 2); - $this->assertEquals(2, $versionInfo->versionNo); + self::assertEquals(2, $versionInfo->versionNo); // Check that ContentInfo contained in VersionInfo has correct main Location id set - $this->assertEquals( + self::assertEquals( $publishedContent->getVersionInfo()->getContentInfo()->mainLocationId, $versionInfo->getContentInfo()->mainLocationId ); @@ -2519,6 +2606,7 @@ public function testLoadVersionInfoWithSecondParameter() * Test for the loadVersionInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersionInfo($contentInfo, $versionNo) + * * @depends testLoadVersionInfoWithSecondParameter */ public function testLoadVersionInfoThrowsNotFoundExceptionWithSecondParameter() @@ -2535,6 +2623,7 @@ public function testLoadVersionInfoThrowsNotFoundExceptionWithSecondParameter() * Test for the loadVersionInfoById() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersionInfoById($contentId, $versionNo) + * * @depends testLoadVersionInfoWithSecondParameter */ public function testLoadVersionInfoByIdWithSecondParameter() @@ -2546,10 +2635,10 @@ public function testLoadVersionInfoByIdWithSecondParameter() // Will return the VersionInfo of the $draftContent $versionInfo = $this->contentService->loadVersionInfoById($publishedContent->id, 2); - $this->assertEquals(2, $versionInfo->versionNo); + self::assertEquals(2, $versionInfo->versionNo); // Check that ContentInfo contained in VersionInfo has correct main Location id set - $this->assertEquals( + self::assertEquals( $publishedContent->getVersionInfo()->getContentInfo()->mainLocationId, $versionInfo->getContentInfo()->mainLocationId ); @@ -2564,6 +2653,7 @@ public function testLoadVersionInfoByIdWithSecondParameter() * Test for the returned value of the loadVersionInfoById() method. * * @depends testLoadVersionInfoByIdWithSecondParameter + * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersionInfoById * * @param array $data @@ -2629,6 +2719,7 @@ public function testLoadVersionInfoByIdThrowsNotFoundExceptionWithSecondParamete * Test for the loadContentByVersionInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByVersionInfo($versionInfo, $languages) + * * @depends testCreateContent * @depends testLoadContentByVersionInfo */ @@ -2698,13 +2789,14 @@ static function ($field1, $field2) { ), ]; - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } /** * Test for the loadContentByContentInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByContentInfo($contentInfo, $languages) + * * @depends testLoadContentByContentInfo */ public function testLoadContentByContentInfoWithLanguageParameters() @@ -2755,7 +2847,7 @@ public function testLoadContentByContentInfoWithLanguageParameters() ), ]; - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); // Will return a content instance with fields in "eng-GB" (versions prior to 6.0.0-beta9 returned "eng-US" also) $reloadedContent = $this->contentService->loadContentByContentInfo( @@ -2781,7 +2873,7 @@ public function testLoadContentByContentInfoWithLanguageParameters() ), ]; - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); // Will return a content instance with fields in main language "eng-US", as "fre-FR" does not exists $reloadedContent = $this->contentService->loadContentByContentInfo( @@ -2807,13 +2899,14 @@ public function testLoadContentByContentInfoWithLanguageParameters() ), ]; - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } /** * Test for the loadContentByContentInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByContentInfo($contentInfo, $languages, $versionNo) + * * @depends testLoadContentByContentInfo */ public function testLoadContentByContentInfoWithVersionNumberParameter() @@ -2829,13 +2922,13 @@ public function testLoadContentByContentInfoWithVersionNumberParameter() 2 ); - $this->assertEquals( + self::assertEquals( 2, $draftContentReloaded->getVersionInfo()->versionNo ); // Check that ContentInfo contained in reloaded draft Content has correct main Location id set - $this->assertEquals( + self::assertEquals( $publishedContent->versionInfo->contentInfo->mainLocationId, $draftContentReloaded->versionInfo->contentInfo->mainLocationId ); @@ -2845,6 +2938,7 @@ public function testLoadContentByContentInfoWithVersionNumberParameter() * Test for the loadContentByContentInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByContentInfo($contentInfo, $languages, $versionNo) + * * @depends testLoadContentByContentInfoWithVersionNumberParameter */ public function testLoadContentByContentInfoThrowsNotFoundExceptionWithVersionNumberParameter() @@ -2861,6 +2955,7 @@ public function testLoadContentByContentInfoThrowsNotFoundExceptionWithVersionNu * Test for the loadContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContent($contentId, $languages) + * * @depends testPublishVersionFromContentDraft */ public function testLoadContentWithPrioritizedLanguages() @@ -2893,6 +2988,7 @@ public function testLoadContentWithPrioritizedLanguagesThrowsNotFoundException(C * Test for the loadContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContent + * * @depends testLoadContentWithPrioritizedLanguages */ public function testLoadContentPassTroughPrioritizedLanguagesToContentType(Content $content): void @@ -2904,13 +3000,14 @@ public function testLoadContentPassTroughPrioritizedLanguagesToContentType(Conte [self::ENG_GB] ); - $this->assertEquals($contentType, $content->getContentType()); + self::assertEquals($contentType, $content->getContentType()); } /** * Test for the loadContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContent($contentId, $languages, $versionNo) + * * @depends testPublishVersionFromContentDraft */ public function testLoadContentWithThirdParameter() @@ -2922,10 +3019,10 @@ public function testLoadContentWithThirdParameter() // This content instance is identical to $draftContent $draftContentReloaded = $this->contentService->loadContent($publishedContent->id, null, 2); - $this->assertEquals(2, $draftContentReloaded->getVersionInfo()->versionNo); + self::assertEquals(2, $draftContentReloaded->getVersionInfo()->versionNo); // Check that ContentInfo contained in reloaded draft Content has correct main Location id set - $this->assertEquals( + self::assertEquals( $publishedContent->versionInfo->contentInfo->mainLocationId, $draftContentReloaded->versionInfo->contentInfo->mainLocationId ); @@ -2935,6 +3032,7 @@ public function testLoadContentWithThirdParameter() * Test for the loadContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContent($contentId, $languages, $versionNo) + * * @depends testLoadContentWithThirdParameter */ public function testLoadContentThrowsNotFoundExceptionWithThirdParameter() @@ -2951,6 +3049,7 @@ public function testLoadContentThrowsNotFoundExceptionWithThirdParameter() * Test for the loadContentByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByRemoteId($remoteId, $languages) + * * @depends testPublishVersionFromContentDraft */ public function testLoadContentByRemoteIdWithSecondParameter() @@ -2974,6 +3073,7 @@ public function testLoadContentByRemoteIdWithSecondParameter() * Test for the loadContentByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByRemoteId($remoteId, $languages, $versionNo) + * * @depends testPublishVersionFromContentDraft */ public function testLoadContentByRemoteIdWithThirdParameter() @@ -2989,10 +3089,10 @@ public function testLoadContentByRemoteIdWithThirdParameter() 2 ); - $this->assertEquals(2, $draftContentReloaded->getVersionInfo()->versionNo); + self::assertEquals(2, $draftContentReloaded->getVersionInfo()->versionNo); // Check that ContentInfo contained in reloaded draft Content has correct main Location id set - $this->assertEquals( + self::assertEquals( $publishedContent->versionInfo->contentInfo->mainLocationId, $draftContentReloaded->versionInfo->contentInfo->mainLocationId ); @@ -3002,6 +3102,7 @@ public function testLoadContentByRemoteIdWithThirdParameter() * Test for the loadContentByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadContentByRemoteId($remoteId, $languages, $versionNo) + * * @depends testLoadContentByRemoteIdWithThirdParameter */ public function testLoadContentByRemoteIdThrowsNotFoundExceptionWithThirdParameter() @@ -3059,6 +3160,7 @@ public function getPrioritizedLanguageList() * Test for the deleteVersion() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::deleteVersion() + * * @depends testLoadContent * @depends testCreateContent * @depends testPublishVersion @@ -3078,8 +3180,8 @@ public function testDeleteVersion() $versions = $this->contentService->loadVersions($content->getVersionInfo()->getContentInfo()); - $this->assertCount(1, $versions); - $this->assertEquals( + self::assertCount(1, $versions); + self::assertEquals( $content->getVersionInfo()->id, $versions[0]->id ); @@ -3089,6 +3191,7 @@ public function testDeleteVersion() * Test for the deleteVersion() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::deleteVersion() + * * @depends testLoadContent * @depends testCreateContent * @depends testPublishVersion @@ -3107,6 +3210,7 @@ public function testDeleteVersionThrowsBadStateExceptionOnPublishedVersion() * Test for the deleteVersion() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::deleteVersion() + * * @depends testLoadContent * @depends testCreateContent * @depends testPublishVersion @@ -3128,6 +3232,7 @@ public function testDeleteVersionWorksIfOnlyVersionIsDraft() * Test for the loadVersions() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersions() + * * @depends testPublishVersion * * @return \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo[] @@ -3144,7 +3249,7 @@ public function testLoadVersions() $this->contentService->loadVersionInfo($contentVersion2->contentInfo, 2), ]; - $this->assertEquals($expectedVersionsOrder, $versions); + self::assertEquals($expectedVersionsOrder, $versions); return $versions; } @@ -3153,13 +3258,14 @@ public function testLoadVersions() * Test for the loadVersions() method. * * @depends testLoadVersions + * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersions * * @param \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo[] $versions */ public function testLoadVersionsSetsExpectedVersionInfo(array $versions) { - $this->assertCount(2, $versions); + self::assertCount(2, $versions); $expectedVersions = [ [ @@ -3180,32 +3286,34 @@ public function testLoadVersionsSetsExpectedVersionInfo(array $versions) $this->assertPropertiesCorrect($expectedVersions[0], $versions[0]); $this->assertPropertiesCorrect($expectedVersions[1], $versions[1]); - $this->assertEqualsWithDelta( + self::assertEqualsWithDelta( $versions[0]->creationDate->getTimestamp(), $versions[1]->creationDate->getTimestamp(), 2, 'Creation time did not match within delta of 2 seconds', ); - $this->assertEqualsWithDelta( + self::assertEqualsWithDelta( $versions[0]->modificationDate->getTimestamp(), $versions[1]->modificationDate->getTimestamp(), 2, 'Creation time did not match within delta of 2 seconds', ); - $this->assertTrue($versions[0]->isArchived()); - $this->assertFalse($versions[0]->isDraft()); - $this->assertFalse($versions[0]->isPublished()); + self::assertTrue($versions[0]->isArchived()); + self::assertFalse($versions[0]->isDraft()); + self::assertFalse($versions[0]->isPublished()); - $this->assertTrue($versions[1]->isPublished()); - $this->assertFalse($versions[1]->isDraft()); - $this->assertFalse($versions[1]->isArchived()); + self::assertTrue($versions[1]->isPublished()); + self::assertFalse($versions[1]->isDraft()); + self::assertFalse($versions[1]->isArchived()); } /** * Test for the copyContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::copyContent() + * * @depends testPublishVersionFromContentDraft + * * @group field-type */ public function testCopyContent() @@ -3229,33 +3337,33 @@ public function testCopyContent() $targetLocationCreate ); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $contentCopied ); - $this->assertNotEquals( + self::assertNotEquals( $contentVersion2->contentInfo->remoteId, $contentCopied->contentInfo->remoteId ); - $this->assertNotEquals( + self::assertNotEquals( $contentVersion2->id, $contentCopied->id ); - $this->assertCount( + self::assertCount( 2, $this->contentService->loadVersions($contentCopied->contentInfo) ); - $this->assertEquals(2, $contentCopied->getVersionInfo()->versionNo); + self::assertEquals(2, $contentCopied->getVersionInfo()->versionNo); $this->assertAllFieldsEquals($contentCopied->getFields()); $this->assertDefaultContentStates($contentCopied->contentInfo); - $this->assertNotNull( + self::assertNotNull( $contentCopied->contentInfo->mainLocationId, 'Expected main location to be set given we provided a LocationCreateStruct' ); @@ -3266,7 +3374,9 @@ public function testCopyContent() * See settings/test/integration_legacy.yml for service override. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::copyContent() + * * @depends testPublishVersionFromContentDraft + * * @group field-type */ public function testCopyContentWithNewOwner() @@ -3302,20 +3412,20 @@ public function testCopyContentWithNewOwner() $targetLocationCreate ); - $this->assertEquals( + self::assertEquals( $owner->id, $contentVersion2->contentInfo->ownerId ); $newOwnerId = $userService->loadUserByLogin('admin')->getUserId(); - $this->assertEquals( + self::assertEquals( $newOwnerId, $contentCopied->contentInfo->ownerId ); $versions = $this->contentService->loadVersions($contentCopied->contentInfo); - $this->assertCount(2, $versions); + self::assertCount(2, $versions); foreach ($versions as $version) { - $this->assertEquals( + self::assertEquals( $newOwnerId, $version->creatorId ); @@ -3326,6 +3436,7 @@ public function testCopyContentWithNewOwner() * Test for the copyContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::copyContent($contentInfo, $destinationLocationCreateStruct, $versionInfo) + * * @depends testCopyContent */ public function testCopyContentWithGivenVersion() @@ -3350,29 +3461,29 @@ public function testCopyContentWithGivenVersion() $this->contentService->loadVersionInfo($contentVersion2->contentInfo, 1) ); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $contentCopied ); - $this->assertNotEquals( + self::assertNotEquals( $contentVersion2->contentInfo->remoteId, $contentCopied->contentInfo->remoteId ); - $this->assertNotEquals( + self::assertNotEquals( $contentVersion2->id, $contentCopied->id ); - $this->assertCount( + self::assertCount( 1, $this->contentService->loadVersions($contentCopied->contentInfo) ); - $this->assertEquals(1, $contentCopied->getVersionInfo()->versionNo); + self::assertEquals(1, $contentCopied->getVersionInfo()->versionNo); - $this->assertNotNull( + self::assertNotNull( $contentCopied->contentInfo->mainLocationId, 'Expected main location to be set given we provided a LocationCreateStruct' ); @@ -3412,11 +3523,12 @@ public function testAddRelation(): array * @param \Ibexa\Contracts\Core\Repository\Values\Content\Relation[] $relations * * @covers \Ibexa\Contracts\Core\Repository\ContentService::addRelation() + * * @depends testAddRelation */ public function testAddRelationAddsRelationToContent($relations) { - $this->assertCount( + self::assertCount( 1, $relations ); @@ -3427,7 +3539,7 @@ public function testAddRelationAddsRelationToContent($relations) */ protected function assertExpectedRelations($relations) { - $this->assertEquals( + self::assertEquals( [ 'type' => Relation::COMMON, 'sourceFieldDefinitionIdentifier' => null, @@ -3449,6 +3561,7 @@ protected function assertExpectedRelations($relations) * @param \Ibexa\Contracts\Core\Repository\Values\Content\Relation[] $relations * * @covers \Ibexa\Contracts\Core\Repository\ContentService::addRelation() + * * @depends testAddRelation */ public function testAddRelationSetsExpectedRelations($relations) @@ -3462,6 +3575,7 @@ public function testAddRelationSetsExpectedRelations($relations) * @return \Ibexa\Contracts\Core\Repository\Values\Content\Relation[] * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft + * * @depends testAddRelationSetsExpectedRelations */ public function testCreateContentDraftWithRelations() @@ -3487,11 +3601,12 @@ public function testCreateContentDraftWithRelations() * @param \Ibexa\Contracts\Core\Repository\Values\Content\Relation[] $relations * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Relation[] + * * @depends testCreateContentDraftWithRelations */ public function testCreateContentDraftWithRelationsCreatesRelations(array $relations): array { - $this->assertCount( + self::assertCount( 1, $relations ); @@ -3515,6 +3630,7 @@ public function testCreateContentDraftWithRelationsCreatesExpectedRelations($rel * Test for the addRelation() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::addRelation() + * * @depends testAddRelation */ public function testAddRelationThrowsBadStateException() @@ -3536,6 +3652,7 @@ public function testAddRelationThrowsBadStateException() * Test for the loadRelations() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadRelations() + * * @depends testAddRelation */ public function testLoadRelations() @@ -3554,7 +3671,7 @@ static function ($rel1, $rel2) { } ); - $this->assertEquals( + self::assertEquals( [ [ 'sourceContentInfo' => 'abcdef0123456789abcdef0123456789', @@ -3582,6 +3699,7 @@ static function ($rel1, $rel2) { * Test for the loadRelations() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadRelations() + * * @depends testAddRelation * @depends testLoadRelations */ @@ -3616,8 +3734,8 @@ public function testLoadRelationsSkipsArchivedContent() // Load all relations $relations = $this->contentService->loadRelations($draft->getVersionInfo()); - $this->assertCount(1, $relations); - $this->assertEquals( + self::assertCount(1, $relations); + self::assertEquals( [ [ 'sourceContentInfo' => 'abcdef0123456789abcdef0123456789', @@ -3637,6 +3755,7 @@ public function testLoadRelationsSkipsArchivedContent() * Test for the loadRelations() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadRelations() + * * @depends testAddRelation * @depends testLoadRelations */ @@ -3666,8 +3785,8 @@ public function testLoadRelationsSkipsDraftContent() $relations = $this->contentService->loadRelations($mediaDraft->getVersionInfo()); - $this->assertCount(1, $relations); - $this->assertEquals( + self::assertCount(1, $relations); + self::assertEquals( [ [ 'sourceContentInfo' => self::MEDIA_REMOTE_ID, @@ -3779,7 +3898,7 @@ public function testCountReverseRelations(): void $contentInfo = $contentWithReverseRelations->content->getVersionInfo()->getContentInfo(); - $this->assertEquals(2, $this->contentService->countReverseRelations($contentInfo)); + self::assertEquals(2, $this->contentService->countReverseRelations($contentInfo)); } /** @@ -3791,7 +3910,7 @@ public function testCountReverseRelationsReturnsZeroByDefault(): void { $draft = $this->createContentDraftVersion1(); - $this->assertSame(0, $this->contentService->countReverseRelations($draft->getVersionInfo()->getContentInfo())); + self::assertSame(0, $this->contentService->countReverseRelations($draft->getVersionInfo()->getContentInfo())); } /** @@ -3811,13 +3930,14 @@ public function testCountReverseRelationsForUnauthorizedUser(): void $contentInfo = $contentWithReverseRelations->content->contentInfo; - $this->assertSame(0, $this->contentService->countReverseRelations($contentInfo)); + self::assertSame(0, $this->contentService->countReverseRelations($contentInfo)); } /** * Test for the loadReverseRelations() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadReverseRelations() + * * @depends testAddRelation */ public function testLoadReverseRelations() @@ -3852,14 +3972,14 @@ public function testLoadReverseRelations() $relations = $this->contentService->loadRelations($versionInfo); $reverseRelations = $this->contentService->loadReverseRelations($contentInfo); - $this->assertEquals($contentInfo->id, $relation1->getDestinationContentInfo()->id); - $this->assertEquals($mediaDraft->id, $relation1->getSourceContentInfo()->id); + self::assertEquals($contentInfo->id, $relation1->getDestinationContentInfo()->id); + self::assertEquals($mediaDraft->id, $relation1->getSourceContentInfo()->id); - $this->assertEquals($contentInfo->id, $relation2->getDestinationContentInfo()->id); - $this->assertEquals($demoDesignDraft->id, $relation2->getSourceContentInfo()->id); + self::assertEquals($contentInfo->id, $relation2->getDestinationContentInfo()->id); + self::assertEquals($demoDesignDraft->id, $relation2->getSourceContentInfo()->id); - $this->assertCount(0, $relations); - $this->assertCount(2, $reverseRelations); + self::assertCount(0, $relations); + self::assertCount(2, $reverseRelations); usort( $reverseRelations, @@ -3871,7 +3991,7 @@ static function ($rel1, $rel2) { } ); - $this->assertEquals( + self::assertEquals( [ [ 'sourceContentInfo' => self::MEDIA_REMOTE_ID, @@ -3899,6 +4019,7 @@ static function ($rel1, $rel2) { * Test for the loadReverseRelations() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadReverseRelations() + * * @depends testAddRelation * @depends testLoadReverseRelations */ @@ -3943,16 +4064,16 @@ public function testLoadReverseRelationsSkipsArchivedContent() $relations = $this->contentService->loadRelations($versionInfo); $reverseRelations = $this->contentService->loadReverseRelations($contentInfo); - $this->assertEquals($contentInfo->id, $relation1->getDestinationContentInfo()->id); - $this->assertEquals($mediaDraft->id, $relation1->getSourceContentInfo()->id); + self::assertEquals($contentInfo->id, $relation1->getDestinationContentInfo()->id); + self::assertEquals($mediaDraft->id, $relation1->getSourceContentInfo()->id); - $this->assertEquals($contentInfo->id, $relation2->getDestinationContentInfo()->id); - $this->assertEquals($demoDesignDraft->id, $relation2->getSourceContentInfo()->id); + self::assertEquals($contentInfo->id, $relation2->getDestinationContentInfo()->id); + self::assertEquals($demoDesignDraft->id, $relation2->getSourceContentInfo()->id); - $this->assertCount(0, $relations); - $this->assertCount(1, $reverseRelations); + self::assertCount(0, $relations); + self::assertCount(1, $reverseRelations); - $this->assertEquals( + self::assertEquals( [ [ 'sourceContentInfo' => self::MEDIA_REMOTE_ID, @@ -3972,6 +4093,7 @@ public function testLoadReverseRelationsSkipsArchivedContent() * Test for the loadReverseRelations() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadReverseRelations() + * * @depends testAddRelation * @depends testLoadReverseRelations */ @@ -4006,16 +4128,16 @@ public function testLoadReverseRelationsSkipsDraftContent() $relations = $this->contentService->loadRelations($media->versionInfo); $reverseRelations = $this->contentService->loadReverseRelations($media->contentInfo); - $this->assertEquals($media->contentInfo->id, $relation1->getDestinationContentInfo()->id); - $this->assertEquals($newDraftVersionInfo->contentInfo->id, $relation1->getSourceContentInfo()->id); + self::assertEquals($media->contentInfo->id, $relation1->getDestinationContentInfo()->id); + self::assertEquals($newDraftVersionInfo->contentInfo->id, $relation1->getSourceContentInfo()->id); - $this->assertEquals($media->contentInfo->id, $relation2->getDestinationContentInfo()->id); - $this->assertEquals($demoDesignDraft->id, $relation2->getSourceContentInfo()->id); + self::assertEquals($media->contentInfo->id, $relation2->getDestinationContentInfo()->id); + self::assertEquals($demoDesignDraft->id, $relation2->getSourceContentInfo()->id); - $this->assertCount(0, $relations); - $this->assertCount(1, $reverseRelations); + self::assertCount(0, $relations); + self::assertCount(1, $reverseRelations); - $this->assertEquals( + self::assertEquals( [ [ 'sourceContentInfo' => self::DEMO_DESIGN_REMOTE_ID, @@ -4056,16 +4178,16 @@ public function testLoadReverseRelationList(): void $reverseRelationList = $this->contentService->loadReverseRelationList($contentInfo); - $this->assertSame(3, $reverseRelationList->totalCount); - $this->assertEquals( + self::assertSame(3, $reverseRelationList->totalCount); + self::assertEquals( $contentWithReverseRelations->reverseRelations[2]->contentInfo, $reverseRelationList->items[0]->getRelation()->sourceContentInfo ); - $this->assertEquals( + self::assertEquals( $contentWithReverseRelations->reverseRelations[1]->contentInfo, $reverseRelationList->items[1]->getRelation()->sourceContentInfo ); - $this->assertEquals( + self::assertEquals( $contentWithReverseRelations->reverseRelations[0]->contentInfo, $reverseRelationList->items[2]->getRelation()->sourceContentInfo ); @@ -4096,17 +4218,17 @@ public function testLoadReverseRelationListWithPagination(): void $reverseRelationPage1 = $this->contentService->loadReverseRelationList($contentInfo, 0, 2); $reverseRelationPage2 = $this->contentService->loadReverseRelationList($contentInfo, 2, 2); - $this->assertSame(3, $reverseRelationPage1->totalCount); - $this->assertSame(3, $reverseRelationPage2->totalCount); - $this->assertEquals( + self::assertSame(3, $reverseRelationPage1->totalCount); + self::assertSame(3, $reverseRelationPage2->totalCount); + self::assertEquals( $contentWithReverseRelations->reverseRelations[2]->contentInfo, $reverseRelationPage1->items[0]->getRelation()->sourceContentInfo ); - $this->assertEquals( + self::assertEquals( $contentWithReverseRelations->reverseRelations[1]->contentInfo, $reverseRelationPage1->items[1]->getRelation()->sourceContentInfo ); - $this->assertEquals( + self::assertEquals( $contentWithReverseRelations->reverseRelations[0]->contentInfo, $reverseRelationPage2->items[0]->getRelation()->sourceContentInfo ); @@ -4143,12 +4265,12 @@ public function testLoadReverseRelationListSkipsArchivedContent(): void $contentInfo = $contentWithReverseRelations->content->contentInfo; $reverseRelationList = $this->contentService->loadReverseRelationList($contentInfo); - $this->assertSame(2, $reverseRelationList->totalCount); - $this->assertEquals( + self::assertSame(2, $reverseRelationList->totalCount); + self::assertEquals( $contentWithReverseRelations->reverseRelations[1]->contentInfo, $reverseRelationList->items[0]->getRelation()->sourceContentInfo ); - $this->assertEquals( + self::assertEquals( $contentWithReverseRelations->reverseRelations[0]->contentInfo, $reverseRelationList->items[1]->getRelation()->sourceContentInfo ); @@ -4178,8 +4300,8 @@ public function testLoadReverseRelationListSkipsDraftContent() $reverseRelationList = $this->contentService->loadReverseRelationList($contentInfo); - $this->assertSame(1, $reverseRelationList->totalCount); - $this->assertEquals( + self::assertSame(1, $reverseRelationList->totalCount); + self::assertEquals( $contentWithReverseRelations->reverseRelations[0]->contentInfo, $reverseRelationList->items[0]->getRelation()->sourceContentInfo ); @@ -4189,6 +4311,7 @@ public function testLoadReverseRelationListSkipsDraftContent() * Test for the deleteRelation() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::deleteRelation() + * * @depends testLoadRelations */ public function testDeleteRelation() @@ -4208,13 +4331,14 @@ public function testDeleteRelation() // The relations array now contains only one element $relations = $this->contentService->loadRelations($draft->getVersionInfo()); - $this->assertCount(1, $relations); + self::assertCount(1, $relations); } /** * Test for the deleteRelation() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::deleteRelation() + * * @depends testDeleteRelation */ public function testDeleteRelationThrowsBadStateException() @@ -4248,6 +4372,7 @@ public function testDeleteRelationThrowsBadStateException() * Test for the deleteRelation() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::deleteRelation() + * * @depends testDeleteRelation */ public function testDeleteRelationThrowsInvalidArgumentException() @@ -4269,6 +4394,7 @@ public function testDeleteRelationThrowsInvalidArgumentException() * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContent * @depends testLoadContent */ @@ -4310,13 +4436,14 @@ public function testCreateContentInTransactionWithRollback() return; } - $this->fail('Content object still exists after rollback.'); + self::fail('Content object still exists after rollback.'); } /** * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContent * @depends testLoadContent */ @@ -4353,13 +4480,14 @@ public function testCreateContentInTransactionWithCommit() // Load the new content object $content = $this->contentService->loadContent($contentId); - $this->assertEquals($contentId, $content->id); + self::assertEquals($contentId, $content->id); } /** * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent($contentCreateStruct, $locationCreateStructs) + * * @depends testCreateContentWithLocationCreateParameterDoesNotCreateLocationImmediately * @depends testLoadContentThrowsNotFoundException */ @@ -4390,13 +4518,14 @@ public function testCreateContentWithLocationCreateParameterInTransactionWithRol return; } - $this->fail('Can still load content object after rollback.'); + self::fail('Can still load content object after rollback.'); } /** * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent($contentCreateStruct, $locationCreateStructs) + * * @depends testCreateContentWithLocationCreateParameterDoesNotCreateLocationImmediately * @depends testLoadContentThrowsNotFoundException */ @@ -4423,13 +4552,14 @@ public function testCreateContentWithLocationCreateParameterInTransactionWithCom // Load the new content object $content = $this->contentService->loadContent($contentId); - $this->assertEquals($contentId, $content->id); + self::assertEquals($contentId, $content->id); } /** * Test for the createContentDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft() + * * @depends testCreateContentDraft * @depends testLoadContent */ @@ -4467,13 +4597,14 @@ public function testCreateContentDraftInTransactionWithRollback() return; } - $this->fail('Can still load content draft after rollback'); + self::fail('Can still load content draft after rollback'); } /** * Test for the createContentDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft() + * * @depends testCreateContentDraft * @depends testLoadContent */ @@ -4506,7 +4637,7 @@ public function testCreateContentDraftInTransactionWithCommit() $content = $this->contentService->loadContent($contentId, null, $versionNo); - $this->assertEquals( + self::assertEquals( $versionNo, $content->getVersionInfo()->versionNo ); @@ -4516,6 +4647,7 @@ public function testCreateContentDraftInTransactionWithCommit() * Test for the publishVersion() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::publishVersion() + * * @depends testPublishVersion * @depends testLoadContent */ @@ -4555,13 +4687,14 @@ public function testPublishVersionInTransactionWithRollback() return; } - $this->fail('Can still load content draft after rollback'); + self::fail('Can still load content draft after rollback'); } /** * Test for the publishVersion() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::publishVersion() + * * @depends testPublishVersion * @depends testLoadVersionInfo */ @@ -4595,13 +4728,14 @@ public function testPublishVersionInTransactionWithCommit() // Load current version info $versionInfo = $this->contentService->loadVersionInfo($content->contentInfo); - $this->assertEquals($versionNo, $versionInfo->versionNo); + self::assertEquals($versionNo, $versionInfo->versionNo); } /** * Test for the updateContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testUpdateContent * @depends testLoadContent * @depends testLoadContentInfo @@ -4645,13 +4779,14 @@ public function testUpdateContentInTransactionWithRollback() // Name will still be "Administrator users" $name = $this->contentService->loadContent($contentId)->getFieldValue('name'); - $this->assertEquals('Administrator users', $name); + self::assertEquals('Administrator users', $name); } /** * Test for the updateContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testUpdateContent * @depends testLoadContent * @depends testLoadContentInfo @@ -4695,13 +4830,14 @@ public function testUpdateContentInTransactionWithCommit() // Name is now "Administrators" $name = $this->contentService->loadContent($contentId)->getFieldValue('name', self::ENG_US); - $this->assertEquals(self::ADMINISTRATORS_USER_GROUP_NAME, $name); + self::assertEquals(self::ADMINISTRATORS_USER_GROUP_NAME, $name); } /** * Test for the updateContentMetadata() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContentMetadata() + * * @depends testUpdateContentMetadata * @depends testLoadContentInfo */ @@ -4742,13 +4878,14 @@ public function testUpdateContentMetadataInTransactionWithRollback() // Load current remoteId $remoteIdReloaded = $this->contentService->loadContentInfo($contentId)->remoteId; - $this->assertEquals($remoteId, $remoteIdReloaded); + self::assertEquals($remoteId, $remoteIdReloaded); } /** * Test for the updateContentMetadata() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContentMetadata() + * * @depends testUpdateContentMetadata * @depends testLoadContentInfo */ @@ -4789,13 +4926,14 @@ public function testUpdateContentMetadataInTransactionWithCommit() // Load current remoteId $remoteIdReloaded = $this->contentService->loadContentInfo($contentId)->remoteId; - $this->assertNotEquals($remoteId, $remoteIdReloaded); + self::assertNotEquals($remoteId, $remoteIdReloaded); } /** * Test for the updateContentMetadata() method, and how cache + transactions play together. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContentMetadata() + * * @depends testUpdateContentMetadata * @depends testLoadContentInfo */ @@ -4827,7 +4965,7 @@ public function testUpdateContentMetadataCheckWithinTransaction() // Check that it's been updated $remoteIdReloaded = $contentService->loadContentInfo($contentId)->remoteId; - $this->assertNotEquals($remoteId, $remoteIdReloaded); + self::assertNotEquals($remoteId, $remoteIdReloaded); // Commit all changes. $repository->commit(); @@ -4842,6 +4980,7 @@ public function testUpdateContentMetadataCheckWithinTransaction() * Test for the deleteVersion() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::deleteVersion() + * * @depends testCreateContent * @depends testLoadContentInfo * @depends testLoadContentDrafts @@ -4874,13 +5013,14 @@ public function testDeleteVersionInTransactionWithRollback() // This array will be empty $drafts = $this->contentService->loadContentDrafts(); - $this->assertSame([], $drafts); + self::assertSame([], $drafts); } /** * Test for the deleteVersion() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::deleteVersion() + * * @depends testCreateContent * @depends testLoadContentInfo * @depends testLoadContentDrafts @@ -4913,13 +5053,14 @@ public function testDeleteVersionInTransactionWithCommit() // This array will contain no element $drafts = $this->contentService->loadContentDrafts(); - $this->assertSame([], $drafts); + self::assertSame([], $drafts); } /** * Test for the deleteContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::deleteContent() + * * @depends testDeleteContent * @depends testLoadContentInfo */ @@ -4950,13 +5091,14 @@ public function testDeleteContentInTransactionWithRollback() // This call will return the original content object $contentInfo = $this->contentService->loadContentInfo($contentId); - $this->assertEquals($contentId, $contentInfo->id); + self::assertEquals($contentId, $contentInfo->id); } /** * Test for the deleteContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::deleteContent() + * * @depends testDeleteContent * @depends testLoadContentInfo */ @@ -4991,13 +5133,14 @@ public function testDeleteContentInTransactionWithCommit() return; } - $this->fail('Can still load ContentInfo after commit.'); + self::fail('Can still load ContentInfo after commit.'); } /** * Test for the copyContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::copyContent() + * * @depends testCopyContent */ public function testCopyContentInTransactionWithRollback() @@ -5038,13 +5181,14 @@ public function testCopyContentInTransactionWithRollback() $this->locationService->loadLocation($locationId) )->locations; - $this->assertCount(1, $locations); + self::assertCount(1, $locations); } /** * Test for the copyContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::copyContent() + * * @depends testCopyContent */ public function testCopyContentInTransactionWithCommit() @@ -5085,7 +5229,7 @@ public function testCopyContentInTransactionWithCommit() $this->locationService->loadLocation($locationId) )->locations; - $this->assertCount(2, $locations); + self::assertCount(2, $locations); } public function testURLAliasesCreatedForNewContent() @@ -5250,7 +5394,7 @@ public function testUpdatingDraftDoesNotUpdateOldVersions() $loadedContent1 = $this->contentService->loadContent($contentVersion2->id, null, 1); $loadedContent2 = $this->contentService->loadContent($contentVersion2->id, null, 2); - $this->assertNotEquals( + self::assertNotEquals( $loadedContent1->getFieldValue('name', self::ENG_US), $loadedContent2->getFieldValue('name', self::ENG_US) ); @@ -5863,7 +6007,7 @@ public function testLoadVersionsAfterDeletingTwoDrafts() } } - $this->assertEquals($versions, $this->contentService->loadVersions($content->contentInfo)); + self::assertEquals($versions, $this->contentService->loadVersions($content->contentInfo)); } /** @@ -5879,7 +6023,7 @@ public function testLoadVersionsOfStatusDraft() $versions = $this->contentService->loadVersions($content->contentInfo, VersionInfo::STATUS_DRAFT); - $this->assertSame(\count($versions), 3); + self::assertSame(\count($versions), 3); } /** @@ -5897,7 +6041,7 @@ public function testLoadVersionsOfStatusArchived() $versions = $this->contentService->loadVersions($content->contentInfo, VersionInfo::STATUS_ARCHIVED); - $this->assertSame(\count($versions), 2); + self::assertSame(\count($versions), 2); } /** @@ -5911,7 +6055,7 @@ private function assertAliasesCorrect(array $expectedAliasProperties, array $act { foreach ($actualAliases as $actualAlias) { if (!isset($expectedAliasProperties[$actualAlias->path])) { - $this->fail( + self::fail( sprintf( 'Alias with path "%s" in languages "%s" not expected.', $actualAlias->path, @@ -5921,7 +6065,7 @@ private function assertAliasesCorrect(array $expectedAliasProperties, array $act } foreach ($expectedAliasProperties[$actualAlias->path] as $propertyName => $propertyValue) { - $this->assertEquals( + self::assertEquals( $propertyValue, $actualAlias->$propertyName, sprintf( @@ -5937,7 +6081,7 @@ private function assertAliasesCorrect(array $expectedAliasProperties, array $act } if (!empty($expectedAliasProperties)) { - $this->fail( + self::fail( sprintf( 'Missing expected aliases with paths "%s".', implode('", "', array_keys($expectedAliasProperties)) @@ -5956,7 +6100,7 @@ private function assertAllFieldsEquals(array $fields) $actual = $this->normalizeFields($fields); $expected = $this->normalizeFields($this->createFieldsFixture()); - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } /** @@ -5978,7 +6122,7 @@ private function assertLocaleFieldsEquals(array $fields, $languageCode) $expected[] = $field; } - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } /** @@ -6036,7 +6180,7 @@ private function assertDefaultContentStates(ContentInfo $contentInfo) $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); foreach ($objectStateService->loadObjectStates($objectStateGroup, Language::ALL) as $objectState) { // Only check the first object state which is the default one. - $this->assertEquals( + self::assertEquals( $objectState, $contentState ); @@ -6161,14 +6305,14 @@ function (Location $parentLocation) { $locations = $this->locationService->loadLocations($publishedContent->contentInfo); // Sanity check - $this->assertCount(3, $locations); - $this->assertCount(0, $this->filterHiddenLocations($locations)); + self::assertCount(3, $locations); + self::assertCount(0, $this->filterHiddenLocations($locations)); $this->contentService->hideContent($publishedContent->contentInfo); $locations = $this->locationService->loadLocations($publishedContent->contentInfo); - $this->assertCount(3, $locations); - $this->assertCount(3, $this->filterHiddenLocations($locations)); + self::assertCount(3, $locations); + self::assertCount(3, $this->filterHiddenLocations($locations)); } /** @@ -6206,11 +6350,11 @@ function (Location $parentLocation) { // Sanity check $hiddenLocations = $this->filterHiddenLocations($locations); - $this->assertCount(3, $locations); - $this->assertCount(1, $hiddenLocations); + self::assertCount(3, $locations); + self::assertCount(1, $hiddenLocations); $this->contentService->hideContent($publishedContent->contentInfo); - $this->assertCount( + self::assertCount( 3, $this->filterHiddenLocations( $this->locationService->loadLocations($publishedContent->contentInfo) @@ -6221,9 +6365,9 @@ function (Location $parentLocation) { $locations = $this->locationService->loadLocations($publishedContent->contentInfo); $hiddenLocationsAfterReveal = $this->filterHiddenLocations($locations); - $this->assertCount(3, $locations); - $this->assertCount(1, $hiddenLocationsAfterReveal); - $this->assertEquals($hiddenLocations, $hiddenLocationsAfterReveal); + self::assertCount(3, $locations); + self::assertCount(1, $hiddenLocationsAfterReveal); + self::assertEquals($hiddenLocations, $hiddenLocationsAfterReveal); } /** @@ -6392,11 +6536,11 @@ public function testHideContentWithParentLocation() $childLocations = $this->locationService->loadLocations($publishedChildContent->contentInfo); - $this->assertTrue($locations[0]->hidden); - $this->assertTrue($locations[0]->invisible); + self::assertTrue($locations[0]->hidden); + self::assertTrue($locations[0]->invisible); - $this->assertFalse($childLocations[0]->hidden); - $this->assertTrue($childLocations[0]->invisible); + self::assertFalse($childLocations[0]->hidden); + self::assertTrue($childLocations[0]->invisible); } public function testChangeContentName() @@ -6417,8 +6561,8 @@ public function testChangeContentName() $updatedContent = $this->contentService->loadContent($publishedContent->id); - $this->assertEquals('Marco', $publishedContent->contentInfo->name); - $this->assertEquals('Polo', $updatedContent->contentInfo->name); + self::assertEquals('Marco', $publishedContent->contentInfo->name); + self::assertEquals('Polo', $updatedContent->contentInfo->name); } public function testCopyTranslationsFromPublishedToDraft() @@ -6445,7 +6589,7 @@ public function testCopyTranslationsFromPublishedToDraft() $deContent = $this->contentService->updateContent($deDraft->versionInfo, $contentUpdateStruct); $updatedContent = $this->contentService->loadContent($deContent->id, null, $deContent->versionInfo->versionNo); - $this->assertEquals( + self::assertEquals( [ self::ENG_US => 'Folder US', self::GER_DE => 'Folder GER', @@ -6465,7 +6609,7 @@ public function testCopyTranslationsFromPublishedToDraft() $gbContent = $this->contentService->updateContent($gbDraft->versionInfo, $contentUpdateStruct); $this->contentService->publishVersion($gbDraft->versionInfo); $updatedContent = $this->contentService->loadContent($gbContent->id, null, $gbContent->versionInfo->versionNo); - $this->assertEquals( + self::assertEquals( [ self::ENG_US => 'Folder US', self::ENG_GB => 'Folder GB', @@ -6474,7 +6618,7 @@ public function testCopyTranslationsFromPublishedToDraft() ); $dePublished = $this->contentService->publishVersion($deDraft->versionInfo); - $this->assertEquals( + self::assertEquals( [ self::ENG_US => 'Folder US', self::GER_DE => 'Folder GER', @@ -6553,7 +6697,7 @@ public function testCopyTranslationsFromInvalidPublishedContentToDraft() $publishedContent = $this->contentService->loadContent($deContent->id, null, $deContent->versionInfo->versionNo); - $this->assertEquals( + self::assertEquals( [ self::GER_DE => 'Folder GER', self::ENG_US => 'Folder US 2', @@ -6561,7 +6705,7 @@ public function testCopyTranslationsFromInvalidPublishedContentToDraft() $publishedContent->fields['name'] ); // Missing values were copied from last updated draft - $this->assertEquals( + self::assertEquals( [ self::GER_DE => 'Required field DE', self::ENG_US => 'Required field DE', @@ -6632,7 +6776,7 @@ public function testPublishVersionWithSelectedLanguages() $this->contentService->publishVersion($draft->versionInfo, ['ger-DE']); $content = $this->contentService->loadContent($draft->contentInfo->id); - $this->assertEquals( + self::assertEquals( [ self::ENG_US => 'Published US', self::GER_DE => 'Draft 1 DE', @@ -6650,7 +6794,7 @@ public function testCreateContentWithRomanianSpecialCharsInTitle() $urlAliasService = $this->getRepository()->getURLAliasService(); $urlAlias = $urlAliasService->lookup($expectedPath); - $this->assertSame($expectedPath, $urlAlias->path); + self::assertSame($expectedPath, $urlAlias->path); } /** diff --git a/tests/integration/Core/Repository/ContentTypeServiceAuthorizationTest.php b/tests/integration/Core/Repository/ContentTypeServiceAuthorizationTest.php index 7968a503b1..bccc5ad49e 100644 --- a/tests/integration/Core/Repository/ContentTypeServiceAuthorizationTest.php +++ b/tests/integration/Core/Repository/ContentTypeServiceAuthorizationTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -12,7 +13,9 @@ * Test case for operations in the ContentTypeServiceAuthorization using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testLoadUser + * * @group integration * @group authorization */ @@ -22,6 +25,7 @@ class ContentTypeServiceAuthorizationTest extends BaseContentTypeServiceTest * Test for the createContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCreateContentTypeGroup */ public function testCreateContentTypeGroupThrowsUnauthorizedException() @@ -63,6 +67,7 @@ public function testCreateContentTypeGroupThrowsUnauthorizedException() * Test for the updateContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testUpdateContentTypeGroup */ public function testUpdateContentTypeGroupThrowsUnauthorizedException() @@ -113,6 +118,7 @@ public function testUpdateContentTypeGroupThrowsUnauthorizedException() * Test for the deleteContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentTypeGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testDeleteContentTypeGroup */ public function testDeleteContentTypeGroupThrowsUnauthorizedException() @@ -150,6 +156,7 @@ public function testDeleteContentTypeGroupThrowsUnauthorizedException() * Test for the createContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCreateContentType */ public function testCreateContentTypeThrowsUnauthorizedException() @@ -207,6 +214,7 @@ public function testCreateContentTypeThrowsUnauthorizedException() * Test for the updateContentTypeDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeDraft() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testUpdateContentTypeDraft */ public function testUpdateContentTypeDraftThrowsUnauthorizedException() @@ -259,6 +267,7 @@ public function testUpdateContentTypeDraftThrowsUnauthorizedException() * Test for the addFieldDefinition() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testAddFieldDefinition */ public function testAddFieldDefinitionThrowsUnauthorizedException() @@ -315,6 +324,7 @@ public function testAddFieldDefinitionThrowsUnauthorizedException() * Test for the removeFieldDefinition() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::removeFieldDefinition() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testRemoveFieldDefinition */ public function testRemoveFieldDefinitionThrowsUnauthorizedException() @@ -348,6 +358,7 @@ public function testRemoveFieldDefinitionThrowsUnauthorizedException() * Test for the updateFieldDefinition() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateFieldDefinition() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testUpdateFieldDefinition */ public function testUpdateFieldDefinitionThrowsUnauthorizedException() @@ -406,6 +417,7 @@ public function testUpdateFieldDefinitionThrowsUnauthorizedException() * Test for the publishContentTypeDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::publishContentTypeDraft() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testPublishContentTypeDraft */ public function testPublishContentTypeDraftThrowsUnauthorizedException() @@ -437,6 +449,7 @@ public function testPublishContentTypeDraftThrowsUnauthorizedException() * Test for the createContentTypeDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeDraft() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCreateContentTypeDraft */ public function testCreateContentTypeDraftThrowsUnauthorizedException() @@ -469,6 +482,7 @@ public function testCreateContentTypeDraftThrowsUnauthorizedException() * Test for the deleteContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentType() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testDeleteContentType */ public function testDeleteContentTypeThrowsUnauthorizedException() @@ -501,6 +515,7 @@ public function testDeleteContentTypeThrowsUnauthorizedException() * Test for the copyContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::copyContentType() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCopyContentType */ public function testCopyContentTypeThrowsUnauthorizedException() @@ -533,6 +548,7 @@ public function testCopyContentTypeThrowsUnauthorizedException() * Test for the assignContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::assignContentTypeGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testAssignContentTypeGroup */ public function testAssignContentTypeGroupThrowsUnauthorizedException() @@ -566,6 +582,7 @@ public function testAssignContentTypeGroupThrowsUnauthorizedException() * Test for the unassignContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::unassignContentTypeGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testUnassignContentTypeGroup */ public function testUnassignContentTypeGroupThrowsUnauthorizedException() diff --git a/tests/integration/Core/Repository/ContentTypeServiceTest.php b/tests/integration/Core/Repository/ContentTypeServiceTest.php index a503bb4bfd..8ef6fe551d 100644 --- a/tests/integration/Core/Repository/ContentTypeServiceTest.php +++ b/tests/integration/Core/Repository/ContentTypeServiceTest.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\Integration\Core\Repository; use Exception; @@ -34,6 +35,7 @@ * Test case for operations in the ContentTypeService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService + * * @group integration * @group content-type */ @@ -43,6 +45,7 @@ class ContentTypeServiceTest extends BaseContentTypeServiceTest * Test for the newContentTypeGroupCreateStruct() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newContentTypeGroupCreateStruct() + * * @group user */ public function testNewContentTypeGroupCreateStruct() @@ -57,7 +60,7 @@ public function testNewContentTypeGroupCreateStruct() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ContentTypeGroupCreateStruct::class, $groupCreate ); @@ -69,6 +72,7 @@ public function testNewContentTypeGroupCreateStruct() * Test for the newContentTypeGroupCreateStruct() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newContentTypeGroupCreateStruct() + * * @depends testNewContentTypeGroupCreateStruct */ public function testNewContentTypeGroupCreateStructValues($createStruct) @@ -90,7 +94,9 @@ public function testNewContentTypeGroupCreateStructValues($createStruct) * Test for the createContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeGroup() + * * @depends testNewContentTypeGroupCreateStruct + * * @group user */ public function testCreateContentTypeGroup() @@ -116,7 +122,7 @@ public function testCreateContentTypeGroup() $group = $contentTypeService->createContentTypeGroup($groupCreate); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ContentTypeGroup::class, $group ); @@ -133,6 +139,7 @@ public function testCreateContentTypeGroup() * Test for the createContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeGroup() + * * @depends testCreateContentTypeGroup */ public function testCreateContentTypeGroupStructValues(array $data) @@ -140,7 +147,7 @@ public function testCreateContentTypeGroupStructValues(array $data) $createStruct = $data['createStruct']; $group = $data['group']; - $this->assertEquals( + self::assertEquals( [ 'identifier' => $group->identifier, 'creatorId' => $group->creatorId, @@ -154,7 +161,7 @@ public function testCreateContentTypeGroupStructValues(array $data) 'isSystem' => $createStruct->isSystem, ] ); - $this->assertNotNull( + self::assertNotNull( $group->id ); @@ -165,6 +172,7 @@ public function testCreateContentTypeGroupStructValues(array $data) * Test for the createContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeGroup() + * * @depends testCreateContentTypeGroupStructValues */ public function testCreateContentTypeGroupStructLanguageDependentValues(array $data) @@ -185,6 +193,7 @@ public function testCreateContentTypeGroupStructLanguageDependentValues(array $d * Test for the createContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeGroup + * * @depends testCreateContentTypeGroup */ public function testCreateContentTypeGroupThrowsInvalidArgumentException() @@ -210,7 +219,9 @@ public function testCreateContentTypeGroupThrowsInvalidArgumentException() * Test for the loadContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeGroup() + * * @depends testCreateContentTypeGroup + * * @group user */ public function testLoadContentTypeGroup() @@ -226,7 +237,7 @@ public function testLoadContentTypeGroup() $loadedGroup = $contentTypeService->loadContentTypeGroup($contentTypeGroupId); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ContentTypeGroup::class, $loadedGroup ); @@ -254,6 +265,7 @@ public function testLoadSystemContentTypeGroup(): void * Test for the loadContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeGroup() + * * @depends testLoadContentTypeGroup */ public function testLoadContentTypeGroupStructValues(ContentTypeGroup $group) @@ -290,6 +302,7 @@ public function testLoadContentTypeGroupThrowsNotFoundException() * Test for the loadContentTypeGroupByIdentifier() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeGroupByIdentifier() + * * @group user * @group field-type */ @@ -305,7 +318,7 @@ public function testLoadContentTypeGroupByIdentifier() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ContentTypeGroup::class, $loadedGroup ); @@ -317,6 +330,7 @@ public function testLoadContentTypeGroupByIdentifier() * Test for the loadContentTypeGroupByIdentifier() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeGroupByIdentifier() + * * @depends testLoadContentTypeGroupByIdentifier */ public function testLoadContentTypeGroupByIdentifierStructValues(ContentTypeGroup $group) @@ -324,7 +338,7 @@ public function testLoadContentTypeGroupByIdentifierStructValues(ContentTypeGrou $repository = $this->getRepository(); $contentTypeService = $repository->getContentTypeService(); - $this->assertEquals( + self::assertEquals( $contentTypeService->loadContentTypeGroup($this->generateId('typegroup', 3)), $group ); @@ -334,6 +348,7 @@ public function testLoadContentTypeGroupByIdentifierStructValues(ContentTypeGrou * Test for the loadContentTypeGroupByIdentifier() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeGroupByIdentifier() + * * @depends testLoadContentTypeGroupByIdentifier */ public function testLoadContentTypeGroupByIdentifierThrowsNotFoundException() @@ -356,6 +371,7 @@ public function testLoadContentTypeGroupByIdentifierThrowsNotFoundException() * Test for the loadContentTypeGroups() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeGroups() + * * @depends testCreateContentTypeGroup */ public function testLoadContentTypeGroups() @@ -394,11 +410,12 @@ public function testLoadContentTypeGroups() * Test for the loadContentTypeGroups() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeGroups() + * * @depends testLoadContentTypeGroups */ public function testLoadContentTypeGroupsIdentifiers($groups) { - $this->assertCount(4, $groups); + self::assertCount(4, $groups); $expectedIdentifiers = [ 'Content' => true, @@ -415,7 +432,7 @@ public function testLoadContentTypeGroupsIdentifiers($groups) ksort($expectedIdentifiers); ksort($actualIdentifiers); - $this->assertEquals( + self::assertEquals( $expectedIdentifiers, $actualIdentifiers, 'Identifier missmatch in loaded groups.' @@ -447,6 +464,7 @@ public function testNewContentTypeGroupUpdateStruct() * Test for the updateContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeGroup() + * * @depends testCreateContentTypeGroup */ public function testUpdateContentTypeGroup() @@ -499,6 +517,7 @@ public function testUpdateContentTypeGroup() * Test for the updateContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeGroup() + * * @depends testUpdateContentTypeGroup */ public function testUpdateContentTypeGroupStructValues(array $data) @@ -521,6 +540,7 @@ public function testUpdateContentTypeGroupStructValues(array $data) * Test for the updateContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeGroup() + * * @depends testUpdateContentTypeGroupStructValues */ public function testUpdateContentTypeGroupStructLanguageDependentValues(array $data) @@ -545,6 +565,7 @@ public function testUpdateContentTypeGroupStructLanguageDependentValues(array $d * Test for the updateContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeGroup + * * @depends testUpdateContentTypeGroup */ public function testUpdateContentTypeGroupThrowsInvalidArgumentException() @@ -573,6 +594,7 @@ public function testUpdateContentTypeGroupThrowsInvalidArgumentException() * Test for the deleteContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentTypeGroup + * * @depends testLoadContentTypeGroup */ public function testDeleteContentTypeGroup() @@ -597,7 +619,7 @@ public function testDeleteContentTypeGroup() // loadContentTypeGroup should throw NotFoundException $contentTypeService->loadContentTypeGroup($group->id); - $this->fail('Content type group not deleted.'); + self::fail('Content type group not deleted.'); } public function testDeleteContentTypeGroupWithOrphanedContentTypeDrafts(): void @@ -634,6 +656,7 @@ public function testDeleteContentTypeGroupWithOrphanedContentTypeDrafts(): void * Test for the newContentTypeCreateStruct() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newContentTypeCreateStruct() + * * @group user * @group field-type */ @@ -661,6 +684,7 @@ public function testNewContentTypeCreateStruct() * Test for the newContentTypeCreateStruct() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newContentTypeCreateStruct() + * * @depends testNewContentTypeCreateStruct */ public function testNewContentTypeCreateStructValues($createStruct) @@ -689,6 +713,7 @@ public function testNewContentTypeCreateStructValues($createStruct) * Test for the newFieldDefinitionCreateStruct() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newFieldDefinitionCreateStruct() + * * @group user * @group field-type */ @@ -702,7 +727,7 @@ public function testNewFieldDefinitionCreateStruct() $fieldDefinitionCreate = $contentTypeService->newFieldDefinitionCreateStruct('title', 'ezstring'); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( FieldDefinitionCreateStruct::class, $fieldDefinitionCreate ); @@ -714,6 +739,7 @@ public function testNewFieldDefinitionCreateStruct() * Test for the newFieldDefinitionCreateStruct() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newFieldDefinitionCreateStruct() + * * @depends testNewFieldDefinitionCreateStruct */ public function testNewFieldDefinitionCreateStructValues($createStruct) @@ -742,6 +768,7 @@ public function testNewFieldDefinitionCreateStructValues($createStruct) * Test for the deleteContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentTypeGroup() + * * @depends testDeleteContentTypeGroup */ public function testDeleteContentTypeGroupThrowsInvalidArgumentException() @@ -764,9 +791,11 @@ public function testDeleteContentTypeGroupThrowsInvalidArgumentException() * Test for the createContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType() + * * @depends testNewContentTypeCreateStruct * @depends testNewFieldDefinitionCreateStruct * @depends testLoadContentTypeGroupByIdentifier + * * @group user * @group field-type */ @@ -857,7 +886,7 @@ public function testCreateContentType() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ContentType::class, $contentTypeDraft ); @@ -873,6 +902,7 @@ public function testCreateContentType() * Test for the createContentType() method struct values. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType + * * @depends testCreateContentType * * @param array $data @@ -894,14 +924,14 @@ public function testCreateContentTypeStructValues(array $data) case 'creationDate': case 'modificationDate': - $this->assertEquals( + self::assertEquals( $typeCreate->$propertyName->getTimestamp(), $contentType->$propertyName->getTimestamp() ); break; default: - $this->assertEquals( + self::assertEquals( $typeCreate->$propertyName, $contentType->$propertyName, "Did not assert that property '$propertyName' is equal on struct and resulting value object" @@ -915,7 +945,7 @@ public function testCreateContentTypeStructValues(array $data) $contentType->contentTypeGroups ); - $this->assertNotNull( + self::assertNotNull( $contentType->id ); } @@ -934,7 +964,7 @@ protected function assertFieldDefinitionsCorrect( array $expectedDefinitionCreates, array $actualDefinitions ): void { - $this->assertSameSize( + self::assertSameSize( $expectedDefinitionCreates, $actualDefinitions, 'Count of field definition creates did not match count of field definitions.' @@ -966,7 +996,7 @@ protected function assertFieldDefinitionsEqual( FieldDefinition $actualDefinition ): void { foreach ($expectedCreate as $propertyName => $propertyValue) { - $this->assertEquals( + self::assertEquals( $expectedCreate->$propertyName, $actualDefinition->$propertyName ); @@ -1008,6 +1038,7 @@ protected function assertContentTypeGroupsCorrect($expectedGroups, $actualGroups * Test for the createContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType() + * * @depends testCreateContentType */ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateIdentifier() @@ -1042,6 +1073,7 @@ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateIden * remoteId. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType() + * * @depends testCreateContentType */ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateRemoteId() @@ -1076,6 +1108,7 @@ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateRemo * Test for the createContentType() method creating content with duplicate field identifiers. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType + * * @depends testCreateContentType */ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateFieldIdentifier() @@ -1113,6 +1146,7 @@ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateFiel * existing identifier. * * @depends testCreateContentType + * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType */ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateContentTypeIdentifier() @@ -1151,6 +1185,7 @@ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateCont * Test for the createContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType() + * * @depends testCreateContentType */ public function testCreateContentTypeThrowsContentTypeFieldDefinitionValidationException() @@ -1188,15 +1223,15 @@ public function testCreateContentTypeThrowsContentTypeFieldDefinitionValidationE /* END: Use Case */ /* @var $validationErrors */ - $this->assertTrue(isset($validationErrors)); - $this->assertIsArray($validationErrors); - $this->assertCount(1, $validationErrors); - $this->assertArrayHasKey('temperature', $validationErrors); - $this->assertIsArray($validationErrors['temperature']); - $this->assertCount(1, $validationErrors['temperature']); - $this->assertInstanceOf(ValidationError::class, $validationErrors['temperature'][0]); - - $this->assertEquals( + self::assertTrue(isset($validationErrors)); + self::assertIsArray($validationErrors); + self::assertCount(1, $validationErrors); + self::assertArrayHasKey('temperature', $validationErrors); + self::assertIsArray($validationErrors['temperature']); + self::assertCount(1, $validationErrors['temperature']); + self::assertInstanceOf(ValidationError::class, $validationErrors['temperature'][0]); + + self::assertEquals( new Message( "Validator parameter '%parameter%' value must be of integer type", ['%parameter%' => 'minIntegerValue'] @@ -1209,6 +1244,7 @@ public function testCreateContentTypeThrowsContentTypeFieldDefinitionValidationE * Test for the createContentTypeGroup() method called with no groups. * * @depends testCreateContentType + * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeGroup */ public function testCreateContentTypeThrowsInvalidArgumentExceptionGroupsEmpty() @@ -1245,7 +1281,7 @@ public function testNewContentTypeUpdateStruct() $typeUpdate = $contentTypeService->newContentTypeUpdateStruct(); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ContentTypeUpdateStruct::class, $typeUpdate ); @@ -1257,12 +1293,13 @@ public function testNewContentTypeUpdateStruct() * Test for the newContentTypeUpdateStruct() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newContentTypeUpdateStruct() + * * @depends testNewContentTypeUpdateStruct */ public function testNewContentTypeUpdateStructValues($typeUpdate) { foreach ($typeUpdate as $propertyName => $propertyValue) { - $this->assertNull( + self::assertNull( $propertyValue, "Property '$propertyName' is not null." ); @@ -1273,6 +1310,7 @@ public function testNewContentTypeUpdateStructValues($typeUpdate) * Test for the loadContentTypeDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeDraft() + * * @depends testCreateContentType */ public function testLoadContentTypeDraft() @@ -1288,7 +1326,7 @@ public function testLoadContentTypeDraft() ); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( $contentTypeDraft, $contentTypeDraftReloaded ); @@ -1298,6 +1336,7 @@ public function testLoadContentTypeDraft() * Test for the loadContentTypeDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeDraft() + * * @depends testLoadContentTypeDraft */ public function testLoadContentTypeDraftThrowsNotFoundException() @@ -1355,7 +1394,7 @@ public function testCanLoadContentTypeDraftEvenIfDiffrentOwner() $loadedDraft = $contentTypeService->loadContentTypeDraft($draft->id, true); - $this->assertSame((int)$loadedDraft->id, (int)$draft->id); + self::assertSame((int)$loadedDraft->id, (int)$draft->id); } /** @@ -1398,7 +1437,7 @@ public function testUpdateContentTypeDraft() $contentTypeDraft->id ); - $this->assertInstanceOf( + self::assertInstanceOf( ContentTypeDraft::class, $updatedType ); @@ -1414,6 +1453,7 @@ public function testUpdateContentTypeDraft() * Test for the updateContentTypeDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeDraft() + * * @depends testUpdateContentTypeDraft */ public function testUpdateContentTypeDraftStructValues($data) @@ -1446,11 +1486,11 @@ public function testUpdateContentTypeDraftStructValues($data) foreach ($originalType->fieldDefinitions as $index => $expectedFieldDefinition) { $actualFieldDefinition = $updatedType->fieldDefinitions[$index]; - $this->assertInstanceOf( + self::assertInstanceOf( FieldDefinition::class, $actualFieldDefinition ); - $this->assertEquals($expectedFieldDefinition, $actualFieldDefinition); + self::assertEquals($expectedFieldDefinition, $actualFieldDefinition); } } @@ -1498,6 +1538,7 @@ public function testUpdateContentTypeDraftWithNewTranslation() * Test for the updateContentTypeDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeDraft() + * * @depends testUpdateContentTypeDraft */ public function testUpdateContentTypeDraftThrowsInvalidArgumentExceptionDuplicateIdentifier() @@ -1522,6 +1563,7 @@ public function testUpdateContentTypeDraftThrowsInvalidArgumentExceptionDuplicat * Test for the updateContentTypeDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeDraft() + * * @depends testUpdateContentTypeDraft */ public function testUpdateContentTypeDraftThrowsInvalidArgumentExceptionDuplicateRemoteId() @@ -1546,6 +1588,7 @@ public function testUpdateContentTypeDraftThrowsInvalidArgumentExceptionDuplicat * Test for the updateContentTypeDraft() method. * * @depends testUpdateContentTypeDraft + * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeDraft */ public function testUpdateContentTypeDraftThrowsInvalidArgumentExceptionNoDraftForAuthenticatedUser() @@ -1584,6 +1627,7 @@ public function testUpdateContentTypeDraftThrowsInvalidArgumentExceptionNoDraftF * @return array * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() + * * @depends testCreateContentType */ public function testAddFieldDefinition() @@ -1623,7 +1667,7 @@ public function testAddFieldDefinition() $loadedType = $contentTypeService->loadContentTypeDraft($contentTypeDraft->id); - $this->assertInstanceOf( + self::assertInstanceOf( ContentTypeDraft::class, $loadedType ); @@ -1638,6 +1682,7 @@ public function testAddFieldDefinition() * Test for the addFieldDefinition() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() + * * @depends testAddFieldDefinition */ public function testAddFieldDefinitionStructValues(array $data) @@ -1653,7 +1698,7 @@ public function testAddFieldDefinitionStructValues(array $data) } } - $this->fail( + self::fail( sprintf( 'Could not create Field definition with identifier "%s".', $fieldDefCreate->identifier @@ -1665,6 +1710,7 @@ public function testAddFieldDefinitionStructValues(array $data) * Test for the addFieldDefinition() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() + * * @depends testAddFieldDefinition */ public function testAddFieldDefinitionThrowsInvalidArgumentExceptionDuplicateFieldIdentifier() @@ -1691,6 +1737,7 @@ public function testAddFieldDefinitionThrowsInvalidArgumentExceptionDuplicateFie * times to the same ContentType. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() + * * @depends testAddFieldDefinition */ public function testAddFieldDefinitionThrowsContentTypeFieldDefinitionValidationException() @@ -1726,15 +1773,15 @@ public function testAddFieldDefinitionThrowsContentTypeFieldDefinitionValidation /* END: Use Case */ /* @var $validationErrors */ - $this->assertTrue(isset($validationErrors)); - $this->assertIsArray($validationErrors); - $this->assertCount(1, $validationErrors); - $this->assertArrayHasKey('temperature', $validationErrors); - $this->assertIsArray($validationErrors['temperature']); - $this->assertCount(1, $validationErrors['temperature']); - $this->assertInstanceOf(ValidationError::class, $validationErrors['temperature'][0]); - - $this->assertEquals( + self::assertTrue(isset($validationErrors)); + self::assertIsArray($validationErrors); + self::assertCount(1, $validationErrors); + self::assertArrayHasKey('temperature', $validationErrors); + self::assertIsArray($validationErrors['temperature']); + self::assertCount(1, $validationErrors['temperature']); + self::assertInstanceOf(ValidationError::class, $validationErrors['temperature'][0]); + + self::assertEquals( new Message( "Validator parameter '%parameter%' value must be of integer type", ['%parameter%' => 'maxIntegerValue'] @@ -1750,6 +1797,7 @@ public function testAddFieldDefinitionThrowsContentTypeFieldDefinitionValidation * times to the same ContentType. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() + * * @depends testAddFieldDefinition */ public function testAddFieldDefinitionThrowsBadStateExceptionNonRepeatableField() @@ -1845,6 +1893,7 @@ public function testCreateContentThrowsContentTypeValidationException() * already has Content instances. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() + * * @depends testAddFieldDefinition */ public function testAddFieldDefinitionThrowsBadStateExceptionContentInstances() @@ -1886,6 +1935,7 @@ public function testAddFieldDefinitionThrowsBadStateExceptionContentInstances() * @return array * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::removeFieldDefinition() + * * @depends testCreateContentType */ public function testRemoveFieldDefinition() @@ -1903,7 +1953,7 @@ public function testRemoveFieldDefinition() $loadedType = $contentTypeService->loadContentTypeDraft($contentTypeDraft->id); - $this->assertInstanceOf( + self::assertInstanceOf( ContentTypeDraft::class, $loadedType ); @@ -1920,6 +1970,7 @@ public function testRemoveFieldDefinition() * @param array $data * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::removeFieldDefinition() + * * @depends testRemoveFieldDefinition */ public function testRemoveFieldDefinitionRemoved(array $data) @@ -1929,7 +1980,7 @@ public function testRemoveFieldDefinitionRemoved(array $data) foreach ($loadedType->fieldDefinitions as $fieldDefinition) { if ($fieldDefinition->identifier == $removedFieldDefinition->identifier) { - $this->fail( + self::fail( sprintf( 'Field definition with identifier "%s" not removed.', $removedFieldDefinition->identifier @@ -1943,6 +1994,7 @@ public function testRemoveFieldDefinitionRemoved(array $data) * Test for the removeFieldDefinition() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::removeFieldDefinition() + * * @depends testRemoveFieldDefinition */ public function testRemoveFieldDefinitionThrowsInvalidArgumentException() @@ -1969,6 +2021,7 @@ public function testRemoveFieldDefinitionThrowsInvalidArgumentException() * Test removeFieldDefinition() method for field in a different draft throws an exception. * * @depends testRemoveFieldDefinition + * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::removeFieldDefinition */ public function testRemoveFieldDefinitionThrowsInvalidArgumentExceptionOnWrongDraft() @@ -1991,6 +2044,7 @@ public function testRemoveFieldDefinitionThrowsInvalidArgumentExceptionOnWrongDr * Test for the removeFieldDefinition() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::removeFieldDefinition() + * * @depends testRemoveFieldDefinition */ public function testRemoveFieldDefinitionRemovesFieldFromContent() @@ -2035,15 +2089,15 @@ public function testRemoveFieldDefinitionRemovesFieldFromContent() $draftContent->versionInfo->versionNo ); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $contentVersion1Archived ); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $contentVersion2Published ); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $contentVersion3Draft ); @@ -2061,6 +2115,7 @@ public function testRemoveFieldDefinitionRemovesFieldFromContent() * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content[] $data * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::removeFieldDefinition + * * @depends testRemoveFieldDefinitionRemovesFieldFromContent */ public function testRemoveFieldDefinitionRemovesFieldFromContentRemoved($data) @@ -2071,15 +2126,15 @@ public function testRemoveFieldDefinitionRemovesFieldFromContentRemoved($data) $contentVersion2Draft ) = $data; - $this->assertFalse( + self::assertFalse( isset($contentVersion1Archived->fields['body']), 'The field was not removed from archived version.' ); - $this->assertFalse( + self::assertFalse( isset($contentVersion1Published->fields['body']), 'The field was not removed from published version.' ); - $this->assertFalse( + self::assertFalse( isset($contentVersion2Draft->fields['body']), 'The field was not removed from draft version.' ); @@ -2119,7 +2174,7 @@ public function testRemoveFieldDefinitionRemovesOrphanedRelations(): void // Load Content $content = $contentService->loadContent($publishedContent->contentInfo->id); - $this->assertCount(0, $contentService->loadRelations($content->versionInfo)); + self::assertCount(0, $contentService->loadRelations($content->versionInfo)); } private function getRelationFieldDefinition(): FieldDefinitionCreateStruct @@ -2149,6 +2204,7 @@ private function getRelationFieldDefinition(): FieldDefinitionCreateStruct * Test for the addFieldDefinition() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() + * * @depends testAddFieldDefinition */ public function testAddFieldDefinitionAddsFieldToContent() @@ -2214,15 +2270,15 @@ public function testAddFieldDefinitionAddsFieldToContent() $draftContent->versionInfo->versionNo ); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $contentVersion1Archived ); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $contentVersion2Published ); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $contentVersion3Draft ); @@ -2240,6 +2296,7 @@ public function testAddFieldDefinitionAddsFieldToContent() * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content[] $data * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() + * * @depends testAddFieldDefinitionAddsFieldToContent */ public function testAddFieldDefinitionAddsFieldToContentAdded(array $data) @@ -2250,24 +2307,24 @@ public function testAddFieldDefinitionAddsFieldToContentAdded(array $data) $contentVersion2Draft ) = $data; - $this->assertTrue( + self::assertTrue( isset($contentVersion1Archived->fields['byline']), 'New field was not added to archived version.' ); - $this->assertTrue( + self::assertTrue( isset($contentVersion1Published->fields['byline']), 'New field was not added to published version.' ); - $this->assertTrue( + self::assertTrue( isset($contentVersion2Draft->fields['byline']), 'New field was not added to draft version.' ); - $this->assertEquals( + self::assertEquals( $contentVersion1Archived->getField('byline')->id, $contentVersion1Published->getField('byline')->id ); - $this->assertEquals( + self::assertEquals( $contentVersion1Published->getField('byline')->id, $contentVersion2Draft->getField('byline')->id ); @@ -2300,6 +2357,7 @@ public function testNewFieldDefinitionUpdateStruct() * Test for the newFieldDefinitionUpdateStruct() method. * * @depends testNewFieldDefinitionUpdateStruct + * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newContentTypeUpdateStruct * * @param \Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinitionUpdateStruct $fieldDefinitionUpdateStruct @@ -2307,7 +2365,7 @@ public function testNewFieldDefinitionUpdateStruct() public function testNewFieldDefinitionUpdateStructValues($fieldDefinitionUpdateStruct) { foreach ($fieldDefinitionUpdateStruct as $propertyName => $propertyValue) { - $this->assertNull( + self::assertNull( $propertyValue, "Property '$propertyName' is not null." ); @@ -2320,6 +2378,7 @@ public function testNewFieldDefinitionUpdateStructValues($fieldDefinitionUpdateS * @return array * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateFieldDefinition() + * * @depends testLoadContentTypeDraft */ public function testUpdateFieldDefinition() @@ -2361,7 +2420,7 @@ public function testUpdateFieldDefinition() /* END: Use Case */ $loadedDraft = $contentTypeService->loadContentTypeDraft($contentTypeDraft->id); - $this->assertInstanceOf( + self::assertInstanceOf( FieldDefinition::class, ($loadedField = $loadedDraft->getFieldDefinition('blog-body')) ); @@ -2443,6 +2502,7 @@ public function testUpdateFieldDefinitionWithNewTranslation() * @param array $data * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateFieldDefinition() + * * @depends testUpdateFieldDefinition */ public function testUpdateFieldDefinitionStructValues(array $data) @@ -2535,6 +2595,7 @@ public function testUpdateFieldDefinitionThrowsInvalidArgumentExceptionFieldIden * Test for the updateFieldDefinition() method trying to update non-existent field. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateFieldDefinition() + * * @depends testLoadContentTypeDraft */ public function testUpdateFieldDefinitionThrowsInvalidArgumentExceptionForUndefinedField() @@ -2568,6 +2629,7 @@ public function testUpdateFieldDefinitionThrowsInvalidArgumentExceptionForUndefi * Test for the publishContentTypeDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::publishContentTypeDraft() + * * @depends testLoadContentTypeDraft */ public function testPublishContentTypeDraft() @@ -2583,11 +2645,11 @@ public function testPublishContentTypeDraft() $publishedType = $contentTypeService->loadContentType($contentTypeDraft->id); - $this->assertInstanceOf( + self::assertInstanceOf( ContentType::class, $publishedType ); - $this->assertNotInstanceOf( + self::assertNotInstanceOf( ContentTypeDraft::class, $publishedType ); @@ -2597,6 +2659,7 @@ public function testPublishContentTypeDraft() * Test for the publishContentTypeDraft() method setting proper ContentType nameSchema. * * @depends testPublishContentTypeDraft + * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::publishContentTypeDraft */ public function testPublishContentTypeDraftSetsNameSchema() @@ -2627,7 +2690,7 @@ public function testPublishContentTypeDraftSetsNameSchema() $loadedContentType = $contentTypeService->loadContentType($type->id); - $this->assertEquals('', $loadedContentType->nameSchema); + self::assertEquals('<title>', $loadedContentType->nameSchema); } /** @@ -2688,6 +2751,7 @@ static function (ContentType $contentType) { * Test for the publishContentTypeDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::publishContentTypeDraft() + * * @depends testPublishContentTypeDraft */ public function testPublishContentTypeDraftThrowsBadStateException() @@ -2711,6 +2775,7 @@ public function testPublishContentTypeDraftThrowsBadStateException() * Test for the createContentTypeGroup() method trying to create content type without any fields. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::publishContentTypeDraft() + * * @depends testPublishContentTypeDraft */ public function testPublishContentTypeDraftThrowsInvalidArgumentExceptionWithoutFields() @@ -2745,7 +2810,9 @@ public function testPublishContentTypeDraftThrowsInvalidArgumentExceptionWithout * Test for the loadContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentType() + * * @depends testCreateContentType + * * @group user * @group field-type */ @@ -2761,7 +2828,7 @@ public function testLoadContentType() $userGroupType = $contentTypeService->loadContentType($userGroupId); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ContentType::class, $userGroupType ); @@ -2826,6 +2893,7 @@ public function getPrioritizedLanguageList() * Test for the loadContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentType() + * * @depends testLoadContentType */ public function testLoadContentTypeStructValues($userGroupType) @@ -2867,6 +2935,7 @@ public function testLoadContentTypeStructValues($userGroupType) * Test for the loadContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentType() + * * @depends testLoadContentTypeStructValues */ public function testLoadContentTypeFieldDefinitions(APIFieldDefinitionCollection $fieldDefinitions) @@ -2906,15 +2975,15 @@ public function testLoadContentTypeFieldDefinitions(APIFieldDefinitionCollection $fieldDefinitions = $fieldDefinitions->toArray(); foreach ($fieldDefinitions as $index => $fieldDefinition) { - $this->assertInstanceOf( + self::assertInstanceOf( FieldDefinition::class, $fieldDefinition ); - $this->assertNotNull($fieldDefinition->id); + self::assertNotNull($fieldDefinition->id); if (!isset($expectedFieldDefinitions[$fieldDefinition->identifier])) { - $this->fail( + self::fail( sprintf( 'Unexpected Field definition loaded: "%s" (%s)', $fieldDefinition->identifier, @@ -2932,7 +3001,7 @@ public function testLoadContentTypeFieldDefinitions(APIFieldDefinitionCollection } if (0 !== count($expectedFieldDefinitions)) { - $this->fail( + self::fail( sprintf( 'Missing expected Field definitions: %s', implode(',', array_column($expectedFieldDefinitions, 'identifier')) @@ -2941,7 +3010,7 @@ public function testLoadContentTypeFieldDefinitions(APIFieldDefinitionCollection } if (0 !== count($fieldDefinitions)) { - $this->fail( + self::fail( sprintf( 'Loaded unexpected Field definitions: %s', implode( @@ -2962,6 +3031,7 @@ static function ($fieldDefinition) { * Test for the loadContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentType() + * * @depends testLoadContentType */ public function testLoadContentTypeThrowsNotFoundException() @@ -2985,7 +3055,9 @@ public function testLoadContentTypeThrowsNotFoundException() * @return \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeByIdentifier() + * * @depends testLoadContentType + * * @group user */ public function testLoadContentTypeByIdentifier() @@ -2998,7 +3070,7 @@ public function testLoadContentTypeByIdentifier() $articleType = $contentTypeService->loadContentTypeByIdentifier('article'); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ContentType::class, $articleType ); @@ -3012,6 +3084,7 @@ public function testLoadContentTypeByIdentifier() * @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType $contentType * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeByIdentifier() + * * @depends testLoadContentTypeByIdentifier */ public function testLoadContentTypeByIdentifierReturnsCorrectInstance($contentType) @@ -3019,7 +3092,7 @@ public function testLoadContentTypeByIdentifierReturnsCorrectInstance($contentTy $repository = $this->getRepository(); $contentTypeService = $repository->getContentTypeService(); - $this->assertEquals( + self::assertEquals( $contentTypeService->loadContentType($contentType->id), $contentType ); @@ -3029,6 +3102,7 @@ public function testLoadContentTypeByIdentifierReturnsCorrectInstance($contentTy * Test for the loadContentTypeByIdentifier() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeByIdentifier() + * * @depends testLoadContentTypeByIdentifier */ public function testLoadContentTypeByIdentifierThrowsNotFoundException() @@ -3049,6 +3123,7 @@ public function testLoadContentTypeByIdentifierThrowsNotFoundException() * Test for the loadContentTypeByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeByRemoteId() + * * @depends testLoadContentType */ public function testLoadContentTypeByRemoteId() @@ -3064,7 +3139,7 @@ public function testLoadContentTypeByRemoteId() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ContentType::class, $userGroupType ); @@ -3076,6 +3151,7 @@ public function testLoadContentTypeByRemoteId() * Test for the loadContentTypeByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeByRemoteId() + * * @depends testLoadContentTypeByRemoteId */ public function testLoadContentTypeByRemoteIdReturnsCorrectInstance($contentType) @@ -3083,7 +3159,7 @@ public function testLoadContentTypeByRemoteIdReturnsCorrectInstance($contentType $repository = $this->getRepository(); $contentTypeService = $repository->getContentTypeService(); - $this->assertEquals( + self::assertEquals( $contentTypeService->loadContentType($contentType->id), $contentType ); @@ -3093,6 +3169,7 @@ public function testLoadContentTypeByRemoteIdReturnsCorrectInstance($contentType * Test for the loadContentTypeByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeByRemoteId() + * * @depends testLoadContentType */ public function testLoadContentTypeByRemoteIdThrowsNotFoundException() @@ -3113,6 +3190,7 @@ public function testLoadContentTypeByRemoteIdThrowsNotFoundException() * Test for the loadContentTypeList() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeList() + * * @depends testLoadContentType */ public function testLoadContentTypeList() @@ -3122,9 +3200,9 @@ public function testLoadContentTypeList() $types = $contentTypeService->loadContentTypeList([3, 4]); - $this->assertIsIterable($types); + self::assertIsIterable($types); - $this->assertEquals( + self::assertEquals( [ 3 => $contentTypeService->loadContentType(3), 4 => $contentTypeService->loadContentType(4), @@ -3137,6 +3215,7 @@ public function testLoadContentTypeList() * Test for the loadContentTypes() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypes() + * * @depends testLoadContentType */ public function testLoadContentTypes() @@ -3154,7 +3233,7 @@ public function testLoadContentTypes() $types = $contentTypeService->loadContentTypes($contentTypeGroup); /* END: Use Case */ - $this->assertIsArray($types); + self::assertIsArray($types); return $types; } @@ -3163,6 +3242,7 @@ public function testLoadContentTypes() * Test for the loadContentTypes() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypes() + * * @depends testLoadContentTypes */ public function testLoadContentTypesContent(array $types) @@ -3180,7 +3260,7 @@ static function ($a, $b) { return ($a->id < $b->id) ? -1 : 1; } ); - $this->assertEquals( + self::assertEquals( [ $contentTypeService->loadContentType($this->generateId('type', 3)), $contentTypeService->loadContentType($this->generateId('type', 4)), @@ -3193,6 +3273,7 @@ static function ($a, $b) { * Test for the createContentTypeDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeDraft() + * * @depends testLoadContentType */ public function testCreateContentTypeDraft() @@ -3207,7 +3288,7 @@ public function testCreateContentTypeDraft() $commentTypeDraft = $contentTypeService->createContentTypeDraft($commentType); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ContentTypeDraft::class, $commentTypeDraft ); @@ -3222,6 +3303,7 @@ public function testCreateContentTypeDraft() * Test for the createContentTypeDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeDraft() + * * @depends testCreateContentTypeDraft */ public function testCreateContentTypeDraftStructValues(array $data) @@ -3252,7 +3334,7 @@ public function testCreateContentTypeDraftStructValues(array $data) $typeDraft ); - $this->assertInstanceOf( + self::assertInstanceOf( 'DateTime', $typeDraft->modificationDate ); @@ -3260,9 +3342,9 @@ public function testCreateContentTypeDraftStructValues(array $data) $typeDraft->modificationDate ); // No modification date is newer, interval is not inverted - $this->assertEquals(0, $modificationDifference->invert); + self::assertEquals(0, $modificationDifference->invert); - $this->assertEquals( + self::assertEquals( ContentType::STATUS_DRAFT, $typeDraft->status ); @@ -3274,6 +3356,7 @@ public function testCreateContentTypeDraftStructValues(array $data) * Test for the createContentTypeDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeDraft() + * * @depends testCreateContentTypeDraftStructValues */ public function testCreateContentTypeDraftStructLanguageDependentValues(array $data) @@ -3281,7 +3364,7 @@ public function testCreateContentTypeDraftStructLanguageDependentValues(array $d $originalType = $data['originalType']; $typeDraft = $data['typeDraft']; - $this->assertEquals( + self::assertEquals( [ 'names' => $originalType->names, 'descriptions' => $originalType->descriptions, @@ -3297,6 +3380,7 @@ public function testCreateContentTypeDraftStructLanguageDependentValues(array $d * Test for the createContentTypeDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeDraft() + * * @depends testCreateContentTypeDraft */ public function testCreateContentTypeDraftThrowsBadStateException() @@ -3321,6 +3405,7 @@ public function testCreateContentTypeDraftThrowsBadStateException() * Test for the deleteContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentType() + * * @depends testLoadContentTypeByIdentifier */ public function testDeleteContentType() @@ -3338,13 +3423,14 @@ public function testDeleteContentType() /* END: Use Case */ $contentTypeService->loadContentType($commentType->id); - $this->fail('Content type could be loaded after delete.'); + self::fail('Content type could be loaded after delete.'); } /** * Test for the deleteContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentType() + * * @depends testDeleteContentType */ public function testDeleteContentTypeThrowsBadStateException() @@ -3370,6 +3456,7 @@ public function testDeleteContentTypeThrowsBadStateException() * @return array * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::copyContentType() + * * @depends testLoadContentTypeByIdentifier */ public function testCopyContentType() @@ -3393,14 +3480,14 @@ public function testCopyContentType() }, $contentTypes); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ContentType::class, $copiedType ); - $this->assertContains($commentType->identifier, $contentTypeIdentifiers); - $this->assertContains($copiedType->identifier, $contentTypeIdentifiers); - $this->assertCount($contentTypesCount + 1, $contentTypes); + self::assertContains($commentType->identifier, $contentTypeIdentifiers); + self::assertContains($copiedType->identifier, $contentTypeIdentifiers); + self::assertCount($contentTypesCount + 1, $contentTypes); $originalType = $contentTypeService->loadContentTypeByIdentifier('comment'); @@ -3416,6 +3503,7 @@ public function testCopyContentType() * @param array $data * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::copyContentType() + * * @depends testCopyContentType */ public function testCopyContentTypeStructValues(array $data) @@ -3451,23 +3539,23 @@ private function assertCopyContentTypeValues($originalType, $copiedType, $exclud $properties ); - $this->assertNotEquals( + self::assertNotEquals( $originalType->id, $copiedType->id ); - $this->assertNotEquals( + self::assertNotEquals( $originalType->remoteId, $copiedType->remoteId ); - $this->assertNotEquals( + self::assertNotEquals( $originalType->identifier, $copiedType->identifier ); - $this->assertNotEquals( + self::assertNotEquals( $originalType->creationDate, $copiedType->creationDate ); - $this->assertNotEquals( + self::assertNotEquals( $originalType->modificationDate, $copiedType->modificationDate ); @@ -3495,7 +3583,7 @@ private function assertCopyContentTypeValues($originalType, $copiedType, $exclud 'isSearchable', ] ); - $this->assertNotEquals( + self::assertNotEquals( $originalFieldDefinition->id, $copiedFieldDefinition->id ); @@ -3506,6 +3594,7 @@ private function assertCopyContentTypeValues($originalType, $copiedType, $exclud * Test for the copyContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::copyContentType($contentType, $user) + * * @depends testCopyContentType */ public function testCopyContentTypeWithSecondParameter() @@ -3537,6 +3626,7 @@ public function testCopyContentTypeWithSecondParameter() * Test for the assignContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::assignContentTypeGroup() + * * @depends testLoadContentTypeGroupByIdentifier * @depends testLoadContentTypeByIdentifier * @depends testLoadContentType @@ -3561,7 +3651,7 @@ public function testAssignContentTypeGroup() return; } } - $this->fail( + self::fail( sprintf( 'Group with ID "%s" not assigned to content type.', $mediaGroup->id @@ -3573,6 +3663,7 @@ public function testAssignContentTypeGroup() * Test for the assignContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::assignContentTypeGroup() + * * @depends testAssignContentTypeGroup */ public function testAssignContentTypeGroupThrowsInvalidArgumentException() @@ -3598,6 +3689,7 @@ public function testAssignContentTypeGroupThrowsInvalidArgumentException() * Test for the unassignContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::unassignContentTypeGroup() + * * @depends testAssignContentTypeGroup */ public function testUnassignContentTypeGroup() @@ -3622,7 +3714,7 @@ public function testUnassignContentTypeGroup() foreach ($loadedType->contentTypeGroups as $assignedGroup) { if ($assignedGroup->id == $contentGroup->id) { - $this->fail( + self::fail( sprintf( 'Could not unassign group with ID "%s".', $assignedGroup->id @@ -3636,6 +3728,7 @@ public function testUnassignContentTypeGroup() * Test for the unassignContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::unassignContentTypeGroup() + * * @depends testUnassignContentTypeGroup */ public function testUnassignContentTypeGroupThrowsInvalidArgumentException() @@ -3659,6 +3752,7 @@ public function testUnassignContentTypeGroupThrowsInvalidArgumentException() * Test for the unassignContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::unassignContentTypeGroup() + * * @depends testUnassignContentTypeGroup */ public function testUnassignContentTypeGroupThrowsBadStateException() @@ -3684,6 +3778,7 @@ public function testUnassignContentTypeGroupThrowsBadStateException() * Test for the createContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeGroup() + * * @depends testLoadContentTypeGroup * @depends testCreateContentTypeGroup */ @@ -3723,13 +3818,14 @@ public function testCreateContentTypeGroupInTransactionWithRollback() } /* END: Use Case */ - $this->fail('Can still load content type group after rollback'); + self::fail('Can still load content type group after rollback'); } /** * Test for the createContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeGroup() + * * @depends testLoadContentTypeGroup * @depends testCreateContentTypeGroup */ @@ -3765,13 +3861,14 @@ public function testCreateContentTypeGroupInTransactionWithCommit() $group = $contentTypeService->loadContentTypeGroup($groupId); /* END: Use Case */ - $this->assertEquals($groupId, $group->id); + self::assertEquals($groupId, $group->id); } /** * Test for the updateContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeGroup() + * * @depends testUpdateContentTypeGroup * @depends testLoadContentTypeGroupByIdentifier */ @@ -3808,13 +3905,14 @@ public function testUpdateContentTypeGroupInTransactionWithRollback() $updatedGroup = $contentTypeService->loadContentTypeGroupByIdentifier('Setup'); /* END: Use Case */ - $this->assertEquals('Setup', $updatedGroup->identifier); + self::assertEquals('Setup', $updatedGroup->identifier); } /** * Test for the updateContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeGroup() + * * @depends testUpdateContentTypeGroup * @depends testLoadContentTypeGroupByIdentifier */ @@ -3853,13 +3951,14 @@ public function testUpdateContentTypeGroupInTransactionWithCommit() ); /* END: Use Case */ - $this->assertEquals('Teardown', $updatedGroup->identifier); + self::assertEquals('Teardown', $updatedGroup->identifier); } /** * Test for the deleteContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentTypeGroup() + * * @depends testDeleteContentTypeGroup * @depends testLoadContentTypeGroupByIdentifierThrowsNotFoundException */ @@ -3901,13 +4000,14 @@ public function testDeleteContentTypeGroupWithRollback() } /* END: Use Case */ - $this->assertTrue(isset($e), 'Group not deleted after rollback'); + self::assertTrue(isset($e), 'Group not deleted after rollback'); } /** * Test for the deleteContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentTypeGroup() + * * @depends testDeleteContentTypeGroup * @depends testLoadContentTypeGroupByIdentifierThrowsNotFoundException */ @@ -3949,13 +4049,14 @@ public function testDeleteContentTypeGroupWithCommit() } /* END: Use Case */ - $this->assertTrue(isset($e), 'Group not deleted after commit.'); + self::assertTrue(isset($e), 'Group not deleted after commit.'); } /** * Test for the createContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType() + * * @depends testCreateContentType * @depends testLoadContentTypeByIdentifierThrowsNotFoundException */ @@ -4009,13 +4110,14 @@ public function testCreateContentTypeInTransactionWithRollback() } /* END: Use Case */ - $this->assertTrue(isset($e), 'Can still load content type after rollback.'); + self::assertTrue(isset($e), 'Can still load content type after rollback.'); } /** * Test for the createContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType() + * * @depends testCreateContentType * @depends testLoadContentTypeByIdentifierThrowsNotFoundException */ @@ -4065,13 +4167,14 @@ public function testCreateContentTypeInTransactionWithCommit() $contentType = $contentTypeService->loadContentTypeByIdentifier('blog-post'); /* END: Use Case */ - $this->assertEquals($contentTypeDraft->id, $contentType->id); + self::assertEquals($contentTypeDraft->id, $contentType->id); } /** * Test for the copyContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::copyContentType() + * * @depends testCopyContentType * @depends testLoadContentTypeByIdentifier * @depends testLoadContentTypeThrowsNotFoundException @@ -4109,13 +4212,14 @@ public function testCopyContentTypeInTransactionWithRollback() } /* END: Use Case */ - $this->assertTrue(isset($e), 'Can still load copied content type after rollback.'); + self::assertTrue(isset($e), 'Can still load copied content type after rollback.'); } /** * Test for the copyContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::copyContentType() + * * @depends testCopyContentType * @depends testLoadContentTypeByIdentifier * @depends testLoadContentTypeThrowsNotFoundException @@ -4149,13 +4253,14 @@ public function testCopyContentTypeInTransactionWithCommit() $copiedContentType = $contentTypeService->loadContentType($contentTypeId); /* END: Use Case */ - $this->assertEquals($contentTypeId, $copiedContentType->id); + self::assertEquals($contentTypeId, $copiedContentType->id); } /** * Test for the deleteContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentType() + * * @depends testCopyContentType * @depends testLoadContentTypeByIdentifierThrowsNotFoundException */ @@ -4188,13 +4293,14 @@ public function testDeleteContentTypeInTransactionWithRollback() $commentType = $contentTypeService->loadContentTypeByIdentifier('comment'); /* END: Use Case */ - $this->assertEquals('comment', $commentType->identifier); + self::assertEquals('comment', $commentType->identifier); } /** * Test for the deleteContentType() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentType() + * * @depends testCopyContentType * @depends testLoadContentTypeByIdentifierThrowsNotFoundException */ @@ -4231,13 +4337,14 @@ public function testDeleteContentTypeInTransactionWithCommit() } /* END: Use Case */ - $this->assertTrue(isset($e), 'Can still load content type after rollback.'); + self::assertTrue(isset($e), 'Can still load content type after rollback.'); } /** * Test for the assignContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::assignContentTypeGroup() + * * @depends testAssignContentTypeGroup */ public function testAssignContentTypeGroupInTransactionWithRollback() @@ -4274,7 +4381,7 @@ public function testAssignContentTypeGroupInTransactionWithRollback() } /* END: Use Case */ - $this->assertFalse( + self::assertFalse( in_array($folderType->id, $contentTypeIds), 'Folder content type is still in media group after rollback.' ); @@ -4284,6 +4391,7 @@ public function testAssignContentTypeGroupInTransactionWithRollback() * Test for the assignContentTypeGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::assignContentTypeGroup() + * * @depends testAssignContentTypeGroup */ public function testAssignContentTypeGroupInTransactionWithCommit() @@ -4320,7 +4428,7 @@ public function testAssignContentTypeGroupInTransactionWithCommit() } /* END: Use Case */ - $this->assertTrue( + self::assertTrue( in_array($folderType->id, $contentTypeIds), 'Folder content type not in media group after commit.' ); @@ -4345,8 +4453,8 @@ public function testIsContentTypeUsed() $isEventUsed = $contentTypeService->isContentTypeUsed($eventType); /* END: Use Case */ - $this->assertTrue($isFolderUsed); - $this->assertFalse($isEventUsed); + self::assertTrue($isFolderUsed); + self::assertFalse($isEventUsed); } /** @@ -4367,7 +4475,7 @@ public function testRemoveContentTypeTranslation() $contentType = $contentTypeService->loadContentType($contentTypeDraft->id); - $this->assertEquals( + self::assertEquals( [ 'eng-US' => 'Blog post', 'ger-DE' => 'Blog-Eintrag', @@ -4382,12 +4490,12 @@ public function testRemoveContentTypeTranslation() $loadedContentTypeDraft = $contentTypeService->loadContentTypeDraft($contentType->id); - $this->assertArrayNotHasKey('ger-DE', $loadedContentTypeDraft->getNames()); - $this->assertArrayNotHasKey('ger-DE', $loadedContentTypeDraft->getDescriptions()); + self::assertArrayNotHasKey('ger-DE', $loadedContentTypeDraft->getNames()); + self::assertArrayNotHasKey('ger-DE', $loadedContentTypeDraft->getDescriptions()); foreach ($loadedContentTypeDraft->fieldDefinitions as $fieldDefinition) { - $this->assertArrayNotHasKey('ger-DE', $fieldDefinition->getNames()); - $this->assertArrayNotHasKey('ger-DE', $fieldDefinition->getDescriptions()); + self::assertArrayNotHasKey('ger-DE', $fieldDefinition->getNames()); + self::assertArrayNotHasKey('ger-DE', $fieldDefinition->getDescriptions()); } } @@ -4451,7 +4559,7 @@ public function testRemoveContentTypeTranslationWithMultilingualData() $loadedContentTypeDraft = $contentTypeService->loadContentTypeDraft($contentType->id); $fieldDefinition = $loadedContentTypeDraft->getFieldDefinition('selection'); - $this->assertArrayNotHasKey('ger-DE', $fieldDefinition->fieldSettings['multilingualOptions']); + self::assertArrayNotHasKey('ger-DE', $fieldDefinition->fieldSettings['multilingualOptions']); } /** diff --git a/tests/integration/Core/Repository/FieldType/AuthorIntegrationTest.php b/tests/integration/Core/Repository/FieldType/AuthorIntegrationTest.php index a2077819fb..5d89c6f9f3 100644 --- a/tests/integration/Core/Repository/FieldType/AuthorIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/AuthorIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException; @@ -142,7 +143,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( AuthorValue::class, $field->value ); @@ -223,7 +224,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( AuthorValue::class, $field->value ); @@ -262,7 +263,7 @@ public function provideInvalidUpdateFieldData() */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( AuthorValue::class, $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/BaseIntegrationTest.php b/tests/integration/Core/Repository/FieldType/BaseIntegrationTest.php index 8e3af2ead9..0323e176c9 100644 --- a/tests/integration/Core/Repository/FieldType/BaseIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/BaseIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository; @@ -282,7 +283,7 @@ public function testCreateContentType() $this->getValidFieldConfiguration() ); - $this->assertNotNull($contentType->id); + self::assertNotNull($contentType->id); return $contentType; } @@ -383,22 +384,24 @@ protected function getOverride($key, array $overrideValues, $default) /** * @covers \Ibexa\Core\FieldType\FieldType::isEmptyValue + * * @dataProvider providerForTestIsEmptyValue */ public function testIsEmptyValue($value) { - $this->assertTrue($this->getRepository()->getFieldTypeService()->getFieldType($this->getTypeName())->isEmptyValue($value)); + self::assertTrue($this->getRepository()->getFieldTypeService()->getFieldType($this->getTypeName())->isEmptyValue($value)); } abstract public function providerForTestIsEmptyValue(); /** * @covers \Ibexa\Core\FieldType\FieldType::isEmptyValue + * * @dataProvider providerForTestIsNotEmptyValue */ public function testIsNotEmptyValue($value) { - $this->assertFalse($this->getRepository()->getFieldTypeService()->getFieldType($this->getTypeName())->isEmptyValue($value)); + self::assertFalse($this->getRepository()->getFieldTypeService()->getFieldType($this->getTypeName())->isEmptyValue($value)); } abstract public function providerForTestIsNotEmptyValue(); @@ -408,7 +411,7 @@ abstract public function providerForTestIsNotEmptyValue(); */ public function testContentTypeField($contentType) { - $this->assertSame( + self::assertSame( $this->getTypeName(), $contentType->fieldDefinitions[1]->fieldTypeIdentifier ); @@ -432,7 +435,7 @@ public function testLoadContentTypeField() */ public function testLoadContentTypeFieldType($contentType) { - $this->assertSame( + self::assertSame( $this->getTypeName(), $contentType->fieldDefinitions[1]->fieldTypeIdentifier ); @@ -446,7 +449,7 @@ public function testSettingsSchema() $fieldTypeService = $repository->getFieldTypeService(); $fieldType = $fieldTypeService->getFieldType($this->getTypeName()); - $this->assertEquals( + self::assertEquals( $this->getSettingsSchema(), $fieldType->getSettingsSchema() ); @@ -457,17 +460,17 @@ public function testSettingsSchema() */ public function testLoadContentTypeFieldData(FieldDefinition $fieldDefinition) { - $this->assertEquals( + self::assertEquals( $this->getTypeName(), $fieldDefinition->fieldTypeIdentifier, 'Loaded fieldTypeIdentifier does not match.' ); - $this->assertEquals( + self::assertEquals( $this->getValidFieldSettings(), $fieldDefinition->fieldSettings, 'Loaded fieldSettings do not match.' ); - $this->assertEquals( + self::assertEquals( $this->getValidValidatorConfiguration(), $fieldDefinition->validatorConfiguration, 'Loaded validatorConfiguration does not match.' @@ -493,7 +496,7 @@ public function testValidatorSchema() $fieldTypeService = $repository->getFieldTypeService(); $fieldType = $fieldTypeService->getFieldType($this->getTypeName()); - $this->assertEquals( + self::assertEquals( $this->getValidatorSchema(), $fieldType->getValidatorConfigurationSchema() ); @@ -605,7 +608,7 @@ public function testCreatedFieldType($content) } } - $this->fail('Custom field not found.'); + self::fail('Custom field not found.'); } /** @@ -616,7 +619,7 @@ public function testPublishContent() $draft = $this->testCreateContent(); if (!$draft->getVersionInfo()->isDraft()) { - $this->markTestSkipped('Provided content object is not a draft.'); + self::markTestSkipped('Provided content object is not a draft.'); } $repository = $this->getRepository(); @@ -636,7 +639,7 @@ public function testPublishedFieldType($content) } } - $this->fail('Custom field not found.'); + self::fail('Custom field not found.'); } /** @@ -644,7 +647,7 @@ public function testPublishedFieldType($content) */ public function testPublishedName(Content $content) { - $this->assertEquals( + self::assertEquals( $content->getFieldValue('name') . ' ' . $this->getFieldName(), $content->contentInfo->name ); @@ -676,7 +679,7 @@ public function testLoadFieldType() } } - $this->fail('Custom field not found.'); + self::fail('Custom field not found.'); } /** @@ -720,11 +723,12 @@ public function testCreatedEmptyFieldValue($content) } } - $this->fail('Custom field not found.'); + self::fail('Custom field not found.'); } /** * @depends testCreateContentWithEmptyFieldValue + * * @group xx */ public function testLoadEmptyFieldValue() @@ -748,7 +752,7 @@ public function testLoadEmptyFieldValueType($content) } } - $this->fail('Custom field not found.'); + self::fail('Custom field not found.'); } /** @@ -765,7 +769,7 @@ public function testLoadEmptyFieldValueData($field) $refProperty->setAccessible(true); $spiFieldType = $refProperty->getValue($fieldType); - $this->assertEquals( + self::assertEquals( $fieldType->getEmptyValue(), $spiFieldType->acceptValue($field->value) ); @@ -818,7 +822,7 @@ public function testUpdateTypeFieldStillAvailable($content) } } - $this->fail('Custom field not found.'); + self::fail('Custom field not found.'); } /** @@ -848,7 +852,7 @@ public function testUpdateNoNewContentTypeFieldStillAvailable($content) } } - $this->fail('Custom field not found.'); + self::fail('Custom field not found.'); } /** @@ -875,7 +879,7 @@ public function testCopyField($content) $copied = $contentService->copyContent($content->contentInfo, $locationCreate); - $this->assertNotSame( + self::assertNotSame( $content->contentInfo->id, $copied->contentInfo->id ); @@ -894,7 +898,7 @@ public function testCopiedFieldType($content) } } - $this->fail('Custom field not found.'); + self::fail('Custom field not found.'); } /** @@ -973,8 +977,8 @@ public function testRemoveFieldDefinition() { $content = $this->removeFieldDefinition(); - $this->assertCount(1, $content->getFields()); - $this->assertNull($content->getFieldValue('data')); + self::assertCount(1, $content->getFields()); + self::assertNull($content->getFieldValue('data')); } protected function addFieldDefinition() @@ -1010,9 +1014,9 @@ public function testAddFieldDefinition() { $content = $this->addFieldDefinition(); - $this->assertCount(2, $content->getFields()); + self::assertCount(2, $content->getFields()); - $this->assertTrue( + self::assertTrue( $this->getRepository()->getFieldTypeService()->getFieldType( $this->getTypeName() )->isEmptyValue( @@ -1030,7 +1034,7 @@ public function testToHash($value, $expectedHash) $fieldTypeService = $repository->getFieldTypeService(); $fieldType = $fieldTypeService->getFieldType($this->getTypeName()); - $this->assertEquals( + self::assertEquals( $expectedHash, $fieldType->toHash($value) ); @@ -1038,7 +1042,9 @@ public function testToHash($value, $expectedHash) /** * @depends testCreateContent + * * @dataProvider provideFromHashData + * * @todo: Requires correct registered FieldTypeService, needs to be * maintained! */ @@ -1048,7 +1054,7 @@ public function testFromHash($hash, $expectedValue) $fieldTypeService = $repository->getFieldTypeService(); $fieldType = $fieldTypeService->getFieldType($this->getTypeName()); - $this->assertEquals( + self::assertEquals( $expectedValue, $fieldType->fromHash($hash) ); diff --git a/tests/integration/Core/Repository/FieldType/BinaryFileIntegrationTest.php b/tests/integration/Core/Repository/FieldType/BinaryFileIntegrationTest.php index a50acfec0f..9ab6935591 100644 --- a/tests/integration/Core/Repository/FieldType/BinaryFileIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/BinaryFileIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Values\Content\Field; @@ -182,7 +183,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( BinaryFileValue::class, $field->value ); @@ -194,13 +195,13 @@ public function assertFieldDataLoadedCorrect(Field $field) unset($expectedData['id']); $expectedData['inputUri'] = null; - $this->assertNotEmpty($field->value->id); + self::assertNotEmpty($field->value->id); $this->assertPropertiesCorrect( $expectedData, $field->value ); - $this->assertTrue( + self::assertTrue( $this->uriExistsOnIO($field->value->uri), "File {$field->value->uri} doesn't exist" ); @@ -249,7 +250,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( BinaryFileValue::class, $field->value ); @@ -261,13 +262,13 @@ public function assertUpdatedFieldDataLoadedCorrect(Field $field) unset($expectedData['id']); $expectedData['inputUri'] = null; - $this->assertNotEmpty($field->value->id); + self::assertNotEmpty($field->value->id); $this->assertPropertiesCorrect( $expectedData, $field->value ); - $this->assertTrue( + self::assertTrue( $this->uriExistsOnIO($field->value->uri), "File {$field->value->uri} doesn't exist." ); @@ -290,7 +291,7 @@ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { $this->assertFieldDataLoadedCorrect($field); - $this->assertEquals( + self::assertEquals( self::$loadedBinaryFilePath, $field->value->id ); @@ -394,7 +395,7 @@ protected function getValidSearchValueOne() protected function checkSearchEngineSupport() { if ($this->getSetupFactory() instanceof Legacy) { - $this->markTestSkipped( + self::markTestSkipped( "'ezbinaryfile' field type is not searchable with Legacy Search Engine" ); } @@ -414,6 +415,7 @@ protected function getValidSearchValueTwo() protected function getSearchTargetValueOne() { $value = $this->getValidSearchValueOne(); + // ensure case-insensitivity return strtoupper($value->fileName); } @@ -421,6 +423,7 @@ protected function getSearchTargetValueOne() protected function getSearchTargetValueTwo() { $value = $this->getValidSearchValueTwo(); + // ensure case-insensitivity return strtoupper($value->fileName); } diff --git a/tests/integration/Core/Repository/FieldType/CheckboxIntegrationTest.php b/tests/integration/Core/Repository/FieldType/CheckboxIntegrationTest.php index dcdf55d297..96cf46f389 100644 --- a/tests/integration/Core/Repository/FieldType/CheckboxIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/CheckboxIntegrationTest.php @@ -322,6 +322,7 @@ public function getDataForTestFindContentFieldCriterion(): iterable /** * @dataProvider getDataForTestFindContentFieldCriterion + * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContent * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\ForbiddenException diff --git a/tests/integration/Core/Repository/FieldType/CountryIntegrationTest.php b/tests/integration/Core/Repository/FieldType/CountryIntegrationTest.php index 3af6da08a0..b1720e3e97 100644 --- a/tests/integration/Core/Repository/FieldType/CountryIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/CountryIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException; @@ -139,7 +140,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( CountryValue::class, $field->value ); @@ -220,7 +221,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( CountryValue::class, $field->value ); @@ -256,7 +257,7 @@ public function provideInvalidUpdateFieldData() */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( CountryValue::class, $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/DateAndTimeIntegrationTest.php b/tests/integration/Core/Repository/FieldType/DateAndTimeIntegrationTest.php index 8b733ee841..00ef1ac6d1 100644 --- a/tests/integration/Core/Repository/FieldType/DateAndTimeIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/DateAndTimeIntegrationTest.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\Integration\Core\Repository\FieldType; use DateTime; @@ -153,7 +154,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( DateAndTimeValue::class, $field->value ); @@ -195,7 +196,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( DateAndTimeValue::class, $field->value ); @@ -241,7 +242,7 @@ public function testUpdateContentFails($failingValue, $expectedException) */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( DateAndTimeValue::class, $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/DateIntegrationTest.php b/tests/integration/Core/Repository/FieldType/DateIntegrationTest.php index 2fc2508f44..32bfc438e8 100644 --- a/tests/integration/Core/Repository/FieldType/DateIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/DateIntegrationTest.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\Integration\Core\Repository\FieldType; use DateTime; @@ -142,7 +143,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( DateValue::class, $field->value ); @@ -187,7 +188,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( DateValue::class, $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/EmailAddressIntegrationTest.php b/tests/integration/Core/Repository/FieldType/EmailAddressIntegrationTest.php index 1d4a9b3c89..346146322f 100644 --- a/tests/integration/Core/Repository/FieldType/EmailAddressIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/EmailAddressIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Values\Content\Field; @@ -129,7 +130,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( EmailAddressValue::class, $field->value ); @@ -192,7 +193,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( EmailAddressValue::class, $field->value ); @@ -221,7 +222,7 @@ public function provideInvalidUpdateFieldData() */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( EmailAddressValue::class, $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/FileSearchBaseIntegrationTest.php b/tests/integration/Core/Repository/FieldType/FileSearchBaseIntegrationTest.php index 17058af66e..9b00ad50d1 100644 --- a/tests/integration/Core/Repository/FieldType/FileSearchBaseIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/FileSearchBaseIntegrationTest.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\Integration\Core\Repository\FieldType; use FilesystemIterator; diff --git a/tests/integration/Core/Repository/FieldType/FloatIntegrationTest.php b/tests/integration/Core/Repository/FieldType/FloatIntegrationTest.php index 47b0c1b337..45acf25fed 100644 --- a/tests/integration/Core/Repository/FieldType/FloatIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/FloatIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException; @@ -141,7 +142,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( FloatValue::class, $field->value ); @@ -190,7 +191,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( FloatValue::class, $field->value ); @@ -219,7 +220,7 @@ public function provideInvalidUpdateFieldData() */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( FloatValue::class, $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/ISBNIntegrationTest.php b/tests/integration/Core/Repository/FieldType/ISBNIntegrationTest.php index f98418b0cf..f7d661e9dd 100644 --- a/tests/integration/Core/Repository/FieldType/ISBNIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/ISBNIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException; @@ -130,14 +131,14 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( ISBNValue::class, $field->value ); $expectedData = '9789722514095'; - $this->assertEquals( + self::assertEquals( $expectedData, $field->value ); @@ -184,13 +185,13 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( ISBNValue::class, $field->value ); $expectedData = '978-972-25-1409-5'; - $this->assertEquals( + self::assertEquals( $expectedData, $field->value ); @@ -211,14 +212,14 @@ public function provideInvalidUpdateFieldData() */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( ISBNValue::class, $field->value ); $expectedData = '9789722514095'; - $this->assertEquals( + self::assertEquals( $expectedData, $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/ImageIntegrationTest.php b/tests/integration/Core/Repository/FieldType/ImageIntegrationTest.php index b11c4eaa23..8f3c5e7687 100644 --- a/tests/integration/Core/Repository/FieldType/ImageIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/ImageIntegrationTest.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\Integration\Core\Repository\FieldType; use Doctrine\DBAL\ParameterType; @@ -328,7 +329,7 @@ public function assertCopiedFieldDataLoadedCorrectly(Field $field): void { $this->assertFieldDataLoadedCorrect($field); - $this->assertEquals( + self::assertEquals( self::$loadedImagePath, $field->value->id ); @@ -461,12 +462,12 @@ public function testInherentCopyForNewLanguage(): void } } - $this->assertTrue( + self::assertTrue( isset($paths['eng-US']) && isset($paths['ger-DE']), 'Failed asserting that file path for all languages were found in draft' ); - $this->assertEquals( + self::assertEquals( $paths['eng-US'], $paths['ger-DE'] ); @@ -625,7 +626,7 @@ public function testUpdateImageAltTextOnly(): void protected function checkSearchEngineSupport(): void { if ($this->getSetupFactory() instanceof Legacy) { - $this->markTestSkipped( + self::markTestSkipped( "'ezimage' field type is not searchable with Legacy Search Engine" ); } diff --git a/tests/integration/Core/Repository/FieldType/IntegerIntegrationTest.php b/tests/integration/Core/Repository/FieldType/IntegerIntegrationTest.php index 2e33f371c8..443ad6d7e7 100644 --- a/tests/integration/Core/Repository/FieldType/IntegerIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/IntegerIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException; @@ -141,7 +142,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( IntegerValue::class, $field->value ); @@ -192,7 +193,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( IntegerValue::class, $field->value ); @@ -221,7 +222,7 @@ public function provideInvalidUpdateFieldData() */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( IntegerValue::class, $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/KeywordIntegrationTest.php b/tests/integration/Core/Repository/FieldType/KeywordIntegrationTest.php index aa0cc736dd..5059b4079e 100644 --- a/tests/integration/Core/Repository/FieldType/KeywordIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/KeywordIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Values\Content\Field; @@ -144,12 +145,12 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( KeywordValue::class, $field->value ); - $this->assertEquals( + self::assertEquals( ['foo' => true, 'bar' => true, 'sindelfingen' => true], array_fill_keys($field->value->values, true) ); @@ -188,12 +189,12 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( KeywordValue::class, $field->value ); - $this->assertEquals( + self::assertEquals( ['bielefeld' => true], array_fill_keys($field->value->values, true) ); @@ -214,12 +215,12 @@ public function provideInvalidUpdateFieldData() */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( KeywordValue::class, $field->value ); - $this->assertEquals( + self::assertEquals( ['foo' => true, 'bar' => true, 'sindelfingen' => true], array_fill_keys($field->value->values, true) ); @@ -367,7 +368,7 @@ private function assertContentFieldHasCorrectData($contentId, KeywordValue $valu $dataField = $loadedContent->getField('data'); sort($dataField->value->values); sort($value->values); - $this->assertEquals($value, $dataField->value); + self::assertEquals($value, $dataField->value); } /** @@ -393,7 +394,7 @@ public function testGoBackToDifferentVersionWithDifferentKeywords(): void // go back to the first version and check whether keywords are correct $contentDraft03 = $contentService->createContentDraft($publishedContent01->contentInfo, $contentDraft01->versionInfo); $contentService->deleteContent($publishedContent01->contentInfo); - $this->assertEqualsCanonicalizing($contentDraft03->getFieldValue('data'), $value01); + self::assertEqualsCanonicalizing($contentDraft03->getFieldValue('data'), $value01); } public function testKeywordsAreCaseSensitive() @@ -403,12 +404,12 @@ public function testKeywordsAreCaseSensitive() $publishedContent02 = $this->createAndPublishContent('foo', $contentType, md5(uniqid(__METHOD__, true))); $data = $publishedContent01->getField('data')->value; - $this->assertCount(1, $data->values); - $this->assertEquals('Foo', $data->values[0]); + self::assertCount(1, $data->values); + self::assertEquals('Foo', $data->values[0]); $data = $publishedContent02->getField('data')->value; - $this->assertCount(1, $data->values); - $this->assertEquals('foo', $data->values[0]); + self::assertCount(1, $data->values); + self::assertEquals('foo', $data->values[0]); } /** @@ -588,7 +589,7 @@ public function testFindContentFieldCriterion() $searchService = $repository->getSearchService(); $searchResult = $searchService->findContent($query); - $this->assertEquals(1, $searchResult->totalCount); + self::assertEquals(1, $searchResult->totalCount); } } diff --git a/tests/integration/Core/Repository/FieldType/MapLocationIntegrationTest.php b/tests/integration/Core/Repository/FieldType/MapLocationIntegrationTest.php index 36541ff5de..10e165f900 100644 --- a/tests/integration/Core/Repository/FieldType/MapLocationIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/MapLocationIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Values\Content\Field; @@ -128,7 +129,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertEquals( + self::assertEquals( $this->getValidCreationFieldData(), $field->value ); @@ -201,7 +202,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertEquals( + self::assertEquals( $this->getValidUpdateFieldData(), $field->value ); @@ -222,7 +223,7 @@ public function provideInvalidUpdateFieldData() */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertEquals( + self::assertEquals( $this->getValidCreationFieldData(), $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/MediaIntegrationTest.php b/tests/integration/Core/Repository/FieldType/MediaIntegrationTest.php index b8b1d7a23e..6fd07dff31 100644 --- a/tests/integration/Core/Repository/FieldType/MediaIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/MediaIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Values\Content\Field; @@ -194,7 +195,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( MediaValue::class, $field->value ); @@ -206,13 +207,13 @@ public function assertFieldDataLoadedCorrect(Field $field) unset($expectedData['id']); $expectedData['inputUri'] = null; - $this->assertNotEmpty($field->value->id); + self::assertNotEmpty($field->value->id); $this->assertPropertiesCorrect( $expectedData, $field->value ); - $this->assertTrue( + self::assertTrue( $this->uriExistsOnIO($field->value->uri), "File {$field->value->uri} doesn't exist." ); @@ -261,7 +262,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( MediaValue::class, $field->value ); @@ -273,13 +274,13 @@ public function assertUpdatedFieldDataLoadedCorrect(Field $field) unset($expectedData['id']); $expectedData['inputUri'] = null; - $this->assertNotEmpty($field->value->id); + self::assertNotEmpty($field->value->id); $this->assertPropertiesCorrect( $expectedData, $field->value ); - $this->assertTrue( + self::assertTrue( $this->uriExistsOnIO($field->value->uri), "File {$field->value->uri} doesn't exist." ); @@ -302,7 +303,7 @@ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { $this->assertFieldDataLoadedCorrect($field); - $this->assertEquals( + self::assertEquals( self::$loadedMediaPath, $field->value->id ); @@ -418,6 +419,7 @@ protected function getValidSearchValueTwo() protected function getSearchTargetValueOne() { $value = $this->getValidSearchValueOne(); + // ensure case-insensitivity return strtoupper($value->fileName); } @@ -425,6 +427,7 @@ protected function getSearchTargetValueOne() protected function getSearchTargetValueTwo() { $value = $this->getValidSearchValueTwo(); + // ensure case-insensitivity return strtoupper($value->fileName); } diff --git a/tests/integration/Core/Repository/FieldType/RelationIntegrationTest.php b/tests/integration/Core/Repository/FieldType/RelationIntegrationTest.php index a47546c4a7..d51cef9ee4 100644 --- a/tests/integration/Core/Repository/FieldType/RelationIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/RelationIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Values\Content\Content; @@ -203,7 +204,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( RelationValue::class, $field->value ); @@ -272,7 +273,7 @@ public function provideInvalidUpdateFieldData() */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( RelationValue::class, $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/RelationListIntegrationTest.php b/tests/integration/Core/Repository/FieldType/RelationListIntegrationTest.php index 6f9f861d1b..17c0969357 100644 --- a/tests/integration/Core/Repository/FieldType/RelationListIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/RelationListIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Values\Content\Content; @@ -232,7 +233,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( RelationListValue::class, $field->value ); @@ -301,7 +302,7 @@ public function provideInvalidUpdateFieldData() */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( RelationListValue::class, $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/RelationSearchBaseIntegrationTestTrait.php b/tests/integration/Core/Repository/FieldType/RelationSearchBaseIntegrationTestTrait.php index 161799afb9..8e451ecdbc 100644 --- a/tests/integration/Core/Repository/FieldType/RelationSearchBaseIntegrationTestTrait.php +++ b/tests/integration/Core/Repository/FieldType/RelationSearchBaseIntegrationTestTrait.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Values\Content\Content; diff --git a/tests/integration/Core/Repository/FieldType/SearchBaseIntegrationTest.php b/tests/integration/Core/Repository/FieldType/SearchBaseIntegrationTest.php index a9a647b06e..f966ee45c2 100644 --- a/tests/integration/Core/Repository/FieldType/SearchBaseIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/SearchBaseIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Repository; @@ -210,7 +211,7 @@ protected function getAdditionallyIndexedFieldData() */ protected function getFullTextIndexedFieldData() { - $this->markTestSkipped( + self::markTestSkipped( 'Skipped by default, override in the concrete test case as required by the field type.' ); } @@ -248,7 +249,7 @@ protected function checkSearchEngineSupport() protected function checkCustomFieldsSupport() { if (get_class($this->getSetupFactory()) === Legacy::class) { - $this->markTestSkipped('Legacy Search Engine does not support custom fields'); + self::markTestSkipped('Legacy Search Engine does not support custom fields'); } } @@ -297,7 +298,7 @@ public function testCreateTestContent(): array $fieldType = $fieldTypeService->getFieldType($this->getTypeName()); if (!$fieldType->isSearchable()) { - $this->markTestSkipped("Field type '{$this->getTypeName()}' is not searchable."); + self::markTestSkipped("Field type '{$this->getTypeName()}' is not searchable."); } $this->checkSearchEngineSupport(); @@ -370,6 +371,7 @@ public function findProvider() * The result should contain Content One. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindEqualsOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -389,6 +391,7 @@ public function testFindEqualsOne($valueOne, $valueTwo, $filter, $content, $modi * The result should contain Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotEqualsOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -408,6 +411,7 @@ public function testFindNotEqualsOne($valueOne, $valueTwo, $filter, $content, $m * The result should contain Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindEqualsTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -427,6 +431,7 @@ public function testFindEqualsTwo($valueOne, $valueTwo, $filter, $content, $modi * The result should contain Content One. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotEqualsTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -446,6 +451,7 @@ public function testFindNotEqualsTwo($valueOne, $valueTwo, $filter, $content, $m * The result should contain Content One. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindInOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -465,6 +471,7 @@ public function testFindInOne($valueOne, $valueTwo, $filter, $content, $modifyFi * The result should contain Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotInOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -486,6 +493,7 @@ public function testFindNotInOne($valueOne, $valueTwo, $filter, $content, $modif * The result should contain Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindInTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -505,6 +513,7 @@ public function testFindInTwo($valueOne, $valueTwo, $filter, $content, $modifyFi * The result should contain Content One. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotInTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -526,6 +535,7 @@ public function testFindNotInTwo($valueOne, $valueTwo, $filter, $content, $modif * The result should contain both Content One and Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindInOneTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -552,6 +562,7 @@ public function testFindInOneTwo($valueOne, $valueTwo, $filter, $content, $modif * The result should be empty. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotInOneTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -580,6 +591,7 @@ public function testFindNotInOneTwo($valueOne, $valueTwo, $filter, $content, $mo * The result should contain Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindGreaterThanOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -599,6 +611,7 @@ public function testFindGreaterThanOne($valueOne, $valueTwo, $filter, $content, * The result should contain Content One. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotGreaterThanOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -618,6 +631,7 @@ public function testFindNotGreaterThanOne($valueOne, $valueTwo, $filter, $conten * The result should be empty. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindGreaterThanTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -637,6 +651,7 @@ public function testFindGreaterThanTwo($valueOne, $valueTwo, $filter, $content, * The result should contain both Content One and Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotGreaterThanTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -656,6 +671,7 @@ public function testFindNotGreaterThanTwo($valueOne, $valueTwo, $filter, $conten * The result should contain both Content One and Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindGreaterThanOrEqualOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -675,6 +691,7 @@ public function testFindGreaterThanOrEqualOne($valueOne, $valueTwo, $filter, $co * The result should be empty. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotGreaterThanOrEqual($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -694,6 +711,7 @@ public function testFindNotGreaterThanOrEqual($valueOne, $valueTwo, $filter, $co * The result should contain Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindGreaterThanOrEqualTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -713,6 +731,7 @@ public function testFindGreaterThanOrEqualTwo($valueOne, $valueTwo, $filter, $co * The result should contain Content One. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotGreaterThanOrEqualTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -732,6 +751,7 @@ public function testFindNotGreaterThanOrEqualTwo($valueOne, $valueTwo, $filter, * The result should be empty. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindLowerThanOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -751,6 +771,7 @@ public function testFindLowerThanOne($valueOne, $valueTwo, $filter, $content, $m * The result should contain both Content One and Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotLowerThanOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -770,6 +791,7 @@ public function testFindNotLowerThanOne($valueOne, $valueTwo, $filter, $content, * The result should contain Content One. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindLowerThanTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -789,6 +811,7 @@ public function testFindLowerThanTwo($valueOne, $valueTwo, $filter, $content, $m * The result should contain Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotLowerThanTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -808,6 +831,7 @@ public function testFindNotLowerThanTwo($valueOne, $valueTwo, $filter, $content, * The result should contain Content One. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindLowerThanOrEqualOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -827,6 +851,7 @@ public function testFindLowerThanOrEqualOne($valueOne, $valueTwo, $filter, $cont * The result should contain Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotLowerThanOrEqualOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -846,6 +871,7 @@ public function testFindNotLowerThanOrEqualOne($valueOne, $valueTwo, $filter, $c * The result should contain both Content One and Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindLowerThanOrEqualTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -865,6 +891,7 @@ public function testFindLowerThanOrEqualTwo($valueOne, $valueTwo, $filter, $cont * The result should be empty. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotLowerThanOrEqualTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -884,6 +911,7 @@ public function testFindNotLowerThanOrEqualTwo($valueOne, $valueTwo, $filter, $c * The result should contain both Content One and Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindBetweenOneTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -910,6 +938,7 @@ public function testFindBetweenOneTwo($valueOne, $valueTwo, $filter, $content, $ * The result should contain both Content One and Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotBetweenOneTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -938,6 +967,7 @@ public function testFindNotBetweenOneTwo($valueOne, $valueTwo, $filter, $content * The result should be empty. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindBetweenTwoOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -964,6 +994,7 @@ public function testFindBetweenTwoOne($valueOne, $valueTwo, $filter, $content, $ * The result should contain both Content One and Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotBetweenTwoOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -992,6 +1023,7 @@ public function testFindNotBetweenTwoOne($valueOne, $valueTwo, $filter, $content * The result should contain Content One. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindContainsOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -1011,6 +1043,7 @@ public function testFindContainsOne($valueOne, $valueTwo, $filter, $content, $mo * The result should contain Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotContainsOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -1030,6 +1063,7 @@ public function testFindNotContainsOne($valueOne, $valueTwo, $filter, $content, * The result should contain Content Two. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindContainsTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -1049,6 +1083,7 @@ public function testFindContainsTwo($valueOne, $valueTwo, $filter, $content, $mo * The result should contain Content One. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotContainsTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -1064,6 +1099,7 @@ public function testFindNotContainsTwo($valueOne, $valueTwo, $filter, $content, * Tests search with LIKE operator, with NO wildcard. * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindLikeOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -1080,6 +1116,7 @@ public function testFindLikeOne($valueOne, $valueTwo, $filter, $content, $modify * Tests search with LIKE operator, with wildcard at the end (on strings). * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotLikeOne($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -1099,6 +1136,7 @@ public function testFindNotLikeOne($valueOne, $valueTwo, $filter, $content, $mod * Tests search with LIKE operator, with wildcard at the start (on strings). * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindLikeTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -1116,6 +1154,7 @@ public function testFindLikeTwo($valueOne, $valueTwo, $filter, $content, $modify * Tests search with LIKE operator, with wildcard in the middle (on strings). * * @dataProvider findProvider + * * @depends testCreateTestContent */ public function testFindNotLikeTwo($valueOne, $valueTwo, $filter, $content, $modifyField, array $context) @@ -1238,6 +1277,7 @@ public function sortProvider() * Tests Content Search sort with Field sort clause on a field of specific field type. * * @dataProvider sortProvider + * * @depends testCreateTestContent */ public function testSort($ascending, $content, $modifyField, array $context) @@ -1288,6 +1328,7 @@ public function fullTextFindProvider() /** * @dataProvider fullTextFindProvider + * * @depends testCreateTestContent */ public function testFullTextFindOne($valueOne, $valueTwo, $filter, $content, array $context) @@ -1301,6 +1342,7 @@ public function testFullTextFindOne($valueOne, $valueTwo, $filter, $content, arr /** * @dataProvider fullTextFindProvider + * * @depends testCreateTestContent */ public function testFullTextFindTwo($valueOne, $valueTwo, $filter, $content, array $context) @@ -1497,29 +1539,29 @@ protected function assertFindResult( $contentIdList = $this->getResultContentIdList($searchResult); if ($includesOne && $includesTwo) { - $this->assertEquals(2, $searchResult->totalCount); - $this->assertNotEquals($contentIdList[0], $contentIdList[1]); + self::assertEquals(2, $searchResult->totalCount); + self::assertNotEquals($contentIdList[0], $contentIdList[1]); - $this->assertThat( + self::assertThat( $contentIdList[0], - $this->logicalOr($this->equalTo($contentOneId), $this->equalTo($contentTwoId)) + self::logicalOr(self::equalTo($contentOneId), self::equalTo($contentTwoId)) ); - $this->assertThat( + self::assertThat( $contentIdList[1], - $this->logicalOr($this->equalTo($contentOneId), $this->equalTo($contentTwoId)) + self::logicalOr(self::equalTo($contentOneId), self::equalTo($contentTwoId)) ); } elseif (!$includesOne && !$includesTwo) { - $this->assertEquals(0, $searchResult->totalCount); + self::assertEquals(0, $searchResult->totalCount); } else { - $this->assertEquals(1, $searchResult->totalCount); + self::assertEquals(1, $searchResult->totalCount); if ($includesOne) { - $this->assertEquals($contentOneId, $contentIdList[0]); + self::assertEquals($contentOneId, $contentIdList[0]); } if ($includesTwo) { - $this->assertEquals($contentTwoId, $contentIdList[0]); + self::assertEquals($contentTwoId, $contentIdList[0]); } } } @@ -1548,9 +1590,9 @@ protected function assertSortResult( $indexTwo = 0; } - $this->assertEquals(2, $searchResult->totalCount); - $this->assertEquals($contentOneId, $contentIdList[$indexOne]); - $this->assertEquals($contentTwoId, $contentIdList[$indexTwo]); + self::assertEquals(2, $searchResult->totalCount); + self::assertEquals($contentOneId, $contentIdList[$indexOne]); + self::assertEquals($contentTwoId, $contentIdList[$indexTwo]); } } diff --git a/tests/integration/Core/Repository/FieldType/SearchMultivaluedBaseIntegrationTest.php b/tests/integration/Core/Repository/FieldType/SearchMultivaluedBaseIntegrationTest.php index 7a5f0997e9..c82f0d95ce 100644 --- a/tests/integration/Core/Repository/FieldType/SearchMultivaluedBaseIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/SearchMultivaluedBaseIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Field; @@ -115,7 +116,7 @@ protected function checkOperatorSupport($operator): void isset($this->legacyUnsupportedOperators[$operator]) && $this->getSetupFactory() instanceof Legacy ) { - $this->markTestSkipped( + self::markTestSkipped( 'Legacy Search Engine does not properly support multivalued fields ' . "with '{$this->legacyUnsupportedOperators[$operator]}' operator" ); @@ -147,7 +148,7 @@ public function testCreateMultivaluedTestContent(): array $fieldType = $fieldTypeService->getFieldType($this->getTypeName()); if (!$fieldType->isSearchable()) { - $this->markTestSkipped("Field type '{$this->getTypeName()}' is not searchable."); + self::markTestSkipped("Field type '{$this->getTypeName()}' is not searchable."); } $this->checkSearchEngineSupport(); @@ -220,6 +221,7 @@ public function findMultivaluedProvider() * The result should contain Content One. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedEqualsOne($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -243,6 +245,7 @@ public function testFindMultivaluedEqualsOne($valuesOne, $valuesTwo, $filter, $c * The result should contain Content Two. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedNotEqualsOne($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -266,6 +269,7 @@ public function testFindMultivaluedNotEqualsOne($valuesOne, $valuesTwo, $filter, * The result should contain Content One. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedInOne($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -287,6 +291,7 @@ public function testFindMultivaluedInOne($valuesOne, $valuesTwo, $filter, $conte * The result should contain Content Two. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedNotInOne($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -310,6 +315,7 @@ public function testFindMultivaluedNotInOne($valuesOne, $valuesTwo, $filter, $co * The result should contain both Content One and Content Two. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedInOneTwo($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -331,6 +337,7 @@ public function testFindMultivaluedInOneTwo($valuesOne, $valuesTwo, $filter, $co * The result should be empty. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedNotInOneTwo($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -354,6 +361,7 @@ public function testFindMultivaluedNotInOneTwo($valuesOne, $valuesTwo, $filter, * The result should contain Content One. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedContainsOne($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -377,6 +385,7 @@ public function testFindMultivaluedContainsOne($valuesOne, $valuesTwo, $filter, * The result should contain Content Two. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedNotContainsOne($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -400,6 +409,7 @@ public function testFindMultivaluedNotContainsOne($valuesOne, $valuesTwo, $filte * The result should contain both Content One and Content Two. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedGreaterThanOneFindsOneTwo($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -421,6 +431,7 @@ public function testFindMultivaluedGreaterThanOneFindsOneTwo($valuesOne, $values * The result should contain Content Two. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedGreaterThanOneFindsTwo($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -442,6 +453,7 @@ public function testFindMultivaluedGreaterThanOneFindsTwo($valuesOne, $valuesTwo * The result should be empty. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedNotGreaterThanOneFindsOneTwo($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -463,6 +475,7 @@ public function testFindMultivaluedNotGreaterThanOneFindsOneTwo($valuesOne, $val * The result should contain Content One. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedNotGreaterThanOneFindsTwo($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -484,6 +497,7 @@ public function testFindMultivaluedNotGreaterThanOneFindsTwo($valuesOne, $values * The result should contain both Content One and Content Two. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedGreaterThanOrEqualOne($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -507,6 +521,7 @@ public function testFindMultivaluedGreaterThanOrEqualOne($valuesOne, $valuesTwo, * The result should be empty. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedNotGreaterThanOrEqual($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -530,6 +545,7 @@ public function testFindMultivaluedNotGreaterThanOrEqual($valuesOne, $valuesTwo, * The result should be empty. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedLowerThanOneEmpty($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -551,6 +567,7 @@ public function testFindMultivaluedLowerThanOneEmpty($valuesOne, $valuesTwo, $fi * The result should contain Content One. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedLowerThanOneFindsOne($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -572,6 +589,7 @@ public function testFindMultivaluedLowerThanOneFindsOne($valuesOne, $valuesTwo, * The result should contain both Content One and Content Two. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedNotLowerThanOneEmpty($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -593,6 +611,7 @@ public function testFindMultivaluedNotLowerThanOneEmpty($valuesOne, $valuesTwo, * The result should contain Content Two. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedNotLowerThanOneFindsOne($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -614,6 +633,7 @@ public function testFindMultivaluedNotLowerThanOneFindsOne($valuesOne, $valuesTw * The result should contain Content One. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedLowerThanOrEqualOne($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -637,6 +657,7 @@ public function testFindMultivaluedLowerThanOrEqualOne($valuesOne, $valuesTwo, $ * The result should contain Content Two. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedNotLowerThanOrEqualOne($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -660,6 +681,7 @@ public function testFindMultivaluedNotLowerThanOrEqualOne($valuesOne, $valuesTwo * The result should contain both Content One and Content Two. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedBetweenOneTwo($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -692,6 +714,7 @@ public function testFindMultivaluedBetweenOneTwo($valuesOne, $valuesTwo, $filter * The result should contain both Content One and Content Two. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedNotBetweenOneTwo($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -726,6 +749,7 @@ public function testFindMultivaluedNotBetweenOneTwo($valuesOne, $valuesTwo, $fil * The result should be empty. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedBetweenTwoOne($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) @@ -758,6 +782,7 @@ public function testFindMultivaluedBetweenTwoOne($valuesOne, $valuesTwo, $filter * The result should contain both Content One and Content Two. * * @dataProvider findMultivaluedProvider + * * @depends testCreateMultivaluedTestContent */ public function testFindMultivaluedNotBetweenTwoOne($valuesOne, $valuesTwo, $filter, $content, $modifyField, array $context) diff --git a/tests/integration/Core/Repository/FieldType/SelectionIntegrationTest.php b/tests/integration/Core/Repository/FieldType/SelectionIntegrationTest.php index a8395a6f0b..dc98f3ece9 100644 --- a/tests/integration/Core/Repository/FieldType/SelectionIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/SelectionIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException; @@ -168,7 +169,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( SelectionValue::class, $field->value ); @@ -215,7 +216,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( SelectionValue::class, $field->value ); @@ -244,7 +245,7 @@ public function provideInvalidUpdateFieldData() */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( SelectionValue::class, $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/SelectionMultilingualIntegrationTest.php b/tests/integration/Core/Repository/FieldType/SelectionMultilingualIntegrationTest.php index c062d374f6..f239a192bb 100644 --- a/tests/integration/Core/Repository/FieldType/SelectionMultilingualIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/SelectionMultilingualIntegrationTest.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\Integration\Core\Repository\FieldType; /** diff --git a/tests/integration/Core/Repository/FieldType/TextBlockIntegrationTest.php b/tests/integration/Core/Repository/FieldType/TextBlockIntegrationTest.php index 5c26890faf..11f45da53d 100644 --- a/tests/integration/Core/Repository/FieldType/TextBlockIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/TextBlockIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Values\Content\Field; @@ -129,7 +130,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( TextBlockValue::class, $field->value ); @@ -172,7 +173,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( TextBlockValue::class, $field->value ); @@ -201,7 +202,7 @@ public function provideInvalidUpdateFieldData() */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( TextBlockValue::class, $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/TextLineIntegrationTest.php b/tests/integration/Core/Repository/FieldType/TextLineIntegrationTest.php index ee493d3a52..e25db83a85 100644 --- a/tests/integration/Core/Repository/FieldType/TextLineIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/TextLineIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException; @@ -141,7 +142,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( TextLineValue::class, $field->value ); @@ -192,7 +193,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( TextLineValue::class, $field->value ); @@ -221,7 +222,7 @@ public function provideInvalidUpdateFieldData() */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( TextLineValue::class, $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/TimeIntegrationTest.php b/tests/integration/Core/Repository/FieldType/TimeIntegrationTest.php index 87132350bf..05992bdeba 100644 --- a/tests/integration/Core/Repository/FieldType/TimeIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/TimeIntegrationTest.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\Integration\Core\Repository\FieldType; use DateTime; @@ -147,7 +148,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( TimeValue::class, $field->value ); @@ -189,7 +190,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( TimeValue::class, $field->value ); @@ -236,7 +237,7 @@ public function testUpdateContentFails($failingValue, $expectedException) */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( TimeValue::class, $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/UrlIntegrationTest.php b/tests/integration/Core/Repository/FieldType/UrlIntegrationTest.php index 08616ef6a8..7243d0fbd7 100644 --- a/tests/integration/Core/Repository/FieldType/UrlIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/UrlIntegrationTest.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\Integration\Core\Repository\FieldType; use Ibexa\Contracts\Core\Repository\Values\Content\Field; @@ -122,7 +123,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( UrlValue::class, $field->value ); @@ -170,7 +171,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( UrlValue::class, $field->value ); @@ -200,7 +201,7 @@ public function provideInvalidUpdateFieldData() */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( UrlValue::class, $field->value ); diff --git a/tests/integration/Core/Repository/FieldType/UserIntegrationTest.php b/tests/integration/Core/Repository/FieldType/UserIntegrationTest.php index 94578eac33..473d3c905d 100644 --- a/tests/integration/Core/Repository/FieldType/UserIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/UserIntegrationTest.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\Integration\Core\Repository\FieldType; use Doctrine\DBAL\Exception\NotNullConstraintViolationException; @@ -169,7 +170,7 @@ public function getFieldName() */ public function assertFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( UserValue::class, $field->value ); @@ -187,7 +188,7 @@ public function assertFieldDataLoadedCorrect(Field $field) $field->value ); - $this->assertNotNull($field->value->contentId); + self::assertNotNull($field->value->contentId); } public function provideInvalidCreationFieldData() @@ -199,7 +200,7 @@ public function testCreateContentFails( $failingValue = null, ?string $expectedException = null ): void { - $this->markTestSkipped('Values are ignored on creation.'); + self::markTestSkipped('Values are ignored on creation.'); } /** @@ -230,7 +231,7 @@ public function getValidUpdateFieldData() */ public function assertUpdatedFieldDataLoadedCorrect(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( UserValue::class, $field->value ); @@ -248,7 +249,7 @@ public function assertUpdatedFieldDataLoadedCorrect(Field $field) $field->value ); - $this->assertNotNull($field->value->contentId); + self::assertNotNull($field->value->contentId); } public function provideInvalidUpdateFieldData() @@ -272,7 +273,7 @@ public function provideInvalidUpdateFieldData() */ public function assertCopiedFieldDataLoadedCorrectly(Field $field) { - $this->assertInstanceOf( + self::assertInstanceOf( UserValue::class, $field->value ); @@ -406,7 +407,7 @@ protected function createContent($fieldData, $contentType = null) public function testCreateContentWithEmptyFieldValue() { - $this->markTestSkipped('User field will never be created empty'); + self::markTestSkipped('User field will never be created empty'); } public function providerForTestIsEmptyValue() @@ -444,8 +445,8 @@ public function testRemoveFieldDefinition() $content = $contentService->loadContent($content->id); - $this->assertCount($countBeforeRemoval - 1, $content->getFields()); - $this->assertNull($content->getFieldValue($userFieldDefinition->identifier)); + self::assertCount($countBeforeRemoval - 1, $content->getFields()); + self::assertNull($content->getFieldValue($userFieldDefinition->identifier)); } public function testAddFieldDefinition() @@ -473,7 +474,7 @@ public function testCopyField($content) */ public function testCopiedFieldType($content) { - $this->markTestSkipped('Users cannot be copied, content is not passed to test.'); + self::markTestSkipped('Users cannot be copied, content is not passed to test.'); } /** @@ -481,7 +482,7 @@ public function testCopiedFieldType($content) */ public function testCopiedExternalData(Field $field) { - $this->markTestSkipped('Users cannot be copied, field is not passed to test.'); + self::markTestSkipped('Users cannot be copied, field is not passed to test.'); } /** @@ -507,7 +508,7 @@ public function testUpdateFieldDefinitionWithIncompleteSettingsSchema() $contentType = $contentTypeService->loadContentType($contentType->id); $userFieldDefinition = $this->getUserFieldDefinition($contentType); - $this->assertNull($userFieldDefinition->fieldSettings[Type::PASSWORD_TTL_WARNING_SETTING]); + self::assertNull($userFieldDefinition->fieldSettings[Type::PASSWORD_TTL_WARNING_SETTING]); } /** @@ -522,7 +523,7 @@ private function getUserFieldDefinition(ContentType $contentType): FieldDefiniti $fieldDefinition = $contentType->getFirstFieldDefinitionOfType('ezuser'); if ($fieldDefinition === null) { - $this->fail("'ezuser' field definition was not found"); + self::fail("'ezuser' field definition was not found"); } return $fieldDefinition; diff --git a/tests/integration/Core/Repository/FieldTypeServiceTest.php b/tests/integration/Core/Repository/FieldTypeServiceTest.php index 488114238d..22f0648a3b 100644 --- a/tests/integration/Core/Repository/FieldTypeServiceTest.php +++ b/tests/integration/Core/Repository/FieldTypeServiceTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\FieldType; @@ -12,6 +13,7 @@ * Test case for operations in the FieldTypeService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\FieldTypeService + * * @group field-type */ class FieldTypeServiceTest extends BaseTest @@ -33,10 +35,10 @@ public function testGetFieldTypes() /* END: Use Case */ // Require at least 1 field type - $this->assertNotCount(0, $fieldTypes); + self::assertNotCount(0, $fieldTypes); foreach ($fieldTypes as $fieldType) { - $this->assertInstanceOf( + self::assertInstanceOf( FieldType::class, $fieldType ); @@ -65,7 +67,7 @@ public function testGetFieldType() FieldType::class, $fieldType ); - $this->assertEquals( + self::assertEquals( 'ezurl', $fieldType->getFieldTypeIdentifier() ); @@ -106,7 +108,7 @@ public function testHasFieldTypeReturnsTrue() $typeExists = $fieldTypeService->hasFieldType('ezurl'); /* END: Use Case */ - $this->assertTrue($typeExists); + self::assertTrue($typeExists); } /** @@ -125,7 +127,7 @@ public function testHasFieldTypeReturnsFalse() $typeExists = $fieldTypeService->hasFieldType('sindelfingen'); /* END: Use Case */ - $this->assertFalse($typeExists); + self::assertFalse($typeExists); } } diff --git a/tests/integration/Core/Repository/IdManager.php b/tests/integration/Core/Repository/IdManager.php index e0811347e3..7ad67ae022 100644 --- a/tests/integration/Core/Repository/IdManager.php +++ b/tests/integration/Core/Repository/IdManager.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\Integration\Core\Repository; /** diff --git a/tests/integration/Core/Repository/LanguageServiceAuthorizationTest.php b/tests/integration/Core/Repository/LanguageServiceAuthorizationTest.php index 6994389d0b..6756ee5acb 100644 --- a/tests/integration/Core/Repository/LanguageServiceAuthorizationTest.php +++ b/tests/integration/Core/Repository/LanguageServiceAuthorizationTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -12,7 +13,9 @@ * Test case for operations in the LanguageService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testLoadUser + * * @group integration * @group authorization */ @@ -22,6 +25,7 @@ class LanguageServiceAuthorizationTest extends BaseTest * Test for the createLanguage() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::createLanguage() + * * @depends testCreateLanguage */ public function testCreateLanguageThrowsUnauthorizedException() @@ -55,6 +59,7 @@ public function testCreateLanguageThrowsUnauthorizedException() * Test for the updateLanguageName() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::updateLanguageName() + * * @depends testUpdateLanguageName */ public function testUpdateLanguageNameThrowsUnauthorizedException() @@ -92,6 +97,7 @@ public function testUpdateLanguageNameThrowsUnauthorizedException() * Test for the enableLanguage() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::enableLanguage() + * * @depends testEnableLanguage */ public function testEnableLanguageThrowsUnauthorizedException() @@ -127,6 +133,7 @@ public function testEnableLanguageThrowsUnauthorizedException() * Test for the disableLanguage() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::disableLanguage() + * * @depends testDisableLanguage */ public function testDisableLanguageThrowsUnauthorizedException() @@ -162,6 +169,7 @@ public function testDisableLanguageThrowsUnauthorizedException() * Test for the deleteLanguage() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::deleteLanguage() + * * @depends testDeleteLanguage */ public function testDeleteLanguageThrowsUnauthorizedException() diff --git a/tests/integration/Core/Repository/LanguageServiceMaximumSupportedLanguagesTest.php b/tests/integration/Core/Repository/LanguageServiceMaximumSupportedLanguagesTest.php index 4fad195312..418e2360fe 100644 --- a/tests/integration/Core/Repository/LanguageServiceMaximumSupportedLanguagesTest.php +++ b/tests/integration/Core/Repository/LanguageServiceMaximumSupportedLanguagesTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Test\Repository\SetupFactory\Legacy as LegacySetupFactory; @@ -12,6 +13,7 @@ * Test case for maximum number of languages supported in the LanguageService. * * @see \Ibexa\Contracts\Core\Repository\LanguageService + * * @group integration * @group language */ @@ -39,7 +41,7 @@ protected function setUp(): void if (\PHP_VERSION_ID < 50400 && PHP_INT_SIZE === 8) { $setupFactory = $this->getSetupFactory(); if ($setupFactory instanceof LegacySetupFactory && $setupFactory->getDB() === 'sqlite') { - $this->markTestSkipped('Skip on Sqlite, PHP 5.3 and 64bit, as int column is limited to 32bit on 64bit'); + self::markTestSkipped('Skip on Sqlite, PHP 5.3 and 64bit, as int column is limited to 32bit on 64bit'); } } diff --git a/tests/integration/Core/Repository/LanguageServiceTest.php b/tests/integration/Core/Repository/LanguageServiceTest.php index a0698f4682..82d74732c3 100644 --- a/tests/integration/Core/Repository/LanguageServiceTest.php +++ b/tests/integration/Core/Repository/LanguageServiceTest.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\Integration\Core\Repository; use Exception; @@ -16,6 +17,7 @@ * Test case for operations in the LanguageService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService + * * @group integration * @group language */ @@ -36,7 +38,7 @@ public function testNewLanguageCreateStruct() $languageCreate = $languageService->newLanguageCreateStruct(); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( LanguageCreateStruct::class, $languageCreate ); @@ -57,6 +59,7 @@ public function testNewLanguageCreateStruct() * @return \Ibexa\Contracts\Core\Repository\Values\Content\Language * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::createLanguage + * * @depends testNewLanguageCreateStruct */ public function testCreateLanguage() @@ -74,7 +77,7 @@ public function testCreateLanguage() $language = $languageService->createLanguage($languageCreate); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( Language::class, $language ); @@ -88,11 +91,12 @@ public function testCreateLanguage() * @param \Ibexa\Contracts\Core\Repository\Values\Content\Language $language * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::createLanguage + * * @depends testCreateLanguage */ public function testCreateLanguageSetsIdPropertyOnReturnedLanguage($language) { - $this->assertNotNull($language->id); + self::assertNotNull($language->id); } /** @@ -101,11 +105,12 @@ public function testCreateLanguageSetsIdPropertyOnReturnedLanguage($language) * @param \Ibexa\Contracts\Core\Repository\Values\Content\Language $language * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::createLanguage + * * @depends testCreateLanguage */ public function testCreateLanguageSetsExpectedProperties($language) { - $this->assertEquals( + self::assertEquals( [ true, 'English (New Zealand)', @@ -123,6 +128,7 @@ public function testCreateLanguageSetsExpectedProperties($language) * Test for the createLanguage() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::createLanguage + * * @depends testCreateLanguage */ public function testCreateLanguageThrowsInvalidArgumentException() @@ -153,6 +159,7 @@ public function testCreateLanguageThrowsInvalidArgumentException() * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::loadLanguageById * @covers \Ibexa\Contracts\Core\Repository\LanguageService::loadLanguageListById + * * @depends testCreateLanguage */ public function testLoadLanguageById() @@ -170,16 +177,16 @@ public function testLoadLanguageById() $language = $languageService->loadLanguageById($languageId); - $this->assertInstanceOf( + self::assertInstanceOf( Language::class, $language ); $languages = $languageService->loadLanguageListById([$languageId]); - $this->assertIsIterable($languages); - $this->assertCount(1, $languages); - $this->assertInstanceOf(Language::class, $languages[$languageId]); + self::assertIsIterable($languages); + self::assertCount(1, $languages); + self::assertInstanceOf(Language::class, $languages[$languageId]); } /** @@ -187,6 +194,7 @@ public function testLoadLanguageById() * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::loadLanguageById * @covers \Ibexa\Contracts\Core\Repository\LanguageService::loadLanguageListById + * * @depends testLoadLanguageById */ public function testLoadLanguageByIdThrowsNotFoundException() @@ -199,8 +207,8 @@ public function testLoadLanguageByIdThrowsNotFoundException() $languages = $languageService->loadLanguageListById([$nonExistentLanguageId]); - $this->assertIsIterable($languages); - $this->assertCount(0, $languages); + self::assertIsIterable($languages); + self::assertCount(0, $languages); $this->expectException(NotFoundException::class); @@ -212,6 +220,7 @@ public function testLoadLanguageByIdThrowsNotFoundException() * Test for the updateLanguageName() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::updateLanguageName + * * @depends testLoadLanguageById */ public function testUpdateLanguageName() @@ -237,7 +246,7 @@ public function testUpdateLanguageName() /* END: Use Case */ // Verify that the service returns an updated language instance. - $this->assertInstanceOf( + self::assertInstanceOf( Language::class, $updatedLanguage ); @@ -276,6 +285,7 @@ public function testUpdateLanguageNameThrowsInvalidArgumentException() * Test for the enableLanguage() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::enableLanguage + * * @depends testLoadLanguageById */ public function testEnableLanguage() @@ -298,13 +308,14 @@ public function testEnableLanguage() $enabledLanguage = $languageService->loadLanguageById($language->id); /* END: Use Case */ - $this->assertTrue($enabledLanguage->enabled); + self::assertTrue($enabledLanguage->enabled); } /** * Test for the disableLanguage() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::disableLanguage + * * @depends testLoadLanguageById */ public function testDisableLanguage() @@ -327,7 +338,7 @@ public function testDisableLanguage() $enabledLanguage = $languageService->loadLanguageById($language->id); /* END: Use Case */ - $this->assertFalse($enabledLanguage->enabled); + self::assertFalse($enabledLanguage->enabled); } /** @@ -335,6 +346,7 @@ public function testDisableLanguage() * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::loadLanguage * @covers \Ibexa\Contracts\Core\Repository\LanguageService::loadLanguageListByCode + * * @depends testCreateLanguage */ public function testLoadLanguage() @@ -367,8 +379,8 @@ public function testLoadLanguage() $languages = $languageService->loadLanguageListByCode(['eng-NZ']); - $this->assertIsIterable($languages); - $this->assertCount(1, $languages); + self::assertIsIterable($languages); + self::assertCount(1, $languages); $this->assertPropertiesCorrect( [ @@ -386,6 +398,7 @@ public function testLoadLanguage() * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::loadLanguage * @covers \Ibexa\Contracts\Core\Repository\LanguageService::loadLanguageListByCode + * * @depends testLoadLanguage */ public function testLoadLanguageThrowsNotFoundException() @@ -396,8 +409,8 @@ public function testLoadLanguageThrowsNotFoundException() $languages = $languageService->loadLanguageListByCode(['fre-FR']); - $this->assertIsIterable($languages); - $this->assertCount(0, $languages); + self::assertIsIterable($languages); + self::assertCount(0, $languages); $this->expectException(NotFoundException::class); @@ -423,6 +436,7 @@ public function testLoadLanguageThrowsInvalidArgumentException() * Test for the loadLanguages() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::loadLanguages + * * @depends testCreateLanguage * @depends testLoadLanguage */ @@ -461,13 +475,14 @@ public function testLoadLanguages() /* END: Use Case */ // eng-US, eng-GB, ger-DE + 2 newly created - $this->assertCount(5, $languages); + self::assertCount(5, $languages); } /** * Test for the loadLanguages() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::loadLanguages + * * @depends testCreateLanguage */ public function loadLanguagesReturnsAnEmptyArrayByDefault() @@ -476,13 +491,14 @@ public function loadLanguagesReturnsAnEmptyArrayByDefault() $languageService = $repository->getContentLanguageService(); - $this->assertSame([], $languageService->loadLanguages()); + self::assertSame([], $languageService->loadLanguages()); } /** * Test for the deleteLanguage() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::deleteLanguage + * * @depends testLoadLanguages */ public function testDeleteLanguage() @@ -507,7 +523,7 @@ public function testDeleteLanguage() /* END: Use Case */ // +1 -1 - $this->assertEquals($beforeCount, count($languageService->loadLanguages())); + self::assertEquals($beforeCount, count($languageService->loadLanguages())); $this->expectException(NotFoundException::class); $this->expectExceptionMessage('Could not find \'Language\' with identifier \'eng-NZ\''); @@ -525,6 +541,7 @@ public function testDeleteLanguage() * we cannot declare them here. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::deleteLanguage + * * @depends testDeleteLanguage */ public function testDeleteLanguageThrowsInvalidArgumentException() @@ -576,7 +593,7 @@ public function testGetDefaultLanguageCode() $repository = $this->getRepository(); $languageService = $repository->getContentLanguageService(); - $this->assertRegExp( + self::assertRegExp( '(^[a-z]{3}\-[A-Z]{2}$)', $languageService->getDefaultLanguageCode() ); @@ -586,6 +603,7 @@ public function testGetDefaultLanguageCode() * Test for the createLanguage() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::createLanguage + * * @depends testCreateLanguage */ public function testCreateLanguageInTransactionWithRollback() @@ -624,13 +642,14 @@ public function testCreateLanguageInTransactionWithRollback() } /* END: Use Case */ - $this->assertTrue(isset($e), 'Can still load language after rollback'); + self::assertTrue(isset($e), 'Can still load language after rollback'); } /** * Test for the createLanguage() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::createLanguage + * * @depends testCreateLanguage */ public function testCreateLanguageInTransactionWithCommit() @@ -665,13 +684,14 @@ public function testCreateLanguageInTransactionWithCommit() $language = $languageService->loadLanguage('eng-NZ'); /* END: Use Case */ - $this->assertEquals('eng-NZ', $language->languageCode); + self::assertEquals('eng-NZ', $language->languageCode); } /** * Test for the updateLanguageName() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::updateLanguageName + * * @depends testUpdateLanguageName */ public function testUpdateLanguageNameInTransactionWithRollback() @@ -703,13 +723,14 @@ public function testUpdateLanguageNameInTransactionWithRollback() $updatedLanguage = $languageService->loadLanguage('eng-US'); /* END: Use Case */ - $this->assertEquals('English (American)', $updatedLanguage->name); + self::assertEquals('English (American)', $updatedLanguage->name); } /** * Test for the updateLanguageName() method. * * @covers \Ibexa\Contracts\Core\Repository\LanguageService::updateLanguageName + * * @depends testUpdateLanguageName */ public function testUpdateLanguageNameInTransactionWithCommit() @@ -741,7 +762,7 @@ public function testUpdateLanguageNameInTransactionWithCommit() $updatedLanguage = $languageService->loadLanguage('eng-US'); /* END: Use Case */ - $this->assertEquals('My English', $updatedLanguage->name); + self::assertEquals('My English', $updatedLanguage->name); } } diff --git a/tests/integration/Core/Repository/LocationServiceAuthorizationTest.php b/tests/integration/Core/Repository/LocationServiceAuthorizationTest.php index f6d49e9257..c503f98966 100644 --- a/tests/integration/Core/Repository/LocationServiceAuthorizationTest.php +++ b/tests/integration/Core/Repository/LocationServiceAuthorizationTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -16,7 +17,9 @@ * Test case for operations in the LocationService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\LocationService + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser + * * @group integration * @group authorization */ @@ -26,6 +29,7 @@ class LocationServiceAuthorizationTest extends BaseTest * Test for the createLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::createLocation() + * * @depends Ibexa\Tests\Integration\Core\Repository\LocationServiceTest::testCreateLocation */ public function testCreateLocationThrowsUnauthorizedException() @@ -68,6 +72,7 @@ public function testCreateLocationThrowsUnauthorizedException() * Test for the createLocation() method. Tests a case when user doesn't have content/manage_locations policy for the new location ID. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::createLocation() + * * @depends Ibexa\Tests\Integration\Core\Repository\LocationServiceTest::testCreateLocation */ public function testCreateLocationThrowsUnauthorizedExceptionDueToLackOfContentManageLocationsPolicy() @@ -128,6 +133,7 @@ public function testCreateLocationThrowsUnauthorizedExceptionDueToLackOfContentM * Test for the loadLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocation() + * * @depends Ibexa\Tests\Integration\Core\Repository\LocationServiceTest::testLoadLocation */ public function testLoadLocationThrowsUnauthorizedException() @@ -177,6 +183,7 @@ public function testLoadLocationListFiltersUnauthorizedLocations(): void * Test for the loadLocationByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocationByRemoteId() + * * @depends Ibexa\Tests\Integration\Core\Repository\LocationServiceTest::testLoadLocationByRemoteId */ public function testLoadLocationByRemoteIdThrowsUnauthorizedException() @@ -206,6 +213,7 @@ public function testLoadLocationByRemoteIdThrowsUnauthorizedException() * Test for the loadLocations() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocations() + * * @depends Ibexa\Tests\Integration\Core\Repository\LocationServiceTest::testLoadLocations */ public function testLoadLocationsNoAccess() @@ -218,8 +226,8 @@ public function testLoadLocationsNoAccess() // this should return one location for admin $locations = $locationService->loadLocations($editorGroupContentInfo); - $this->assertCount(1, $locations); - $this->assertInstanceOf(Location::class, $locations[0]); + self::assertCount(1, $locations); + self::assertInstanceOf(Location::class, $locations[0]); $user = $this->createUserVersion1(); @@ -228,13 +236,14 @@ public function testLoadLocationsNoAccess() // This should return empty array given current user does not have read access $locations = $locationService->loadLocations($editorGroupContentInfo); - $this->assertEmpty($locations); + self::assertEmpty($locations); } /** * Test for the updateLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::updateLocation() + * * @depends Ibexa\Tests\Integration\Core\Repository\LocationServiceTest::testUpdateLocation */ public function testUpdateLocationThrowsUnauthorizedException() @@ -274,6 +283,7 @@ public function testUpdateLocationThrowsUnauthorizedException() * Test for the swapLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::swapLocation() + * * @depends Ibexa\Tests\Integration\Core\Repository\LocationServiceTest::testSwapLocation */ public function testSwapLocationThrowsUnauthorizedException() @@ -315,6 +325,7 @@ public function testSwapLocationThrowsUnauthorizedException() * Test for the hideLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::hideLocation() + * * @depends Ibexa\Tests\Integration\Core\Repository\LocationServiceTest::testHideLocation */ public function testHideLocationThrowsUnauthorizedException() @@ -345,6 +356,7 @@ public function testHideLocationThrowsUnauthorizedException() * Test for the unhideLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::unhideLocation() + * * @depends Ibexa\Tests\Integration\Core\Repository\LocationServiceTest::testUnhideLocation */ public function testUnhideLocationThrowsUnauthorizedException() @@ -378,6 +390,7 @@ public function testUnhideLocationThrowsUnauthorizedException() * Test for the deleteLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::deleteLocation() + * * @depends Ibexa\Tests\Integration\Core\Repository\LocationServiceTest::testDeleteLocation */ public function testDeleteLocationThrowsUnauthorizedException() @@ -441,6 +454,7 @@ public function testDeleteLocationThrowsUnauthorizedExceptionWithLanguageLimitat * Test for the deleteLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::deleteLocation() + * * @depends Ibexa\Tests\Integration\Core\Repository\LocationServiceTest::testDeleteLocation */ public function testDeleteLocationWithSubtreeThrowsUnauthorizedException() @@ -539,6 +553,7 @@ public function testDeleteLocationWithSubtreeThrowsUnauthorizedException() * Test for the copySubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::copySubtree() + * * @depends Ibexa\Tests\Integration\Core\Repository\LocationServiceTest::testCopySubtree */ public function testCopySubtreeThrowsUnauthorizedException() @@ -583,6 +598,7 @@ public function testCopySubtreeThrowsUnauthorizedException() * Test for the moveSubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::moveSubtree() + * * @depends Ibexa\Tests\Integration\Core\Repository\LocationServiceTest::testMoveSubtree */ public function testMoveSubtreeThrowsUnauthorizedException() diff --git a/tests/integration/Core/Repository/LocationServiceTest.php b/tests/integration/Core/Repository/LocationServiceTest.php index 350347bda4..709eef3a7d 100644 --- a/tests/integration/Core/Repository/LocationServiceTest.php +++ b/tests/integration/Core/Repository/LocationServiceTest.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\Integration\Core\Repository; use Exception; @@ -29,6 +30,7 @@ * Test case for operations in the LocationService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\LocationService + * * @group location */ class LocationServiceTest extends BaseTest @@ -54,7 +56,7 @@ public function testNewLocationCreateStruct() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( LocationCreateStruct::class, $locationCreate ); @@ -68,6 +70,7 @@ public function testNewLocationCreateStruct() * @param \Ibexa\Contracts\Core\Repository\Values\Content\LocationCreateStruct $locationCreate * * @covers \Ibexa\Contracts\Core\Repository\LocationService::newLocationCreateStruct() + * * @depends testNewLocationCreateStruct */ public function testNewLocationCreateStructValues(LocationCreateStruct $locationCreate) @@ -90,6 +93,7 @@ public function testNewLocationCreateStructValues(LocationCreateStruct $location * Test for the createLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::createLocation() + * * @depends testNewLocationCreateStruct */ public function testCreateLocation() @@ -120,7 +124,7 @@ public function testCreateLocation() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( Location::class, $location ); @@ -137,6 +141,7 @@ public function testCreateLocation() * Test for the createLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::createLocation + * * @depends testCreateLocation * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testHideContent */ @@ -207,14 +212,15 @@ public function testCreateLocationWithContentTypeSortingOptions(): void $locationCreate ); - $this->assertEquals($contentType->defaultSortField, $location->sortField); - $this->assertEquals($contentType->defaultSortOrder, $location->sortOrder); + self::assertEquals($contentType->defaultSortField, $location->sortField); + self::assertEquals($contentType->defaultSortOrder, $location->sortOrder); } /** * Test for the createLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::createLocation() + * * @depends testCreateLocation */ public function testCreateLocationStructValues(array $data) @@ -239,13 +245,14 @@ public function testCreateLocationStructValues(array $data) $createdLocation ); - $this->assertNotNull($createdLocation->id); + self::assertNotNull($createdLocation->id); } /** * Test for the createLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::createLocation() + * * @depends testNewLocationCreateStruct */ public function testCreateLocationThrowsInvalidArgumentExceptionContentAlreadyBelowParent() @@ -280,6 +287,7 @@ public function testCreateLocationThrowsInvalidArgumentExceptionContentAlreadyBe * Test for the createLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::createLocation() + * * @depends testNewLocationCreateStruct */ public function testCreateLocationThrowsInvalidArgumentExceptionParentIsSubLocationOfContent() @@ -314,6 +322,7 @@ public function testCreateLocationThrowsInvalidArgumentExceptionParentIsSubLocat * Test for the createLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::createLocation() + * * @depends testNewLocationCreateStruct */ public function testCreateLocationThrowsInvalidArgumentExceptionRemoteIdExists() @@ -348,7 +357,9 @@ public function testCreateLocationThrowsInvalidArgumentExceptionRemoteIdExists() * Test for the createLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::createLocation() + * * @depends testNewLocationCreateStruct + * * @dataProvider dataProviderForOutOfRangeLocationPriority */ public function testCreateLocationThrowsInvalidArgumentExceptionPriorityIsOutOfRange($priority) @@ -392,6 +403,7 @@ public function dataProviderForOutOfRangeLocationPriority() * Test for the createLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::createLocation() + * * @depends testCreateLocation */ public function testCreateLocationInTransactionWithRollback() @@ -435,7 +447,7 @@ public function testCreateLocationInTransactionWithRollback() } /* END: Use Case */ - $this->fail('Objects still exists after rollback.'); + self::fail('Objects still exists after rollback.'); } /** @@ -444,6 +456,7 @@ public function testCreateLocationInTransactionWithRollback() * @return \Ibexa\Contracts\Core\Repository\Values\Content\Location * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocation + * * @depends testCreateLocation */ public function testLoadLocation() @@ -458,7 +471,7 @@ public function testLoadLocation() $location = $locationService->loadLocation($locationId); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( Location::class, $location ); @@ -471,6 +484,7 @@ public function testLoadLocation() * Test for the loadLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocation() + * * @depends testLoadLocation */ public function testLoadLocationRootStructValues() @@ -504,7 +518,7 @@ private function assertRootLocationStructValues(Location $location): void $legacyDateTime = new \DateTime(); $legacyDateTime->setTimestamp(1030968000); - $this->assertInstanceOf(Location::class, $location); + self::assertInstanceOf(Location::class, $location); $this->assertPropertiesCorrect( [ 'id' => $this->generateId('location', 1), @@ -522,7 +536,7 @@ private function assertRootLocationStructValues(Location $location): void $location ); - $this->assertInstanceOf(ContentInfo::class, $location->contentInfo); + self::assertInstanceOf(ContentInfo::class, $location->contentInfo); $this->assertPropertiesCorrect( [ 'id' => $this->generateId('content', 0), @@ -549,6 +563,7 @@ private function assertRootLocationStructValues(Location $location): void * @param \Ibexa\Contracts\Core\Repository\Values\Content\Location $location * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocation() + * * @depends testLoadLocation */ public function testLoadLocationStructValues(Location $location) @@ -569,18 +584,18 @@ public function testLoadLocationStructValues(Location $location) $location ); - $this->assertInstanceOf(ContentInfo::class, $location->contentInfo); - $this->assertEquals($this->generateId('object', 4), $location->contentInfo->id); + self::assertInstanceOf(ContentInfo::class, $location->contentInfo); + self::assertEquals($this->generateId('object', 4), $location->contentInfo->id); - $this->assertInstanceOf(Location::class, $location->getParentLocation()); - $this->assertEquals($this->generateId('location', 1), $location->getParentLocation()->id); + self::assertInstanceOf(Location::class, $location->getParentLocation()); + self::assertEquals($this->generateId('location', 1), $location->getParentLocation()->id); // Check lazy loaded proxy on ->content - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $content = $location->getContent() ); - $this->assertEquals(4, $content->contentInfo->id); + self::assertEquals(4, $content->contentInfo->id); } public function testLoadLocationPrioritizedLanguagesFallback() @@ -604,19 +619,19 @@ public function testLoadLocationPrioritizedLanguagesFallback() // Load with priority language (fallback will be the old one) $location = $locationService->loadLocation(5, ['nor-NO']); - $this->assertInstanceOf( + self::assertInstanceOf( Location::class, $location ); self::assertEquals(5, $location->id); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $content = $location->getContent() ); - $this->assertEquals(4, $content->contentInfo->id); + self::assertEquals(4, $content->contentInfo->id); - $this->assertEquals($content->getVersionInfo()->getName(), 'Brukere'); - $this->assertEquals($content->getVersionInfo()->getName('eng-US'), 'Users'); + self::assertEquals($content->getVersionInfo()->getName(), 'Brukere'); + self::assertEquals($content->getVersionInfo()->getName('eng-US'), 'Users'); } /** @@ -641,6 +656,7 @@ public function testLoadLocationThrowsNotFoundExceptionForNotAvailableContent(): * Test for the loadLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocation() + * * @depends testCreateLocation */ public function testLoadLocationThrowsNotFoundException() @@ -683,6 +699,7 @@ public function testLoadLocationList(): void * Test for the loadLocationList() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocationList + * * @depends testLoadLocationList */ public function testLoadLocationListPrioritizedLanguagesFallback(): void @@ -703,6 +720,7 @@ public function testLoadLocationListPrioritizedLanguagesFallback(): void * Test for the loadLocationList() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocationList + * * @depends testLoadLocationListPrioritizedLanguagesFallback */ public function testLoadLocationListPrioritizedLanguagesFallbackAndAlwaysAvailable(): void @@ -770,6 +788,7 @@ public function testLoadLocationListInCorrectOrder() * Test for the loadLocationByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocationByRemoteId() + * * @depends testLoadLocation */ public function testLoadLocationByRemoteId() @@ -784,7 +803,7 @@ public function testLoadLocationByRemoteId() ); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( $locationService->loadLocation($this->generateId('location', 5)), $location ); @@ -794,6 +813,7 @@ public function testLoadLocationByRemoteId() * Test for the loadLocationByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocationByRemoteId() + * * @depends testLoadLocation */ public function testLoadLocationByRemoteIdThrowsNotFoundException() @@ -816,6 +836,7 @@ public function testLoadLocationByRemoteIdThrowsNotFoundException() * Test for the loadLocations() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocations() + * * @depends testCreateLocation */ public function testLoadLocations() @@ -833,7 +854,7 @@ public function testLoadLocations() $locations = $locationService->loadLocations($contentInfo); /* END: Use Case */ - $this->assertIsArray($locations); + self::assertIsArray($locations); self::assertNotEmpty($locations); foreach ($locations as $location) { @@ -848,11 +869,12 @@ public function testLoadLocations() * Test for the loadLocations() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocations() + * * @depends testLoadLocations */ public function testLoadLocationsContent(array $locations) { - $this->assertCount(1, $locations); + self::assertCount(1, $locations); foreach ($locations as $loadedLocation) { self::assertInstanceOf(Location::class, $loadedLocation); } @@ -864,7 +886,7 @@ static function ($a, $b) { } ); - $this->assertEquals( + self::assertEquals( [$this->generateId('location', 5)], array_map( static function (Location $location) { @@ -881,6 +903,7 @@ static function (Location $location) { * @return \Ibexa\Contracts\Core\Repository\Values\Content\Location[] * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocations($contentInfo, $rootLocation) + * * @depends testLoadLocations */ public function testLoadLocationsLimitedSubtree() @@ -917,7 +940,7 @@ public function testLoadLocationsLimitedSubtree() ); /* END: Use Case */ - $this->assertIsArray($locations); + self::assertIsArray($locations); return $locations; } @@ -928,13 +951,14 @@ public function testLoadLocationsLimitedSubtree() * @param \Ibexa\Contracts\Core\Repository\Values\Content\Location[] $locations * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocations() + * * @depends testLoadLocationsLimitedSubtree */ public function testLoadLocationsLimitedSubtreeContent(array $locations) { - $this->assertCount(1, $locations); + self::assertCount(1, $locations); - $this->assertEquals( + self::assertEquals( $this->generateId('location', 54), reset($locations)->id ); @@ -944,6 +968,7 @@ public function testLoadLocationsLimitedSubtreeContent(array $locations) * Test for the loadLocations() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocations() + * * @depends testLoadLocations */ public function testLoadLocationsThrowsBadStateException() @@ -974,6 +999,7 @@ public function testLoadLocationsThrowsBadStateException() * Test for the loadLocations() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocations($contentInfo, $rootLocation) + * * @depends testLoadLocations */ public function testLoadLocationsThrowsBadStateExceptionLimitedSubtree() @@ -1009,6 +1035,7 @@ public function testLoadLocationsThrowsBadStateExceptionLimitedSubtree() * Test for the loadLocationChildren() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocationChildren + * * @depends testLoadLocation */ public function testLoadLocationChildren() @@ -1025,14 +1052,14 @@ public function testLoadLocationChildren() $childLocations = $locationService->loadLocationChildren($location); /* END: Use Case */ - $this->assertInstanceOf(LocationList::class, $childLocations); - $this->assertIsArray($childLocations->locations); - $this->assertNotEmpty($childLocations->locations); - $this->assertIsInt($childLocations->totalCount); + self::assertInstanceOf(LocationList::class, $childLocations); + self::assertIsArray($childLocations->locations); + self::assertNotEmpty($childLocations->locations); + self::assertIsInt($childLocations->totalCount); foreach ($childLocations->locations as $childLocation) { - $this->assertInstanceOf(Location::class, $childLocation); - $this->assertEquals($location->id, $childLocation->parentLocationId); + self::assertInstanceOf(Location::class, $childLocation); + self::assertEquals($location->id, $childLocation->parentLocationId); } return $childLocations; @@ -1099,6 +1126,7 @@ public function testLoadParentLocationsForDraftContentThrowsBadStateException(Co * Test for the getLocationChildCount() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::getLocationChildCount() + * * @depends testLoadLocation */ public function testGetLocationChildCount() @@ -1106,7 +1134,7 @@ public function testGetLocationChildCount() // $locationId is the ID of an existing location $locationService = $this->getRepository()->getLocationService(); - $this->assertSame( + self::assertSame( 5, $locationService->getLocationChildCount( $locationService->loadLocation($this->generateId('location', 5)) @@ -1118,21 +1146,22 @@ public function testGetLocationChildCount() * Test for the loadLocationChildren() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::loadLocationChildren() + * * @depends testLoadLocationChildren */ public function testLoadLocationChildrenData(LocationList $locations) { - $this->assertCount(5, $locations->locations); - $this->assertEquals(5, $locations->getTotalCount()); + self::assertCount(5, $locations->locations); + self::assertEquals(5, $locations->getTotalCount()); foreach ($locations->locations as $location) { - $this->assertInstanceOf( + self::assertInstanceOf( Location::class, $location ); } - $this->assertEquals( + self::assertEquals( [ $this->generateId('location', 12), $this->generateId('location', 13), @@ -1217,8 +1246,8 @@ public function testLoadLocationChildrenWithOffsetAndLimit(): LocationList $childLocations = $locationService->loadLocationChildren($location, 2, 2); - $this->assertIsArray($childLocations->locations); - $this->assertIsInt($childLocations->totalCount); + self::assertIsArray($childLocations->locations); + self::assertIsInt($childLocations->totalCount); return $childLocations; } @@ -1230,8 +1259,8 @@ public function testLoadLocationChildrenWithOffsetAndLimit(): LocationList */ public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $locations): void { - $this->assertCount(2, $locations->locations); - $this->assertEquals(5, $locations->getTotalCount()); + self::assertCount(2, $locations->locations); + self::assertEquals(5, $locations->getTotalCount()); $actualLocationIds = []; foreach ($locations->locations as $location) { @@ -1239,7 +1268,7 @@ public function testLoadLocationChildrenDataWithOffsetAndLimit(LocationList $loc $actualLocationIds[] = $location->id; } - $this->assertEquals( + self::assertEquals( [ $this->generateId('location', 14), $this->generateId('location', 44), @@ -1393,7 +1422,7 @@ public function testNewLocationUpdateStruct() $updateStruct = $locationService->newLocationUpdateStruct(); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( LocationUpdateStruct::class, $updateStruct ); @@ -1413,6 +1442,7 @@ public function testNewLocationUpdateStruct() * Test for the updateLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::updateLocation() + * * @depends testLoadLocation */ public function testUpdateLocation() @@ -1435,7 +1465,7 @@ public function testUpdateLocation() $updatedLocation = $locationService->updateLocation($originalLocation, $updateStruct); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( Location::class, $updatedLocation ); @@ -1451,6 +1481,7 @@ public function testUpdateLocation() * Test for the updateLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::updateLocation() + * * @depends testUpdateLocation */ public function testUpdateLocationStructValues(array $data) @@ -1481,6 +1512,7 @@ public function testUpdateLocationStructValues(array $data) * Test for the updateLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::updateLocation() + * * @depends testLoadLocation */ public function testUpdateLocationWithSameRemoteId() @@ -1505,10 +1537,10 @@ public function testUpdateLocationWithSameRemoteId() $location = $locationService->updateLocation($originalLocation, $updateStruct); // Checks that the location was updated - $this->assertEquals(2, $location->priority); + self::assertEquals(2, $location->priority); // Checks that remoteId remains the same - $this->assertEquals($originalLocation->remoteId, $location->remoteId); + self::assertEquals($originalLocation->remoteId, $location->remoteId); /* END: Use Case */ } @@ -1516,6 +1548,7 @@ public function testUpdateLocationWithSameRemoteId() * Test for the updateLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::updateLocation() + * * @depends testLoadLocation */ public function testUpdateLocationThrowsInvalidArgumentException() @@ -1545,7 +1578,9 @@ public function testUpdateLocationThrowsInvalidArgumentException() * Test for the updateLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::updateLocation() + * * @depends testLoadLocation + * * @dataProvider dataProviderForOutOfRangeLocationPriority */ public function testUpdateLocationThrowsInvalidArgumentExceptionPriorityIsOutOfRange($priority) @@ -1576,6 +1611,7 @@ public function testUpdateLocationThrowsInvalidArgumentExceptionPriorityIsOutOfR * Ref EZP-23302: Update Location fails if no change is performed with the update. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::updateLocation() + * * @depends testLoadLocation */ public function testUpdateLocationTwice() @@ -1599,14 +1635,15 @@ public function testUpdateLocationTwice() $secondUpdatedLocation = $locationService->updateLocation($updatedLocation, $updateStruct); /* END: Use Case */ - $this->assertEquals($updatedLocation->priority, 42); - $this->assertEquals($secondUpdatedLocation->priority, 42); + self::assertEquals($updatedLocation->priority, 42); + self::assertEquals($secondUpdatedLocation->priority, 42); } /** * Test for the swapLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::swapLocation() + * * @depends testLoadLocation */ public function testSwapLocation() @@ -1642,21 +1679,21 @@ public function testSwapLocation() $mediaLocation = $locationService->loadLocation($demoDesignLocationId); // Assert Location's Content is updated - $this->assertEquals( + self::assertEquals( $mediaContentInfo->id, $mediaLocation->getContentInfo()->id ); - $this->assertEquals( + self::assertEquals( $demoDesignContentInfo->id, $demoDesignLocation->getContentInfo()->id ); // Assert URL aliases are updated - $this->assertEquals( + self::assertEquals( $mediaLocation->id, $repository->getURLAliasService()->lookup('/Design/Media')->destination ); - $this->assertEquals( + self::assertEquals( $demoDesignLocation->id, $repository->getURLAliasService()->lookup('/Ibexa-Demo-Design-without-demo-content')->destination ); @@ -1988,14 +2025,15 @@ public function testBookmarksAreSwappedAfterSwapLocation() $afterSwap = $bookmarkService->loadBookmarks(); /* END: Use Case */ - $this->assertEquals($beforeSwap->items[0]->id, $afterSwap->items[1]->id); - $this->assertEquals($beforeSwap->items[1]->id, $afterSwap->items[0]->id); + self::assertEquals($beforeSwap->items[0]->id, $afterSwap->items[1]->id); + self::assertEquals($beforeSwap->items[1]->id, $afterSwap->items[0]->id); } /** * Test for the hideLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::hideLocation() + * * @depends testLoadLocation */ public function testHideLocation() @@ -2012,12 +2050,12 @@ public function testHideLocation() $hiddenLocation = $locationService->hideLocation($visibleLocation); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( Location::class, $hiddenLocation ); - $this->assertTrue( + self::assertTrue( $hiddenLocation->hidden, sprintf( 'Location with ID "%s" is not hidden.', @@ -2051,7 +2089,7 @@ protected function assertSubtreeProperties(array $expectedValues, Location $loca } foreach ($expectedValues as $propertyName => $propertyValue) { - $this->assertEquals( + self::assertEquals( $propertyValue, $location->$propertyName ); @@ -2066,6 +2104,7 @@ protected function assertSubtreeProperties(array $expectedValues, Location $loca * Test for the unhideLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::unhideLocation() + * * @depends testHideLocation */ public function testUnhideLocation() @@ -2083,12 +2122,12 @@ public function testUnhideLocation() $unHiddenLocation = $locationService->unhideLocation($hiddenLocation); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( Location::class, $unHiddenLocation ); - $this->assertFalse( + self::assertFalse( $unHiddenLocation->hidden, sprintf( 'Location with ID "%s" is hidden.', @@ -2110,6 +2149,7 @@ public function testUnhideLocation() * Test for the unhideLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::unhideLocation() + * * @depends testUnhideLocation */ public function testUnhideLocationNotUnhidesHiddenSubtree() @@ -2132,12 +2172,12 @@ public function testUnhideLocationNotUnhidesHiddenSubtree() $unHiddenHigherLocation = $locationService->unhideLocation($hiddenHigherLocation); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( Location::class, $unHiddenHigherLocation ); - $this->assertFalse( + self::assertFalse( $unHiddenHigherLocation->hidden, sprintf( 'Location with ID "%s" is hidden.', @@ -2156,7 +2196,7 @@ public function testUnhideLocationNotUnhidesHiddenSubtree() } $stillHiddenLocation = $locationService->loadLocation($this->generateId('location', 13)); - $this->assertTrue( + self::assertTrue( $stillHiddenLocation->hidden, sprintf( 'Hidden sub-location with ID %s unhidden unexpectedly.', @@ -2175,6 +2215,7 @@ public function testUnhideLocationNotUnhidesHiddenSubtree() * Test for the deleteLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::deleteLocation() + * * @depends testLoadLocation */ public function testDeleteLocation() @@ -2194,7 +2235,7 @@ public function testDeleteLocation() try { $locationService->loadLocation($mediaLocationId); - $this->fail("Location $mediaLocationId not deleted."); + self::fail("Location $mediaLocationId not deleted."); } catch (NotFoundException $e) { } @@ -2203,7 +2244,7 @@ public function testDeleteLocation() foreach ([51, 52, 53] as $childLocationId) { try { $locationService->loadLocation($this->generateId('location', $childLocationId)); - $this->fail("Location $childLocationId not deleted."); + self::fail("Location $childLocationId not deleted."); } catch (NotFoundException $e) { } } @@ -2214,7 +2255,7 @@ public function testDeleteLocation() foreach ([49, 50, 51] as $childContentId) { try { $contentService->loadContentInfo($this->generateId('object', $childContentId)); - $this->fail("Content $childContentId not deleted."); + self::fail("Content $childContentId not deleted."); } catch (NotFoundException $e) { } } @@ -2224,6 +2265,7 @@ public function testDeleteLocation() * Test for the deleteLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::deleteLocation() + * * @depends testDeleteLocation */ public function testDeleteLocationDecrementsChildCountOnParent() @@ -2262,7 +2304,7 @@ public function testDeleteLocationDecrementsChildCountOnParent() $childCountAfter = $locationService->getLocationChildCount($parentLocation); /* END: Use Case */ - $this->assertEquals($childCountBefore - 1, $childCountAfter); + self::assertEquals($childCountBefore - 1, $childCountAfter); } /** @@ -2315,6 +2357,7 @@ public function testDeleteContentObjectLastLocation() * Test for the deleteLocation() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::deleteLocation + * * @depends testDeleteLocation */ public function testDeleteLocationDeletesRelatedBookmarks() @@ -2340,7 +2383,7 @@ public function testDeleteLocationDeletesRelatedBookmarks() // Location isn't bookmarked anymore foreach ($bookmarkService->loadBookmarks(0, 9999) as $bookmarkedLocation) { - $this->assertNotEquals($childLocation->id, $bookmarkedLocation->id); + self::assertNotEquals($childLocation->id, $bookmarkedLocation->id); } } @@ -2416,6 +2459,7 @@ public function testDeleteUnusedLocationWhichPreviousHadContentWithRelativeAlias * Test for the copySubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::copySubtree() + * * @depends testLoadLocation */ public function testCopySubtree() @@ -2447,7 +2491,7 @@ public function testCopySubtree() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( Location::class, $copiedLocation ); @@ -2468,6 +2512,7 @@ public function testCopySubtree() * Test for the copySubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::copySubtree() + * * @depends testLoadLocation */ public function testCopySubtreeWithAliases() @@ -2576,7 +2621,7 @@ private function assertDefaultContentStates(ContentInfo $contentInfo) $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); foreach ($objectStateService->loadObjectStates($objectStateGroup, Language::ALL) as $objectState) { // Only check the first object state which is the default one. - $this->assertEquals( + self::assertEquals( $objectState, $contentState ); @@ -2589,6 +2634,7 @@ private function assertDefaultContentStates(ContentInfo $contentInfo) * Test for the copySubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::copySubtree() + * * @depends testCopySubtree */ public function testCopySubtreeUpdatesSubtreeProperties() @@ -2636,15 +2682,15 @@ public function testCopySubtreeUpdatesSubtreeProperties() // Load Subtree properties after copy $actual = $this->loadSubtreeProperties($copiedLocation); - $this->assertEquals(count($expected), count($actual)); + self::assertEquals(count($expected), count($actual)); foreach ($actual as $properties) { - $this->assertNotContains($properties['id'], $beforeIds); - $this->assertStringStartsWith( + self::assertNotContains($properties['id'], $beforeIds); + self::assertStringStartsWith( $newParentLocation->pathString . $this->parseId('location', $copiedLocation->id) . '/', $properties['pathString'] ); - $this->assertStringEndsWith( + self::assertStringEndsWith( '/' . $this->parseId('location', $properties['id']) . '/', $properties['pathString'] ); @@ -2655,6 +2701,7 @@ public function testCopySubtreeUpdatesSubtreeProperties() * Test for the copySubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::copySubtree() + * * @depends testCopySubtree */ public function testCopySubtreeIncrementsChildCountOfNewParent() @@ -2693,7 +2740,7 @@ public function testCopySubtreeIncrementsChildCountOfNewParent() $childCountAfter = $locationService->getLocationChildCount($locationService->loadLocation($demoDesignLocationId)); - $this->assertEquals($childCountBefore + 1, $childCountAfter); + self::assertEquals($childCountBefore + 1, $childCountAfter); } /** @@ -2743,6 +2790,7 @@ public function testCopySubtreeWithInvisibleChild(): void * Test for the copySubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::copySubtree() + * * @depends testCopySubtree */ public function testCopySubtreeThrowsInvalidArgumentException() @@ -2779,6 +2827,7 @@ public function testCopySubtreeThrowsInvalidArgumentException() * Test for the moveSubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::moveSubtree + * * @depends testLoadLocation */ public function testMoveSubtree(): void @@ -2829,6 +2878,7 @@ public function testMoveSubtree(): void * Test for the moveSubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::moveSubtree + * * @depends testLoadLocation */ public function testMoveSubtreeToLocationWithoutContent(): void @@ -2864,6 +2914,7 @@ public function testMoveSubtreeToLocationWithoutContent(): void * Test for the moveSubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::moveSubtree + * * @depends testLoadLocation */ public function testMoveSubtreeThrowsExceptionOnMoveNotIntoContainer(): void @@ -2897,6 +2948,7 @@ public function testMoveSubtreeThrowsExceptionOnMoveNotIntoContainer(): void * Test for the moveSubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::moveSubtree + * * @depends testLoadLocation */ public function testMoveSubtreeThrowsExceptionOnMoveToSame(): void @@ -2926,6 +2978,7 @@ public function testMoveSubtreeThrowsExceptionOnMoveToSame(): void * Test for the moveSubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::moveSubtree + * * @depends testMoveSubtree */ public function testMoveSubtreeHidden(): void @@ -2979,6 +3032,7 @@ public function testMoveSubtreeHidden(): void * Test for the moveSubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::moveSubtree() + * * @depends testMoveSubtree */ public function testMoveSubtreeUpdatesSubtreeProperties() @@ -3033,13 +3087,14 @@ public function testMoveSubtreeUpdatesSubtreeProperties() // Load Subtree properties after move $actual = $this->loadSubtreeProperties($movedLocation); - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } /** * Test for the moveSubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::moveSubtree() + * * @depends testMoveSubtreeUpdatesSubtreeProperties */ public function testMoveSubtreeUpdatesSubtreePropertiesHidden() @@ -3098,13 +3153,14 @@ public function testMoveSubtreeUpdatesSubtreePropertiesHidden() // Load Subtree properties after move $actual = $this->loadSubtreeProperties($movedLocation); - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } /** * Test for the moveSubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::moveSubtree() + * * @depends testMoveSubtree */ public function testMoveSubtreeIncrementsChildCountOfNewParent() @@ -3155,14 +3211,15 @@ public function testMoveSubtreeIncrementsChildCountOfNewParent() $actual = $this->loadLocationProperties($newParentLocation); $childCountAfter = $locationService->getLocationChildCount($newParentLocation); - $this->assertEquals($expected, $actual); - $this->assertEquals($childCountBefore + 1, $childCountAfter); + self::assertEquals($expected, $actual); + self::assertEquals($childCountBefore + 1, $childCountAfter); } /** * Test for the moveSubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\LocationService::moveSubtree() + * * @depends testMoveSubtree */ public function testMoveSubtreeDecrementsChildCountOfOldParent() @@ -3213,8 +3270,8 @@ public function testMoveSubtreeDecrementsChildCountOfOldParent() $actual = $this->loadLocationProperties($oldParentLocation); $childCountAfter = $locationService->getLocationChildCount($oldParentLocation); - $this->assertEquals($expected, $actual); - $this->assertEquals($childCountBefore - 1, $childCountAfter); + self::assertEquals($expected, $actual); + self::assertEquals($childCountBefore - 1, $childCountAfter); } /** @@ -3627,9 +3684,9 @@ private function assertAliasesBeforeCopy($urlAliasService, array $expectedSubIte foreach ($expectedSubItemAliases as $aliasUrl) { try { $urlAliasService->lookup($aliasUrl); - $this->fail('We didn\'t expect to find alias, but it was found'); + self::fail('We didn\'t expect to find alias, but it was found'); } catch (\Exception $e) { - $this->assertTrue(true); // OK - alias was not found + self::assertTrue(true); // OK - alias was not found } } } @@ -3691,7 +3748,7 @@ private function assertAliasExists( $articleAliasesBeforeDelete = $urlAliasService ->listLocationAliases($location); - $this->assertNotEmpty( + self::assertNotEmpty( array_filter( $articleAliasesBeforeDelete, static function (URLAlias $alias) use ($expectedAliasPath) { diff --git a/tests/integration/Core/Repository/NonRedundantFieldSetTest.php b/tests/integration/Core/Repository/NonRedundantFieldSetTest.php index 141ec36a26..502e088a39 100644 --- a/tests/integration/Core/Repository/NonRedundantFieldSetTest.php +++ b/tests/integration/Core/Repository/NonRedundantFieldSetTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Values\Content\Content; @@ -16,6 +17,7 @@ * These tests depends on TextLine field type being functional. * * @covers \Ibexa\Contracts\Core\Repository\ContentService + * * @group content */ class NonRedundantFieldSetTest extends BaseNonRedundantFieldSetTest @@ -26,6 +28,7 @@ class NonRedundantFieldSetTest extends BaseNonRedundantFieldSetTest * Default values are stored. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContent * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCreateContentType * @@ -41,7 +44,7 @@ public function testCreateContentDefaultValues() $content = $this->createTestContent($mainLanguageCode, $fieldValues); - $this->assertInstanceOf(Content::class, $content); + self::assertInstanceOf(Content::class, $content); return $content; } @@ -50,21 +53,22 @@ public function testCreateContentDefaultValues() * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContentDefaultValues * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content */ public function testCreateContentDefaultValuesFields(Content $content) { - $this->assertCount(1, $content->versionInfo->languageCodes); - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertCount(4, $content->getFields()); + self::assertCount(1, $content->versionInfo->languageCodes); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertCount(4, $content->getFields()); // eng-US - $this->assertEquals('new value 1', $content->getFieldValue('field1', 'eng-US')); - $this->assertEquals('default value 2', $content->getFieldValue('field2', 'eng-US')); - $this->assertEquals('new value 3', $content->getFieldValue('field3', 'eng-US')); - $this->assertEquals('default value 4', $content->getFieldValue('field4', 'eng-US')); + self::assertEquals('new value 1', $content->getFieldValue('field1', 'eng-US')); + self::assertEquals('default value 2', $content->getFieldValue('field2', 'eng-US')); + self::assertEquals('new value 3', $content->getFieldValue('field3', 'eng-US')); + self::assertEquals('default value 4', $content->getFieldValue('field4', 'eng-US')); } /** @@ -73,6 +77,7 @@ public function testCreateContentDefaultValuesFields(Content $content) * Creating fields with empty values, no values being passed to storage. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContent * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCreateContentType * @@ -88,7 +93,7 @@ public function testCreateContentEmptyValues() $content = $this->createTestContent($mainLanguageCode, $fieldValues); - $this->assertInstanceOf(Content::class, $content); + self::assertInstanceOf(Content::class, $content); return $content; } @@ -97,6 +102,7 @@ public function testCreateContentEmptyValues() * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContentEmptyValues * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content @@ -105,16 +111,16 @@ public function testCreateContentEmptyValuesFields(Content $content) { $emptyValue = $this->getRepository()->getFieldTypeService()->getFieldType('ezstring')->getEmptyValue(); - $this->assertCount(1, $content->versionInfo->languageCodes); - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertCount(4, $content->getFields()); + self::assertCount(1, $content->versionInfo->languageCodes); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertCount(4, $content->getFields()); // eng-US - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); - $this->assertEquals($emptyValue, $content->getFieldValue('field2', 'eng-US')); - $this->assertEquals($emptyValue, $content->getFieldValue('field3', 'eng-US')); - $this->assertEquals($emptyValue, $content->getFieldValue('field4', 'eng-US')); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field2', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field3', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field4', 'eng-US')); } /** @@ -124,6 +130,7 @@ public function testCreateContentEmptyValuesFields(Content $content) * Case where additional language is not stored. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContent * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCreateContentType * @@ -139,7 +146,7 @@ public function testCreateContentEmptyValuesTranslationNotStored() $content = $this->createTestContent($mainLanguageCode, $fieldValues); - $this->assertInstanceOf(Content::class, $content); + self::assertInstanceOf(Content::class, $content); return $content; } @@ -148,6 +155,7 @@ public function testCreateContentEmptyValuesTranslationNotStored() * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContentEmptyValuesTranslationNotStored * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content @@ -156,19 +164,19 @@ public function testCreateContentEmptyValuesTranslationNotStoredFields(Content $ { $emptyValue = $this->getRepository()->getFieldTypeService()->getFieldType('ezstring')->getEmptyValue(); - $this->assertCount(1, $content->versionInfo->languageCodes); - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertCount(4, $content->getFields()); + self::assertCount(1, $content->versionInfo->languageCodes); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertCount(4, $content->getFields()); // eng-US - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); - $this->assertEquals($emptyValue, $content->getFieldValue('field2', 'eng-US')); - $this->assertEquals($emptyValue, $content->getFieldValue('field3', 'eng-US')); - $this->assertEquals($emptyValue, $content->getFieldValue('field4', 'eng-US')); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field2', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field3', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field4', 'eng-US')); // ger-DE is not stored! - $this->assertNotContains('ger-DE', $content->versionInfo->languageCodes); + self::assertNotContains('ger-DE', $content->versionInfo->languageCodes); } /** @@ -177,6 +185,7 @@ public function testCreateContentEmptyValuesTranslationNotStoredFields(Content $ * Creating with two languages, main language is always stored (even with all values being empty). * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContent * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCreateContentType * @@ -192,7 +201,7 @@ public function testCreateContentTwoLanguagesMainTranslationStored() $content = $this->createTestContent($mainLanguageCode, $fieldValues); - $this->assertInstanceOf(Content::class, $content); + self::assertInstanceOf(Content::class, $content); return $content; } @@ -201,6 +210,7 @@ public function testCreateContentTwoLanguagesMainTranslationStored() * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContentTwoLanguagesMainTranslationStored * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content @@ -209,23 +219,23 @@ public function testCreateContentTwoLanguagesMainTranslationStoredFields(Content { $emptyValue = $this->getRepository()->getFieldTypeService()->getFieldType('ezstring')->getEmptyValue(); - $this->assertCount(2, $content->versionInfo->languageCodes); - $this->assertContains('ger-DE', $content->versionInfo->languageCodes); - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertCount(8, $content->getFields()); + self::assertCount(2, $content->versionInfo->languageCodes); + self::assertContains('ger-DE', $content->versionInfo->languageCodes); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertCount(8, $content->getFields()); // eng-US - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); - $this->assertEquals($emptyValue, $content->getFieldValue('field2', 'eng-US')); - $this->assertEquals($emptyValue, $content->getFieldValue('field3', 'eng-US')); - $this->assertEquals($emptyValue, $content->getFieldValue('field4', 'eng-US')); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field2', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field3', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field4', 'eng-US')); // ger-DE - $this->assertEquals($emptyValue, $content->getFieldValue('field1', 'ger-DE')); - $this->assertEquals($emptyValue, $content->getFieldValue('field2', 'ger-DE')); - $this->assertEquals($emptyValue, $content->getFieldValue('field3', 'ger-DE')); - $this->assertEquals('new ger-DE value 4', $content->getFieldValue('field4', 'ger-DE')); + self::assertEquals($emptyValue, $content->getFieldValue('field1', 'ger-DE')); + self::assertEquals($emptyValue, $content->getFieldValue('field2', 'ger-DE')); + self::assertEquals($emptyValue, $content->getFieldValue('field3', 'ger-DE')); + self::assertEquals('new ger-DE value 4', $content->getFieldValue('field4', 'ger-DE')); } /** @@ -235,6 +245,7 @@ public function testCreateContentTwoLanguagesMainTranslationStoredFields(Content * for it being passed to the storage. Second language will not be stored. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContent * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCreateContentType * @@ -249,7 +260,7 @@ public function testCreateContentTwoLanguagesSecondTranslationNotStored() $content = $this->createTestContent($mainLanguageCode, $fieldValues); - $this->assertInstanceOf(Content::class, $content); + self::assertInstanceOf(Content::class, $content); return $content; } @@ -258,6 +269,7 @@ public function testCreateContentTwoLanguagesSecondTranslationNotStored() * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContentTwoLanguagesSecondTranslationNotStored * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content @@ -266,18 +278,18 @@ public function testCreateContentTwoLanguagesSecondTranslationNotStoredFields(Co { $emptyValue = $this->getRepository()->getFieldTypeService()->getFieldType('ezstring')->getEmptyValue(); - $this->assertCount(1, $content->versionInfo->languageCodes); - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertCount(4, $content->getFields()); + self::assertCount(1, $content->versionInfo->languageCodes); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertCount(4, $content->getFields()); // eng-US - $this->assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); - $this->assertEquals('default value 2', $content->getFieldValue('field2', 'eng-US')); - $this->assertEquals($emptyValue, $content->getFieldValue('field3', 'eng-US')); - $this->assertEquals('default value 4', $content->getFieldValue('field4', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); + self::assertEquals('default value 2', $content->getFieldValue('field2', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field3', 'eng-US')); + self::assertEquals('default value 4', $content->getFieldValue('field4', 'eng-US')); // ger-DE is not stored! - $this->assertNotContains('ger-DE', $content->versionInfo->languageCodes); + self::assertNotContains('ger-DE', $content->versionInfo->languageCodes); } /** @@ -286,6 +298,7 @@ public function testCreateContentTwoLanguagesSecondTranslationNotStoredFields(Co * Creating with no fields in struct, using only default values. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContent * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCreateContentType * @@ -298,7 +311,7 @@ public function testCreateContentDefaultValuesNoStructFields() $content = $this->createTestContent($mainLanguageCode, $fieldValues); - $this->assertInstanceOf(Content::class, $content); + self::assertInstanceOf(Content::class, $content); return $content; } @@ -307,6 +320,7 @@ public function testCreateContentDefaultValuesNoStructFields() * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContentDefaultValuesNoStructFields * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content @@ -315,15 +329,15 @@ public function testCreateContentDefaultValuesNoStructFieldsFields(Content $cont { $emptyValue = $this->getRepository()->getFieldTypeService()->getFieldType('ezstring')->getEmptyValue(); - $this->assertCount(1, $content->versionInfo->languageCodes); - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertCount(4, $content->getFields()); + self::assertCount(1, $content->versionInfo->languageCodes); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertCount(4, $content->getFields()); // eng-US - $this->assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); - $this->assertEquals('default value 2', $content->getFieldValue('field2', 'eng-US')); - $this->assertEquals($emptyValue, $content->getFieldValue('field3', 'eng-US')); - $this->assertEquals('default value 4', $content->getFieldValue('field4', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); + self::assertEquals('default value 2', $content->getFieldValue('field2', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field3', 'eng-US')); + self::assertEquals('default value 4', $content->getFieldValue('field4', 'eng-US')); } /** @@ -332,6 +346,7 @@ public function testCreateContentDefaultValuesNoStructFieldsFields(Content $cont * Creating in two languages with no given field values for main language. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContent * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCreateContentType * @@ -346,7 +361,7 @@ public function testCreateContentTwoLanguagesNoValuesForMainLanguage() $content = $this->createTestContent($mainLanguageCode, $fieldValues); - $this->assertInstanceOf(Content::class, $content); + self::assertInstanceOf(Content::class, $content); return $content; } @@ -355,6 +370,7 @@ public function testCreateContentTwoLanguagesNoValuesForMainLanguage() * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends testCreateContentTwoLanguagesNoValuesForMainLanguage * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content @@ -363,28 +379,29 @@ public function testCreateContentTwoLanguagesNoValuesForMainLanguageFields(Conte { $emptyValue = $this->getRepository()->getFieldTypeService()->getFieldType('ezstring')->getEmptyValue(); - $this->assertCount(2, $content->versionInfo->languageCodes); - $this->assertContains('ger-DE', $content->versionInfo->languageCodes); - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertCount(8, $content->getFields()); + self::assertCount(2, $content->versionInfo->languageCodes); + self::assertContains('ger-DE', $content->versionInfo->languageCodes); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertCount(8, $content->getFields()); // eng-US - $this->assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); - $this->assertEquals('default value 2', $content->getFieldValue('field2', 'eng-US')); - $this->assertEquals($emptyValue, $content->getFieldValue('field3', 'eng-US')); - $this->assertEquals('default value 4', $content->getFieldValue('field4', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); + self::assertEquals('default value 2', $content->getFieldValue('field2', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field3', 'eng-US')); + self::assertEquals('default value 4', $content->getFieldValue('field4', 'eng-US')); // ger-DE - $this->assertEquals($emptyValue, $content->getFieldValue('field1', 'ger-DE')); - $this->assertEquals('default value 2', $content->getFieldValue('field2', 'ger-DE')); - $this->assertEquals($emptyValue, $content->getFieldValue('field3', 'ger-DE')); - $this->assertEquals('new value 4', $content->getFieldValue('field4', 'ger-DE')); + self::assertEquals($emptyValue, $content->getFieldValue('field1', 'ger-DE')); + self::assertEquals('default value 2', $content->getFieldValue('field2', 'ger-DE')); + self::assertEquals($emptyValue, $content->getFieldValue('field3', 'ger-DE')); + self::assertEquals('new value 4', $content->getFieldValue('field4', 'ger-DE')); } /** * Test for the createContentDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContentDraft() + * * @depends testCreateContentTwoLanguagesMainTranslationStoredFields * * @return \Ibexa\Contracts\Core\Repository\Values\Content\Content[] @@ -414,24 +431,24 @@ public function testCreateContentDraftFields(array $data) { $content = $data[1]; - $this->assertEquals(VersionInfo::STATUS_DRAFT, $content->versionInfo->status); - $this->assertEquals(2, $content->versionInfo->versionNo); - $this->assertCount(2, $content->versionInfo->languageCodes); - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertContains('eng-GB', $content->versionInfo->languageCodes); - $this->assertCount(8, $content->getFields()); + self::assertEquals(VersionInfo::STATUS_DRAFT, $content->versionInfo->status); + self::assertEquals(2, $content->versionInfo->versionNo); + self::assertCount(2, $content->versionInfo->languageCodes); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertContains('eng-GB', $content->versionInfo->languageCodes); + self::assertCount(8, $content->getFields()); // eng-US - $this->assertEquals('value 1', $content->getFieldValue('field1', 'eng-US')); - $this->assertEquals('value 2', $content->getFieldValue('field2', 'eng-US')); - $this->assertEquals('value 3', $content->getFieldValue('field3', 'eng-US')); - $this->assertEquals('value 4', $content->getFieldValue('field4', 'eng-US')); + self::assertEquals('value 1', $content->getFieldValue('field1', 'eng-US')); + self::assertEquals('value 2', $content->getFieldValue('field2', 'eng-US')); + self::assertEquals('value 3', $content->getFieldValue('field3', 'eng-US')); + self::assertEquals('value 4', $content->getFieldValue('field4', 'eng-US')); // eng-GB - $this->assertEquals('value 1', $content->getFieldValue('field1', 'eng-GB')); - $this->assertEquals('value 2', $content->getFieldValue('field2', 'eng-GB')); - $this->assertEquals('value 3 eng-GB', $content->getFieldValue('field3', 'eng-GB')); - $this->assertEquals('value 4 eng-GB', $content->getFieldValue('field4', 'eng-GB')); + self::assertEquals('value 1', $content->getFieldValue('field1', 'eng-GB')); + self::assertEquals('value 2', $content->getFieldValue('field2', 'eng-GB')); + self::assertEquals('value 3 eng-GB', $content->getFieldValue('field3', 'eng-GB')); + self::assertEquals('value 4 eng-GB', $content->getFieldValue('field4', 'eng-GB')); } /** @@ -456,6 +473,7 @@ public function testCreateContentDraftFieldsRetainsIds(array $data) * - value for new language is not empty * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContent * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCreateContentType * @@ -469,7 +487,7 @@ public function testUpdateContentWithNewLanguage() ]; $content = $this->updateTestContent($initialLanguageCode, $fieldValues); - $this->assertInstanceOf(Content::class, $content); + self::assertInstanceOf(Content::class, $content); return $content; } @@ -478,6 +496,7 @@ public function testUpdateContentWithNewLanguage() * Test for the updateContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testUpdateContentWithNewLanguage * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content @@ -486,29 +505,29 @@ public function testUpdateContentWithNewLanguageFields(Content $content) { $emptyValue = $this->getRepository()->getFieldTypeService()->getFieldType('ezstring')->getEmptyValue(); - $this->assertCount(3, $content->versionInfo->languageCodes); - $this->assertContains('ger-DE', $content->versionInfo->languageCodes); - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertContains('eng-GB', $content->versionInfo->languageCodes); - $this->assertCount(12, $content->getFields()); + self::assertCount(3, $content->versionInfo->languageCodes); + self::assertContains('ger-DE', $content->versionInfo->languageCodes); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertContains('eng-GB', $content->versionInfo->languageCodes); + self::assertCount(12, $content->getFields()); // eng-US - $this->assertEquals('value 1', $content->getFieldValue('field1', 'eng-US')); - $this->assertEquals('value 2', $content->getFieldValue('field2', 'eng-US')); - $this->assertEquals('value 3', $content->getFieldValue('field3', 'eng-US')); - $this->assertEquals('value 4', $content->getFieldValue('field4', 'eng-US')); + self::assertEquals('value 1', $content->getFieldValue('field1', 'eng-US')); + self::assertEquals('value 2', $content->getFieldValue('field2', 'eng-US')); + self::assertEquals('value 3', $content->getFieldValue('field3', 'eng-US')); + self::assertEquals('value 4', $content->getFieldValue('field4', 'eng-US')); // eng-GB - $this->assertEquals('value 1', $content->getFieldValue('field1', 'eng-GB')); - $this->assertEquals('value 2', $content->getFieldValue('field2', 'eng-GB')); - $this->assertEquals('value 3 eng-GB', $content->getFieldValue('field3', 'eng-GB')); - $this->assertEquals('value 4 eng-GB', $content->getFieldValue('field4', 'eng-GB')); + self::assertEquals('value 1', $content->getFieldValue('field1', 'eng-GB')); + self::assertEquals('value 2', $content->getFieldValue('field2', 'eng-GB')); + self::assertEquals('value 3 eng-GB', $content->getFieldValue('field3', 'eng-GB')); + self::assertEquals('value 4 eng-GB', $content->getFieldValue('field4', 'eng-GB')); // ger-DE - $this->assertEquals('value 1', $content->getFieldValue('field1', 'ger-DE')); - $this->assertEquals('value 2', $content->getFieldValue('field2', 'ger-DE')); - $this->assertEquals($emptyValue, $content->getFieldValue('field3', 'ger-DE')); - $this->assertEquals('new value 4', $content->getFieldValue('field4', 'ger-DE')); + self::assertEquals('value 1', $content->getFieldValue('field1', 'ger-DE')); + self::assertEquals('value 2', $content->getFieldValue('field2', 'ger-DE')); + self::assertEquals($emptyValue, $content->getFieldValue('field3', 'ger-DE')); + self::assertEquals('new value 4', $content->getFieldValue('field4', 'ger-DE')); } /** @@ -522,6 +541,7 @@ public function testUpdateContentWithNewLanguageFields(Content $content) * - existing language value not changed * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContent * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCreateContentType * @@ -536,7 +556,7 @@ public function testUpdateContentWithNewLanguageVariant() ]; $content = $this->updateTestContent($initialLanguageCode, $fieldValues); - $this->assertInstanceOf(Content::class, $content); + self::assertInstanceOf(Content::class, $content); return $content; } @@ -545,6 +565,7 @@ public function testUpdateContentWithNewLanguageVariant() * Test for the updateContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testUpdateContentWithNewLanguageVariant * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content @@ -553,29 +574,29 @@ public function testUpdateContentWithNewLanguageVariantFields(Content $content) { $emptyValue = $this->getRepository()->getFieldTypeService()->getFieldType('ezstring')->getEmptyValue(); - $this->assertCount(3, $content->versionInfo->languageCodes); - $this->assertContains('ger-DE', $content->versionInfo->languageCodes); - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertContains('eng-GB', $content->versionInfo->languageCodes); - $this->assertCount(12, $content->getFields()); + self::assertCount(3, $content->versionInfo->languageCodes); + self::assertContains('ger-DE', $content->versionInfo->languageCodes); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertContains('eng-GB', $content->versionInfo->languageCodes); + self::assertCount(12, $content->getFields()); // eng-US - $this->assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); - $this->assertEquals('value 2', $content->getFieldValue('field2', 'eng-US')); - $this->assertEquals('value 3', $content->getFieldValue('field3', 'eng-US')); - $this->assertEquals('value 4', $content->getFieldValue('field4', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); + self::assertEquals('value 2', $content->getFieldValue('field2', 'eng-US')); + self::assertEquals('value 3', $content->getFieldValue('field3', 'eng-US')); + self::assertEquals('value 4', $content->getFieldValue('field4', 'eng-US')); // eng-GB - $this->assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-GB')); - $this->assertEquals('value 2', $content->getFieldValue('field2', 'eng-GB')); - $this->assertEquals('value 3 eng-GB', $content->getFieldValue('field3', 'eng-GB')); - $this->assertEquals('value 4 eng-GB', $content->getFieldValue('field4', 'eng-GB')); + self::assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-GB')); + self::assertEquals('value 2', $content->getFieldValue('field2', 'eng-GB')); + self::assertEquals('value 3 eng-GB', $content->getFieldValue('field3', 'eng-GB')); + self::assertEquals('value 4 eng-GB', $content->getFieldValue('field4', 'eng-GB')); // ger-DE - $this->assertEquals($emptyValue, $content->getFieldValue('field1', 'ger-DE')); - $this->assertEquals('value 2', $content->getFieldValue('field2', 'ger-DE')); - $this->assertEquals($emptyValue, $content->getFieldValue('field3', 'ger-DE')); - $this->assertEquals('new value 4', $content->getFieldValue('field4', 'ger-DE')); + self::assertEquals($emptyValue, $content->getFieldValue('field1', 'ger-DE')); + self::assertEquals('value 2', $content->getFieldValue('field2', 'ger-DE')); + self::assertEquals($emptyValue, $content->getFieldValue('field3', 'ger-DE')); + self::assertEquals('new value 4', $content->getFieldValue('field4', 'ger-DE')); } /** @@ -584,6 +605,7 @@ public function testUpdateContentWithNewLanguageVariantFields(Content $content) * Updating with with new language and no field values given in the update struct. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContent * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCreateContentType * @@ -595,7 +617,7 @@ public function testUpdateContentWithNewLanguageNoValues() $fieldValues = []; $content = $this->updateTestContent($initialLanguageCode, $fieldValues); - $this->assertInstanceOf(Content::class, $content); + self::assertInstanceOf(Content::class, $content); return $content; } @@ -604,6 +626,7 @@ public function testUpdateContentWithNewLanguageNoValues() * Test for the updateContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testUpdateContentWithNewLanguageNoValues * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content @@ -612,29 +635,29 @@ public function testUpdateContentWithNewLanguageNoValuesFields(Content $content) { $emptyValue = $this->getRepository()->getFieldTypeService()->getFieldType('ezstring')->getEmptyValue(); - $this->assertCount(3, $content->versionInfo->languageCodes); - $this->assertContains('ger-DE', $content->versionInfo->languageCodes); - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertContains('eng-GB', $content->versionInfo->languageCodes); - $this->assertCount(12, $content->getFields()); + self::assertCount(3, $content->versionInfo->languageCodes); + self::assertContains('ger-DE', $content->versionInfo->languageCodes); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertContains('eng-GB', $content->versionInfo->languageCodes); + self::assertCount(12, $content->getFields()); // eng-US - $this->assertEquals('value 1', $content->getFieldValue('field1', 'eng-US')); - $this->assertEquals('value 2', $content->getFieldValue('field2', 'eng-US')); - $this->assertEquals('value 3', $content->getFieldValue('field3', 'eng-US')); - $this->assertEquals('value 4', $content->getFieldValue('field4', 'eng-US')); + self::assertEquals('value 1', $content->getFieldValue('field1', 'eng-US')); + self::assertEquals('value 2', $content->getFieldValue('field2', 'eng-US')); + self::assertEquals('value 3', $content->getFieldValue('field3', 'eng-US')); + self::assertEquals('value 4', $content->getFieldValue('field4', 'eng-US')); // eng-GB - $this->assertEquals('value 1', $content->getFieldValue('field1', 'eng-GB')); - $this->assertEquals('value 2', $content->getFieldValue('field2', 'eng-GB')); - $this->assertEquals('value 3 eng-GB', $content->getFieldValue('field3', 'eng-GB')); - $this->assertEquals('value 4 eng-GB', $content->getFieldValue('field4', 'eng-GB')); + self::assertEquals('value 1', $content->getFieldValue('field1', 'eng-GB')); + self::assertEquals('value 2', $content->getFieldValue('field2', 'eng-GB')); + self::assertEquals('value 3 eng-GB', $content->getFieldValue('field3', 'eng-GB')); + self::assertEquals('value 4 eng-GB', $content->getFieldValue('field4', 'eng-GB')); // ger-DE - $this->assertEquals('value 1', $content->getFieldValue('field1', 'ger-DE')); - $this->assertEquals('value 2', $content->getFieldValue('field2', 'ger-DE')); - $this->assertEquals($emptyValue, $content->getFieldValue('field3', 'ger-DE')); - $this->assertEquals('default value 4', $content->getFieldValue('field4', 'ger-DE')); + self::assertEquals('value 1', $content->getFieldValue('field1', 'ger-DE')); + self::assertEquals('value 2', $content->getFieldValue('field2', 'ger-DE')); + self::assertEquals($emptyValue, $content->getFieldValue('field3', 'ger-DE')); + self::assertEquals('default value 4', $content->getFieldValue('field4', 'ger-DE')); } /** @@ -644,6 +667,7 @@ public function testUpdateContentWithNewLanguageNoValuesFields(Content $content) * for non-main language. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContent * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCreateContentType * @@ -658,7 +682,7 @@ public function testUpdateContentUpdatingNonTranslatableFieldUpdatesFieldCopy() ]; $content = $this->updateTestContent($initialLanguageCode, $fieldValues); - $this->assertInstanceOf(Content::class, $content); + self::assertInstanceOf(Content::class, $content); return $content; } @@ -667,6 +691,7 @@ public function testUpdateContentUpdatingNonTranslatableFieldUpdatesFieldCopy() * Test for the updateContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testUpdateContentUpdatingNonTranslatableFieldUpdatesFieldCopy * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content @@ -675,22 +700,22 @@ public function testUpdateContentUpdatingNonTranslatableFieldUpdatesFieldCopyFie { $emptyValue = $this->getRepository()->getFieldTypeService()->getFieldType('ezstring')->getEmptyValue(); - $this->assertCount(2, $content->versionInfo->languageCodes); - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertContains('eng-GB', $content->versionInfo->languageCodes); - $this->assertCount(8, $content->getFields()); + self::assertCount(2, $content->versionInfo->languageCodes); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertContains('eng-GB', $content->versionInfo->languageCodes); + self::assertCount(8, $content->getFields()); // eng-US - $this->assertEquals('new value 1', $content->getFieldValue('field1', 'eng-US')); - $this->assertEquals($emptyValue, $content->getFieldValue('field2', 'eng-US')); - $this->assertEquals('value 3', $content->getFieldValue('field3', 'eng-US')); - $this->assertEquals('value 4', $content->getFieldValue('field4', 'eng-US')); + self::assertEquals('new value 1', $content->getFieldValue('field1', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field2', 'eng-US')); + self::assertEquals('value 3', $content->getFieldValue('field3', 'eng-US')); + self::assertEquals('value 4', $content->getFieldValue('field4', 'eng-US')); // eng-GB - $this->assertEquals('new value 1', $content->getFieldValue('field1', 'eng-GB')); - $this->assertEquals($emptyValue, $content->getFieldValue('field2', 'eng-GB')); - $this->assertEquals('value 3 eng-GB', $content->getFieldValue('field3', 'eng-GB')); - $this->assertEquals('value 4 eng-GB', $content->getFieldValue('field4', 'eng-GB')); + self::assertEquals('new value 1', $content->getFieldValue('field1', 'eng-GB')); + self::assertEquals($emptyValue, $content->getFieldValue('field2', 'eng-GB')); + self::assertEquals('value 3 eng-GB', $content->getFieldValue('field3', 'eng-GB')); + self::assertEquals('value 4 eng-GB', $content->getFieldValue('field4', 'eng-GB')); } /** @@ -699,6 +724,7 @@ public function testUpdateContentUpdatingNonTranslatableFieldUpdatesFieldCopyFie * Updating with two languages, initial language is always stored (even with all values being empty). * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testCreateContent * @depends Ibexa\Tests\Integration\Core\Repository\ContentTypeServiceTest::testCreateContentType * @@ -714,7 +740,7 @@ public function testUpdateContentWithTwoLanguagesInitialLanguageTranslationNotCr ]; $content = $this->updateTestContent($initialLanguageCode, $fieldValues); - $this->assertInstanceOf(Content::class, $content); + self::assertInstanceOf(Content::class, $content); return $content; } @@ -723,6 +749,7 @@ public function testUpdateContentWithTwoLanguagesInitialLanguageTranslationNotCr * Test for the updateContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent() + * * @depends testUpdateContentWithTwoLanguagesInitialLanguageTranslationNotCreated * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content $content @@ -731,29 +758,29 @@ public function testUpdateContentWithTwoLanguagesInitialLanguageTranslationNotCr { $emptyValue = $this->getRepository()->getFieldTypeService()->getFieldType('ezstring')->getEmptyValue(); - $this->assertCount(3, $content->versionInfo->languageCodes); - $this->assertContains('ger-DE', $content->versionInfo->languageCodes); - $this->assertContains('eng-US', $content->versionInfo->languageCodes); - $this->assertContains('eng-GB', $content->versionInfo->languageCodes); - $this->assertCount(12, $content->getFields()); + self::assertCount(3, $content->versionInfo->languageCodes); + self::assertContains('ger-DE', $content->versionInfo->languageCodes); + self::assertContains('eng-US', $content->versionInfo->languageCodes); + self::assertContains('eng-GB', $content->versionInfo->languageCodes); + self::assertCount(12, $content->getFields()); // eng-US - $this->assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); - $this->assertEquals($emptyValue, $content->getFieldValue('field2', 'eng-US')); - $this->assertEquals('value 3', $content->getFieldValue('field3', 'eng-US')); - $this->assertEquals('value 4', $content->getFieldValue('field4', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-US')); + self::assertEquals($emptyValue, $content->getFieldValue('field2', 'eng-US')); + self::assertEquals('value 3', $content->getFieldValue('field3', 'eng-US')); + self::assertEquals('value 4', $content->getFieldValue('field4', 'eng-US')); // eng-GB - $this->assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-GB')); - $this->assertEquals($emptyValue, $content->getFieldValue('field2', 'eng-GB')); - $this->assertEquals('value 3 eng-GB', $content->getFieldValue('field3', 'eng-GB')); - $this->assertEquals('value 4 eng-GB', $content->getFieldValue('field4', 'eng-GB')); + self::assertEquals($emptyValue, $content->getFieldValue('field1', 'eng-GB')); + self::assertEquals($emptyValue, $content->getFieldValue('field2', 'eng-GB')); + self::assertEquals('value 3 eng-GB', $content->getFieldValue('field3', 'eng-GB')); + self::assertEquals('value 4 eng-GB', $content->getFieldValue('field4', 'eng-GB')); // ger-DE - $this->assertEquals($emptyValue, $content->getFieldValue('field1', 'ger-DE')); - $this->assertEquals($emptyValue, $content->getFieldValue('field2', 'ger-DE')); - $this->assertEquals($emptyValue, $content->getFieldValue('field3', 'ger-DE')); - $this->assertEquals($emptyValue, $content->getFieldValue('field4', 'ger-DE')); + self::assertEquals($emptyValue, $content->getFieldValue('field1', 'ger-DE')); + self::assertEquals($emptyValue, $content->getFieldValue('field2', 'ger-DE')); + self::assertEquals($emptyValue, $content->getFieldValue('field3', 'ger-DE')); + self::assertEquals($emptyValue, $content->getFieldValue('field4', 'ger-DE')); } protected function assertFieldIds(Content $content1, Content $content2) @@ -763,7 +790,7 @@ protected function assertFieldIds(Content $content1, Content $content2) foreach ($fields1 as $fieldDefinitionIdentifier => $languageFieldIds) { foreach ($languageFieldIds as $languageCode => $fieldId) { - $this->assertEquals( + self::assertEquals( $fields2[$fieldDefinitionIdentifier][$languageCode], $fieldId ); diff --git a/tests/integration/Core/Repository/NotificationServiceTest.php b/tests/integration/Core/Repository/NotificationServiceTest.php index 7b13a4c6ff..ecdb333b49 100644 --- a/tests/integration/Core/Repository/NotificationServiceTest.php +++ b/tests/integration/Core/Repository/NotificationServiceTest.php @@ -33,10 +33,10 @@ public function testLoadNotifications() $notificationList = $notificationService->loadNotifications(0, 25); /* END: Use Case */ - $this->assertInstanceOf(NotificationList::class, $notificationList); - $this->assertIsArray($notificationList->items); - $this->assertIsInt($notificationList->totalCount); - $this->assertEquals(5, $notificationList->totalCount); + self::assertInstanceOf(NotificationList::class, $notificationList); + self::assertIsArray($notificationList->items); + self::assertIsInt($notificationList->totalCount); + self::assertEquals(5, $notificationList->totalCount); } /** @@ -54,8 +54,8 @@ public function testGetNotification() $notification = $notificationService->getNotification($notificationId); /* END: Use Case */ - $this->assertInstanceOf(Notification::class, $notification); - $this->assertEquals($notificationId, $notification->id); + self::assertInstanceOf(Notification::class, $notification); + self::assertEquals($notificationId, $notification->id); } /** @@ -74,7 +74,7 @@ public function testMarkNotificationAsRead() $notification = $notificationService->getNotification($notificationId); /* END: Use Case */ - $this->assertFalse($notification->isPending); + self::assertFalse($notification->isPending); } /** @@ -89,7 +89,7 @@ public function testGetPendingNotificationCount() $notificationPendingCount = $notificationService->getPendingNotificationCount(); /* END: Use Case */ - $this->assertEquals(3, $notificationPendingCount); + self::assertEquals(3, $notificationPendingCount); } /** @@ -104,7 +104,7 @@ public function testGetNotificationCount() $notificationCount = $notificationService->getNotificationCount(); /* END: Use Case */ - $this->assertEquals(5, $notificationCount); + self::assertEquals(5, $notificationCount); } /** @@ -123,7 +123,7 @@ public function testDeleteNotification() try { $notificationService->getNotification($notificationId); - $this->fail('Notification ' . $notificationId . ' not deleted.'); + self::fail('Notification ' . $notificationId . ' not deleted.'); } catch (NotFoundException $e) { } } @@ -152,12 +152,13 @@ public function testCreateNotification() $notification = $notificationService->createNotification($createStruct); /* END: Use Case */ - $this->assertInstanceOf(Notification::class, $notification); - $this->assertGreaterThan(0, $notification->id); + self::assertInstanceOf(Notification::class, $notification); + self::assertGreaterThan(0, $notification->id); } /** * @covers \Ibexa\Contracts\Core\Repository\NotificationService::createNotification() + * * @depends testCreateNotification */ public function testCreateNotificationThrowsInvalidArgumentExceptionOnMissingOwner() @@ -180,6 +181,7 @@ public function testCreateNotificationThrowsInvalidArgumentExceptionOnMissingOwn /** * @covers \Ibexa\Contracts\Core\Repository\NotificationService::createNotification() + * * @depends testCreateNotification */ public function testCreateNotificationThrowsInvalidArgumentExceptionOnMissingType() diff --git a/tests/integration/Core/Repository/ObjectStateServiceAuthorizationTest.php b/tests/integration/Core/Repository/ObjectStateServiceAuthorizationTest.php index 1a7ade9c56..66811e9b9f 100644 --- a/tests/integration/Core/Repository/ObjectStateServiceAuthorizationTest.php +++ b/tests/integration/Core/Repository/ObjectStateServiceAuthorizationTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -12,6 +13,7 @@ * Test case for operations in the ObjectStateService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService + * * @group integration * @group authorization */ @@ -21,6 +23,7 @@ class ObjectStateServiceAuthorizationTest extends BaseTest * Test for the createObjectStateGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::createObjectStateGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\ObjectStateServiceTest::testCreateObjectStateGroup */ public function testCreateObjectStateGroupThrowsUnauthorizedException() @@ -65,6 +68,7 @@ public function testCreateObjectStateGroupThrowsUnauthorizedException() * Test for the updateObjectStateGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::updateObjectStateGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\ObjectStateServiceTest::testUpdateObjectStateGroup */ public function testUpdateObjectStateGroupThrowsUnauthorizedException() @@ -114,6 +118,7 @@ public function testUpdateObjectStateGroupThrowsUnauthorizedException() * Test for the deleteObjectStateGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::deleteObjectStateGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\ObjectStateServiceTest::testDeleteObjectStateGroup */ public function testDeleteObjectStateGroupThrowsUnauthorizedException() @@ -150,6 +155,7 @@ public function testDeleteObjectStateGroupThrowsUnauthorizedException() * Test for the createObjectState() method. * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::createObjectState() + * * @depends Ibexa\Tests\Integration\Core\Repository\ObjectStateServiceTest::testCreateObjectState */ public function testCreateObjectStateThrowsUnauthorizedException() @@ -201,6 +207,7 @@ public function testCreateObjectStateThrowsUnauthorizedException() * Test for the updateObjectState() method. * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::updateObjectState() + * * @depends Ibexa\Tests\Integration\Core\Repository\ObjectStateServiceTest::testUpdateObjectState */ public function testUpdateObjectStateThrowsUnauthorizedException() @@ -251,6 +258,7 @@ public function testUpdateObjectStateThrowsUnauthorizedException() * Test for the setPriorityOfObjectState() method. * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::setPriorityOfObjectState() + * * @depends Ibexa\Tests\Integration\Core\Repository\ObjectStateServiceTest::testSetPriorityOfObjectState */ public function testSetPriorityOfObjectStateThrowsUnauthorizedException() @@ -289,6 +297,7 @@ public function testSetPriorityOfObjectStateThrowsUnauthorizedException() * Test for the deleteObjectState() method. * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::deleteObjectState() + * * @depends Ibexa\Tests\Integration\Core\Repository\ObjectStateServiceTest::testDeleteObjectState */ public function testDeleteObjectStateThrowsUnauthorizedException() @@ -323,6 +332,7 @@ public function testDeleteObjectStateThrowsUnauthorizedException() * Test for the setContentState() method. * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::setContentState() + * * @depends Ibexa\Tests\Integration\Core\Repository\ObjectStateServiceTest::testSetContentState */ public function testSetContentStateThrowsUnauthorizedException() diff --git a/tests/integration/Core/Repository/ObjectStateServiceTest.php b/tests/integration/Core/Repository/ObjectStateServiceTest.php index b67b08d23c..e283dfd97f 100644 --- a/tests/integration/Core/Repository/ObjectStateServiceTest.php +++ b/tests/integration/Core/Repository/ObjectStateServiceTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException; @@ -20,6 +21,7 @@ * Test case for operations in the ObjectStateService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService + * * @group object-state */ class ObjectStateServiceTest extends BaseTest @@ -48,7 +50,7 @@ public function testNewObjectStateGroupCreateStruct() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ObjectStateGroupCreateStruct::class, $objectStateGroupCreate ); @@ -61,7 +63,6 @@ public function testNewObjectStateGroupCreateStruct() * * @param \Ibexa\Contracts\Core\Repository\Values\ObjectState\ObjectStateGroupCreateStruct $objectStateGroupCreate * - * * @depends testNewObjectStateGroupCreateStruct */ public function testNewObjectStateGroupCreateStructValues(ObjectStateGroupCreateStruct $objectStateGroupCreate) @@ -93,7 +94,7 @@ public function testNewObjectStateGroupUpdateStruct() $objectStateGroupUpdate = $objectStateService->newObjectStateGroupUpdateStruct(); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ObjectStateGroupUpdateStruct::class, $objectStateGroupUpdate ); @@ -106,7 +107,6 @@ public function testNewObjectStateGroupUpdateStruct() * * @param \Ibexa\Contracts\Core\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct $objectStateGroupUpdate * - * * @depends testNewObjectStateGroupUpdateStruct */ public function testNewObjectStateGroupUpdateStructValues(ObjectStateGroupUpdateStruct $objectStateGroupUpdate) @@ -140,7 +140,7 @@ public function testNewObjectStateCreateStruct() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ObjectStateCreateStruct::class, $objectStateCreate ); @@ -153,7 +153,6 @@ public function testNewObjectStateCreateStruct() * * @param \Ibexa\Contracts\Core\Repository\Values\ObjectState\ObjectStateCreateStruct $objectStateCreate * - * * @depends testNewObjectStateCreateStruct */ public function testNewObjectStateCreateStructValues(ObjectStateCreateStruct $objectStateCreate) @@ -186,7 +185,7 @@ public function testNewObjectStateUpdateStruct() $objectStateUpdate = $objectStateService->newObjectStateUpdateStruct(); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ObjectStateUpdateStruct::class, $objectStateUpdate ); @@ -199,7 +198,6 @@ public function testNewObjectStateUpdateStruct() * * @param \Ibexa\Contracts\Core\Repository\Values\ObjectState\ObjectStateUpdateStruct $objectStateUpdate * - * * @depends testNewObjectStateUpdateStruct */ public function testNewObjectStateUpdateStructValues(ObjectStateUpdateStruct $objectStateUpdate) @@ -220,6 +218,7 @@ public function testNewObjectStateUpdateStructValues(ObjectStateUpdateStruct $ob * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::createObjectStateGroup() + * * @depends testNewObjectStateGroupCreateStructValues */ public function testCreateObjectStateGroup() @@ -247,7 +246,7 @@ public function testCreateObjectStateGroup() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ObjectStateGroup::class, $createdObjectStateGroup ); @@ -260,7 +259,6 @@ public function testCreateObjectStateGroup() * * @param \Ibexa\Contracts\Core\Repository\Values\ObjectState\ObjectStateGroup $createdObjectStateGroup * - * * @depends testCreateObjectStateGroup */ public function testCreateObjectStateGroupStructValues(ObjectStateGroup $createdObjectStateGroup) @@ -281,7 +279,7 @@ public function testCreateObjectStateGroupStructValues(ObjectStateGroup $created ], $createdObjectStateGroup ); - $this->assertNotNull($createdObjectStateGroup->id); + self::assertNotNull($createdObjectStateGroup->id); } /** @@ -289,6 +287,7 @@ public function testCreateObjectStateGroupStructValues(ObjectStateGroup $created * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::createObjectStateGroup() + * * @depends testCreateObjectStateGroup */ public function testCreateObjectStateGroupThrowsInvalidArgumentException() @@ -339,7 +338,7 @@ public function testLoadObjectStateGroup() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ObjectStateGroup::class, $loadedObjectStateGroup ); @@ -362,6 +361,7 @@ public function testLoadObjectStateGroup() * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::loadObjectStateGroup() + * * @depends testLoadObjectStateGroup */ public function testLoadObjectStateGroupThrowsNotFoundException() @@ -396,7 +396,7 @@ public function testLoadObjectStateGroupByIdentifier(): void self::EXISTING_OBJECT_STATE_GROUP_IDENTIFIER ); - $this->assertInstanceOf( + self::assertInstanceOf( ObjectStateGroup::class, $loadedObjectStateGroup ); @@ -439,6 +439,7 @@ public function testLoadObjectStateGroupByIdentifierThrowsNotFoundException(): v * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::loadObjectStateGroups() + * * @depends testLoadObjectStateGroup */ public function testLoadObjectStateGroups() @@ -454,7 +455,7 @@ public function testLoadObjectStateGroups() $loadedObjectStateGroups = $objectStateService->loadObjectStateGroups(); /* END: Use Case */ - $this->assertIsArray($loadedObjectStateGroups); + self::assertIsArray($loadedObjectStateGroups); $this->assertObjectsLoadedByIdentifiers( $expectedGroupIdentifiers, @@ -513,7 +514,7 @@ protected function assertObjectsLoadedByIdentifiers(array $expectedIdentifiers, { foreach ($loadedObjects as $loadedObject) { if (!isset($expectedIdentifiers[$loadedObject->identifier])) { - $this->fail( + self::fail( sprintf( 'Loaded unexpected %s with identifier "%s"', $class, @@ -525,7 +526,7 @@ protected function assertObjectsLoadedByIdentifiers(array $expectedIdentifiers, } if (!empty($expectedIdentifiers)) { - $this->fail( + self::fail( sprintf( 'Expected %ss with identifiers "%s" not loaded.', $class, @@ -540,6 +541,7 @@ protected function assertObjectsLoadedByIdentifiers(array $expectedIdentifiers, * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::loadObjectStateGroups($offset) + * * @depends testLoadObjectStateGroups */ public function testLoadObjectStateGroupsWithOffset() @@ -559,7 +561,7 @@ public function testLoadObjectStateGroupsWithOffset() $loadedObjectStateGroups = $objectStateService->loadObjectStateGroups(2); /* END: Use Case */ - $this->assertIsArray($loadedObjectStateGroups); + self::assertIsArray($loadedObjectStateGroups); $this->assertObjectsLoadedByIdentifiers( array_slice($existingGroupIdentifiers, 2), @@ -592,6 +594,7 @@ static function ($group) { * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::loadObjectStateGroups($offset, $limit) + * * @depends testLoadObjectStateGroupsWithOffset */ public function testLoadObjectStateGroupsWithOffsetAndLimit() @@ -609,7 +612,7 @@ public function testLoadObjectStateGroupsWithOffsetAndLimit() $loadedObjectStateGroups = $objectStateService->loadObjectStateGroups(1, 2); /* END: Use Case */ - $this->assertIsArray($loadedObjectStateGroups); + self::assertIsArray($loadedObjectStateGroups); $this->assertObjectsLoadedByIdentifiers( array_slice($existingGroupIdentifiers, 1, 2), @@ -623,6 +626,7 @@ public function testLoadObjectStateGroupsWithOffsetAndLimit() * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::loadObjectStates() + * * @depends testLoadObjectStateGroup */ public function testLoadObjectStates() @@ -643,7 +647,7 @@ public function testLoadObjectStates() $loadedObjectStates = $objectStateService->loadObjectStates($objectStateGroup); /* END: Use Case */ - $this->assertIsArray( + self::assertIsArray( $loadedObjectStates ); $this->assertObjectsLoadedByIdentifiers( @@ -657,6 +661,7 @@ public function testLoadObjectStates() * Test for the updateObjectStateGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::updateObjectStateGroup + * * @depends testLoadObjectStateGroup */ public function testUpdateObjectStateGroup() @@ -696,7 +701,7 @@ public function testUpdateObjectStateGroup() $allObjectGroups = $objectStateService->loadObjectStateGroups(); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ObjectStateGroup::class, $updatedObjectStateGroup ); @@ -713,6 +718,7 @@ public function testUpdateObjectStateGroup() * Test service method for partially updating object state group. * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::updateObjectStateGroup + * * @depends testLoadObjectStateGroup */ public function testUpdateObjectStateGroupChosenFieldsOnly() @@ -728,7 +734,7 @@ public function testUpdateObjectStateGroupChosenFieldsOnly() $updatedGroup = $objectStateService->updateObjectStateGroup($group, $groupUpdateStruct); - $this->assertInstanceOf( + self::assertInstanceOf( ObjectStateGroup::class, $updatedGroup ); @@ -754,6 +760,7 @@ public function testUpdateObjectStateGroupChosenFieldsOnly() * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::updateObjectStateGroup() + * * @depends testUpdateObjectStateGroup */ public function testUpdateObjectStateGroupThrowsInvalidArgumentException() @@ -805,7 +812,6 @@ public function testUpdateObjectStateGroupThrowsInvalidArgumentException() * * @param array $testData * - * * @depends testUpdateObjectStateGroup */ public function testUpdateObjectStateGroupStructValues(array $testData) @@ -822,8 +828,8 @@ public function testUpdateObjectStateGroupStructValues(array $testData) $updatedObjectStateGroup ); - $this->assertContainsEquals($updatedObjectStateGroup, $allObjectGroups, ''); - $this->assertNotContainsEquals($loadedObjectStateGroup, $allObjectGroups, ''); + self::assertContainsEquals($updatedObjectStateGroup, $allObjectGroups, ''); + self::assertNotContainsEquals($loadedObjectStateGroup, $allObjectGroups, ''); } /** @@ -831,6 +837,7 @@ public function testUpdateObjectStateGroupStructValues(array $testData) * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::createObjectState() + * * @depends testLoadObjectStateGroup * @depends testNewObjectStateCreateStruct */ @@ -871,7 +878,7 @@ public function testCreateObjectState() ); /* END: Use Case */ - $this->assertInstanceOf(ObjectState::class, $createdObjectState); + self::assertInstanceOf(ObjectState::class, $createdObjectState); // Object sequences are renumbered $objectStateCreateStruct->priority = 2; @@ -910,12 +917,12 @@ public function testCreateObjectStateInEmptyGroup() $stateCreateStruct ); - $this->assertInstanceOf( + self::assertInstanceOf( ObjectState::class, $createdState ); - $this->assertNotNull($createdState->id); + self::assertNotNull($createdState->id); $this->assertPropertiesCorrect( [ 'identifier' => 'test', @@ -929,13 +936,13 @@ public function testCreateObjectStateInEmptyGroup() ); $objectStateGroup = $createdState->getObjectStateGroup(); - $this->assertInstanceOf( + self::assertInstanceOf( ObjectStateGroup::class, $objectStateGroup ); - $this->assertEquals($createdGroup->id, $objectStateGroup->id); - $this->assertGreaterThan(0, $objectStateService->getContentCount($createdState)); + self::assertEquals($createdGroup->id, $objectStateGroup->id); + self::assertGreaterThan(0, $objectStateService->getContentCount($createdState)); } /** @@ -943,6 +950,7 @@ public function testCreateObjectStateInEmptyGroup() * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::createObjectState() + * * @depends testLoadObjectStateGroup * @depends testCreateObjectState */ @@ -987,7 +995,6 @@ public function testCreateObjectStateThrowsInvalidArgumentException() * * @param array $testData * - * * @depends testCreateObjectState */ public function testCreateObjectStateStructValues(array $testData) @@ -1003,9 +1010,9 @@ public function testCreateObjectStateStructValues(array $testData) $createdObjectState ); - $this->assertNotNull($createdObjectState->id); + self::assertNotNull($createdObjectState->id); - $this->assertEquals( + self::assertEquals( $loadedObjectStateGroup, $createdObjectState->getObjectStateGroup() ); @@ -1016,6 +1023,7 @@ public function testCreateObjectStateStructValues(array $testData) * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::loadObjectState() + * * @depends testLoadObjectStateGroup */ public function testLoadObjectState() @@ -1032,7 +1040,7 @@ public function testLoadObjectState() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ObjectState::class, $loadedObjectState ); @@ -1058,7 +1066,7 @@ public function testLoadObjectStateByIdentifier(): void self::EXISTING_OBJECT_STATE_IDENTIFIER ); - $this->assertInstanceOf( + self::assertInstanceOf( ObjectState::class, $loadedObjectState ); @@ -1107,7 +1115,6 @@ public function testLoadObjectStateByIdentifierThrowsNotFoundException(): void * * @param \Ibexa\Contracts\Core\Repository\Values\ObjectState\ObjectState $loadedObjectState * - * * @depends testLoadObjectState */ public function testLoadObjectStateStructValues(ObjectState $loadedObjectState) @@ -1130,7 +1137,7 @@ public function testLoadObjectStateStructValues(ObjectState $loadedObjectState) $loadedObjectState ); - $this->assertEquals( + self::assertEquals( $this->getRepository()->getObjectStateService()->loadObjectStateGroup(2), $loadedObjectState->getObjectStateGroup() ); @@ -1141,6 +1148,7 @@ public function testLoadObjectStateStructValues(ObjectState $loadedObjectState) * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::loadObjectState() + * * @depends testLoadObjectState */ public function testLoadObjectStateThrowsNotFoundException() @@ -1351,6 +1359,7 @@ public function testLoadObjectStatesWithPrioritizedLanguagesList($languageCodes, * Test for the updateObjectState() method. * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::updateObjectState + * * @depends testLoadObjectState */ public function testUpdateObjectState() @@ -1389,7 +1398,7 @@ public function testUpdateObjectState() $allObjectStates = $objectStateService->loadObjectStates($loadedObjectState->getObjectStateGroup()); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ObjectState::class, $updatedObjectState ); @@ -1406,6 +1415,7 @@ public function testUpdateObjectState() * Test service method for partially updating object state. * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::updateObjectState + * * @depends testLoadObjectState */ public function testUpdateObjectStateChosenFieldsOnly() @@ -1421,7 +1431,7 @@ public function testUpdateObjectStateChosenFieldsOnly() $updatedState = $objectStateService->updateObjectState($state, $stateUpdateStruct); - $this->assertInstanceOf( + self::assertInstanceOf( ObjectState::class, $updatedState ); @@ -1440,12 +1450,12 @@ public function testUpdateObjectStateChosenFieldsOnly() $updatedState ); - $this->assertInstanceOf( + self::assertInstanceOf( ObjectStateGroup::class, $updatedState->getObjectStateGroup() ); - $this->assertEquals($state->getObjectStateGroup()->id, $updatedState->getObjectStateGroup()->id); + self::assertEquals($state->getObjectStateGroup()->id, $updatedState->getObjectStateGroup()->id); } /** @@ -1453,6 +1463,7 @@ public function testUpdateObjectStateChosenFieldsOnly() * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::updateObjectState() + * * @depends testUpdateObjectState */ public function testUpdateObjectStateThrowsInvalidArgumentException() @@ -1495,7 +1506,6 @@ public function testUpdateObjectStateThrowsInvalidArgumentException() * * @param array $testData * - * * @depends testUpdateObjectState */ public function testUpdateObjectStateStructValues(array $testData) @@ -1520,13 +1530,13 @@ public function testUpdateObjectStateStructValues(array $testData) $updatedObjectState ); - $this->assertEquals( + self::assertEquals( $loadedObjectState->getObjectStateGroup(), $updatedObjectState->getObjectStateGroup() ); - $this->assertContainsEquals($updatedObjectState, $allObjectStates, ''); - $this->assertNotContainsEquals($loadedObjectState, $allObjectStates, ''); + self::assertContainsEquals($updatedObjectState, $allObjectStates, ''); + self::assertNotContainsEquals($loadedObjectState, $allObjectStates, ''); } /** @@ -1534,6 +1544,7 @@ public function testUpdateObjectStateStructValues(array $testData) * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::setPriorityOfObjectState + * * @depends testLoadObjectState */ public function testSetPriorityOfObjectState() @@ -1561,11 +1572,11 @@ public function testSetPriorityOfObjectState() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ObjectState::class, $loadedObjectState ); - $this->assertEquals(1, $loadedObjectState->priority); + self::assertEquals(1, $loadedObjectState->priority); } /** @@ -1573,6 +1584,7 @@ public function testSetPriorityOfObjectState() * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::getContentState() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentInfo * @depends testLoadObjectState */ @@ -1600,11 +1612,11 @@ public function testGetContentState() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ObjectState::class, $ezLockObjectState ); - $this->assertEquals('not_locked', $ezLockObjectState->identifier); + self::assertEquals('not_locked', $ezLockObjectState->identifier); } /** @@ -1664,13 +1676,13 @@ public function testGetInitialObjectState() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( ObjectState::class, $initialObjectState ); - $this->assertEquals('sindelfingen', $initialObjectState->identifier); - $this->assertEquals(['eng-US' => 'Sindelfingen'], $initialObjectState->names); - $this->assertEquals('eng-US', $initialObjectState->defaultLanguageCode); + self::assertEquals('sindelfingen', $initialObjectState->identifier); + self::assertEquals(['eng-US' => 'Sindelfingen'], $initialObjectState->names); + self::assertEquals('eng-US', $initialObjectState->defaultLanguageCode); } /** @@ -1678,6 +1690,7 @@ public function testGetInitialObjectState() * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::setContentState() + * * @depends Ibexa\Tests\Integration\Core\Repository\ContentServiceTest::testLoadContentInfo * @depends testLoadObjectState */ @@ -1716,13 +1729,14 @@ public function testSetContentState() $ezLockObjectStateGroup ); - $this->assertEquals('locked', $ezLockObjectState->identifier); + self::assertEquals('locked', $ezLockObjectState->identifier); } /** * Test for the setContentState() method. * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::setContentState + * * @depends testSetContentState */ public function testSetContentStateThrowsInvalidArgumentException() @@ -1767,6 +1781,7 @@ public function testSetContentStateThrowsInvalidArgumentException() * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::getContentCount() + * * @depends testLoadObjectState */ public function testGetContentCount() @@ -1783,7 +1798,7 @@ public function testGetContentCount() $objectCount = $objectStateService->getContentCount($notLockedObjectState); /* END: Use Case */ - $this->assertEquals(18, $objectCount); + self::assertEquals(18, $objectCount); } /** @@ -1791,6 +1806,7 @@ public function testGetContentCount() * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::deleteObjectState() + * * @depends testLoadObjectState */ public function testDeleteObjectState() @@ -1813,7 +1829,7 @@ public function testDeleteObjectState() $lockedObjectState = $objectStateService->loadObjectState($lockedObjectStateId); // All objects transferred - $this->assertEquals( + self::assertEquals( 18, $objectStateService->getContentCount($lockedObjectState) ); @@ -1824,6 +1840,7 @@ public function testDeleteObjectState() * * * @covers \Ibexa\Contracts\Core\Repository\ObjectStateService::deleteObjectStateGroup() + * * @depends testLoadObjectStateGroup */ public function testDeleteObjectStateGroup() @@ -1845,7 +1862,7 @@ public function testDeleteObjectStateGroup() try { $objectStateService->loadObjectStateGroup($objectStateGroupId); - $this->fail( + self::fail( sprintf( 'Object state group with ID "%s" not deleted.', $objectStateGroupId diff --git a/tests/integration/Core/Repository/Parallel/BaseParallelTestCase.php b/tests/integration/Core/Repository/Parallel/BaseParallelTestCase.php index 6bf573cbe3..6f95602cc5 100644 --- a/tests/integration/Core/Repository/Parallel/BaseParallelTestCase.php +++ b/tests/integration/Core/Repository/Parallel/BaseParallelTestCase.php @@ -22,7 +22,7 @@ protected function setUp(): void $dbms = $connection->getDatabasePlatform()->getName(); if ($dbms == 'sqlite') { - $this->markTestSkipped('Can not run parallel test on sqlite'); + self::markTestSkipped('Can not run parallel test on sqlite'); } } diff --git a/tests/integration/Core/Repository/Parallel/ContentServiceTest.php b/tests/integration/Core/Repository/Parallel/ContentServiceTest.php index 08d0ec0830..71a2dc0822 100644 --- a/tests/integration/Core/Repository/Parallel/ContentServiceTest.php +++ b/tests/integration/Core/Repository/Parallel/ContentServiceTest.php @@ -48,7 +48,7 @@ public function testPublishMultipleVersions(): void $version1 = $contentService->loadVersionInfo($version1->contentInfo, 2); $version2 = $contentService->loadVersionInfo($version2->contentInfo, 3); - $this->assertTrue( + self::assertTrue( $version1->isPublished() && $version2->isDraft() || $version1->isDraft() && $version2->isPublished(), 'One of the versions should be published and the other should be draft' ); diff --git a/tests/integration/Core/Repository/PermissionResolverTest.php b/tests/integration/Core/Repository/PermissionResolverTest.php index 3cfeb6d70b..e9785fe175 100644 --- a/tests/integration/Core/Repository/PermissionResolverTest.php +++ b/tests/integration/Core/Repository/PermissionResolverTest.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\Integration\Core\Repository; use function array_filter; @@ -24,6 +25,7 @@ * Test case for operations in the PermissionResolver. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver + * * @group integration * @group permission */ @@ -61,6 +63,7 @@ public function testGetCurrentUserReferenceReturnsAnonymousUserReference() * Test for the setCurrentUserReference() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::setCurrentUserReference() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService */ public function testSetCurrentUserReference() @@ -88,12 +91,12 @@ public function testSetCurrentUserReference() $permissionResolver->setCurrentUserReference($administratorUser); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( $administratorUserId, $permissionResolver->getCurrentUserReference()->getUserId() ); - $this->assertSame( + self::assertSame( $administratorUser, $permissionResolver->getCurrentUserReference() ); @@ -103,6 +106,7 @@ public function testSetCurrentUserReference() * Test for the hasAccess() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::hasAccess() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService */ public function testHasAccessWithAnonymousUserNo() @@ -126,13 +130,14 @@ public function testHasAccessWithAnonymousUserNo() $hasAccess = $permissionResolver->hasAccess('content', 'remove', $anonymousUser); /* END: Use Case */ - $this->assertFalse($hasAccess); + self::assertFalse($hasAccess); } /** * Test for the hasAccess() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::hasAccess() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends testHasAccessWithAnonymousUserNo */ @@ -160,13 +165,14 @@ public function testHasAccessForCurrentUserNo() $hasAccess = $permissionResolver->hasAccess('content', 'remove'); /* END: Use Case */ - $this->assertFalse($hasAccess); + self::assertFalse($hasAccess); } /** * Test for the hasAccess() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::hasAccess() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService */ public function testHasAccessWithAdministratorUser() @@ -188,13 +194,14 @@ public function testHasAccessWithAdministratorUser() $hasAccess = $permissionResolver->hasAccess('content', 'read', $administratorUser); /* END: Use Case */ - $this->assertTrue($hasAccess); + self::assertTrue($hasAccess); } /** * Test for the hasAccess() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::hasAccess() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends testSetCurrentUserReference * @depends testHasAccessWithAdministratorUser @@ -221,13 +228,14 @@ public function testHasAccessForCurrentUserYes() $hasAccess = $permissionResolver->hasAccess('content', 'read'); /* END: Use Case */ - $this->assertTrue($hasAccess); + self::assertTrue($hasAccess); } /** * Test for the hasAccess() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::hasAccess() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends testSetCurrentUserReference */ @@ -248,16 +256,17 @@ public function testHasAccessLimited() $permissionSets = $permissionResolver->hasAccess('content', 'read'); /* END: Use Case */ - $this->assertIsArray( + self::assertIsArray( $permissionSets ); - $this->assertNotEmpty($permissionSets); + self::assertNotEmpty($permissionSets); } /** * Test for the canUser() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::canUser() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentService * @depends testHasAccessForCurrentUserNo @@ -304,6 +313,7 @@ public function testCanUserForAnonymousUserNo() * Test for the canUser() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::canUser() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentService * @depends testHasAccessForCurrentUserYes @@ -341,7 +351,7 @@ public function testCanUserForAdministratorUser() $contentService->deleteContent($contentInfo); /* END: Use Case */ - $this->assertTrue($canUser); + self::assertTrue($canUser); $contentService->loadContent($homeId); } @@ -349,6 +359,7 @@ public function testCanUserForAdministratorUser() * Test for the canUser() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::canUser() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentService * @depends testHasAccessLimited @@ -378,13 +389,14 @@ public function testCanUserWithLimitationYes() $canUser = $permissionResolver->canUser('content', 'read', $imagesFolder); /* END: Use Case */ - $this->assertTrue($canUser); + self::assertTrue($canUser); } /** * Test for the canUser() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::canUser() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentService * @depends testHasAccessLimited @@ -429,6 +441,7 @@ public function testCanUserWithLimitationNo() * Test for the canUser() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::canUser() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentTypeService * @depends testSetCurrentUserReference @@ -468,6 +481,7 @@ public function testCanUserThrowsInvalidArgumentException() * Test for the canUser() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::canUser() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentTypeService @@ -518,8 +532,8 @@ public function testCanUserWithTargetYes() ); /* END: Use Case */ - $this->assertTrue($canUser); - $this->assertEquals( + self::assertTrue($canUser); + self::assertEquals( 'My awesome forums', $contentDraft->getFieldValue('title')->text ); @@ -529,6 +543,7 @@ public function testCanUserWithTargetYes() * Test for the canUser() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::canUser() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentTypeService @@ -589,6 +604,7 @@ public function testCanUserWithTargetNo() * Test for the canUser() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::canUser() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentTypeService @@ -640,8 +656,8 @@ public function testCanUserWithMultipleTargetsYes() $contentDraft = $contentService->createContent($contentCreateStruct, $locationCreateStructs); /* END: Use Case */ - $this->assertTrue($canUser); - $this->assertEquals( + self::assertTrue($canUser); + self::assertEquals( 'My multipurpose folder', $contentDraft->getFieldValue('name')->text ); @@ -651,6 +667,7 @@ public function testCanUserWithMultipleTargetsYes() * Test for the canUser() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::canUser() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentTypeService @@ -712,6 +729,7 @@ public function testCanUserWithMultipleTargetsNo() * Test for the canUser() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::canUser() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentTypeService @@ -766,7 +784,7 @@ public function testCanUserThrowsBadStateException() { $this->expectException(BadStateException::class); - $this->markTestIncomplete( + self::markTestIncomplete( 'Cannot be tested on current fixture since policy with unsupported limitation value is not available.' ); } @@ -881,6 +899,7 @@ public function getDataForTestCanUserWithLimitations() * Test for the lookupLimitations() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::lookupLimitations() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentService * @depends Ibexa\Tests\Integration\Core\Repository\PermissionResolverTest::testHasAccessForCurrentUserNo @@ -916,15 +935,16 @@ public function testLookupLimitationsForAnonymousUserHasNoAccess(): void $lookupLimitations = $permissionResolver->lookupLimitations('content', 'remove', $contentInfo); /* END: Use Case */ - $this->assertFalse($lookupLimitations->hasAccess); - $this->assertEquals($lookupLimitations->roleLimitations, []); - $this->assertEquals($lookupLimitations->lookupPolicyLimitations, []); + self::assertFalse($lookupLimitations->hasAccess); + self::assertEquals($lookupLimitations->roleLimitations, []); + self::assertEquals($lookupLimitations->lookupPolicyLimitations, []); } /** * Test for the lookupLimitations() method. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::lookupLimitations() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentService * @depends Ibexa\Tests\Integration\Core\Repository\PermissionResolverTest::testHasAccessForCurrentUserYes @@ -957,15 +977,16 @@ public function testLookupLimitationsForAdministratorUser(): void $lookupLimitations = $permissionResolver->lookupLimitations('content', 'remove', $contentInfo); /* END: Use Case */ - $this->assertTrue($lookupLimitations->hasAccess); - $this->assertEquals($lookupLimitations->roleLimitations, []); - $this->assertEquals($lookupLimitations->lookupPolicyLimitations, []); + self::assertTrue($lookupLimitations->hasAccess); + self::assertEquals($lookupLimitations->roleLimitations, []); + self::assertEquals($lookupLimitations->lookupPolicyLimitations, []); } /** * When one of policy pass then all limitation should be returned. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::lookupLimitations() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentService * @depends Ibexa\Tests\Integration\Core\Repository\PermissionResolverTest::testHasAccessForCurrentUserYes @@ -1027,6 +1048,7 @@ public function testLookupLimitationsWithLimitations(): void * When one of policy pass then only filtered limitation should be returned. * * @covers \Ibexa\Contracts\Core\Repository\PermissionResolver::lookupLimitations() + * * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetUserService * @depends Ibexa\Tests\Integration\Core\Repository\RepositoryTest::testGetContentService * @depends Ibexa\Tests\Integration\Core\Repository\PermissionResolverTest::testHasAccessForCurrentUserYes diff --git a/tests/integration/Core/Repository/Regression/EZP20018LanguageTest.php b/tests/integration/Core/Repository/Regression/EZP20018LanguageTest.php index d5b46d5c10..9f5fef50d0 100644 --- a/tests/integration/Core/Repository/Regression/EZP20018LanguageTest.php +++ b/tests/integration/Core/Repository/Regression/EZP20018LanguageTest.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\Integration\Core\Repository\Regression; use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; @@ -66,7 +67,7 @@ public function testSearchOnNotExistingLanguageGivesException() $setupFactory = $this->getSetupFactory(); if ($setupFactory instanceof LegacySetupFactory) { - $this->markTestSkipped('Skipped on Solr as it is not clear that SPI search should have to validate Criterion values, in this case language code'); + self::markTestSkipped('Skipped on Solr as it is not clear that SPI search should have to validate Criterion values, in this case language code'); } $query = new Query(); @@ -83,8 +84,8 @@ public function testSearchOnUsedLanguageGivesOneResult() $query->filter = new LanguageCode(['por-PT'], false); $results = $this->getRepository()->getSearchService()->findContent($query); - $this->assertEquals(1, $results->totalCount); - $this->assertCount(1, $results->searchHits); + self::assertEquals(1, $results->totalCount); + self::assertCount(1, $results->searchHits); } /** @@ -97,8 +98,8 @@ public function testSearchOnStandardLanguageGivesManyResult() $query->limit = 50; $results = $this->getRepository()->getSearchService()->findContent($query); - $this->assertEquals(16, $results->totalCount); - $this->assertEquals($results->totalCount, count($results->searchHits)); + self::assertEquals(16, $results->totalCount); + self::assertEquals($results->totalCount, count($results->searchHits)); } /** @@ -110,8 +111,8 @@ public function testSearchOnNotUsedInstalledLanguageGivesNoResult() $query->filter = new LanguageCode(['eng-GB'], false); $results = $this->getRepository()->getSearchService()->findContent($query); - $this->assertEquals(2, $results->totalCount); - $this->assertEquals($results->totalCount, count($results->searchHits)); + self::assertEquals(2, $results->totalCount); + self::assertEquals($results->totalCount, count($results->searchHits)); } } diff --git a/tests/integration/Core/Repository/Regression/EZP20018ObjectStateTest.php b/tests/integration/Core/Repository/Regression/EZP20018ObjectStateTest.php index c6782fc312..edab5ef2b1 100644 --- a/tests/integration/Core/Repository/Regression/EZP20018ObjectStateTest.php +++ b/tests/integration/Core/Repository/Regression/EZP20018ObjectStateTest.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\Integration\Core\Repository\Regression; use Ibexa\Contracts\Core\Repository\Values\Content\Query; @@ -27,8 +28,8 @@ public function testSearchForNonUsedObjectState() $query->filter = new ObjectStateId(2); $results1 = $repository->getSearchService()->findContent($query); - $this->assertEquals(0, $results1->totalCount); - $this->assertCount(0, $results1->searchHits); + self::assertEquals(0, $results1->totalCount); + self::assertCount(0, $results1->searchHits); // Assign and make sure it updates $stateService = $repository->getObjectStateService(); @@ -43,8 +44,8 @@ public function testSearchForNonUsedObjectState() $results2 = $repository->getSearchService()->findContent($query); - $this->assertEquals(1, $results2->totalCount); - $this->assertCount($results2->totalCount, $results2->searchHits); + self::assertEquals(1, $results2->totalCount); + self::assertCount($results2->totalCount, $results2->searchHits); } public function testSearchForUsedObjectState() @@ -56,8 +57,8 @@ public function testSearchForUsedObjectState() $query->limit = 50; $results1 = $repository->getSearchService()->findContent($query); - $this->assertEquals(18, $results1->totalCount); - $this->assertEquals($results1->totalCount, count($results1->searchHits)); + self::assertEquals(18, $results1->totalCount); + self::assertEquals($results1->totalCount, count($results1->searchHits)); // Assign and make sure it updates $stateService = $repository->getObjectStateService(); @@ -72,8 +73,8 @@ public function testSearchForUsedObjectState() $results2 = $repository->getSearchService()->findContent($query); - $this->assertEquals(17, $results2->totalCount); - $this->assertCount($results2->totalCount, $results2->searchHits); + self::assertEquals(17, $results2->totalCount); + self::assertCount($results2->totalCount, $results2->searchHits); } } diff --git a/tests/integration/Core/Repository/Regression/EZP20018VisibilityTest.php b/tests/integration/Core/Repository/Regression/EZP20018VisibilityTest.php index d184c09f9c..b805ad65fa 100644 --- a/tests/integration/Core/Repository/Regression/EZP20018VisibilityTest.php +++ b/tests/integration/Core/Repository/Regression/EZP20018VisibilityTest.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\Integration\Core\Repository\Regression; use Ibexa\Contracts\Core\Repository\Values\Content\Query; @@ -27,8 +28,8 @@ public function testSearchForHiddenContent() $query->filter = new Visibility(Visibility::HIDDEN); $results1 = $repository->getSearchService()->findContent($query); - $this->assertEquals(0, $results1->totalCount); - $this->assertCount(0, $results1->searchHits); + self::assertEquals(0, $results1->totalCount); + self::assertCount(0, $results1->searchHits); // Hide "Images" Folder $locationService = $repository->getLocationService(); @@ -39,8 +40,8 @@ public function testSearchForHiddenContent() // Assert updated values $results2 = $repository->getSearchService()->findContent($query); - $this->assertEquals(1, $results2->totalCount); - $this->assertCount(1, $results2->searchHits); + self::assertEquals(1, $results2->totalCount); + self::assertCount(1, $results2->searchHits); } public function testSearchForVisibleContent() @@ -52,8 +53,8 @@ public function testSearchForVisibleContent() $query->limit = 50; $results1 = $repository->getSearchService()->findContent($query); - $this->assertEquals(18, $results1->totalCount); - $this->assertEquals($results1->totalCount, count($results1->searchHits)); + self::assertEquals(18, $results1->totalCount); + self::assertEquals($results1->totalCount, count($results1->searchHits)); // Hide "Images" Folder $locationService = $repository->getLocationService(); @@ -64,8 +65,8 @@ public function testSearchForVisibleContent() // Assert updated values $results2 = $repository->getSearchService()->findContent($query); - $this->assertEquals($results1->totalCount - 1, $results2->totalCount); - $this->assertEquals($results2->totalCount, count($results2->searchHits)); + self::assertEquals($results1->totalCount - 1, $results2->totalCount); + self::assertEquals($results2->totalCount, count($results2->searchHits)); } } diff --git a/tests/integration/Core/Repository/Regression/EZP21069Test.php b/tests/integration/Core/Repository/Regression/EZP21069Test.php index 851ee3b591..8d2ceba13d 100644 --- a/tests/integration/Core/Repository/Regression/EZP21069Test.php +++ b/tests/integration/Core/Repository/Regression/EZP21069Test.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\Integration\Core\Repository\Regression; use Ibexa\Contracts\Core\Repository\Values\Content\Query; @@ -89,8 +90,8 @@ public function testSearchOnPreviousAttributeContentGivesNoResult() $query->filter = new Field('name', Operator::EQ, 'TheOriginalNews'); $results = $this->getRepository()->getSearchService()->findContent($query); - $this->assertEquals(0, $results->totalCount); - $this->assertEmpty($results->searchHits); + self::assertEquals(0, $results->totalCount); + self::assertEmpty($results->searchHits); } public function testSearchOnCurrentAttributeContentGivesOnesResult() @@ -99,8 +100,8 @@ public function testSearchOnCurrentAttributeContentGivesOnesResult() $query->filter = new Field('name', Operator::EQ, 'TheUpdatedNews'); $results = $this->getRepository()->getSearchService()->findContent($query); - $this->assertEquals(1, $results->totalCount); - $this->assertCount(1, $results->searchHits); + self::assertEquals(1, $results->totalCount); + self::assertCount(1, $results->searchHits); } public function testSearchOnDraftAttributeContentGivesNoResult() @@ -109,8 +110,8 @@ public function testSearchOnDraftAttributeContentGivesNoResult() $query->filter = new Field('name', Operator::EQ, 'TheDraftNews'); $results = $this->getRepository()->getSearchService()->findContent($query); - $this->assertEquals(0, $results->totalCount); - $this->assertEmpty($results->searchHits); + self::assertEquals(0, $results->totalCount); + self::assertEmpty($results->searchHits); } } diff --git a/tests/integration/Core/Repository/Regression/EZP21089Test.php b/tests/integration/Core/Repository/Regression/EZP21089Test.php index 70b6d9a826..e41559e0e3 100644 --- a/tests/integration/Core/Repository/Regression/EZP21089Test.php +++ b/tests/integration/Core/Repository/Regression/EZP21089Test.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\Integration\Core\Repository\Regression; use DateTime; diff --git a/tests/integration/Core/Repository/Regression/EZP21109EzIntegerTest.php b/tests/integration/Core/Repository/Regression/EZP21109EzIntegerTest.php index 420c2a2046..33d02b7e95 100644 --- a/tests/integration/Core/Repository/Regression/EZP21109EzIntegerTest.php +++ b/tests/integration/Core/Repository/Regression/EZP21109EzIntegerTest.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\Integration\Core\Repository\Regression; use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType; @@ -67,9 +68,9 @@ public function testEzIntegerWithDefaultValues($integerValue) /** @var \Ibexa\Core\FieldType\Integer\Value $fieldValue */ $fieldValue = $content->getFieldValue('test'); - $this->assertInstanceOf(Value::class, $fieldValue); + self::assertInstanceOf(Value::class, $fieldValue); - $this->assertEquals($integerValue, $fieldValue->value); + self::assertEquals($integerValue, $fieldValue->value); $contentService->deleteContent($content->versionInfo->contentInfo); } diff --git a/tests/integration/Core/Repository/Regression/EZP21771EzStringTest.php b/tests/integration/Core/Repository/Regression/EZP21771EzStringTest.php index 605a4087d3..ae38b987b6 100644 --- a/tests/integration/Core/Repository/Regression/EZP21771EzStringTest.php +++ b/tests/integration/Core/Repository/Regression/EZP21771EzStringTest.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\Integration\Core\Repository\Regression; use Ibexa\Tests\Integration\Core\Repository\BaseTest; @@ -48,7 +49,7 @@ public function test11NumbersOnEzString() $content = $contentService->loadContent($draft->versionInfo->contentInfo->id); // finaly test if the value is done right - $this->assertEquals( + self::assertEquals( $content->versionInfo->names, ['eng-GB' => '12345678901'] ); diff --git a/tests/integration/Core/Repository/Regression/EZP21798Test.php b/tests/integration/Core/Repository/Regression/EZP21798Test.php index b19588a7c5..ea7221b4f2 100644 --- a/tests/integration/Core/Repository/Regression/EZP21798Test.php +++ b/tests/integration/Core/Repository/Regression/EZP21798Test.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\Integration\Core\Repository\Regression; use Ibexa\Contracts\Core\Repository\Values\User\Limitation\SectionLimitation; @@ -89,7 +90,7 @@ public function testRoleChanges() } } while ($numPolicies > 0 && !$found); - $this->assertTrue($found, "Couldn't find policy with module 'content' and function 'read'"); + self::assertTrue($found, "Couldn't find policy with module 'content' and function 'read'"); $newPolicy = $roleService->newPolicyUpdateStruct(); $newLimitation = new SectionLimitation(); diff --git a/tests/integration/Core/Repository/Regression/EZP21906SearchOneContentMultipleLocationsTest.php b/tests/integration/Core/Repository/Regression/EZP21906SearchOneContentMultipleLocationsTest.php index 4b18b4ec55..e3435bcf7f 100644 --- a/tests/integration/Core/Repository/Regression/EZP21906SearchOneContentMultipleLocationsTest.php +++ b/tests/integration/Core/Repository/Regression/EZP21906SearchOneContentMultipleLocationsTest.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\Integration\Core\Repository\Regression; use Ibexa\Contracts\Core\Repository\Values\Content\Query; @@ -66,8 +67,8 @@ protected function setUp(): void public function testSearchContentMultipleLocations(Query $query, $expectedResultCount) { $result = $this->getRepository()->getSearchService()->findContent($query); - $this->assertSame($expectedResultCount, $result->totalCount); - $this->assertSame($expectedResultCount, count($result->searchHits)); + self::assertSame($expectedResultCount, $result->totalCount); + self::assertSame($expectedResultCount, count($result->searchHits)); } public function searchContentQueryProvider() diff --git a/tests/integration/Core/Repository/Regression/EZP22408DeleteRelatedObjectTest.php b/tests/integration/Core/Repository/Regression/EZP22408DeleteRelatedObjectTest.php index f6fcb51f43..ad04aefdde 100644 --- a/tests/integration/Core/Repository/Regression/EZP22408DeleteRelatedObjectTest.php +++ b/tests/integration/Core/Repository/Regression/EZP22408DeleteRelatedObjectTest.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\Integration\Core\Repository\Regression; use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinitionCreateStruct; @@ -39,7 +40,7 @@ public function testRelationListIsUpdatedWhenRelatedObjectIsDeleted() $reloadedReferenceObject = $contentService->loadContent($referenceObject->id); /** @var \Ibexa\Core\FieldType\RelationList\Value */ $relationListValue = $reloadedReferenceObject->getFieldValue('relation_list'); - $this->assertSame([$targetObject2->id], $relationListValue->destinationContentIds); + self::assertSame([$targetObject2->id], $relationListValue->destinationContentIds); } public function testSingleRelationIsUpdatedWhenRelatedObjectIsDeleted() @@ -57,7 +58,7 @@ public function testSingleRelationIsUpdatedWhenRelatedObjectIsDeleted() $reloadedReferenceObject = $contentService->loadContent($referenceObject->id); /** @var \Ibexa\Core\FieldType\Relation\Value */ $relationValue = $reloadedReferenceObject->getFieldValue('single_relation'); - $this->assertEmpty($relationValue->destinationContentId); + self::assertEmpty($relationValue->destinationContentId); } private function createTestContentType() diff --git a/tests/integration/Core/Repository/Regression/EZP22409RelationListTypeStateTest.php b/tests/integration/Core/Repository/Regression/EZP22409RelationListTypeStateTest.php index 1b71d055a3..2c8933e351 100644 --- a/tests/integration/Core/Repository/Regression/EZP22409RelationListTypeStateTest.php +++ b/tests/integration/Core/Repository/Regression/EZP22409RelationListTypeStateTest.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\Integration\Core\Repository\Regression; use DateTime; diff --git a/tests/integration/Core/Repository/Regression/EZP22612URLAliasTranslations.php b/tests/integration/Core/Repository/Regression/EZP22612URLAliasTranslations.php index 837f92c35f..8623383b92 100644 --- a/tests/integration/Core/Repository/Regression/EZP22612URLAliasTranslations.php +++ b/tests/integration/Core/Repository/Regression/EZP22612URLAliasTranslations.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\Integration\Core\Repository\Regression; use Ibexa\Contracts\Core\Repository\Values\Content\URLAlias; @@ -54,7 +55,7 @@ public function testURLAliasLoadedInRightLanguage() $aliasService = $this->getRepository()->getURLAliasService(); $alias = $aliasService->lookup('common/alias'); - $this->assertInstanceOf( + self::assertInstanceOf( URLAlias::class, $alias ); diff --git a/tests/integration/Core/Repository/Regression/EZP22840RoleLimitations.php b/tests/integration/Core/Repository/Regression/EZP22840RoleLimitations.php index 66611cf4b5..6e9f64e5a2 100644 --- a/tests/integration/Core/Repository/Regression/EZP22840RoleLimitations.php +++ b/tests/integration/Core/Repository/Regression/EZP22840RoleLimitations.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\Integration\Core\Repository\Regression; use Ibexa\Contracts\Core\Repository\Values\User\Limitation\NewObjectStateLimitation; @@ -81,7 +82,7 @@ public function testSectionRoleAssignLimitation() $permissionResolver->setCurrentUserReference($user); // try to login - $this->assertTrue( + self::assertTrue( $permissionResolver->canUser('user', 'login', new SiteAccess('test')), 'Could not verify that user can login with section limitation' ); diff --git a/tests/integration/Core/Repository/Regression/EZP22958SearchSubtreePathstringFormatTest.php b/tests/integration/Core/Repository/Regression/EZP22958SearchSubtreePathstringFormatTest.php index 721a21600c..96e5343265 100644 --- a/tests/integration/Core/Repository/Regression/EZP22958SearchSubtreePathstringFormatTest.php +++ b/tests/integration/Core/Repository/Regression/EZP22958SearchSubtreePathstringFormatTest.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\Integration\Core\Repository\Regression; use Ibexa\Contracts\Core\Repository\Values\Content\Query; diff --git a/tests/integration/Core/Repository/Regression/EZP26327UrlAliasHistorizationTest.php b/tests/integration/Core/Repository/Regression/EZP26327UrlAliasHistorizationTest.php index ee9513e659..6fddc007a8 100644 --- a/tests/integration/Core/Repository/Regression/EZP26327UrlAliasHistorizationTest.php +++ b/tests/integration/Core/Repository/Regression/EZP26327UrlAliasHistorizationTest.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\Integration\Core\Repository\Regression; use Ibexa\Tests\Integration\Core\Repository\BaseTest; @@ -48,8 +49,8 @@ public function testHistorization() $activeAlias = $urlAliasService->lookup('/name-gb'); $historyAlias = $urlAliasService->lookup('/name-us'); - $this->assertFalse($activeAlias->isHistory); - $this->assertTrue($historyAlias->isHistory); + self::assertFalse($activeAlias->isHistory); + self::assertTrue($historyAlias->isHistory); } } diff --git a/tests/integration/Core/Repository/Regression/EZP26367UrlAliasHistoryRedirectLoopTest.php b/tests/integration/Core/Repository/Regression/EZP26367UrlAliasHistoryRedirectLoopTest.php index b2b5d28aec..860906fc6d 100644 --- a/tests/integration/Core/Repository/Regression/EZP26367UrlAliasHistoryRedirectLoopTest.php +++ b/tests/integration/Core/Repository/Regression/EZP26367UrlAliasHistoryRedirectLoopTest.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\Integration\Core\Repository\Regression; use Ibexa\Tests\Integration\Core\Repository\BaseTest; @@ -64,8 +65,8 @@ public function testReverseLookupReturnsHistoryAlias() $urlAliasHistorized = $urlAliasService->lookup($historyPath); - $this->assertEquals($historyPath, $urlAliasHistorized->path); - $this->assertTrue($urlAliasHistorized->isHistory); + self::assertEquals($historyPath, $urlAliasHistorized->path); + self::assertTrue($urlAliasHistorized->isHistory); // Reverse lookup once to warm-up URL alias ID cache by Location ID @@ -73,8 +74,8 @@ public function testReverseLookupReturnsHistoryAlias() $locationService->loadLocation($article->contentInfo->mainLocationId) ); - $this->assertEquals($activePath, $urlAlias->path); - $this->assertFalse($urlAlias->isHistory); + self::assertEquals($activePath, $urlAlias->path); + self::assertFalse($urlAlias->isHistory); // Reverse lookup again to trigger return of URL alias object lookup cache by ID, // through URL alias ID cache by Location ID @@ -83,8 +84,8 @@ public function testReverseLookupReturnsHistoryAlias() $locationService->loadLocation($article->contentInfo->mainLocationId) ); - $this->assertEquals($activePath, $urlAlias->path); - $this->assertFalse($urlAlias->isHistory); + self::assertEquals($activePath, $urlAlias->path); + self::assertFalse($urlAlias->isHistory); } public function testLookupHistoryUrlReturnsActiveAlias() @@ -134,30 +135,30 @@ public function testLookupHistoryUrlReturnsActiveAlias() $locationService->loadLocation($article->contentInfo->mainLocationId) ); - $this->assertEquals($activePath, $urlAlias->path); - $this->assertFalse($urlAlias->isHistory); + self::assertEquals($activePath, $urlAlias->path); + self::assertFalse($urlAlias->isHistory); $urlAlias = $urlAliasService->reverseLookup( $locationService->loadLocation($article->contentInfo->mainLocationId) ); - $this->assertEquals($activePath, $urlAlias->path); - $this->assertFalse($urlAlias->isHistory); + self::assertEquals($activePath, $urlAlias->path); + self::assertFalse($urlAlias->isHistory); // Lookup history URL one to warm-up URL alias ID cache by URL $urlAliasHistorized = $urlAliasService->lookup($historyPath); - $this->assertEquals($historyPath, $urlAliasHistorized->path); - $this->assertTrue($urlAliasHistorized->isHistory); + self::assertEquals($historyPath, $urlAliasHistorized->path); + self::assertTrue($urlAliasHistorized->isHistory); // Lookup history URL again to trigger return of URL alias object reverse lookup cache by ID, // through URL alias ID cache by URL $urlAliasHistorized = $urlAliasService->lookup($historyPath); - $this->assertEquals($historyPath, $urlAliasHistorized->path); - $this->assertTrue($urlAliasHistorized->isHistory); + self::assertEquals($historyPath, $urlAliasHistorized->path); + self::assertTrue($urlAliasHistorized->isHistory); } } diff --git a/tests/integration/Core/Repository/Regression/EZP26551DeleteContentTypeDraftTest.php b/tests/integration/Core/Repository/Regression/EZP26551DeleteContentTypeDraftTest.php index c2f3ad147e..65ad643479 100644 --- a/tests/integration/Core/Repository/Regression/EZP26551DeleteContentTypeDraftTest.php +++ b/tests/integration/Core/Repository/Regression/EZP26551DeleteContentTypeDraftTest.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\Integration\Core\Repository\Regression; use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException; @@ -11,6 +12,7 @@ /** * @issue https://issues.ibexa.co/browse/EZP-26551 + * * @group regression * @group ezp26551 */ @@ -43,7 +45,7 @@ public function testDeleteContentTypeGroup() try { $contentTypeService->deleteContentTypeGroup($contentTypeGroup); } catch (InvalidArgumentException $e) { - $this->fail( + self::fail( "ContentTypeGroup can't be deleted because it has ContentType instances" ); } diff --git a/tests/integration/Core/Repository/Regression/EZP28799SubtreeSearchTest.php b/tests/integration/Core/Repository/Regression/EZP28799SubtreeSearchTest.php index 5d28154928..ae0f128a92 100644 --- a/tests/integration/Core/Repository/Regression/EZP28799SubtreeSearchTest.php +++ b/tests/integration/Core/Repository/Regression/EZP28799SubtreeSearchTest.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\Integration\Core\Repository\Regression; use Ibexa\Contracts\Core\Repository\Values\Content\Query; @@ -79,7 +80,7 @@ public function testConflictingConditions() $searchService = $this->getRepository()->getSearchService(); $result = $searchService->findContent($query); - $this->assertSame(0, $result->totalCount); + self::assertSame(0, $result->totalCount); } public function testNegativeSubtree() @@ -100,7 +101,7 @@ public function testNegativeSubtree() $searchService = $this->getRepository()->getSearchService(); $result = $searchService->findContent($query); - $this->assertSame(0, $result->totalCount); + self::assertSame(0, $result->totalCount); } } diff --git a/tests/integration/Core/Repository/Regression/EnvTest.php b/tests/integration/Core/Repository/Regression/EnvTest.php index ec7a08559d..88ef62da4c 100644 --- a/tests/integration/Core/Repository/Regression/EnvTest.php +++ b/tests/integration/Core/Repository/Regression/EnvTest.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\Integration\Core\Repository\Regression; use Ibexa\Core\Persistence\Cache\Adapter\TransactionalInMemoryCacheAdapter; @@ -24,22 +25,22 @@ public function testVerifyCacheDriver() { $pool = $this->getSetupFactory()->getServiceContainer()->get('ibexa.cache_pool'); - $this->assertInstanceOf(TransactionalInMemoryCacheAdapter::class, $pool); + self::assertInstanceOf(TransactionalInMemoryCacheAdapter::class, $pool); $reflectionDecoratedPool = new \ReflectionProperty($pool, 'sharedPool'); $reflectionDecoratedPool->setAccessible(true); $pool = $reflectionDecoratedPool->getValue($pool); - $this->assertInstanceOf(TagAwareAdapter::class, $pool); + self::assertInstanceOf(TagAwareAdapter::class, $pool); $reflectionPool = new \ReflectionProperty($pool, 'pool'); $reflectionPool->setAccessible(true); $innerPool = $reflectionPool->getValue($pool); if (getenv('CUSTOM_CACHE_POOL') === 'singleredis') { - $this->assertInstanceOf(RedisAdapter::class, $innerPool); + self::assertInstanceOf(RedisAdapter::class, $innerPool); } else { - $this->assertInstanceOf(ArrayAdapter::class, $innerPool); + self::assertInstanceOf(ArrayAdapter::class, $innerPool); } } } diff --git a/tests/integration/Core/Repository/Regression/PureNegativeQueryTest.php b/tests/integration/Core/Repository/Regression/PureNegativeQueryTest.php index 5e507e5b15..783866aefe 100644 --- a/tests/integration/Core/Repository/Regression/PureNegativeQueryTest.php +++ b/tests/integration/Core/Repository/Regression/PureNegativeQueryTest.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\Integration\Core\Repository\Regression; use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; @@ -24,7 +25,7 @@ public function providerForTestMatchAll() $query = new Query(['filter' => new Criterion\MatchAll()]); $result = $this->getRepository()->getSearchService()->findContent($query); // Sanity check - $this->assertGreaterThan(0, $result->totalCount); + self::assertGreaterThan(0, $result->totalCount); $totalCount = $result->totalCount; $contentId = 12; @@ -228,7 +229,7 @@ public function testMatchAllContentInfoQuery($criterion, $totalCount) $result = $this->getRepository()->getSearchService()->findContentInfo($query); - $this->assertEquals($totalCount, $result->totalCount); + self::assertEquals($totalCount, $result->totalCount); } /** @@ -247,7 +248,7 @@ public function testMatchAllContentInfoFilter($criterion, $totalCount) $result = $this->getRepository()->getSearchService()->findContentInfo($query); - $this->assertEquals($totalCount, $result->totalCount); + self::assertEquals($totalCount, $result->totalCount); } /** @@ -266,7 +267,7 @@ public function testMatchAllLocationQuery($criterion, $totalCount) $result = $this->getRepository()->getSearchService()->findLocations($query); - $this->assertEquals($totalCount, $result->totalCount); + self::assertEquals($totalCount, $result->totalCount); } /** @@ -285,7 +286,7 @@ public function testMatchAllLocationFilter($criterion, $totalCount) $result = $this->getRepository()->getSearchService()->findLocations($query); - $this->assertEquals($totalCount, $result->totalCount); + self::assertEquals($totalCount, $result->totalCount); } } diff --git a/tests/integration/Core/Repository/RepositoryTest.php b/tests/integration/Core/Repository/RepositoryTest.php index 8b66866183..5e0e2a3dc6 100644 --- a/tests/integration/Core/Repository/RepositoryTest.php +++ b/tests/integration/Core/Repository/RepositoryTest.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\Integration\Core\Repository; use Exception; @@ -28,6 +29,7 @@ * Test case for operations in the Repository using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\Repository + * * @group integration */ class RepositoryTest extends BaseTest @@ -37,7 +39,7 @@ class RepositoryTest extends BaseTest */ public function testGetRepository() { - $this->assertInstanceOf(Repository::class, $this->getSetupFactory()->getRepository(true)); + self::assertInstanceOf(Repository::class, $this->getSetupFactory()->getRepository(true)); } /** @@ -137,7 +139,7 @@ public function testGetUserService() public function testGetNotificationService() { $repository = $this->getRepository(); - $this->assertInstanceOf( + self::assertInstanceOf( NotificationService::class, $repository->getNotificationService() ); diff --git a/tests/integration/Core/Repository/RoleServiceAuthorizationTest.php b/tests/integration/Core/Repository/RoleServiceAuthorizationTest.php index 7f6ff1873b..58e76ab082 100644 --- a/tests/integration/Core/Repository/RoleServiceAuthorizationTest.php +++ b/tests/integration/Core/Repository/RoleServiceAuthorizationTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -13,6 +14,7 @@ * Test case for operations in the RoleService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\RoleService + * * @group integration * @group authorization */ @@ -22,6 +24,7 @@ class RoleServiceAuthorizationTest extends BaseTest * Test for the createRole() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::createRole() + * * @depends Ibexa\Tests\Integration\Core\Repository\RoleServiceTest::testCreateRole * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ @@ -53,6 +56,7 @@ public function testCreateRoleThrowsUnauthorizedException() * Test for the loadRole() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::loadRole() + * * @depends Ibexa\Tests\Integration\Core\Repository\RoleServiceTest::testLoadRole * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ @@ -81,6 +85,7 @@ public function testLoadRoleThrowsUnauthorizedException() * Test for the loadRoleByIdentifier() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::loadRoleByIdentifier() + * * @depends Ibexa\Tests\Integration\Core\Repository\RoleServiceTest::testLoadRoleByIdentifier * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ @@ -125,7 +130,7 @@ public function testLoadRolesLoadsEmptyListForAnonymousUser() $roleService = $repository->getRoleService(); /* END: Use Case */ - $this->assertEquals([], $roleService->loadRoles()); + self::assertEquals([], $roleService->loadRoles()); } /** @@ -155,13 +160,14 @@ public function testLoadRolesForUserWithSubtreeLimitation() $repository->getPermissionResolver()->setCurrentUserReference($user); /* END: Use Case */ - $this->assertCount(6, $roleService->loadRoles()); + self::assertCount(6, $roleService->loadRoles()); } /** * Test for the deleteRole() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::deleteRole() + * * @depends Ibexa\Tests\Integration\Core\Repository\RoleServiceTest::testDeleteRole * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ @@ -190,6 +196,7 @@ public function testDeleteRoleThrowsUnauthorizedException() * Test for the updatePolicy() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::updatePolicyByRoleDraft() + * * @depends Ibexa\Tests\Integration\Core\Repository\RoleServiceTest::testUpdatePolicyByRoleDraft * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ @@ -237,6 +244,7 @@ public function testUpdatePolicyByRoleDraftThrowsUnauthorizedException() * Test for the removePolicy() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::removePolicy() + * * @depends Ibexa\Tests\Integration\Core\Repository\RoleServiceTest::testRemovePolicyByRoleDraft * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ @@ -279,6 +287,7 @@ public function testRemovePolicyThrowsUnauthorizedException() * Test for the removePolicyByRoleDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::removePolicyByRoleDraft() + * * @depends Ibexa\Tests\Integration\Core\Repository\RoleServiceTest::testRemovePolicyByRoleDraft * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ @@ -312,6 +321,7 @@ public function testDeletePolicyThrowsUnauthorizedException() * Test for the assignRoleToUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::assignRoleToUserGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\RoleServiceTest::testAssignRoleToUserGroup * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ @@ -346,6 +356,7 @@ public function testAssignRoleToUserGroupThrowsUnauthorizedException() * Test for the assignRoleToUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::assignRoleToUserGroup($role, $userGroup, $roleLimitation) + * * @depends Ibexa\Tests\Integration\Core\Repository\RoleServiceTest::testAssignRoleToUserGroup * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ @@ -387,6 +398,7 @@ public function testAssignRoleToUserGroupThrowsUnauthorizedExceptionWithRoleLimi * Test for the removeRoleAssignment() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::removeRoleAssignment() + * * @depends Ibexa\Tests\Integration\Core\Repository\RoleServiceTest::testRemoveRoleAssignmentFromUserGroup * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ @@ -430,6 +442,7 @@ public function testRemoveRoleAssignmentFromUserGroupThrowsUnauthorizedException * Test for the assignRoleToUser() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::assignRoleToUser() + * * @depends Ibexa\Tests\Integration\Core\Repository\RoleServiceTest::testAssignRoleToUser * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ @@ -458,6 +471,7 @@ public function testAssignRoleToUserThrowsUnauthorizedException() * Test for the assignRoleToUser() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::assignRoleToUser($role, $user, $roleLimitation) + * * @depends Ibexa\Tests\Integration\Core\Repository\RoleServiceTest::testAssignRoleToUser * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ @@ -493,6 +507,7 @@ public function testAssignRoleToUserThrowsUnauthorizedExceptionWithRoleLimitatio * Test for the removeRoleAssignment() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::removeRoleAssignment() + * * @depends Ibexa\Tests\Integration\Core\Repository\RoleServiceTest::testRemoveRoleAssignment * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ @@ -529,6 +544,7 @@ public function testRemoveRoleAssignmentThrowsUnauthorizedException() * Test for the getRoleAssignments() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::getRoleAssignments() + * * @depends Ibexa\Tests\Integration\Core\Repository\RoleServiceTest::testGetRoleAssignments * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ @@ -572,7 +588,7 @@ public function testGetRoleAssignmentsForUserLoadsEmptyListForAnonymousUser() $repository->getPermissionResolver()->setCurrentUserReference($user); /* END: Use Case */ - $this->assertSame([], $roleService->getRoleAssignmentsForUser($user)); + self::assertSame([], $roleService->getRoleAssignmentsForUser($user)); } /** @@ -598,16 +614,17 @@ public function testGetRoleAssignmentsForUserWithSubtreeLimitation() /* END: Use Case */ $roleAssignments = $roleService->getRoleAssignmentsForUser($user); - $this->assertCount(1, $roleAssignments); + self::assertCount(1, $roleAssignments); $roleAssignment = $roleAssignments[0]; - $this->assertSame($user, $roleAssignment->user); + self::assertSame($user, $roleAssignment->user); } /** * Test for the getRoleAssignmentsForUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::getRoleAssignmentsForUserGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\RoleServiceTest::testGetRoleAssignmentsForUserGroup * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ diff --git a/tests/integration/Core/Repository/RoleServiceTest.php b/tests/integration/Core/Repository/RoleServiceTest.php index 09d1aebd5c..63658b8206 100644 --- a/tests/integration/Core/Repository/RoleServiceTest.php +++ b/tests/integration/Core/Repository/RoleServiceTest.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\Integration\Core\Repository; use Exception; @@ -48,6 +49,7 @@ * <ul> * * @covers \Ibexa\Contracts\Core\Repository\RoleService + * * @group role */ class RoleServiceTest extends BaseTest @@ -64,7 +66,7 @@ public function testNewRoleCreateStruct() $roleService = $repository->getRoleService(); $roleCreate = $roleService->newRoleCreateStruct('roleName'); - $this->assertInstanceOf(RoleCreateStruct::class, $roleCreate); + self::assertInstanceOf(RoleCreateStruct::class, $roleCreate); } /** @@ -77,14 +79,15 @@ public function testNewRoleCopyStruct(): void $roleService = $repository->getRoleService(); $roleCopy = $roleService->newRoleCopyStruct('copiedRole'); - $this->assertSame('copiedRole', $roleCopy->newIdentifier); - $this->assertSame([], $roleCopy->getPolicies()); + self::assertSame('copiedRole', $roleCopy->newIdentifier); + self::assertSame([], $roleCopy->getPolicies()); } /** * Test for the newRoleCreateStruct() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::newRoleCreateStruct() + * * @depends testNewRoleCreateStruct */ public function testNewRoleCreateStructSetsNamePropertyOnStruct() @@ -98,13 +101,14 @@ public function testNewRoleCreateStructSetsNamePropertyOnStruct() /* END: Use Case */ - $this->assertEquals('roleName', $roleCreate->identifier); + self::assertEquals('roleName', $roleCreate->identifier); } /** * Test for the createRole() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::createRole() + * * @depends testNewRoleCreateStruct */ public function testCreateRole() @@ -138,6 +142,7 @@ public function testCreateRole() * Test for the createRole() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::createRole() + * * @depends testCreateRole */ public function testRoleCreateStructValues(array $data) @@ -145,7 +150,7 @@ public function testRoleCreateStructValues(array $data) $createStruct = $data['createStruct']; $role = $data['role']; - $this->assertEquals( + self::assertEquals( [ 'identifier' => $createStruct->identifier, 'policies' => $createStruct->policies, @@ -155,7 +160,7 @@ public function testRoleCreateStructValues(array $data) 'policies' => $role->policies, ] ); - $this->assertNotNull($role->id); + self::assertNotNull($role->id); return $data; } @@ -164,6 +169,7 @@ public function testRoleCreateStructValues(array $data) * Test for the createRole() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::createRole() + * * @depends testNewRoleCreateStruct */ public function testCreateRoleWithPolicy() @@ -196,7 +202,7 @@ public function testCreateRoleWithPolicy() /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( RoleDraft::class, $role ); @@ -211,6 +217,7 @@ public function testCreateRoleWithPolicy() * Test for the createRole() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::createRole() + * * @depends testCreateRoleWithPolicy */ public function testRoleCreateStructValuesWithPolicy(array $data) @@ -218,7 +225,7 @@ public function testRoleCreateStructValuesWithPolicy(array $data) $createStruct = $data['createStruct']; $role = $data['role']; - $this->assertEquals( + self::assertEquals( [ 'identifier' => $createStruct->identifier, 'policy_module' => $createStruct->policies[0]->module, @@ -232,7 +239,7 @@ public function testRoleCreateStructValuesWithPolicy(array $data) 'policy_limitation' => array_values($role->policies[0]->limitations), ] ); - $this->assertNotNull($role->id); + self::assertNotNull($role->id); return $data; } @@ -332,6 +339,7 @@ public function testCreateRoleWithMultiplePolicies() * Test for the createRoleDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::createRoleDraft() + * * @depends testNewRoleCreateStruct */ public function testCreateRoleDraft() @@ -353,7 +361,7 @@ public function testCreateRoleDraft() /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( RoleDraft::class, $newRoleDraft ); @@ -363,6 +371,7 @@ public function testCreateRoleDraft() * Test for the createRole() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::createRole() + * * @depends testCreateRole */ public function testCreateRoleThrowsInvalidArgumentException() @@ -389,6 +398,7 @@ public function testCreateRoleThrowsInvalidArgumentException() * Test for the createRoleDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::createRoleDraft() + * * @depends testCreateRoleDraft */ public function testCreateRoleDraftThrowsInvalidArgumentException() @@ -460,6 +470,7 @@ public function testCreateRoleThrowsLimitationValidationException() * Test for the createRole() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::createRole() + * * @depends testNewRoleCreateStruct */ public function testCreateRoleInTransactionWithRollback() @@ -489,13 +500,14 @@ public function testCreateRoleInTransactionWithRollback() } /* END: Use Case */ - $this->fail('Role object still exists after rollback.'); + self::fail('Role object still exists after rollback.'); } /** * Test for the createRoleDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::createRoleDraft() + * * @depends testNewRoleCreateStruct */ public function testCreateRoleDraftInTransactionWithRollback() @@ -525,7 +537,7 @@ public function testCreateRoleDraftInTransactionWithRollback() } /* END: Use Case */ - $this->fail('Role draft object still exists after rollback.'); + self::fail('Role draft object still exists after rollback.'); } public function providerForCopyRoleTests(): array @@ -572,6 +584,7 @@ public function providerForCopyRoleTests(): array * @dataProvider providerForCopyRoleTests * * @covers \Ibexa\Contracts\Core\Repository\RoleService::copyRole + * * @depends testNewRoleCopyStruct * @depends testLoadRoleByIdentifier * @@ -597,9 +610,9 @@ public function testCopyRole(RoleCreateStruct $roleCreateStruct, RoleCopyStruct // Now verify that our change was saved $role = $roleService->loadRoleByIdentifier('copiedRole'); - $this->assertEquals($role->id, $copiedRole->id); - $this->assertEquals('copiedRole', $role->identifier); - $this->assertEmpty($role->getPolicies()); + self::assertEquals($role->id, $copiedRole->id); + self::assertEquals('copiedRole', $role->identifier); + self::assertEmpty($role->getPolicies()); } /** @@ -608,6 +621,7 @@ public function testCopyRole(RoleCreateStruct $roleCreateStruct, RoleCopyStruct * @dataProvider providerForCopyRoleTests * * @covers \Ibexa\Contracts\Core\Repository\RoleService::copyRole + * * @depends testNewRoleCopyStruct * @depends testLoadRoleByIdentifier * @@ -642,7 +656,7 @@ public function testCopyRoleWithPolicies( // Now verify that our change was saved $role = $roleService->loadRoleByIdentifier('copiedRole'); - $this->assertEquals($role->getPolicies(), $copiedRole->getPolicies()); + self::assertEquals($role->getPolicies(), $copiedRole->getPolicies()); } /** @@ -651,6 +665,7 @@ public function testCopyRoleWithPolicies( * @dataProvider providerForCopyRoleTests * * @covers \Ibexa\Contracts\Core\Repository\RoleService::copyRole + * * @depends testNewRoleCopyStruct * @depends testLoadRoleByIdentifier * @@ -695,9 +710,9 @@ public function testCopyRoleWithPoliciesAndLimitations( $limitationsCopied[$policy->function] = $policy->getLimitations(); } - $this->assertEquals($role->getPolicies(), $copiedRole->getPolicies()); + self::assertEquals($role->getPolicies(), $copiedRole->getPolicies()); foreach ($limitations as $policy => $limitation) { - $this->assertEquals($limitation, $limitationsCopied[$policy]); + self::assertEquals($limitation, $limitationsCopied[$policy]); } } @@ -705,6 +720,7 @@ public function testCopyRoleWithPoliciesAndLimitations( * Test for the loadRole() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::loadRole() + * * @depends testCreateRole */ public function testLoadRole() @@ -727,7 +743,7 @@ public function testLoadRole() /* END: Use Case */ - $this->assertEquals('roleName', $role->identifier); + self::assertEquals('roleName', $role->identifier); } /** @@ -754,7 +770,7 @@ public function testLoadRoleDraft() /* END: Use Case */ - $this->assertEquals('roleName', $role->identifier); + self::assertEquals('roleName', $role->identifier); } public function testLoadRoleDraftByRoleId() @@ -787,6 +803,7 @@ public function testLoadRoleDraftByRoleId() * Test for the loadRole() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::loadRole() + * * @depends testLoadRole */ public function testLoadRoleThrowsNotFoundException() @@ -810,6 +827,7 @@ public function testLoadRoleThrowsNotFoundException() * Test for the loadRoleDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::loadRoleDraft() + * * @depends testLoadRoleDraft */ public function testLoadRoleDraftThrowsNotFoundException() @@ -850,6 +868,7 @@ public function testLoadRoleDraftByRoleIdThrowsNotFoundException() * Test for the loadRoleByIdentifier() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::loadRoleByIdentifier() + * * @depends testCreateRole */ public function testLoadRoleByIdentifier() @@ -872,13 +891,14 @@ public function testLoadRoleByIdentifier() /* END: Use Case */ - $this->assertEquals('roleName', $role->identifier); + self::assertEquals('roleName', $role->identifier); } /** * Test for the loadRoleByIdentifier() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::loadRoleByIdentifier() + * * @depends testLoadRoleByIdentifier */ public function testLoadRoleByIdentifierThrowsNotFoundException() @@ -901,6 +921,7 @@ public function testLoadRoleByIdentifierThrowsNotFoundException() * Test for the loadRoles() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::loadRoles() + * * @depends testCreateRole */ public function testLoadRoles() @@ -930,13 +951,14 @@ public function testLoadRoles() /* END: Use Case */ - $this->assertEquals('roleName', $role->identifier); + self::assertEquals('roleName', $role->identifier); } /** * Test for the loadRoles() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::loadRoles() + * * @depends testLoadRoles */ public function testLoadRolesReturnsExpectedSetOfDefaultRoles() @@ -954,7 +976,7 @@ public function testLoadRolesReturnsExpectedSetOfDefaultRoles() } /* END: Use Case */ - $this->assertEqualsCanonicalizing( + self::assertEqualsCanonicalizing( [ 'Administrator', 'Anonymous', @@ -987,6 +1009,7 @@ public function testNewRoleUpdateStruct() * Test for the updateRoleDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::updateRoleDraft() + * * @depends testNewRoleUpdateStruct * @depends testLoadRoleDraft */ @@ -1012,13 +1035,14 @@ public function testUpdateRoleDraft() // Now verify that our change was saved $role = $roleService->loadRoleDraft($updatedRole->id); - $this->assertEquals($role->identifier, 'updatedRole'); + self::assertEquals($role->identifier, 'updatedRole'); } /** * Test for the updateRoleDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::updateRoleDraft() + * * @depends testUpdateRoleDraft */ public function testUpdateRoleDraftThrowsInvalidArgumentException() @@ -1048,6 +1072,7 @@ public function testUpdateRoleDraftThrowsInvalidArgumentException() * Test for the deleteRole() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::deleteRole() + * * @depends testCreateRole * @depends testLoadRoles */ @@ -1069,13 +1094,14 @@ public function testDeleteRole() $roleService->deleteRole($role); /* END: Use Case */ - $this->assertCount(5, $roleService->loadRoles()); + self::assertCount(5, $roleService->loadRoles()); } /** * Test for the deleteRoleDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::deleteRoleDraft() + * * @depends testLoadRoleDraft */ public function testDeleteRoleDraft() @@ -1121,6 +1147,7 @@ public function testNewPolicyCreateStruct() * Test for the newPolicyCreateStruct() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::newPolicyCreateStruct() + * * @depends testNewPolicyCreateStruct */ public function testNewPolicyCreateStructSetsStructProperties() @@ -1132,7 +1159,7 @@ public function testNewPolicyCreateStructSetsStructProperties() $policyCreate = $roleService->newPolicyCreateStruct('content', 'create'); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( ['content', 'create'], [$policyCreate->module, $policyCreate->function] ); @@ -1142,6 +1169,7 @@ public function testNewPolicyCreateStructSetsStructProperties() * Test for the addPolicyByRoleDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::addPolicyByRoleDraft() + * * @depends testCreateRoleDraft * @depends testNewPolicyCreateStruct */ @@ -1183,7 +1211,7 @@ static function ($p1, $p2) { } ); - $this->assertEquals( + self::assertEquals( [ [ 'module' => 'content', @@ -1204,6 +1232,7 @@ static function ($p1, $p2) { * @return array [\Ibexa\Contracts\Core\Repository\Values\User\RoleDraft, \Ibexa\Contracts\Core\Repository\Values\User\Policy] * * @covers \Ibexa\Contracts\Core\Repository\RoleService::addPolicyByRoleDraft() + * * @depends testAddPolicyByRoleDraft */ public function testAddPolicyByRoleDraftUpdatesRole() @@ -1231,7 +1260,7 @@ public function testAddPolicyByRoleDraftUpdatesRole() } /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( Policy::class, $policy ); @@ -1245,13 +1274,14 @@ public function testAddPolicyByRoleDraftUpdatesRole() * @param array $roleAndPolicy * * @covers \Ibexa\Contracts\Core\Repository\RoleService::addPolicyByRoleDraft() + * * @depends testAddPolicyByRoleDraftUpdatesRole */ public function testAddPolicyByRoleDraftSetsPolicyProperties($roleAndPolicy) { list($role, $policy) = $roleAndPolicy; - $this->assertEquals( + self::assertEquals( [$role->id, 'content', 'create'], [$policy->roleId, $policy->module, $policy->function] ); @@ -1261,6 +1291,7 @@ public function testAddPolicyByRoleDraftSetsPolicyProperties($roleAndPolicy) * Test for the addPolicyByRoleDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::addPolicyByRoleDraft() + * * @depends testNewPolicyCreateStruct * @depends testCreateRoleDraft */ @@ -1301,6 +1332,7 @@ public function testAddPolicyByRoleDraftThrowsLimitationValidationException() * Test for the createRole() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::createRole() + * * @depends testAddPolicyByRoleDraftUpdatesRole */ public function testCreateRoleWithAddPolicy() @@ -1342,7 +1374,7 @@ public function testCreateRoleWithAddPolicy() /* END: Use Case */ array_multisort($policies); - $this->assertEquals( + self::assertEquals( [ [ 'module' => 'content', @@ -1361,6 +1393,7 @@ public function testCreateRoleWithAddPolicy() * Test for the createRoleDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::createRoleDraft() + * * @depends testAddPolicyByRoleDraftUpdatesRole */ public function testCreateRoleDraftWithAddPolicy() @@ -1399,7 +1432,7 @@ public function testCreateRoleDraftWithAddPolicy() } /* END: Use Case */ - $this->assertEquals( + self::assertEquals( [ [ 'module' => 'content', @@ -1480,7 +1513,7 @@ public function testUpdatePolicyByRoleDraftNoLimitation() /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( Policy::class, $policy ); @@ -1492,6 +1525,7 @@ public function testUpdatePolicyByRoleDraftNoLimitation() * @return array * * @covers \Ibexa\Contracts\Core\Repository\RoleService::updatePolicyByRoleDraft() + * * @depends testAddPolicyByRoleDraft * @depends testNewPolicyUpdateStruct */ @@ -1557,7 +1591,7 @@ public function testUpdatePolicyByRoleDraft() /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( Policy::class, $policy ); @@ -1569,13 +1603,14 @@ public function testUpdatePolicyByRoleDraft() * @param array $roleAndPolicy * * @covers \Ibexa\Contracts\Core\Repository\RoleService::testUpdatePolicyByRoleDraft() + * * @depends testUpdatePolicyByRoleDraft */ public function testUpdatePolicyUpdatesLimitations($roleAndPolicy) { list($role, $policy) = $roleAndPolicy; - $this->assertEquals( + self::assertEquals( [ new ContentTypeLimitation( [ @@ -1595,6 +1630,7 @@ public function testUpdatePolicyUpdatesLimitations($roleAndPolicy) * @param \Ibexa\Contracts\Core\Repository\Values\User\Role $role * * @covers \Ibexa\Contracts\Core\Repository\RoleService::updatePolicyByRoleDraft() + * * @depends testUpdatePolicyUpdatesLimitations */ public function testUpdatePolicyUpdatesRole($role) @@ -1606,8 +1642,8 @@ public function testUpdatePolicyUpdatesRole($role) } } - $this->assertCount(1, $limitations); - $this->assertInstanceOf( + self::assertCount(1, $limitations); + self::assertInstanceOf( Limitation::class, $limitations[0] ); @@ -1625,6 +1661,7 @@ public function testUpdatePolicyUpdatesRole($role) * Test for the updatePolicy() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::updatePolicyByRoleDraft() + * * @depends testAddPolicyByRoleDraft * @depends testNewPolicyCreateStruct * @depends testNewPolicyUpdateStruct @@ -1698,6 +1735,7 @@ public function testUpdatePolicyByRoleDraftThrowsLimitationValidationException() * Test for the removePolicyByRoleDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::removePolicyByRoleDraft() + * * @depends testAddPolicyByRoleDraft */ public function testRemovePolicyByRoleDraft() @@ -1730,7 +1768,7 @@ public function testRemovePolicyByRoleDraft() } /* END: Use Case */ - $this->assertSame([], $roleDraft->getPolicies()); + self::assertSame([], $roleDraft->getPolicies()); } /** @@ -1775,7 +1813,7 @@ public function testAddPolicyWithRoleAssignment() $roleAssignmentsAfterNewPolicy = $roleService->getRoleAssignments($roleAfterUpdate)[0]; /* END: Use Case */ - $this->assertNotEquals($roleAssignmentsBeforeNewPolicy->id, $roleAssignmentsAfterNewPolicy->id); + self::assertNotEquals($roleAssignmentsBeforeNewPolicy->id, $roleAssignmentsAfterNewPolicy->id); } /** @@ -1794,7 +1832,7 @@ public function testLoadRoleAssignment() $user = $repository->getUserService()->loadUser(14); // Check initial empty assignments (also warms up potential cache to validate it is correct below) - $this->assertCount(0, $roleService->getRoleAssignmentsForUser($user)); + self::assertCount(0, $roleService->getRoleAssignmentsForUser($user)); // Assignment to user group $groupRoleAssignment = $roleService->loadRoleAssignment(25); @@ -1809,7 +1847,7 @@ public function testLoadRoleAssignment() self::assertInstanceOf(UserGroupRoleAssignment::class, $groupRoleAssignment); - $this->assertEquals( + self::assertEquals( [ 12, 2, @@ -1834,6 +1872,7 @@ public function testLoadRoleAssignment() * @return \Ibexa\Contracts\Core\Repository\Values\User\RoleAssignment[] * * @covers \Ibexa\Contracts\Core\Repository\RoleService::getRoleAssignments() + * * @depends testLoadRoleByIdentifier */ public function testGetRoleAssignments() @@ -1851,12 +1890,12 @@ public function testGetRoleAssignments() /* END: Use Case */ - $this->assertCount(2, $roleAssignments); - $this->assertInstanceOf( + self::assertCount(2, $roleAssignments); + self::assertInstanceOf( UserGroupRoleAssignment::class, $roleAssignments[0] ); - $this->assertInstanceOf( + self::assertInstanceOf( UserGroupRoleAssignment::class, $roleAssignments[1] ); @@ -1870,11 +1909,12 @@ public function testGetRoleAssignments() * @param \Ibexa\Contracts\Core\Repository\Values\User\RoleAssignment[] $roleAssignments * * @covers \Ibexa\Contracts\Core\Repository\RoleService::getRoleAssignments + * * @depends testGetRoleAssignments */ public function testGetRoleAssignmentsContainExpectedLimitation(array $roleAssignments) { - $this->assertEquals( + self::assertEquals( 'Subtree', reset($roleAssignments)->limitation->getIdentifier() ); @@ -1978,6 +2018,7 @@ public function testCountRoleAssignmentsAfterDeletingUser(): void * Test for the assignRoleToUser() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::assignRoleToUser() + * * @depends testGetRoleAssignments */ public function testAssignRoleToUser() @@ -1999,13 +2040,14 @@ public function testAssignRoleToUser() /* END: Use Case */ // Administrator + Example User - $this->assertCount(2, $roleAssignments); + self::assertCount(2, $roleAssignments); } /** * Test for the assignRoleToUser() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::assignRoleToUser($role, $user, $roleLimitation) + * * @depends testAssignRoleToUser */ public function testAssignRoleToUserWithRoleLimitation() @@ -2035,14 +2077,14 @@ public function testAssignRoleToUserWithRoleLimitation() /* END: Use Case */ // Members + Partners + Anonymous + Example User - $this->assertCount(4, $roleAssignments); + self::assertCount(4, $roleAssignments); // Get the role limitation $roleLimitation = null; foreach ($roleAssignments as $roleAssignment) { $roleLimitation = $roleAssignment->getRoleLimitation(); if ($roleLimitation) { - $this->assertInstanceOf( + self::assertInstanceOf( UserRoleAssignment::class, $roleAssignment ); @@ -2050,7 +2092,7 @@ public function testAssignRoleToUserWithRoleLimitation() } } - $this->assertEquals( + self::assertEquals( new SubtreeLimitation( [ 'limitationValues' => ['/1/43/'], @@ -2074,14 +2116,14 @@ public function testAssignRoleToUserWithRoleLimitation() $roleAssignments = $roleService->getRoleAssignments($role); // Members + Partners + Anonymous + Example User - $this->assertCount(5, $roleAssignments); + self::assertCount(5, $roleAssignments); // Get the role limitation $roleLimitations = []; foreach ($roleAssignments as $roleAssignment) { $roleLimitation = $roleAssignment->getRoleLimitation(); if ($roleLimitation) { - $this->assertInstanceOf( + self::assertInstanceOf( UserRoleAssignment::class, $roleAssignment ); @@ -2090,7 +2132,7 @@ public function testAssignRoleToUserWithRoleLimitation() } array_multisort($roleLimitations); - $this->assertEquals( + self::assertEquals( [ new SubtreeLimitation( [ @@ -2111,6 +2153,7 @@ public function testAssignRoleToUserWithRoleLimitation() * Test for the assignRoleToUser() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::assignRoleToUser($role, $user, $roleLimitation) + * * @depends testAssignRoleToUser * @depends testLoadRoleByIdentifier */ @@ -2152,6 +2195,7 @@ public function testAssignRoleToUserWithRoleLimitationThrowsLimitationValidation * Makes sure assigning role several times throws. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::assignRoleToUser($role, $user, $roleLimitation) + * * @depends testAssignRoleToUser * @depends testLoadRoleByIdentifier */ @@ -2179,7 +2223,7 @@ public function testAssignRoleToUserThrowsInvalidArgumentException() $currentUser ); } catch (Exception $e) { - $this->fail('Got exception at first valid attempt to assign role'); + self::fail('Got exception at first valid attempt to assign role'); } // Re-Assign the "Anonymous" role to the current user @@ -2197,6 +2241,7 @@ public function testAssignRoleToUserThrowsInvalidArgumentException() * Makes sure assigning role several times with same limitations throws. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::assignRoleToUser($role, $user, $roleLimitation) + * * @depends testAssignRoleToUser * @depends testLoadRoleByIdentifier */ @@ -2229,7 +2274,7 @@ public function testAssignRoleToUserWithRoleLimitationThrowsInvalidArgumentExcep ) ); } catch (Exception $e) { - $this->fail('Got exception at first valid attempt to assign role'); + self::fail('Got exception at first valid attempt to assign role'); } // Re-Assign the "Anonymous" role to the current user @@ -2250,6 +2295,7 @@ public function testAssignRoleToUserWithRoleLimitationThrowsInvalidArgumentExcep * Test for the removeRoleAssignment() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::removeRoleAssignment() + * * @depends testAssignRoleToUser */ public function testRemoveRoleAssignment() @@ -2278,13 +2324,14 @@ public function testRemoveRoleAssignment() /* END: Use Case */ // Members + Editors + Partners - $this->assertCount(3, $roleAssignments); + self::assertCount(3, $roleAssignments); } /** * Test for the getRoleAssignmentsForUser() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::getRoleAssignmentsForUser() + * * @depends testAssignRoleToUser * @depends testCreateRoleWithAddPolicy */ @@ -2318,8 +2365,8 @@ public function testGetRoleAssignmentsForUserDirect() $role = $roleService->loadRole($roleDraft->id); // Check inital empty assigments (also warms up potential cache to validate it is correct below) - $this->assertCount(0, $roleService->getRoleAssignmentsForUser($user)); - $this->assertCount(0, $roleService->getRoleAssignments($role)); + self::assertCount(0, $roleService->getRoleAssignmentsForUser($user)); + self::assertCount(0, $roleService->getRoleAssignments($role)); // Assign role to new user $roleService->assignRoleToUser($role, $user); @@ -2328,18 +2375,19 @@ public function testGetRoleAssignmentsForUserDirect() $roleAssignments = $roleService->getRoleAssignmentsForUser($user); /* END: Use Case */ - $this->assertCount(1, $roleAssignments); - $this->assertInstanceOf( + self::assertCount(1, $roleAssignments); + self::assertInstanceOf( UserRoleAssignment::class, reset($roleAssignments) ); - $this->assertCount(1, $roleService->getRoleAssignments($role)); + self::assertCount(1, $roleService->getRoleAssignments($role)); } /** * Test for the getRoleAssignmentsForUser() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::getRoleAssignmentsForUser() + * * @depends testAssignRoleToUser * @depends testCreateRoleWithAddPolicy */ @@ -2357,13 +2405,14 @@ public function testGetRoleAssignmentsForUserEmpty() $roleAssignments = $roleService->getRoleAssignmentsForUser($adminUser); /* END: Use Case */ - $this->assertCount(0, $roleAssignments); + self::assertCount(0, $roleAssignments); } /** * Test for the getRoleAssignmentsForUser() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::getRoleAssignmentsForUser() + * * @depends testAssignRoleToUser * @depends testCreateRoleWithAddPolicy */ @@ -2381,8 +2430,8 @@ public function testGetRoleAssignmentsForUserInherited() $roleAssignments = $roleService->getRoleAssignmentsForUser($adminUser, true); /* END: Use Case */ - $this->assertCount(1, $roleAssignments); - $this->assertInstanceOf( + self::assertCount(1, $roleAssignments); + self::assertInstanceOf( UserGroupRoleAssignment::class, reset($roleAssignments) ); @@ -2392,6 +2441,7 @@ public function testGetRoleAssignmentsForUserInherited() * Test for the assignRoleToUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::assignRoleToUserGroup() + * * @depends testGetRoleAssignments */ public function testAssignRoleToUserGroup() @@ -2413,7 +2463,7 @@ public function testAssignRoleToUserGroup() /* END: Use Case */ // Administrator + Example Group - $this->assertCount(2, $roleAssignments); + self::assertCount(2, $roleAssignments); } /** @@ -2442,14 +2492,15 @@ public function testAssignRoleToUserGroupAffectsRoleAssignmentsForUser() $updatedRoleAssignments = $roleService->getRoleAssignmentsForUser($user, true); /* END: Use Case */ - $this->assertEmpty($initRoleAssignments); - $this->assertCount(1, $updatedRoleAssignments); + self::assertEmpty($initRoleAssignments); + self::assertCount(1, $updatedRoleAssignments); } /** * Test for the assignRoleToUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::assignRoleToUserGroup($role, $userGroup, $roleLimitation) + * * @depends testAssignRoleToUserGroup */ public function testAssignRoleToUserGroupWithRoleLimitation() @@ -2479,7 +2530,7 @@ public function testAssignRoleToUserGroupWithRoleLimitation() /* END: Use Case */ // Members + Partners + Anonymous + Example Group - $this->assertCount(4, $roleAssignments); + self::assertCount(4, $roleAssignments); // Get the role limitation $roleLimitation = null; @@ -2490,7 +2541,7 @@ public function testAssignRoleToUserGroupWithRoleLimitation() } } - $this->assertEquals( + self::assertEquals( new SubtreeLimitation( [ 'limitationValues' => ['/1/43/'], @@ -2514,14 +2565,14 @@ public function testAssignRoleToUserGroupWithRoleLimitation() $roleAssignments = $roleService->getRoleAssignments($role); // Members + Partners + Anonymous + Example User - $this->assertCount(5, $roleAssignments); + self::assertCount(5, $roleAssignments); // Get the role limitation $roleLimitations = []; foreach ($roleAssignments as $roleAssignment) { $roleLimitation = $roleAssignment->getRoleLimitation(); if ($roleLimitation) { - $this->assertInstanceOf( + self::assertInstanceOf( UserGroupRoleAssignment::class, $roleAssignment ); @@ -2530,7 +2581,7 @@ public function testAssignRoleToUserGroupWithRoleLimitation() } array_multisort($roleLimitations); - $this->assertEquals( + self::assertEquals( [ new SubtreeLimitation( [ @@ -2551,6 +2602,7 @@ public function testAssignRoleToUserGroupWithRoleLimitation() * Test for the assignRoleToUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::assignRoleToUserGroup($role, $userGroup, $roleLimitation) + * * @depends testLoadRoleByIdentifier * @depends testAssignRoleToUserGroup */ @@ -2593,6 +2645,7 @@ public function testAssignRoleToUserGroupWithRoleLimitationThrowsLimitationValid * Makes sure assigning role several times throws. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::assignRoleToUserGroup($role, $userGroup, $roleLimitation) + * * @depends testLoadRoleByIdentifier * @depends testAssignRoleToUserGroup */ @@ -2621,7 +2674,7 @@ public function testAssignRoleToUserGroupThrowsInvalidArgumentException() $userGroup ); } catch (Exception $e) { - $this->fail('Got exception at first valid attempt to assign role'); + self::fail('Got exception at first valid attempt to assign role'); } // Re-Assign the "Anonymous" role to the newly created user group @@ -2639,6 +2692,7 @@ public function testAssignRoleToUserGroupThrowsInvalidArgumentException() * Makes sure assigning role several times with same limitations throws. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::assignRoleToUserGroup($role, $userGroup, $roleLimitation) + * * @depends testLoadRoleByIdentifier * @depends testAssignRoleToUserGroup */ @@ -2672,7 +2726,7 @@ public function testAssignRoleToUserGroupWithRoleLimitationThrowsInvalidArgument ) ); } catch (Exception $e) { - $this->fail('Got exception at first valid attempt to assign role'); + self::fail('Got exception at first valid attempt to assign role'); } // Re-Assign the "Anonymous" role to the newly created user group @@ -2693,6 +2747,7 @@ public function testAssignRoleToUserGroupWithRoleLimitationThrowsInvalidArgument * Test for the removeRoleAssignment() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::removeRoleAssignment() + * * @depends testAssignRoleToUserGroup */ public function testRemoveRoleAssignmentFromUserGroup() @@ -2723,7 +2778,7 @@ public function testRemoveRoleAssignmentFromUserGroup() /* END: Use Case */ // Members + Editors + Partners - $this->assertCount(3, $roleAssignments); + self::assertCount(3, $roleAssignments); } /** @@ -2807,6 +2862,7 @@ public function testUnassignRoleByAssignmentThrowsNotFoundException() * Test for the getRoleAssignmentsForUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::getRoleAssignmentsForUserGroup() + * * @depends testAssignRoleToUserGroup * @depends testCreateRoleWithAddPolicy */ @@ -2846,8 +2902,8 @@ public function testGetRoleAssignmentsForUserGroup() $roleAssignments = $roleService->getRoleAssignmentsForUserGroup($userGroup); /* END: Use Case */ - $this->assertCount(1, $roleAssignments); - $this->assertInstanceOf( + self::assertCount(1, $roleAssignments); + self::assertInstanceOf( UserGroupRoleAssignment::class, reset($roleAssignments) ); @@ -2857,6 +2913,7 @@ public function testGetRoleAssignmentsForUserGroup() * Test for the getRoleAssignmentsForUser() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::getRoleAssignmentsForUser() + * * @depends testAssignRoleToUser * @depends testAssignRoleToUserGroup */ @@ -2912,7 +2969,7 @@ public function testLoadPoliciesByUserId() /* END: Use Case */ array_multisort($simplePolicyList); - $this->assertEquals( + self::assertEquals( [ [1, 'content', 'pdf'], [1, 'content', 'read'], @@ -2934,6 +2991,7 @@ public function testLoadPoliciesByUserId() * Test for the publishRoleDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::publishRoleDraft() + * * @depends testCreateRoleDraft */ public function testPublishRoleDraft() @@ -2961,7 +3019,7 @@ public function testPublishRoleDraft() $roleService->publishRoleDraft($roleDraft); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( Role::class, $roleService->loadRoleByIdentifier($roleCreate->identifier) ); @@ -2971,6 +3029,7 @@ public function testPublishRoleDraft() * Test for the publishRoleDraft() method. * * @covers \Ibexa\Contracts\Core\Repository\RoleService::publishRoleDraft() + * * @depends testCreateRoleDraft * @depends testAddPolicyByRoleDraft */ @@ -3014,7 +3073,7 @@ static function ($p1, $p2) { } ); - $this->assertEquals( + self::assertEquals( [ [ 'module' => 'content', diff --git a/tests/integration/Core/Repository/SearchEngineIndexingTest.php b/tests/integration/Core/Repository/SearchEngineIndexingTest.php index 8fe3092741..a75cafe039 100644 --- a/tests/integration/Core/Repository/SearchEngineIndexingTest.php +++ b/tests/integration/Core/Repository/SearchEngineIndexingTest.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\Integration\Core\Repository; use DateTime; @@ -44,9 +45,9 @@ public function testFindContentInfoFullTextIsSearchable() $searchResult = $searchService->findContentInfo($query); - $this->assertEquals(1, $searchResult->totalCount); + self::assertEquals(1, $searchResult->totalCount); $contentInfo = $searchResult->searchHits[0]->valueObject; - $this->assertEquals($content->id, $contentInfo->id); + self::assertEquals($content->id, $contentInfo->id); return $contentInfo; } @@ -73,8 +74,8 @@ public function testFindLocationsFullTextIsSearchable(ContentInfo $contentInfo) $searchResult = $searchService->findLocations($query); - $this->assertEquals(1, $searchResult->totalCount); - $this->assertEquals( + self::assertEquals(1, $searchResult->totalCount); + self::assertEquals( $contentInfo->mainLocationId, $searchResult->searchHits[0]->valueObject->id ); @@ -101,7 +102,7 @@ public function testFindContentInfoFullTextIsNotSearchable() $searchResult = $searchService->findContentInfo($query); - $this->assertEquals(0, $searchResult->totalCount); + self::assertEquals(0, $searchResult->totalCount); } /** @@ -124,7 +125,7 @@ public function testFindLocationsFullTextIsNotSearchable() $searchResult = $searchService->findLocations($query); - $this->assertEquals(0, $searchResult->totalCount); + self::assertEquals(0, $searchResult->totalCount); } /** @@ -202,8 +203,8 @@ public function testDeleteVersion() $criterion = new Criterion\LocationId($contentInfo->mainLocationId); $query = new Query(['filter' => $criterion]); $result = $searchService->findContentInfo($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $contentInfo->id, $result->searchHits[0]->valueObject->id ); @@ -229,7 +230,7 @@ public function testDeleteContent() $criterion = new Criterion\ParentLocationId($contentInfo->mainLocationId); $query = new LocationQuery(['filter' => $criterion]); $result = $searchService->findLocations($query); - $this->assertEquals(0, $result->totalCount); + self::assertEquals(0, $result->totalCount); } /** @@ -252,7 +253,7 @@ public function testDeleteUser() $criterion = new Criterion\ContentId($user->id); $query = new Query(['filter' => $criterion]); $result = $searchService->findContentInfo($query); - $this->assertEquals(0, $result->totalCount); + self::assertEquals(0, $result->totalCount); } /** @@ -275,7 +276,7 @@ public function testDeleteUserGroup() $criterion = new Criterion\ContentId($userGroup->id); $query = new Query(['filter' => $criterion]); $result = $searchService->findContentInfo($query); - $this->assertEquals(0, $result->totalCount); + self::assertEquals(0, $result->totalCount); } /** @@ -311,7 +312,7 @@ public function testCreateUser() $criterion = new Criterion\ContentId($user->id); $query = new Query(['filter' => $criterion]); $result = $searchService->findContentInfo($query); - $this->assertEquals(1, $result->totalCount); + self::assertEquals(1, $result->totalCount); } /** @@ -343,7 +344,7 @@ public function testUpdateUser() ); $result = $searchService->findContentInfo($query); - $this->assertEquals(1, $result->totalCount); + self::assertEquals(1, $result->totalCount); } /** @@ -373,7 +374,7 @@ public function testCreateUserGroup() $criterion = new Criterion\ContentId($userGroup->id); $query = new Query(['filter' => $criterion]); $result = $searchService->findContentInfo($query); - $this->assertEquals(1, $result->totalCount); + self::assertEquals(1, $result->totalCount); } /** @@ -391,8 +392,8 @@ public function testCreateLocation() $criterion = new Criterion\LocationId($membersLocation->id); $query = new LocationQuery(['filter' => $criterion]); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $membersLocation->id, $result->searchHits[0]->valueObject->id ); @@ -417,8 +418,8 @@ public function testHideSubtree() $criterion = new Criterion\LocationId($locationId); $query = new LocationQuery(['filter' => $criterion]); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertTrue($result->searchHits[0]->valueObject->hidden); + self::assertEquals(1, $result->totalCount); + self::assertTrue($result->searchHits[0]->valueObject->hidden); // Check if children locations are invisible $this->assertSubtreeInvisibleProperty($searchService, $locationId, true); @@ -445,8 +446,8 @@ public function testRevealSubtree() $criterion = new Criterion\LocationId($locationId); $query = new LocationQuery(['filter' => $criterion]); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertFalse($result->searchHits[0]->valueObject->hidden); + self::assertEquals(1, $result->totalCount); + self::assertFalse($result->searchHits[0]->valueObject->hidden); // Check if children locations are not invisible $this->assertSubtreeInvisibleProperty($searchService, $locationId, false); @@ -485,8 +486,8 @@ public function testCopySubtree() $criterion = new Criterion\ParentLocationId($membersLocation->id); $query = new LocationQuery(['filter' => $criterion]); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $adminsLocation->id, $result->searchHits[0]->valueObject->id ); @@ -495,8 +496,8 @@ public function testCopySubtree() $criterion = new Criterion\ParentLocationId($editorsLocation->id); $query = new LocationQuery(['filter' => $criterion]); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $copiedLocation->id, $result->searchHits[0]->valueObject->id ); @@ -534,14 +535,14 @@ public function testMoveSubtree() $criterion = new Criterion\ParentLocationId($editorsLocation->id); $query = new LocationQuery(['filter' => $criterion]); $result = $searchService->findLocations($query); - $this->assertEquals(0, $result->totalCount); + self::assertEquals(0, $result->totalCount); // Found under Members $criterion = new Criterion\ParentLocationId($membersLocation->id); $query = new LocationQuery(['filter' => $criterion]); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $adminsLocation->id, $result->searchHits[0]->valueObject->id ); @@ -553,8 +554,8 @@ public function testMoveSubtree() $criterion = new Criterion\ParentLocationId($editorsLocation->id); $query = new LocationQuery(['filter' => $criterion]); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $adminsLocation->id, $result->searchHits[0]->valueObject->id ); @@ -563,7 +564,7 @@ public function testMoveSubtree() $criterion = new Criterion\ParentLocationId($membersLocation->id); $query = new LocationQuery(['filter' => $criterion]); $result = $searchService->findLocations($query); - $this->assertEquals(0, $result->totalCount); + self::assertEquals(0, $result->totalCount); } /** @@ -616,8 +617,8 @@ public function testIndexContentWithNullField() $criterion = new Criterion\ContentId($content->id); $query = new Query(['filter' => $criterion]); $result = $searchService->findContent($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $content->id, $result->searchHits[0]->valueObject->id ); @@ -643,7 +644,7 @@ public function testUpdateLocation() $query = new LocationQuery(['filter' => $criterion]); $result = $searchService->findLocations($query); - $this->assertEquals(0, $result->totalCount); + self::assertEquals(0, $result->totalCount); $locationUpdateStruct = $locationService->newLocationUpdateStruct(); $locationUpdateStruct->priority = 4; @@ -653,8 +654,8 @@ public function testUpdateLocation() $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $locationToUpdate->id, $result->searchHits[0]->valueObject->id ); @@ -711,8 +712,8 @@ public function testPublishVersion() $query = new Query(['filter' => $criterion]); $result = $searchService->findContent($query); - $this->assertCount(1, $result->searchHits); - $this->assertEquals($publishedContent->contentInfo->id, $result->searchHits[0]->valueObject->contentInfo->id); + self::assertCount(1, $result->searchHits); + self::assertEquals($publishedContent->contentInfo->id, $result->searchHits[0]->valueObject->contentInfo->id); // Searching for children of locationId=2 should also hit this content $criterion = new Criterion\ParentLocationId(2); @@ -724,7 +725,7 @@ public function testPublishVersion() return; } } - $this->fail('Parent location sub-items do not contain published content'); + self::fail('Parent location sub-items do not contain published content'); } /** @@ -746,14 +747,14 @@ public function testRecoverLocation() $criterion = new Criterion\LocationId($location->id); $query = new LocationQuery(['filter' => $criterion]); $locations = $searchService->findLocations($query); - $this->assertEquals(0, $locations->totalCount); + self::assertEquals(0, $locations->totalCount); $trashItem = $trashService->loadTrashItem($location->id); $trashService->recover($trashItem); $this->refreshSearch($repository); $locations = $searchService->findLocations($query); - $this->assertEquals(0, $locations->totalCount); + self::assertEquals(0, $locations->totalCount); $this->assertContentIdSearch($publishedContent->contentInfo->id, 1); } @@ -772,12 +773,12 @@ public function testCopyContent() $criterion = new Criterion\FullText('copyTest'); $query = new Query(['filter' => $criterion]); $result = $searchService->findContent($query); - $this->assertCount(1, $result->searchHits); + self::assertCount(1, $result->searchHits); $copiedContent = $contentService->copyContent($publishedContent->contentInfo, $locationService->newLocationCreateStruct(2)); $this->refreshSearch($repository); $result = $searchService->findContent($query); - $this->assertCount(2, $result->searchHits); + self::assertCount(2, $result->searchHits); $this->assertContentIdSearch($publishedContent->contentInfo->id, 1); $this->assertContentIdSearch($copiedContent->contentInfo->id, 1); @@ -815,6 +816,7 @@ public function testSetContentState() * @param string $text Content Item field value text (to be indexed) * @param string $searchForText text based on which Content Item should be found * @param array $ignoreForSetupFactories list of SetupFactories to be ignored + * * @dataProvider getSpecialFullTextCases */ public function testIndexingSpecialFullTextCases($text, $searchForText) @@ -957,13 +959,13 @@ public function testRemovedContentFieldValueIsNotFound() $criterion = new Criterion\FullText('descriptionToBeRemoved'); $query = new Query(['filter' => $criterion]); $results = $searchService->findContent($query); - $this->assertEquals(0, $results->totalCount); + self::assertEquals(0, $results->totalCount); // Should be found $criterion = new Criterion\FullText('testRemovedContentFieldValueIsNotFound'); $query = new Query(['filter' => $criterion]); $results = $searchService->findContent($query); - $this->assertEquals(1, $results->totalCount); + self::assertEquals(1, $results->totalCount); } /** @@ -979,7 +981,7 @@ private function assertSubtreeInvisibleProperty(SearchService $searchService, $p $query = new LocationQuery(['filter' => $criterion]); $result = $searchService->findLocations($query); foreach ($result->searchHits as $searchHit) { - $this->assertEquals($expected, $searchHit->valueObject->invisible, sprintf('Location %s is not hidden', $searchHit->valueObject->id)); + self::assertEquals($expected, $searchHit->valueObject->invisible, sprintf('Location %s is not hidden', $searchHit->valueObject->id)); // Perform recursive check for children locations $this->assertSubtreeInvisibleProperty($searchService, $searchHit->valueObject->id, $expected); } @@ -1007,15 +1009,15 @@ public function testSwapLocation() $criterion = new Criterion\LocationId($location01->id); $query = new Query(['filter' => $criterion]); $results = $searchService->findContent($query); - $this->assertEquals(1, $results->totalCount); - $this->assertEquals($content02->id, $results->searchHits[0]->valueObject->id); + self::assertEquals(1, $results->totalCount); + self::assertEquals($content02->id, $results->searchHits[0]->valueObject->id); // content01 should be at location02 $criterion = new Criterion\LocationId($location02->id); $query = new Query(['filter' => $criterion]); $results = $searchService->findContent($query); - $this->assertEquals(1, $results->totalCount); - $this->assertEquals($content01->id, $results->searchHits[0]->valueObject->id); + self::assertEquals(1, $results->totalCount); + self::assertEquals($content01->id, $results->searchHits[0]->valueObject->id); } /** @@ -1046,27 +1048,27 @@ public function testUpdateContentMetadata() $criterion = new Criterion\ContentId($publishedContent->id); $query = new Query(['filter' => $criterion]); $results = $searchService->findContentInfo($query); - $this->assertEquals(1, $results->totalCount); - $this->assertEquals($publishedContent->contentInfo->id, $results->searchHits[0]->valueObject->id); + self::assertEquals(1, $results->totalCount); + self::assertEquals($publishedContent->contentInfo->id, $results->searchHits[0]->valueObject->id); // find Content using updated RemoteId $criterion = new Criterion\RemoteId($newContentMetadataUpdateStruct->remoteId); $query = new Query(['filter' => $criterion]); $results = $searchService->findContent($query); - $this->assertEquals(1, $results->totalCount); + self::assertEquals(1, $results->totalCount); $foundContentInfo = $results->searchHits[0]->valueObject->contentInfo; /** @var \Ibexa\Core\Repository\Values\Content\Content $foundContentInfo */ - $this->assertEquals($publishedContent->id, $foundContentInfo->id); - $this->assertEquals($newContentMetadataUpdateStruct->publishedDate->getTimestamp(), $foundContentInfo->publishedDate->getTimestamp()); - $this->assertEquals($newLocation->id, $foundContentInfo->mainLocationId); - $this->assertEquals($newContentMetadataUpdateStruct->remoteId, $foundContentInfo->remoteId); + self::assertEquals($publishedContent->id, $foundContentInfo->id); + self::assertEquals($newContentMetadataUpdateStruct->publishedDate->getTimestamp(), $foundContentInfo->publishedDate->getTimestamp()); + self::assertEquals($newLocation->id, $foundContentInfo->mainLocationId); + self::assertEquals($newContentMetadataUpdateStruct->remoteId, $foundContentInfo->remoteId); // find Content using old main location $criterion = new Criterion\LocationId($originalMainLocationId); $query = new LocationQuery(['filter' => $criterion]); $results = $searchService->findLocations($query); - $this->assertEquals(1, $results->totalCount); - $this->assertEquals($newContentMetadataUpdateStruct->remoteId, $results->searchHits[0]->valueObject->contentInfo->remoteId); + self::assertEquals(1, $results->totalCount); + self::assertEquals($newContentMetadataUpdateStruct->remoteId, $results->searchHits[0]->valueObject->contentInfo->remoteId); } /** @@ -1345,12 +1347,12 @@ protected function assertContentIdSearch($contentId, $expectedCount) $query = new Query(['filter' => $criterion]); $result = $searchService->findContent($query); - $this->assertEquals($expectedCount, $result->totalCount); + self::assertEquals($expectedCount, $result->totalCount); if ($expectedCount == 0) { return; } - $this->assertEquals( + self::assertEquals( $contentId, $result->searchHits[0]->valueObject->id ); diff --git a/tests/integration/Core/Repository/SearchService/DeleteTranslationTest.php b/tests/integration/Core/Repository/SearchService/DeleteTranslationTest.php index acbf0b80d0..2a6fb1d88a 100644 --- a/tests/integration/Core/Repository/SearchService/DeleteTranslationTest.php +++ b/tests/integration/Core/Repository/SearchService/DeleteTranslationTest.php @@ -21,6 +21,7 @@ * Test case for delete content translation with the SearchService. * * @covers \Ibexa\Contracts\Core\Repository\SearchService + * * @group integration * @group search */ @@ -95,12 +96,12 @@ public function testDeleteContentTranslation(): void $this->refreshSearch($repository); $searchResult = $this->findContent('Kontakt', 'ger-DE'); - $this->assertEquals(1, $searchResult->totalCount); + self::assertEquals(1, $searchResult->totalCount); $contentService->deleteTranslation($testContent->contentInfo, 'ger-DE'); $this->refreshSearch($repository); $searchResult = $this->findContent('Kontakt', 'ger-DE'); - $this->assertEquals( + self::assertEquals( 0, $searchResult->totalCount, 'Found reference to the deleted Content translation' @@ -108,7 +109,7 @@ public function testDeleteContentTranslation(): void // check if unrelated items were not affected $searchResult = $this->findContent('OtherGerContent', 'ger-DE'); - $this->assertEquals(1, $searchResult->totalCount, 'Unrelated translation was deleted'); + self::assertEquals(1, $searchResult->totalCount, 'Unrelated translation was deleted'); } /** @@ -129,12 +130,12 @@ public function testDeleteContentTranslationWithContentRemovePolicy(): void $searchResult = $this->findContent('Kontakt', 'ger-DE'); - $this->assertEquals(1, $searchResult->totalCount); + self::assertEquals(1, $searchResult->totalCount); $contentService->deleteTranslation($testContent->contentInfo, 'ger-DE'); $this->refreshSearch($repository); $searchResult = $this->findContent('Kontakt', 'ger-DE'); - $this->assertEquals(0, $searchResult->totalCount); + self::assertEquals(0, $searchResult->totalCount); } /** diff --git a/tests/integration/Core/Repository/SearchServiceAuthorizationTest.php b/tests/integration/Core/Repository/SearchServiceAuthorizationTest.php index 43fc1fb583..c34d3713c9 100644 --- a/tests/integration/Core/Repository/SearchServiceAuthorizationTest.php +++ b/tests/integration/Core/Repository/SearchServiceAuthorizationTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; @@ -15,7 +16,9 @@ * Test case for operations in the SearchService. * * @covers \Ibexa\Contracts\Core\Repository\SearchService + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testLoadUser + * * @group integration * @group authorization */ @@ -25,6 +28,7 @@ class SearchServiceAuthorizationTest extends BaseTest * Test for the findContent() method but with anonymous user. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\SearchServiceTest::testFindContentFiltered */ public function testFindContent() @@ -55,6 +59,7 @@ public function testFindContent() * Test for the findContent() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContent() + * * @depends Ibexa\Tests\Integration\Core\Repository\SearchServiceTest::testFindContentFiltered */ public function testFindContentEmptyResult() @@ -88,6 +93,7 @@ public function testFindContentEmptyResult() * Test for the findSingle() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findSingle() + * * @depends Ibexa\Tests\Integration\Core\Repository\SearchServiceTest::testFindSingle */ public function testFindSingleThrowsNotFoundException() @@ -120,6 +126,7 @@ public function testFindSingleThrowsNotFoundException() * Test for the findContent() method, verifying disabling permissions. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::findContent($query, $languageFilter, $filterOnUserPermissions) + * * @depends Ibexa\Tests\Integration\Core\Repository\SearchServiceAuthorizationTest::testFindContent */ public function testFindContentWithUserPermissionFilter() @@ -150,14 +157,15 @@ public function testFindContentWithUserPermissionFilter() $searchResultWithPermissions = $searchService->findContent($query, []); /* END: Use Case */ - $this->assertEquals(1, $searchResultWithoutPermissions->totalCount); - $this->assertEquals(0, $searchResultWithPermissions->totalCount); + self::assertEquals(1, $searchResultWithoutPermissions->totalCount); + self::assertEquals(0, $searchResultWithPermissions->totalCount); } /** * Test for the findSingle() method disabling permission filtering. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::findSingle($query, $languageFilter, $filterOnUserPermissions) + * * @depends Ibexa\Tests\Integration\Core\Repository\SearchServiceAuthorizationTest::testFindContent */ public function testFindSingleWithUserPermissionFilter() @@ -189,6 +197,7 @@ public function testFindSingleWithUserPermissionFilter() * Test for the findSingle() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::findSingle($query, $languageFilter, $filterOnUserPermissions) + * * @depends Ibexa\Tests\Integration\Core\Repository\SearchServiceAuthorizationTest::testFindContent */ public function testFindSingleThrowsNotFoundExceptionWithUserPermissionFilter() diff --git a/tests/integration/Core/Repository/SearchServiceFulltextTest.php b/tests/integration/Core/Repository/SearchServiceFulltextTest.php index a1af8b37a8..6f9be645af 100644 --- a/tests/integration/Core/Repository/SearchServiceFulltextTest.php +++ b/tests/integration/Core/Repository/SearchServiceFulltextTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\SearchService; @@ -20,6 +21,7 @@ * Test case for full text search in the SearchService. * * @covers \Ibexa\Contracts\Core\Repository\SearchService + * * @group integration * @group search * @group fulltext @@ -35,7 +37,7 @@ protected function setUp(): void ->getRepository(false) ->getSearchService()->supports(SearchService::CAPABILITY_ADVANCED_FULLTEXT) ) { - $this->markTestSkipped('Engine says it does not support advance fulltext format'); + self::markTestSkipped('Engine says it does not support advance fulltext format'); } } @@ -180,12 +182,13 @@ public function providerForTestFulltextSearchSolr7(): array * @param array $idMap * * @depends testPrepareContent + * * @dataProvider providerForTestFulltextSearchSolr7 */ public function testFulltextContentSearchSolr7(string $searchString, array $expectedKeys, array $idMap): void { if (false === $this->isSolrMajorVersionInRange('7.0.0', '8.0.0')) { - $this->markTestSkipped('This test is only relevant for Solr >= 7'); + self::markTestSkipped('This test is only relevant for Solr >= 7'); } $this->doTestFulltextContentSearch($searchString, $expectedKeys, $idMap); @@ -210,12 +213,13 @@ private function doTestFulltextContentSearch(string $searchString, array $expect * @param array $idMap * * @depends testPrepareContent + * * @dataProvider providerForTestFulltextSearchSolr7 */ public function testFulltextLocationSearchSolr7($searchString, array $expectedKeys, array $idMap): void { if (false === $this->isSolrMajorVersionInRange('7.0.0', '8.0.0')) { - $this->markTestSkipped('This test is only relevant for Solr >= 7'); + self::markTestSkipped('This test is only relevant for Solr >= 7'); } $this->doTestFulltextLocationSearch($searchString, $expectedKeys, $idMap); @@ -241,7 +245,7 @@ private function doTestFulltextLocationSearch($searchString, array $expectedKeys */ public function assertFulltextSearch(SearchResult $searchResult, array $expectedKeys, array $idMap) { - $this->assertEquals( + self::assertEquals( array_reduce( $expectedKeys, static function ($carry, $item) { @@ -257,7 +261,7 @@ static function ($carry, $item) { $expectedIds = $this->mapKeysToIds($expectedKeys, $idMap); $actualIds = $this->mapSearchResultToIds($searchResult); - $this->assertEquals($expectedIds, $actualIds); + self::assertEquals($expectedIds, $actualIds); } /** diff --git a/tests/integration/Core/Repository/SearchServiceLocationTest.php b/tests/integration/Core/Repository/SearchServiceLocationTest.php index 374ae91784..44290ec70a 100644 --- a/tests/integration/Core/Repository/SearchServiceLocationTest.php +++ b/tests/integration/Core/Repository/SearchServiceLocationTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException; @@ -23,6 +24,7 @@ * Test case for Location operations in the SearchService. * * @covers \Ibexa\Contracts\Core\Repository\SearchService + * * @group integration * @group search */ @@ -221,14 +223,14 @@ public function testFieldIsEmptyInLocation() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(2, $result->totalCount); + self::assertEquals(2, $result->totalCount); - $this->assertEquals( + self::assertEquals( $testContents[0]->contentInfo->mainLocationId, $result->searchHits[0]->valueObject->id ); - $this->assertEquals( + self::assertEquals( $testContents[1]->contentInfo->mainLocationId, $result->searchHits[1]->valueObject->id ); @@ -256,9 +258,9 @@ public function testFieldIsNotEmptyInLocation() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); + self::assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals( $testContents[2]->contentInfo->mainLocationId, $result->searchHits[0]->valueObject->id ); @@ -287,8 +289,8 @@ public function testFieldCollectionContains() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $testContent->contentInfo->mainLocationId, $result->searchHits[0]->valueObject->id ); @@ -298,6 +300,7 @@ public function testFieldCollectionContains() * Test for the findLocations() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findLocations() + * * @depends Ibexa\Tests\Integration\Core\Repository\SearchServiceTest::testFieldCollectionContains */ public function testFieldCollectionContainsNoMatch() @@ -317,7 +320,7 @@ public function testFieldCollectionContainsNoMatch() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(0, $result->totalCount); + self::assertEquals(0, $result->totalCount); } /** @@ -344,8 +347,8 @@ public function testNonPrintableUtf8Characters(): void $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $folder->contentInfo->mainLocationId, $result->searchHits[0]->valueObject->id ); @@ -364,7 +367,7 @@ public function testEscapedNonPrintableUtf8Characters(): void $setupFactory = $this->getSetupFactory(); if (!$setupFactory instanceof LegacySolrSetupFactory) { - $this->markTestIncomplete( + self::markTestIncomplete( 'Field Value mappers are used only with Solr and Elastic search engines' ); } @@ -384,7 +387,7 @@ public function testEscapedNonPrintableUtf8Characters(): void $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); + self::assertEquals(1, $result->totalCount); } public function testInvalidFieldIdentifierRange() @@ -503,7 +506,7 @@ public function testQueryModifiedField() { // Check using get_class since the others extend SetupFactory\Legacy if ($this->getSetupFactory() instanceof Legacy) { - $this->markTestIncomplete( + self::markTestIncomplete( 'Custom fields not supported by LegacySE ' . '(@todo: Legacy should fallback to just querying normal field so this should be tested here)' ); @@ -566,6 +569,7 @@ protected function createTestPlaceContentType() * Test for the findLocations() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findLocations() + * * @group maplocation */ public function testMapLocationDistanceLessThanOrEqual() @@ -636,8 +640,8 @@ public function testMapLocationDistanceLessThanOrEqual() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $wildBoars->contentInfo->mainLocationId, $result->searchHits[0]->valueObject->id ); @@ -647,6 +651,7 @@ public function testMapLocationDistanceLessThanOrEqual() * Test for the findLocations() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findLocations() + * * @group maplocation */ public function testMapLocationDistanceGreaterThanOrEqual() @@ -717,8 +722,8 @@ public function testMapLocationDistanceGreaterThanOrEqual() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $tree->contentInfo->mainLocationId, $result->searchHits[0]->valueObject->id ); @@ -728,6 +733,7 @@ public function testMapLocationDistanceGreaterThanOrEqual() * Test for the findLocations() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findLocations() + * * @group maplocation */ public function testMapLocationDistanceBetween() @@ -814,8 +820,8 @@ public function testMapLocationDistanceBetween() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $mushrooms->contentInfo->mainLocationId, $result->searchHits[0]->valueObject->id ); @@ -825,6 +831,7 @@ public function testMapLocationDistanceBetween() * Test for the findLocations() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findLocations() + * * @group maplocation */ public function testMapLocationDistanceSortAscending() @@ -924,16 +931,16 @@ public function testMapLocationDistanceSortAscending() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(3, $result->totalCount); - $this->assertEquals( + self::assertEquals(3, $result->totalCount); + self::assertEquals( $wildBoars->contentInfo->mainLocationId, $result->searchHits[0]->valueObject->id ); - $this->assertEquals( + self::assertEquals( $mushrooms->contentInfo->mainLocationId, $result->searchHits[1]->valueObject->id ); - $this->assertEquals( + self::assertEquals( $tree->contentInfo->mainLocationId, $result->searchHits[2]->valueObject->id ); @@ -943,6 +950,7 @@ public function testMapLocationDistanceSortAscending() * Test for the findLocations() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findLocations() + * * @group maplocation */ public function testMapLocationDistanceSortDescending() @@ -1042,16 +1050,16 @@ public function testMapLocationDistanceSortDescending() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(3, $result->totalCount); - $this->assertEquals( + self::assertEquals(3, $result->totalCount); + self::assertEquals( $wildBoars->contentInfo->mainLocationId, $result->searchHits[2]->valueObject->id ); - $this->assertEquals( + self::assertEquals( $mushrooms->contentInfo->mainLocationId, $result->searchHits[1]->valueObject->id ); - $this->assertEquals( + self::assertEquals( $tree->contentInfo->mainLocationId, $result->searchHits[0]->valueObject->id ); @@ -1061,6 +1069,7 @@ public function testMapLocationDistanceSortDescending() * Test for the findLocations() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findLocations() + * * @group maplocation */ public function testMapLocationDistanceWithCustomField() @@ -1134,8 +1143,8 @@ public function testMapLocationDistanceWithCustomField() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $wildBoars->contentInfo->mainLocationId, $result->searchHits[0]->valueObject->id ); @@ -1145,6 +1154,7 @@ public function testMapLocationDistanceWithCustomField() * Test for the findLocations() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findLocations() + * * @group maplocation */ public function testMapLocationDistanceWithCustomFieldSort() @@ -1247,16 +1257,16 @@ public function testMapLocationDistanceWithCustomFieldSort() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(3, $result->totalCount); - $this->assertEquals( + self::assertEquals(3, $result->totalCount); + self::assertEquals( $wildBoars->contentInfo->mainLocationId, $result->searchHits[2]->valueObject->id ); - $this->assertEquals( + self::assertEquals( $mushrooms->contentInfo->mainLocationId, $result->searchHits[1]->valueObject->id ); - $this->assertEquals( + self::assertEquals( $tree->contentInfo->mainLocationId, $result->searchHits[0]->valueObject->id ); @@ -1333,14 +1343,14 @@ public function testVisibilityCriterionWithHiddenContent() //Sanity check for visible locations $result = $searchService->findLocations($query); - $this->assertEquals(3, $result->totalCount); + self::assertEquals(3, $result->totalCount); //Hide main content $contentService->hideContent($publishedContent->contentInfo); $this->refreshSearch($repository); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); + self::assertEquals(1, $result->totalCount); //Query for invisible content $hiddenQuery = new LocationQuery([ @@ -1355,7 +1365,7 @@ public function testVisibilityCriterionWithHiddenContent() ]); $result = $searchService->findLocations($hiddenQuery); - $this->assertEquals(2, $result->totalCount); + self::assertEquals(2, $result->totalCount); } /** @@ -1373,7 +1383,7 @@ protected function assertQueryFixture(LocationQuery $query, $fixture, $closure = $result = $searchService->findLocations($query); $this->simplifySearchResult($result); } catch (NotImplementedException $e) { - $this->markTestSkipped( + self::markTestSkipped( 'This feature is not supported by the current search backend: ' . $e->getMessage() ); } @@ -1384,9 +1394,9 @@ protected function assertQueryFixture(LocationQuery $query, $fixture, $closure = $record = $fixture . '.recording', "<?php\n\nreturn " . var_export($result, true) . ";\n\n" ); - $this->markTestIncomplete("No fixture available. Result recorded at $record. Result: \n" . $this->printResult($result)); + self::markTestIncomplete("No fixture available. Result recorded at $record. Result: \n" . $this->printResult($result)); } else { - $this->markTestIncomplete("No fixture available. Set \$_ENV['ibexa_tests_record'] to generate:\n " . $fixture); + self::markTestIncomplete("No fixture available. Set \$_ENV['ibexa_tests_record'] to generate:\n " . $fixture); } } @@ -1422,7 +1432,7 @@ protected function assertQueryFixture(LocationQuery $query, $fixture, $closure = } } - $this->assertEqualsWithDelta( + self::assertEqualsWithDelta( $fixture, $result, .2, // Be quite generous regarding delay -- most important for scores diff --git a/tests/integration/Core/Repository/SearchServiceTest.php b/tests/integration/Core/Repository/SearchServiceTest.php index a2175606e2..5cba1e7b62 100644 --- a/tests/integration/Core/Repository/SearchServiceTest.php +++ b/tests/integration/Core/Repository/SearchServiceTest.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\Integration\Core\Repository; use function count; @@ -28,6 +29,7 @@ * Test case for operations in the SearchService. * * @covers \Ibexa\Contracts\Core\Repository\SearchService + * * @group integration * @group search */ @@ -1188,6 +1190,7 @@ public function testRelationContentCreation() * @dataProvider getRelationFieldFilterSearches * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContentInfo() + * * @depends testRelationContentCreation */ public function testFindRelationFieldContentInfoFiltered($queryData, $fixture) @@ -1203,6 +1206,7 @@ public function testFindRelationFieldContentInfoFiltered($queryData, $fixture) * @dataProvider getRelationFieldFilterSearches * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findLocations() + * * @depends testRelationContentCreation */ public function testFindRelationFieldLocationsFiltered($queryData, $fixture) @@ -1223,7 +1227,7 @@ public function testFindSingle() ) ); - $this->assertEquals( + self::assertEquals( 4, $content->id ); @@ -1243,11 +1247,11 @@ public function testFindNoPerformCount() $searchHit = $searchService->findContent($query); if ($this->isRunningOnLegacySetup()) { - $this->assertNull( + self::assertNull( $searchHit->totalCount ); } else { - $this->assertEquals( + self::assertEquals( 2, $searchHit->totalCount ); @@ -1259,7 +1263,7 @@ public function testFindNoPerformCountException() $this->expectException(\RuntimeException::class); if (!$this->isRunningOnLegacySetup()) { - $this->markTestSkipped('Only applicable to Legacy/DB based search'); + self::markTestSkipped('Only applicable to Legacy/DB based search'); } $repository = $this->getRepository(); @@ -1289,11 +1293,11 @@ public function testFindLocationsNoPerformCount() $searchHit = $searchService->findLocations($query); if ($this->isRunningOnLegacySetup()) { - $this->assertNull( + self::assertNull( $searchHit->totalCount ); } else { - $this->assertEquals( + self::assertEquals( 2, $searchHit->totalCount ); @@ -1305,7 +1309,7 @@ public function testFindLocationsNoPerformCountException() $this->expectException(\RuntimeException::class); if (!$this->isRunningOnLegacySetup()) { - $this->markTestSkipped('Only applicable to Legacy/DB based search'); + self::markTestSkipped('Only applicable to Legacy/DB based search'); } $repository = $this->getRepository(); @@ -1465,13 +1469,13 @@ public function testFieldIsEmpty() $searchService = $repository->getSearchService(); $result = $searchService->findContent($query, ['eng-GB']); - $this->assertEquals(2, $result->totalCount); + self::assertEquals(2, $result->totalCount); - $this->assertEquals( + self::assertEquals( $testContents[0]->id, $result->searchHits[0]->valueObject->id ); - $this->assertEquals( + self::assertEquals( $testContents[1]->id, $result->searchHits[1]->valueObject->id ); @@ -1501,8 +1505,8 @@ public function testFieldIsNotEmpty() $searchService = $repository->getSearchService(); $result = $searchService->findContent($query, ['eng-GB']); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $testContents[2]->id, $result->searchHits[0]->valueObject->id ); @@ -1531,8 +1535,8 @@ public function testFieldCollectionContains() $searchService = $repository->getSearchService(); $result = $searchService->findContent($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $testContent->id, $result->searchHits[0]->valueObject->id ); @@ -1542,6 +1546,7 @@ public function testFieldCollectionContains() * Test for the findContent() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContent() + * * @depends testFieldCollectionContains */ public function testFieldCollectionContainsNoMatch() @@ -1561,7 +1566,7 @@ public function testFieldCollectionContainsNoMatch() $searchService = $repository->getSearchService(); $result = $searchService->findContent($query); - $this->assertEquals(0, $result->totalCount); + self::assertEquals(0, $result->totalCount); } public function testInvalidFieldIdentifierRange() @@ -2336,6 +2341,7 @@ public function providerForTestMultilingualFieldSort() * Test for the findContent() method. * * @group rrr + * * @dataProvider providerForTestMultilingualFieldSort * * @param array $contentDataList @@ -2361,6 +2367,7 @@ public function testMultilingualFieldSortContent( * Test for the findLocations() method. * * @group rrr + * * @dataProvider providerForTestMultilingualFieldSort * * @param array $contentDataList @@ -2451,14 +2458,14 @@ protected function assertMultilingualFieldSort( $result = $searchService->findLocations($query, $languageSettings); } - $this->assertEquals(count($expected), $result->totalCount); + self::assertEquals(count($expected), $result->totalCount); $expectedIdList = []; foreach ($expected as $contentNumber) { $expectedIdList[] = $contentIdList[$contentNumber]; } - $this->assertEquals($expectedIdList, $this->mapResultContentIds($result)); + self::assertEquals($expectedIdList, $this->mapResultContentIds($result)); } public function providerForTestMultilingualFieldFilter() @@ -2624,6 +2631,7 @@ public function providerForTestMultilingualFieldFilter() * Test for the findContent() method. * * @group ttt + * * @dataProvider providerForTestMultilingualFieldFilter * * @param array $contentDataList @@ -2649,6 +2657,7 @@ public function testMultilingualFieldFilterContent( * Test for the findLocations() method. * * @group ttt + * * @dataProvider providerForTestMultilingualFieldFilter * * @param array $contentDataList @@ -2744,14 +2753,14 @@ protected function assertMultilingualFieldFilter( $result = $searchService->findLocations($query, $languageSettings); } - $this->assertEquals(count($expected), $result->totalCount); + self::assertEquals(count($expected), $result->totalCount); $expectedIdList = []; foreach ($expected as $contentNumber) { $expectedIdList[] = $contentIdList[$contentNumber]; } - $this->assertEquals($expectedIdList, $this->mapResultContentIds($result)); + self::assertEquals($expectedIdList, $this->mapResultContentIds($result)); } /** @@ -2887,7 +2896,7 @@ public function testQueryModifiedField() { // Check using get_class since the others extend SetupFactory\Legacy if ($this->getSetupFactory() instanceof Legacy) { - $this->markTestIncomplete( + self::markTestIncomplete( 'Custom fields not supported by LegacySE ' . '(@todo: Legacy should fallback to just querying normal field so this should be tested here)' ); @@ -2927,7 +2936,7 @@ public function testSortModifiedField() { // Check using get_class since the others extend SetupFactory\Legacy if ($this->getSetupFactory() instanceof Legacy) { - $this->markTestIncomplete( + self::markTestIncomplete( 'Custom field sort not supported by LegacySE ' . '(@todo: Legacy should fallback to just querying normal field so this should be tested here)' ); @@ -2989,6 +2998,7 @@ protected function createTestPlaceContentType() * Test for the findContent() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContent() + * * @group maplocation */ public function testMapLocationDistanceLessThanOrEqual() @@ -3058,8 +3068,8 @@ public function testMapLocationDistanceLessThanOrEqual() $searchService = $repository->getSearchService(); $result = $searchService->findContent($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $wildBoars->id, $result->searchHits[0]->valueObject->id ); @@ -3069,6 +3079,7 @@ public function testMapLocationDistanceLessThanOrEqual() * Test for the findContent() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContent() + * * @group maplocation */ public function testMapLocationDistanceGreaterThanOrEqual() @@ -3138,8 +3149,8 @@ public function testMapLocationDistanceGreaterThanOrEqual() $searchService = $repository->getSearchService(); $result = $searchService->findContent($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $tree->id, $result->searchHits[0]->valueObject->id ); @@ -3149,6 +3160,7 @@ public function testMapLocationDistanceGreaterThanOrEqual() * Test for the findContent() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContent() + * * @group maplocation */ public function testMapLocationDistanceBetween() @@ -3234,8 +3246,8 @@ public function testMapLocationDistanceBetween() $searchService = $repository->getSearchService(); $result = $searchService->findContent($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $mushrooms->id, $result->searchHits[0]->valueObject->id ); @@ -3253,6 +3265,7 @@ public function testMapLocationDistanceBetween() * (always very precise) and flat Earth (very imprecise for this use case) models. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContent() + * * @group maplocation */ public function testMapLocationDistanceBetweenPolar() @@ -3306,8 +3319,8 @@ public function testMapLocationDistanceBetweenPolar() $searchService = $repository->getSearchService(); $result = $searchService->findContent($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $polarBear->id, $result->searchHits[0]->valueObject->id ); @@ -3317,6 +3330,7 @@ public function testMapLocationDistanceBetweenPolar() * Test for the findContent() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContent() + * * @group maplocation */ public function testMapLocationDistanceSortAscending() @@ -3415,16 +3429,16 @@ public function testMapLocationDistanceSortAscending() $searchService = $repository->getSearchService(); $result = $searchService->findContent($query); - $this->assertEquals(3, $result->totalCount); - $this->assertEquals( + self::assertEquals(3, $result->totalCount); + self::assertEquals( $wildBoars->id, $result->searchHits[0]->valueObject->id ); - $this->assertEquals( + self::assertEquals( $mushrooms->id, $result->searchHits[1]->valueObject->id ); - $this->assertEquals( + self::assertEquals( $tree->id, $result->searchHits[2]->valueObject->id ); @@ -3434,6 +3448,7 @@ public function testMapLocationDistanceSortAscending() * Test for the findContent() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContent() + * * @group maplocation */ public function testMapLocationDistanceSortDescending() @@ -3532,16 +3547,16 @@ public function testMapLocationDistanceSortDescending() $searchService = $repository->getSearchService(); $result = $searchService->findContent($query); - $this->assertEquals(3, $result->totalCount); - $this->assertEquals( + self::assertEquals(3, $result->totalCount); + self::assertEquals( $wildBoars->id, $result->searchHits[2]->valueObject->id ); - $this->assertEquals( + self::assertEquals( $mushrooms->id, $result->searchHits[1]->valueObject->id ); - $this->assertEquals( + self::assertEquals( $tree->id, $result->searchHits[0]->valueObject->id ); @@ -3551,6 +3566,7 @@ public function testMapLocationDistanceSortDescending() * Test for the findContent() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContent() + * * @group maplocation */ public function testMapLocationDistanceWithCustomField() @@ -3623,8 +3639,8 @@ public function testMapLocationDistanceWithCustomField() $searchService = $repository->getSearchService(); $result = $searchService->findContent($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals(1, $result->totalCount); + self::assertEquals( $wildBoars->id, $result->searchHits[0]->valueObject->id ); @@ -3634,6 +3650,7 @@ public function testMapLocationDistanceWithCustomField() * Test for the findContent() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContent() + * * @group maplocation */ public function testMapLocationDistanceWithCustomFieldSort() @@ -3735,16 +3752,16 @@ public function testMapLocationDistanceWithCustomFieldSort() $searchService = $repository->getSearchService(); $result = $searchService->findContent($query); - $this->assertEquals(3, $result->totalCount); - $this->assertEquals( + self::assertEquals(3, $result->totalCount); + self::assertEquals( $wildBoars->id, $result->searchHits[2]->valueObject->id ); - $this->assertEquals( + self::assertEquals( $mushrooms->id, $result->searchHits[1]->valueObject->id ); - $this->assertEquals( + self::assertEquals( $tree->id, $result->searchHits[0]->valueObject->id ); @@ -3791,8 +3808,8 @@ public function testFindMainLocation() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals($plainSiteLocationId, $result->searchHits[0]->valueObject->id); + self::assertEquals(1, $result->totalCount); + self::assertEquals($plainSiteLocationId, $result->searchHits[0]->valueObject->id); } /** @@ -3835,8 +3852,8 @@ public function testFindNonMainLocation() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(1, $result->totalCount); - $this->assertEquals($newLocation->id, $result->searchHits[0]->valueObject->id); + self::assertEquals(1, $result->totalCount); + self::assertEquals($newLocation->id, $result->searchHits[0]->valueObject->id); } /** @@ -3877,9 +3894,9 @@ public function testSortMainLocationAscending() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(2, $result->totalCount); - $this->assertEquals($newLocation->id, $result->searchHits[0]->valueObject->id); - $this->assertEquals($plainSiteLocationId, $result->searchHits[1]->valueObject->id); + self::assertEquals(2, $result->totalCount); + self::assertEquals($newLocation->id, $result->searchHits[0]->valueObject->id); + self::assertEquals($plainSiteLocationId, $result->searchHits[1]->valueObject->id); } /** @@ -3920,9 +3937,9 @@ public function testSortMainLocationDescending() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(2, $result->totalCount); - $this->assertEquals($plainSiteLocationId, $result->searchHits[0]->valueObject->id); - $this->assertEquals($newLocation->id, $result->searchHits[1]->valueObject->id); + self::assertEquals(2, $result->totalCount); + self::assertEquals($plainSiteLocationId, $result->searchHits[0]->valueObject->id); + self::assertEquals($newLocation->id, $result->searchHits[1]->valueObject->id); } /** @@ -3962,15 +3979,15 @@ public function testContentWithMultipleLocations() $searchService = $repository->getSearchService(); $result = $searchService->findLocations($query); - $this->assertEquals(2, $result->totalCount); + self::assertEquals(2, $result->totalCount); $locationIds = array_map( static function (SearchHit $searchHit): int { return $searchHit->valueObject->id; }, $result->searchHits ); - $this->assertContains($location1->id, $locationIds); - $this->assertContains($location2->id, $locationIds); + self::assertContains($location1->id, $locationIds); + self::assertContains($location2->id, $locationIds); } protected function createContentForTestUserMetadataGroupHorizontal() @@ -4079,9 +4096,9 @@ public function testUserMetadataGroupHorizontalFilterContent($queryType = null) // in listeners yet, and also miss SPI methods to do it without using Search (also // needed to decouple services), because as indexing is asynchronous Search // should not eat its own dog food for reindexing. - $this->assertEquals(1, $result->totalCount); + self::assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals( $content->id, $result->searchHits[0]->valueObject->id ); @@ -4095,10 +4112,10 @@ public function testUserMetadataGroupHorizontalFilterContent($queryType = null) // and not present it base fixture. $foundContent1 = array_pop($result->searchHits); $result->totalCount = $result->totalCount - 1; - $this->assertEquals($content->id, $foundContent1->valueObject->id); + self::assertEquals($content->id, $foundContent1->valueObject->id); $this->simplifySearchResult($result); - $this->assertEqualsWithDelta( + self::assertEqualsWithDelta( include $this->getFixtureDir() . '/UserMetadata.php', $result, .1, // Be quite generous regarding delay -- most important for scores @@ -4169,9 +4186,9 @@ public function testUserMetadataGroupHorizontalFilterLocation($queryType = null) // in listeners yet, and also miss SPI methods to do it without using Search (also // needed to decouple services), because as indexing is asynchronous Search // should not eat its own dog food for reindexing. - $this->assertEquals(1, $result->totalCount); + self::assertEquals(1, $result->totalCount); - $this->assertEquals( + self::assertEquals( $content->contentInfo->mainLocationId, $result->searchHits[0]->valueObject->id ); @@ -4188,17 +4205,17 @@ public function testUserMetadataGroupHorizontalFilterLocation($queryType = null) // Remove additional Administrators UserGroup Location array_pop($result->searchHits); $result->totalCount = $result->totalCount - 2; - $this->assertEquals( + self::assertEquals( $content->versionInfo->contentInfo->mainLocationId, $foundLocation1->valueObject->id ); - $this->assertEquals( + self::assertEquals( $permissionResolver->getCurrentUserReference()->getUserId(), $foundLocation2->valueObject->contentId ); $this->simplifySearchResult($result); - $this->assertEqualsWithDelta( + self::assertEqualsWithDelta( include $this->getFixtureDir() . '/UserMetadataLocation.php', $result, .1, // Be quite generous regarding delay -- most important for scores @@ -4254,8 +4271,8 @@ public function testFullTextOnNewContent() $searchResult = $searchService->findContentInfo($query); - $this->assertEquals(1, $searchResult->totalCount); - $this->assertEquals($englishContent->id, $searchResult->searchHits[0]->valueObject->id); + self::assertEquals(1, $searchResult->totalCount); + self::assertEquals($englishContent->id, $searchResult->searchHits[0]->valueObject->id); } /** @@ -4265,7 +4282,7 @@ public function testFullTextOnNewContent() */ public function testLanguageAnalysisSeparateContent() { - $this->markTestSkipped('Language analysis is currently not supported'); + self::markTestSkipped('Language analysis is currently not supported'); $repository = $this->getRepository(); $contentService = $repository->getContentService(); @@ -4318,8 +4335,8 @@ public function testLanguageAnalysisSeparateContent() $searchResult = $searchService->findContent($query); - $this->assertEquals(1, $searchResult->totalCount); - $this->assertEquals($englishContent->id, $searchResult->searchHits[0]->valueObject->id); + self::assertEquals(1, $searchResult->totalCount); + self::assertEquals($englishContent->id, $searchResult->searchHits[0]->valueObject->id); } /** @@ -4329,7 +4346,7 @@ public function testLanguageAnalysisSeparateContent() */ public function testLanguageAnalysisSameContent() { - $this->markTestSkipped('Language analysis is currently not supported'); + self::markTestSkipped('Language analysis is currently not supported'); $repository = $this->getRepository(); $contentService = $repository->getContentService(); @@ -4368,8 +4385,8 @@ public function testLanguageAnalysisSameContent() $searchResult = $searchService->findContent($query); - $this->assertEquals(1, $searchResult->totalCount); - $this->assertEquals($mixedContent->id, $searchResult->searchHits[0]->valueObject->id); + self::assertEquals(1, $searchResult->totalCount); + self::assertEquals($mixedContent->id, $searchResult->searchHits[0]->valueObject->id); } /** @@ -4379,7 +4396,7 @@ public function testLanguageAnalysisSameContent() */ public function testLanguageAnalysisSameContentNotFound() { - $this->markTestSkipped('Language analysis is currently not supported'); + self::markTestSkipped('Language analysis is currently not supported'); $repository = $this->getRepository(); $contentService = $repository->getContentService(); @@ -4420,7 +4437,7 @@ public function testLanguageAnalysisSameContentNotFound() // not be correctly stemmed $searchResult = $searchService->findContent($query, ['languages' => ['eng-GB']]); - $this->assertEquals(0, $searchResult->totalCount); + self::assertEquals(0, $searchResult->totalCount); } /** @@ -4446,15 +4463,16 @@ public function testFindContentWithLanguageFilter() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( SearchResult::class, $searchResult ); - $this->assertEquals(1, $searchResult->totalCount); - $this->assertCount($searchResult->totalCount, $searchResult->searchHits); + self::assertEquals(1, $searchResult->totalCount); + self::assertNotNull($searchResult->totalCount); + self::assertCount($searchResult->totalCount, $searchResult->searchHits); foreach ($searchResult->searchHits as $searchHit) { - $this->assertInstanceOf( + self::assertInstanceOf( SearchHit::class, $searchHit ); @@ -4536,6 +4554,7 @@ public function testFulltextComplex() * Test for the findContent() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContent() + * * @depends testFulltextComplex * * @param array $data @@ -4553,34 +4572,35 @@ public function testFulltextContentSearchComplex(array $data) ); $searchHits = $searchResult->searchHits; - $this->assertEquals(3, $searchResult->totalCount); + self::assertEquals(3, $searchResult->totalCount); // Legacy search engine does have scoring, sorting the results by ID in that case $setupFactory = $this->getSetupFactory(); if ($setupFactory instanceof Legacy) { $this->sortSearchHitsById($searchHits); - $this->assertEquals($content1->id, $searchHits[0]->valueObject->id); - $this->assertEquals($content2->id, $searchHits[1]->valueObject->id); - $this->assertEquals($content3->id, $searchHits[2]->valueObject->id); + self::assertEquals($content1->id, $searchHits[0]->valueObject->id); + self::assertEquals($content2->id, $searchHits[1]->valueObject->id); + self::assertEquals($content3->id, $searchHits[2]->valueObject->id); return; } // Assert scores are descending - $this->assertGreaterThan($searchHits[1]->score, $searchHits[0]->score); - $this->assertGreaterThan($searchHits[2]->score, $searchHits[1]->score); + self::assertGreaterThan($searchHits[1]->score, $searchHits[0]->score); + self::assertGreaterThan($searchHits[2]->score, $searchHits[1]->score); // Assert order - $this->assertEquals($content1->id, $searchHits[0]->valueObject->id); - $this->assertEquals($content3->id, $searchHits[1]->valueObject->id); - $this->assertEquals($content2->id, $searchHits[2]->valueObject->id); + self::assertEquals($content1->id, $searchHits[0]->valueObject->id); + self::assertEquals($content3->id, $searchHits[1]->valueObject->id); + self::assertEquals($content2->id, $searchHits[2]->valueObject->id); } /** * Test for the findContent() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findContent() + * * @depends testFulltextComplex * * @param array $data @@ -4597,6 +4617,7 @@ public function testFulltextContentTranslationSearch(array $data) * Test for the findLocations() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findLocations() + * * @depends testFulltextComplex * * @param array $data @@ -4605,7 +4626,7 @@ public function testFulltextLocationSearchComplex(array $data) { $setupFactory = $this->getSetupFactory(); if ($setupFactory instanceof LegacySolrSetupFactory && getenv('SOLR_VERSION') === '4.10.4') { - $this->markTestSkipped('Skipping location search score test on Solr 4.10, you need Solr 6 for this!'); + self::markTestSkipped('Skipping location search score test on Solr 4.10, you need Solr 6 for this!'); } // Do not initialize from scratch @@ -4619,34 +4640,35 @@ public function testFulltextLocationSearchComplex(array $data) ); $searchHits = $searchResult->searchHits; - $this->assertEquals(3, $searchResult->totalCount); + self::assertEquals(3, $searchResult->totalCount); // Legacy search engine does have scoring, sorting the results by ID in that case $setupFactory = $this->getSetupFactory(); if ($setupFactory instanceof Legacy) { $this->sortSearchHitsById($searchHits); - $this->assertEquals($content1->id, $searchHits[0]->valueObject->contentId); - $this->assertEquals($content2->id, $searchHits[1]->valueObject->contentId); - $this->assertEquals($content3->id, $searchHits[2]->valueObject->contentId); + self::assertEquals($content1->id, $searchHits[0]->valueObject->contentId); + self::assertEquals($content2->id, $searchHits[1]->valueObject->contentId); + self::assertEquals($content3->id, $searchHits[2]->valueObject->contentId); return; } // Assert scores are descending - $this->assertGreaterThan($searchHits[1]->score, $searchHits[0]->score); - $this->assertGreaterThan($searchHits[2]->score, $searchHits[1]->score); + self::assertGreaterThan($searchHits[1]->score, $searchHits[0]->score); + self::assertGreaterThan($searchHits[2]->score, $searchHits[1]->score); // Assert order - $this->assertEquals($content1->id, $searchHits[0]->valueObject->contentId); - $this->assertEquals($content3->id, $searchHits[1]->valueObject->contentId); - $this->assertEquals($content2->id, $searchHits[2]->valueObject->contentId); + self::assertEquals($content1->id, $searchHits[0]->valueObject->contentId); + self::assertEquals($content3->id, $searchHits[1]->valueObject->contentId); + self::assertEquals($content2->id, $searchHits[2]->valueObject->contentId); } /** * Test for the findLocations() method. * * @covers \Ibexa\Contracts\Core\Repository\SearchService::findLocations() + * * @depends testFulltextComplex * * @param array $data @@ -4908,7 +4930,7 @@ public function testFieldCriterionForContentsWithIdenticalFieldIdentifiers() $searchService = $repository->getSearchService(); $result = $searchService->findContent($query); - $this->assertTrue(($result->totalCount === 1 || $result->totalCount === 2)); + self::assertTrue(($result->totalCount === 1 || $result->totalCount === 2)); } private function createContentWithFieldType( @@ -4998,7 +5020,7 @@ public function testRandomSortContent(?int $firstSeed, ?int $secondSeed) $searchService->findContent($secondQuery)->searchHits ); } catch (NotImplementedException $e) { - $this->markTestSkipped( + self::markTestSkipped( 'This feature is not supported by the current search backend: ' . $e->getMessage() ); } @@ -5044,7 +5066,7 @@ public function testRandomSortLocation(?int $firstSeed, ?int $secondSeed) $searchService->findLocations($secondQuery)->searchHits ); } catch (NotImplementedException $e) { - $this->markTestSkipped( + self::markTestSkipped( 'This feature is not supported by the current search backend: ' . $e->getMessage() ); } @@ -5078,7 +5100,7 @@ private function skipIfSeedNotImplemented() $db = $setupFactory->getDB(); if (in_array($db, ['sqlite', 'pgsql'])) { - $this->markTestSkipped( + self::markTestSkipped( 'Seed function is not implemented in ' . $db . '.' ); } @@ -5129,41 +5151,41 @@ private function assertFulltextSearchForTranslations(string $findMethod, Query $ * Search in German translations without always available */ $searchResult = $this->find($findMethod, $query, ['ger-DE'], false); - $this->assertEquals(1, $searchResult->totalCount); + self::assertEquals(1, $searchResult->totalCount); $this->assertSearchResultMatchTranslations($searchResult, ['ger-DE']); /* * Search in German translations with always available */ $searchResult = $this->find($findMethod, $query, ['ger-DE'], true); - $this->assertEquals(4, $searchResult->totalCount); + self::assertEquals(4, $searchResult->totalCount); $this->assertSearchResultMatchTranslations($searchResult, ['eng-GB', 'eng-GB', 'eng-GB', 'ger-DE']); /* * Search in multiple (ger-DE, eng-GB) translations without always available */ $searchResult = $this->find($findMethod, $query, ['ger-DE', 'eng-GB'], false); - $this->assertEquals(4, $searchResult->totalCount); + self::assertEquals(4, $searchResult->totalCount); $this->assertSearchResultMatchTranslations($searchResult, ['eng-GB', 'eng-GB', 'eng-GB', 'ger-DE']); /* * Search in multiple (eng-US, ger-DE) translations without always available */ $searchResult = $this->find($findMethod, $query, ['eng-US', 'ger-DE'], false); - $this->assertEquals(1, $searchResult->totalCount); + self::assertEquals(1, $searchResult->totalCount); $this->assertSearchResultMatchTranslations($searchResult, ['ger-DE']); /* * Search in eng-US translations without always available */ $searchResult = $this->find($findMethod, $query, ['eng-US'], false); - $this->assertEquals(0, $searchResult->totalCount); + self::assertEquals(0, $searchResult->totalCount); /* * Search in eng-US translations with always available */ $searchResult = $this->find($findMethod, $query, ['eng-US'], true); - $this->assertEquals(3, $searchResult->totalCount); + self::assertEquals(3, $searchResult->totalCount); $this->assertSearchResultMatchTranslations($searchResult, ['eng-GB', 'eng-GB', 'eng-GB']); } @@ -5191,7 +5213,7 @@ private function assertSearchResultMatchTranslations( $this->sortSearchHitsById($searchHits); for ($i = 0; $i < $searchResult->totalCount; ++$i) { - $this->assertEquals( + self::assertEquals( $translationsToMatch[$i], $searchHits[$i]->matchedTranslation ); diff --git a/tests/integration/Core/Repository/SearchServiceTranslationLanguageFallbackTest.php b/tests/integration/Core/Repository/SearchServiceTranslationLanguageFallbackTest.php index f9a919e276..16b5bdb2fd 100644 --- a/tests/integration/Core/Repository/SearchServiceTranslationLanguageFallbackTest.php +++ b/tests/integration/Core/Repository/SearchServiceTranslationLanguageFallbackTest.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\Integration\Core\Repository; use DateTime; @@ -19,6 +20,7 @@ * Test case for field filtering operations in the SearchService. * * @covers \Ibexa\Contracts\Core\Repository\SearchService + * * @group integration * @group search * @group language_fallback @@ -1707,6 +1709,7 @@ protected function getIndexName($indexMap) /** * @dataProvider providerForTestFind + * * @depends testCreateTestContent * * @param array $languageSettings @@ -1733,7 +1736,7 @@ public function testFindContent( $languageSettings ); - $this->assertEquals(count($contentDataList), $searchResult->totalCount); + self::assertEquals(count($contentDataList), $searchResult->totalCount); foreach ($contentDataList as $index => $contentData) { list($contentNo, $translationLanguageCode, $indexMap) = $contentData; @@ -1742,12 +1745,12 @@ public function testFindContent( /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content $content */ $content = $searchResult->searchHits[$index]->valueObject; - $this->assertEquals( + self::assertEquals( $data[$contentNo]['content']->id, $content->id ); $this->assertIndexName($indexMap, $searchResult->searchHits[$index]); - $this->assertEquals( + self::assertEquals( $translationLanguageCode, $searchResult->searchHits[$index]->matchedTranslation ); @@ -1756,6 +1759,7 @@ public function testFindContent( /** * @dataProvider providerForTestFind + * * @depends testCreateTestContent * * @param array $languageSettings @@ -1787,7 +1791,7 @@ public function testFindLocationsSingle( $languageSettings ); - $this->assertEquals(count($contentDataList), $searchResult->totalCount); + self::assertEquals(count($contentDataList), $searchResult->totalCount); foreach ($contentDataList as $index => $contentData) { list($contentNo, $translationLanguageCode, $indexMap) = $contentData; @@ -1796,12 +1800,12 @@ public function testFindLocationsSingle( /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location $location */ $location = $searchResult->searchHits[$index]->valueObject; - $this->assertEquals( + self::assertEquals( $data[$contentNo]['locations'][0]->id, $location->id ); $this->assertIndexName($indexMap, $searchResult->searchHits[$index]); - $this->assertEquals( + self::assertEquals( $translationLanguageCode, $searchResult->searchHits[$index]->matchedTranslation ); @@ -1810,6 +1814,7 @@ public function testFindLocationsSingle( /** * @dataProvider providerForTestFind + * * @depends testCreateTestContent * * @param array $languageSettings @@ -1837,7 +1842,7 @@ public function testFindLocationsMultiple( $languageSettings ); - $this->assertEquals(count($contentDataList) * 2, $searchResult->totalCount); + self::assertEquals(count($contentDataList) * 2, $searchResult->totalCount); foreach ($contentDataList as $index => $contentData) { list($contentNo, $translationLanguageCode, $indexMap) = $contentData; @@ -1846,12 +1851,12 @@ public function testFindLocationsMultiple( /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location $location */ $location = $searchResult->searchHits[$index]->valueObject; - $this->assertEquals( + self::assertEquals( $data[$contentNo]['locations'][0]->id, $location->id ); $this->assertIndexName($indexMap, $searchResult->searchHits[$index]); - $this->assertEquals( + self::assertEquals( $translationLanguageCode, $searchResult->searchHits[$index]->matchedTranslation ); @@ -1865,12 +1870,12 @@ public function testFindLocationsMultiple( /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location $location */ $location = $searchResult->searchHits[$realIndex]->valueObject; - $this->assertEquals( + self::assertEquals( $data[$contentNo]['locations'][1]->id, $location->id ); $this->assertIndexName($indexMap, $searchResult->searchHits[$realIndex]); - $this->assertEquals( + self::assertEquals( $translationLanguageCode, $searchResult->searchHits[$realIndex]->matchedTranslation ); @@ -1882,9 +1887,9 @@ private function assertIndexName(array $indexMap, SearchHit $searchHit): void $indexName = $this->getIndexName($indexMap); if ($indexName === null) { - $this->assertNull($searchHit->index); + self::assertNull($searchHit->index); } else { - $this->assertRegExp('~^' . $indexName . '$~', $searchHit->index); + self::assertRegExp('~^' . $indexName . '$~', $searchHit->index); } } diff --git a/tests/integration/Core/Repository/SectionServiceAuthorizationTest.php b/tests/integration/Core/Repository/SectionServiceAuthorizationTest.php index 29baeae5fb..26f1ca8531 100644 --- a/tests/integration/Core/Repository/SectionServiceAuthorizationTest.php +++ b/tests/integration/Core/Repository/SectionServiceAuthorizationTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -13,6 +14,7 @@ * Test case for operations in the SectionService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\SectionService + * * @group integration * @group authorization */ @@ -150,7 +152,7 @@ public function testLoadSectionsLoadsEmptyListForAnonymousUser() $sections = $sectionService->loadSections(); /* END: Use Case */ - $this->assertEquals([], $sections); + self::assertEquals([], $sections); } /** @@ -195,7 +197,7 @@ public function testLoadSectionFiltersSections() /* END: Use Case */ // Only Sections the user has access to should be loaded - $this->assertEquals([$expectedSection], $sections); + self::assertEquals([$expectedSection], $sections); } /** diff --git a/tests/integration/Core/Repository/SectionServiceTest.php b/tests/integration/Core/Repository/SectionServiceTest.php index 8ff940b9ca..65013edb14 100644 --- a/tests/integration/Core/Repository/SectionServiceTest.php +++ b/tests/integration/Core/Repository/SectionServiceTest.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\Integration\Core\Repository; use Exception; @@ -19,6 +20,7 @@ * Test case for operations in the SectionService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\SectionService + * * @group integration * @group section */ @@ -51,14 +53,14 @@ protected function setUp(): void ); if (false === is_object($contentInfo)) { - $this->markTestSkipped( + self::markTestSkipped( 'This test cannot be executed, because the utilized ' . 'ContentService::loadContentInfoByRemoteId() does not ' . 'return an object.' ); } } catch (Exception $e) { - $this->markTestSkipped( + self::markTestSkipped( 'This test cannot be executed, because the utilized ' . 'ContentService::loadContentInfoByRemoteId() failed with ' . PHP_EOL . PHP_EOL . @@ -85,13 +87,14 @@ public function testNewSectionCreateStruct() $sectionCreate = $sectionService->newSectionCreateStruct(); /* END: Use Case */ - $this->assertInstanceOf(SectionCreateStruct::class, $sectionCreate); + self::assertInstanceOf(SectionCreateStruct::class, $sectionCreate); } /** * Test for the createSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::createSection() + * * @depends testNewSectionCreateStruct */ public function testCreateSection() @@ -108,13 +111,14 @@ public function testCreateSection() $section = $sectionService->createSection($sectionCreate); /* END: Use Case */ - $this->assertInstanceOf(Section::class, $section); + self::assertInstanceOf(Section::class, $section); } /** * Test for the createSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::createSection() + * * @depends testNewSectionCreateStruct */ public function testCreateSectionForUserWithSectionLimitation() @@ -145,14 +149,15 @@ public function testCreateSectionForUserWithSectionLimitation() $section = $sectionService->createSection($sectionCreate); /* END: Use Case */ - $this->assertInstanceOf(Section::class, $section); - $this->assertSame(self::SECTION_UNIQUE_KEY, $section->identifier); + self::assertInstanceOf(Section::class, $section); + self::assertSame(self::SECTION_UNIQUE_KEY, $section->identifier); } /** * Test for the createSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::createSection() + * * @depends testCreateSection */ public function testCreateSectionThrowsInvalidArgumentException() @@ -183,6 +188,7 @@ public function testCreateSectionThrowsInvalidArgumentException() * Test for the loadSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::loadSection() + * * @depends testCreateSection */ public function testLoadSection() @@ -198,7 +204,7 @@ public function testLoadSection() $section = $sectionService->loadSection($sectionId); /* END: Use Case */ - $this->assertEquals('users', $section->identifier); + self::assertEquals('users', $section->identifier); } /** @@ -237,13 +243,14 @@ public function testNewSectionUpdateStruct() $sectionUpdate = $sectionService->newSectionUpdateStruct(); /* END: Use Case */ - $this->assertInstanceOf(SectionUpdateStruct::class, $sectionUpdate); + self::assertInstanceOf(SectionUpdateStruct::class, $sectionUpdate); } /** * Test for the updateSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::updateSection() + * * @depends testCreateSection * @depends testLoadSection * @depends testNewSectionUpdateStruct @@ -269,18 +276,19 @@ public function testUpdateSection() /* END: Use Case */ // Verify that service returns an instance of Section - $this->assertInstanceOf(Section::class, $updatedSection); + self::assertInstanceOf(Section::class, $updatedSection); // Verify that the service also persists the changes $updatedSection = $sectionService->loadSection($standardSectionId); - $this->assertEquals('New section name', $updatedSection->name); + self::assertEquals('New section name', $updatedSection->name); } /** * Test for the updateSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::updateSection() + * * @depends testCreateSection * @depends testLoadSection * @depends testNewSectionUpdateStruct @@ -321,7 +329,7 @@ public function testUpdateSectionForUserWithSectionLimitation() /* END: Use Case */ // Verify that service returns an instance of Section - $this->assertInstanceOf(Section::class, $updatedSection); + self::assertInstanceOf(Section::class, $updatedSection); // Load section as an administrator $administratorUser = $userService->loadUser($administratorUserId); @@ -330,14 +338,15 @@ public function testUpdateSectionForUserWithSectionLimitation() // Verify that the service also persists the changes $updatedSection = $sectionService->loadSection($section->id); - $this->assertEquals('New section name', $updatedSection->name); - $this->assertEquals('newUniqueKey', $updatedSection->identifier); + self::assertEquals('New section name', $updatedSection->name); + self::assertEquals('newUniqueKey', $updatedSection->identifier); } /** * Test for the updateSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::updateSection() + * * @depends testUpdateSection */ public function testUpdateSectionKeepsSectionIdentifierOnNameUpdate() @@ -358,13 +367,14 @@ public function testUpdateSectionKeepsSectionIdentifierOnNameUpdate() $updatedSection = $sectionService->updateSection($section, $sectionUpdate); /* END: Use Case */ - $this->assertEquals('standard', $updatedSection->identifier); + self::assertEquals('standard', $updatedSection->identifier); } /** * Test for the updateSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::updateSection() + * * @depends testUpdateSection */ public function testUpdateSectionWithSectionIdentifierOnNameUpdate() @@ -388,13 +398,14 @@ public function testUpdateSectionWithSectionIdentifierOnNameUpdate() $updatedSection = $sectionService->updateSection($section, $sectionUpdate); /* END: Use Case */ - $this->assertEquals('standard', $updatedSection->identifier); + self::assertEquals('standard', $updatedSection->identifier); } /** * Test for the updateSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::updateSection() + * * @depends testUpdateSection */ public function testUpdateSectionKeepsSectionNameOnIdentifierUpdate() @@ -416,13 +427,14 @@ public function testUpdateSectionKeepsSectionNameOnIdentifierUpdate() $updatedSection = $sectionService->updateSection($section, $sectionUpdate); /* END: Use Case */ - $this->assertEquals('Standard', $updatedSection->name); + self::assertEquals('Standard', $updatedSection->name); } /** * Test for the updateSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::updateSection() + * * @depends testUpdateSection */ public function testUpdateSectionThrowsInvalidArgumentException() @@ -460,6 +472,7 @@ public function testUpdateSectionThrowsInvalidArgumentException() * Test for the loadSections() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::loadSections() + * * @depends testCreateSection */ public function testLoadSections() @@ -475,13 +488,14 @@ public function testLoadSections() } /* END: Use Case */ - $this->assertCount(6, $sections); + self::assertCount(6, $sections); } /** * Test for the loadSections() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::loadSections() + * * @depends testCreateSection */ public function testLoadSectionsReturnsDefaultSectionsByDefault() @@ -490,7 +504,7 @@ public function testLoadSectionsReturnsDefaultSectionsByDefault() $sectionService = $repository->getSectionService(); - $this->assertEquals( + self::assertEquals( [ new Section( [ @@ -543,6 +557,7 @@ public function testLoadSectionsReturnsDefaultSectionsByDefault() * Test for the loadSectionByIdentifier() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::loadSectionByIdentifier() + * * @depends testCreateSection */ public function testLoadSectionByIdentifier() @@ -561,7 +576,7 @@ public function testLoadSectionByIdentifier() $section = $sectionService->loadSectionByIdentifier(self::SECTION_UNIQUE_KEY); /* END: Use Case */ - $this->assertEquals($sectionId, $section->id); + self::assertEquals($sectionId, $section->id); } /** @@ -606,7 +621,7 @@ public function testCountAssignedContents() ); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( 2, // Taken from the fixture $numberOfAssignedContent ); @@ -635,7 +650,7 @@ public function testIsSectionUsed() ); /* END: Use Case */ - $this->assertTrue( + self::assertTrue( // Taken from the fixture $isSectionUsed ); @@ -645,6 +660,7 @@ public function testIsSectionUsed() * Test for the assignSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::assignSection() + * * @depends testCountAssignedContents */ public function testAssignSection() @@ -684,13 +700,13 @@ public function testAssignSection() $sectionService->assignSection($contentInfo, $section); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( $beforeStandardCount + 1, $sectionService->countAssignedContents( $sectionService->loadSection($standardSectionId) ) ); - $this->assertEquals( + self::assertEquals( $beforeMediaCount - 1, $sectionService->countAssignedContents( $sectionService->loadSection($mediaSectionId) @@ -702,6 +718,7 @@ public function testAssignSection() * Test for the assignSectionToSubtree() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::assignSectionToSubtree() + * * @depends testCreateSection */ public function testAssignSectionToSubtree() @@ -736,13 +753,13 @@ public function testAssignSectionToSubtree() $sectionService->assignSectionToSubtree($location, $section); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( $beforeStandardCount + 4, $sectionService->countAssignedContents( $sectionService->loadSection($standardSectionId) ) ); - $this->assertEquals( + self::assertEquals( $beforeMediaCount - 4, $sectionService->countAssignedContents( $sectionService->loadSection($mediaSectionId) @@ -754,6 +771,7 @@ public function testAssignSectionToSubtree() * Test for the countAssignedContents() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::countAssignedContents() + * * @depends testCreateSection */ public function testCountAssignedContentsReturnsZeroByDefault() @@ -773,13 +791,14 @@ public function testCountAssignedContentsReturnsZeroByDefault() $assignedContents = $sectionService->countAssignedContents($section); /* END: Use Case */ - $this->assertSame(0, $assignedContents); + self::assertSame(0, $assignedContents); } /** * Test for the isSectionUsed() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::isSectionUsed() + * * @depends testCreateSection */ public function testIsSectionUsedReturnsZeroByDefault() @@ -799,13 +818,14 @@ public function testIsSectionUsedReturnsZeroByDefault() $isSectionUsed = $sectionService->isSectionUsed($section); /* END: Use Case */ - $this->assertFalse($isSectionUsed); + self::assertFalse($isSectionUsed); } /** * Test for the deleteSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::deleteSection() + * * @depends testLoadSections */ public function testDeleteSection() @@ -825,13 +845,14 @@ public function testDeleteSection() $sectionService->deleteSection($section); /* END: Use Case */ - $this->assertCount(6, $sectionService->loadSections()); + self::assertCount(6, $sectionService->loadSections()); } /** * Test for the deleteSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::deleteSection() + * * @depends testDeleteSection */ public function testDeleteSectionThrowsNotFoundException() @@ -861,6 +882,7 @@ public function testDeleteSectionThrowsNotFoundException() * Test for the deleteSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::deleteSection() + * * @depends testAssignSection */ public function testDeleteSectionThrowsBadStateException() @@ -898,6 +920,7 @@ public function testDeleteSectionThrowsBadStateException() * Test for the createSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::createSection() + * * @depends testCreateSection * @depends testLoadSectionByIdentifier */ @@ -936,13 +959,14 @@ public function testCreateSectionInTransactionWithRollback() } /* END: Use Case */ - $this->assertTrue(isset($e), 'Can still load section after rollback.'); + self::assertTrue(isset($e), 'Can still load section after rollback.'); } /** * Test for the createSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::createSection() + * * @depends testCreateSection * @depends testLoadSectionByIdentifier */ @@ -977,13 +1001,14 @@ public function testCreateSectionInTransactionWithCommit() $section = $sectionService->loadSectionByIdentifier(self::SECTION_UNIQUE_KEY); /* END: Use Case */ - $this->assertEquals(self::SECTION_UNIQUE_KEY, $section->identifier); + self::assertEquals(self::SECTION_UNIQUE_KEY, $section->identifier); } /** * Test for the createSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::createSection() + * * @depends testUpdateSection * @depends testLoadSectionByIdentifier */ @@ -1020,13 +1045,14 @@ public function testUpdateSectionInTransactionWithRollback() $updatedStandard = $sectionService->loadSectionByIdentifier('standard'); /* END: Use Case */ - $this->assertEquals('Standard', $updatedStandard->name); + self::assertEquals('Standard', $updatedStandard->name); } /** * Test for the createSection() method. * * @covers \Ibexa\Contracts\Core\Repository\SectionService::createSection() + * * @depends testUpdateSection * @depends testLoadSectionByIdentifier */ @@ -1063,7 +1089,7 @@ public function testUpdateSectionInTransactionWithCommit() $updatedStandard = $sectionService->loadSectionByIdentifier('standard'); /* END: Use Case */ - $this->assertEquals('My Standard', $updatedStandard->name); + self::assertEquals('My Standard', $updatedStandard->name); } } diff --git a/tests/integration/Core/Repository/SettingServiceTest.php b/tests/integration/Core/Repository/SettingServiceTest.php index e19688b9c4..612cf8e72f 100644 --- a/tests/integration/Core/Repository/SettingServiceTest.php +++ b/tests/integration/Core/Repository/SettingServiceTest.php @@ -17,6 +17,7 @@ * Test case for operations in the SettingService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\SettingService + * * @group integration * @group setting */ diff --git a/tests/integration/Core/Repository/TrashServiceAuthorizationTest.php b/tests/integration/Core/Repository/TrashServiceAuthorizationTest.php index c05865e438..0bf404e336 100644 --- a/tests/integration/Core/Repository/TrashServiceAuthorizationTest.php +++ b/tests/integration/Core/Repository/TrashServiceAuthorizationTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -16,6 +17,7 @@ * Test case for operations in the TrashService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\TrashService + * * @group integration * @group authorization */ @@ -25,6 +27,7 @@ class TrashServiceAuthorizationTest extends BaseTrashServiceTest * Test for the loadTrashItem() method. * * @covers \Ibexa\Contracts\Core\Repository\TrashService::loadTrashItem() + * * @depends Ibexa\Tests\Integration\Core\Repository\TrashServiceTest::testLoadTrashItem * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testLoadUser */ @@ -146,6 +149,7 @@ public function testTrashRequiresContentRemovePolicy() * Test for the recover() method. * * @covers \Ibexa\Contracts\Core\Repository\TrashService::recover() + * * @depends Ibexa\Tests\Integration\Core\Repository\TrashServiceTest::testRecover * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testLoadUser */ @@ -177,6 +181,7 @@ public function testRecoverThrowsUnauthorizedException() * Test for the recover() method. * * @covers \Ibexa\Contracts\Core\Repository\TrashService::recover($trashItem, $newParentLocation) + * * @depends Ibexa\Tests\Integration\Core\Repository\TrashServiceTest::testRecover * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testLoadUser */ @@ -216,6 +221,7 @@ public function testRecoverThrowsUnauthorizedExceptionWithNewParentLocationParam * Test for the emptyTrash() method. * * @covers \Ibexa\Contracts\Core\Repository\TrashService::emptyTrash() + * * @depends Ibexa\Tests\Integration\Core\Repository\TrashServiceTest::testEmptyTrash * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testLoadUser */ @@ -247,6 +253,7 @@ public function testEmptyTrashThrowsUnauthorizedException() * Test for the deleteTrashItem() method. * * @covers \Ibexa\Contracts\Core\Repository\TrashService::deleteTrashItem() + * * @depends Ibexa\Tests\Integration\Core\Repository\TrashServiceTest::testDeleteTrashItem * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testLoadUser */ diff --git a/tests/integration/Core/Repository/TrashServiceTest.php b/tests/integration/Core/Repository/TrashServiceTest.php index ffb2bc5446..a080bc3b45 100644 --- a/tests/integration/Core/Repository/TrashServiceTest.php +++ b/tests/integration/Core/Repository/TrashServiceTest.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\Integration\Core\Repository; use DateTime; @@ -28,6 +29,7 @@ * Test case for operations in the TrashService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\TrashService + * * @group integration * @group trash */ @@ -44,7 +46,7 @@ public function testTrash() $trashItem = $this->createTrashItem(); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( TrashItem::class, $trashItem ); @@ -130,13 +132,13 @@ public function testTrashRemovesChildLocationsFromMainStorage() foreach ($remoteIds as $remoteId) { try { $locationService->loadLocationByRemoteId($remoteId); - $this->fail("Location '{$remoteId}' should exist.'"); + self::fail("Location '{$remoteId}' should exist.'"); } catch (NotFoundException $e) { // echo $e->getFile(), ' +', $e->getLine(), PHP_EOL; } } - $this->assertGreaterThan( + self::assertGreaterThan( 0, count($remoteIds), "There should be at least one 'Community' child location." @@ -163,7 +165,7 @@ public function testTrashDecrementsChildCountOnParentLocation() $this->refreshSearch($repository); - $this->assertEquals( + self::assertEquals( $childCount - 1, $locationService->getLocationChildCount($location) ); @@ -235,36 +237,36 @@ public function testLoadTrashItem() $trashItemReloaded = $trashService->loadTrashItem($trashItem->id); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( APITrashItem::class, $trashItemReloaded ); - $this->assertEquals( + self::assertEquals( $trashItem->pathString, $trashItemReloaded->pathString ); - $this->assertInstanceOf( + self::assertInstanceOf( DateTime::class, $trashItemReloaded->trashed ); - $this->assertEquals( + self::assertEquals( $trashItem->trashed->getTimestamp(), $trashItemReloaded->trashed->getTimestamp() ); - $this->assertGreaterThan( + self::assertGreaterThan( 0, $trashItemReloaded->trashed->getTimestamp() ); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $content = $trashItemReloaded->getContent() ); - $this->assertEquals($trashItem->contentId, $content->contentInfo->id); + self::assertEquals($trashItem->contentId, $content->contentInfo->id); } /** @@ -313,19 +315,19 @@ public function testRecover() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( APILocation::class, $location ); - $this->assertEquals( + self::assertEquals( $location, $locationReloaded ); try { $trashService->loadTrashItem($trashItem->id); - $this->fail('Trash item was not removed after being recovered.'); + self::fail('Trash item was not removed after being recovered.'); } catch (NotFoundException $e) { // All well } @@ -402,7 +404,7 @@ public function testAliasesForRemovedItems() $createdLocationAlias = $urlAliasService->lookup('/Media'); - $this->assertNotEquals( + self::assertNotEquals( $trashedLocationAlias->destination, $createdLocationAlias->destination, 'Destination for /media url should changed' @@ -412,10 +414,10 @@ public function testAliasesForRemovedItems() $recoveredLocationAlias = $urlAliasService->lookup('/Media2'); $recoveredLocationAliasReverse = $urlAliasService->reverseLookup($recoveredLocation); - $this->assertEquals($recoveredLocationAlias->destination, $recoveredLocationAliasReverse->destination); + self::assertEquals($recoveredLocationAlias->destination, $recoveredLocationAliasReverse->destination); - $this->assertNotEquals($recoveredLocationAliasReverse->destination, $trashedLocationAlias->destination); - $this->assertNotEquals($recoveredLocationAliasReverse->destination, $createdLocationAlias->destination); + self::assertNotEquals($recoveredLocationAliasReverse->destination, $trashedLocationAlias->destination); + self::assertNotEquals($recoveredLocationAliasReverse->destination, $createdLocationAlias->destination); } /** @@ -438,7 +440,7 @@ public function testRecoverDoesNotRestoreChildLocations() $trashService->recover($trashItem); - $this->assertGreaterThan( + self::assertGreaterThan( 0, count($remoteIds), "There should be at least one 'Community' child location." @@ -448,7 +450,7 @@ public function testRecoverDoesNotRestoreChildLocations() foreach ($remoteIds as $remoteId) { try { $locationService->loadLocationByRemoteId($remoteId); - $this->fail( + self::fail( sprintf( 'Location with remote ID "%s" unexpectedly restored.', $remoteId @@ -461,7 +463,7 @@ public function testRecoverDoesNotRestoreChildLocations() try { $trashService->loadTrashItem($trashItem->id); - $this->fail('Trash item was not removed after being recovered.'); + self::fail('Trash item was not removed after being recovered.'); } catch (NotFoundException $e) { // All well } @@ -512,7 +514,7 @@ public function testRecoverWithLocationCreateStructParameter() try { $trashService->loadTrashItem($trashItem->id); - $this->fail('Trash item was not removed after being recovered.'); + self::fail('Trash item was not removed after being recovered.'); } catch (NotFoundException $e) { // All well } @@ -544,14 +546,14 @@ public function testRecoverIncrementsChildCountOnOriginalParent() $this->refreshSearch($repository); - $this->assertEquals( + self::assertEquals( $childCount + 1, $locationService->getLocationChildCount($location) ); try { $trashService->loadTrashItem($trashItem->id); - $this->fail('Trash item was not removed after being recovered.'); + self::fail('Trash item was not removed after being recovered.'); } catch (NotFoundException $e) { // All well } @@ -589,14 +591,14 @@ public function testRecoverWithLocationCreateStructParameterIncrementsChildCount $this->refreshSearch($repository); - $this->assertEquals( + self::assertEquals( $childCount + 1, $locationService->getLocationChildCount($location) ); try { $trashService->loadTrashItem($trashItem->id); - $this->fail('Trash item was not removed after being recovered.'); + self::fail('Trash item was not removed after being recovered.'); } catch (NotFoundException $e) { // All well } @@ -650,7 +652,7 @@ public function testFindTrashItems( $searchResult = $trashService->findTrashItems($query); - $this->assertEquals($expectedCount, $searchResult->totalCount); + self::assertEquals($expectedCount, $searchResult->totalCount); } /** @@ -717,7 +719,7 @@ public function testFindTrashItemsSort(array $sortClausesClasses): void $ascResultsIds[] = $result->contentInfo->id; } - $this->assertGreaterThanOrEqual($expectedCount, count($ascResultsIds)); + self::assertGreaterThanOrEqual($expectedCount, count($ascResultsIds)); foreach ($sortClausesClasses as $sortClauseClass) { $descQuery->sortClauses[] = new $sortClauseClass(Query::SORT_DESC); @@ -728,12 +730,12 @@ public function testFindTrashItemsSort(array $sortClausesClasses): void $descResultsIds[] = $result->contentInfo->id; } - $this->assertNotSame($descResultsIds, $ascResultsIds); + self::assertNotSame($descResultsIds, $ascResultsIds); krsort($descResultsIds); $descResultsIds = array_values($descResultsIds); - $this->assertSame($descResultsIds, $ascResultsIds); + self::assertSame($descResultsIds, $ascResultsIds); } /** @@ -755,15 +757,15 @@ public function testFindTrashItemsLimits() // Load all trashed locations $searchResult = $trashService->findTrashItems($query); - $this->assertInstanceOf( + self::assertInstanceOf( SearchResult::class, $searchResult ); // 4 trashed locations from the sub tree, but only 2 in results - $this->assertCount(2, $searchResult->items); - $this->assertEquals(4, $searchResult->count); - $this->assertEquals(4, $searchResult->totalCount); + self::assertCount(2, $searchResult->items); + self::assertEquals(4, $searchResult->count); + self::assertEquals(4, $searchResult->totalCount); } /** @@ -803,13 +805,13 @@ public function testFindTrashItemsLimitedAccess() $searchResult = $trashService->findTrashItems($query); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( SearchResult::class, $searchResult ); // 0 trashed locations found, though 4 exist - $this->assertEquals(0, $searchResult->count); + self::assertEquals(0, $searchResult->count); } /** @@ -859,12 +861,12 @@ public function testFindTrashItemsSubtreeLimitation() // Load all trashed locations $searchResult = $trashService->findTrashItems($query); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( SearchResult::class, $searchResult ); - $this->assertEquals(1, count($searchResult->items)); + self::assertEquals(1, count($searchResult->items)); } /** @@ -891,7 +893,7 @@ public function testEmptyTrash() $searchResult = $trashService->findTrashItems($query); /* END: Use Case */ - $this->assertEquals(0, $searchResult->count); + self::assertEquals(0, $searchResult->count); // Try to load content $this->expectException(NotFoundException::class); @@ -935,7 +937,7 @@ public function testEmptyTrashForUserWithSubtreeLimitation() $searchResult = $trashService->findTrashItems($query); /* END: Use Case */ - $this->assertEquals(0, $searchResult->totalCount); + self::assertEquals(0, $searchResult->totalCount); // Try to load content $this->expectException(NotFoundException::class); @@ -983,8 +985,8 @@ static function ($trashItem) { $searchResult->items ); - $this->assertEquals(4, $searchResult->count); - $this->assertTrue( + self::assertEquals(4, $searchResult->count); + self::assertTrue( in_array($demoDesignLocationId, $foundIds) ); @@ -1277,9 +1279,9 @@ private function assertAliasNotExists(URLAliasService $urlAliasService, $urlPath { try { $this->getRepository()->getURLAliasService()->lookup($urlPath); - $this->fail(sprintf('Alias [%s] should not exist', $urlPath)); + self::fail(sprintf('Alias [%s] should not exist', $urlPath)); } catch (NotFoundException $e) { - $this->assertTrue(true); + self::assertTrue(true); } } diff --git a/tests/integration/Core/Repository/URLAliasServiceAuthorizationTest.php b/tests/integration/Core/Repository/URLAliasServiceAuthorizationTest.php index c4bed8b4dd..08a0ba678a 100644 --- a/tests/integration/Core/Repository/URLAliasServiceAuthorizationTest.php +++ b/tests/integration/Core/Repository/URLAliasServiceAuthorizationTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -14,6 +15,7 @@ class URLAliasServiceAuthorizationTest extends BaseTest * Test for the createUrlAlias() method. * * @covers \Ibexa\Contracts\Core\Repository\URLAliasService::createUrlAlias() + * * @depends Ibexa\Tests\Integration\Core\Repository\URLAliasServiceTest::testCreateUrlAlias */ public function testCreateUrlAliasThrowsUnauthorizedException() @@ -47,6 +49,7 @@ public function testCreateUrlAliasThrowsUnauthorizedException() * Test for the createGlobalUrlAlias() method. * * @covers \Ibexa\Contracts\Core\Repository\URLAliasService::createGlobalUrlAlias() + * * @depends Ibexa\Tests\Integration\Core\Repository\URLAliasServiceTest::testCreateGlobalUrlAlias */ public function testCreateGlobalUrlAliasThrowsUnauthorizedException() @@ -74,6 +77,7 @@ public function testCreateGlobalUrlAliasThrowsUnauthorizedException() * Test for the removeAliases() method. * * @covers \Ibexa\Contracts\Core\Repository\URLAliasService::removeAliases() + * * @depends Ibexa\Tests\Integration\Core\Repository\URLAliasServiceTest::testRemoveAliases */ public function testRemoveAliasesThrowsUnauthorizedException() diff --git a/tests/integration/Core/Repository/URLAliasServiceTest.php b/tests/integration/Core/Repository/URLAliasServiceTest.php index c4284521f2..ce03cf089b 100644 --- a/tests/integration/Core/Repository/URLAliasServiceTest.php +++ b/tests/integration/Core/Repository/URLAliasServiceTest.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\Integration\Core\Repository; use Doctrine\DBAL\Connection; @@ -22,6 +23,7 @@ * Test case for operations in the URLAliasService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\URLAliasService + * * @group url-alias */ class URLAliasServiceTest extends BaseTest @@ -47,14 +49,14 @@ protected function setUp(): void ); if (false === is_object($location)) { - $this->markTestSkipped( + self::markTestSkipped( 'This test cannot be executed, because the utilized ' . 'LocationService::loadLocation() does not ' . 'return an object.' ); } } catch (Exception $e) { - $this->markTestSkipped( + self::markTestSkipped( 'This test cannot be executed, because the utilized ' . 'LocationService::loadLocation() failed with ' . PHP_EOL . PHP_EOL . @@ -85,7 +87,7 @@ public function testCreateUrlAlias() $createdUrlAlias = $urlAliasService->createUrlAlias($location, '/Home/My-New-Site', 'eng-US'); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( URLAlias::class, $createdUrlAlias ); @@ -154,7 +156,7 @@ public function testCreateUrlAliasPropertyValues(array $testData) { [$createdUrlAlias, $locationId] = $testData; - $this->assertNotNull($createdUrlAlias->id); + self::assertNotNull($createdUrlAlias->id); $this->assertPropertiesCorrect( [ @@ -175,6 +177,7 @@ public function testCreateUrlAliasPropertyValues(array $testData) * Test for the createUrlAlias() method. * * @covers \Ibexa\Contracts\Core\Repository\URLAliasService::createUrlAlias($location, $path, $languageCode, $forwarding) + * * @depends testCreateUrlAliasPropertyValues */ public function testCreateUrlAliasWithForwarding() @@ -194,7 +197,7 @@ public function testCreateUrlAliasWithForwarding() $createdUrlAlias = $urlAliasService->createUrlAlias($location, '/Home/My-New-Site', 'eng-US', true); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( URLAlias::class, $createdUrlAlias ); @@ -211,7 +214,7 @@ public function testCreateUrlAliasPropertyValuesWithForwarding(array $testData) { [$createdUrlAlias, $locationId] = $testData; - $this->assertNotNull($createdUrlAlias->id); + self::assertNotNull($createdUrlAlias->id); $this->assertPropertiesCorrect( [ @@ -250,7 +253,7 @@ public function testCreateUrlAliasWithAlwaysAvailable() $createdUrlAlias = $urlAliasService->createUrlAlias($location, '/Home/My-New-Site', 'eng-US', false, true); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( URLAlias::class, $createdUrlAlias ); @@ -267,7 +270,7 @@ public function testCreateUrlAliasPropertyValuesWithAlwaysAvailable(array $testD { [$createdUrlAlias, $locationId] = $testData; - $this->assertNotNull($createdUrlAlias->id); + self::assertNotNull($createdUrlAlias->id); $this->assertPropertiesCorrect( [ @@ -330,7 +333,7 @@ public function testCreateGlobalUrlAlias() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( URLAlias::class, $createdUrlAlias ); @@ -345,7 +348,7 @@ public function testCreateGlobalUrlAlias() */ public function testCreateGlobalUrlAliasPropertyValues(URLAlias $createdUrlAlias) { - $this->assertNotNull($createdUrlAlias->id); + self::assertNotNull($createdUrlAlias->id); $this->assertPropertiesCorrect( [ @@ -382,7 +385,7 @@ public function testCreateGlobalUrlAliasWithForward() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( URLAlias::class, $createdUrlAlias ); @@ -397,7 +400,7 @@ public function testCreateGlobalUrlAliasWithForward() */ public function testCreateGlobalUrlAliasWithForwardPropertyValues(URLAlias $createdUrlAlias) { - $this->assertNotNull($createdUrlAlias->id); + self::assertNotNull($createdUrlAlias->id); $this->assertPropertiesCorrect( [ @@ -435,7 +438,7 @@ public function testCreateGlobalUrlAliasWithAlwaysAvailable() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( URLAlias::class, $createdUrlAlias ); @@ -450,7 +453,7 @@ public function testCreateGlobalUrlAliasWithAlwaysAvailable() */ public function testCreateGlobalUrlAliasWithAlwaysAvailablePropertyValues(URLAlias $createdUrlAlias) { - $this->assertNotNull($createdUrlAlias->id); + self::assertNotNull($createdUrlAlias->id); $this->assertPropertiesCorrect( [ @@ -494,7 +497,7 @@ public function testCreateGlobalUrlAliasForLocation() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( URLAlias::class, $createdUrlAlias ); @@ -529,7 +532,7 @@ public function testCreateGlobalUrlAliasForLocationVariation() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( URLAlias::class, $createdUrlAlias ); @@ -546,7 +549,7 @@ public function testCreateGlobalUrlAliasForLocationPropertyValues($testData) { [$createdUrlAlias, $locationId] = $testData; - $this->assertNotNull($createdUrlAlias->id); + self::assertNotNull($createdUrlAlias->id); $this->assertPropertiesCorrect( [ @@ -622,10 +625,10 @@ public function testListLocationAliases() $loadedAliases = $urlAliasService->listLocationAliases($location); /* END: Use Case */ - $this->assertIsArray($loadedAliases); + self::assertIsArray($loadedAliases); // Only 1 non-history alias - $this->assertCount(1, $loadedAliases); + self::assertCount(1, $loadedAliases); return [$loadedAliases, $location]; } @@ -640,11 +643,11 @@ public function testListLocationAliasesLoadsCorrectly(array $testData) [$loadedAliases, $location] = $testData; foreach ($loadedAliases as $loadedAlias) { - $this->assertInstanceOf( + self::assertInstanceOf( URLAlias::class, $loadedAlias ); - $this->assertEquals( + self::assertEquals( $location->id, $loadedAlias->destination ); @@ -676,8 +679,8 @@ public function testListLocationAliasesWithCustomFilter() $loadedAliases = $urlAliasService->listLocationAliases($location, false, 'eng-US'); /* END: Use Case */ - $this->assertIsArray($loadedAliases); - $this->assertCount(1, $loadedAliases); + self::assertIsArray($loadedAliases); + self::assertCount(1, $loadedAliases); } /** @@ -704,8 +707,8 @@ public function testListLocationAliasesWithLanguageCodeFilter() $loadedAliases = $urlAliasService->listLocationAliases($location, true, 'eng-US'); /* END: Use Case */ - $this->assertIsArray($loadedAliases); - $this->assertCount(1, $loadedAliases); + self::assertIsArray($loadedAliases); + self::assertCount(1, $loadedAliases); } /** @@ -727,8 +730,8 @@ public function testListGlobalAliases() $loadedAliases = $urlAliasService->listGlobalAliases(); /* END: Use Case */ - $this->assertIsArray($loadedAliases); - $this->assertCount(3, $loadedAliases); + self::assertIsArray($loadedAliases); + self::assertCount(3, $loadedAliases); } /** @@ -777,8 +780,8 @@ public function testListGlobalAliasesWithLanguageFilter() $loadedAliases = $urlAliasService->listGlobalAliases('eng-US'); /* END: Use Case */ - $this->assertIsArray($loadedAliases); - $this->assertCount(2, $loadedAliases); + self::assertIsArray($loadedAliases); + self::assertCount(2, $loadedAliases); } /** @@ -800,8 +803,8 @@ public function testListGlobalAliasesWithOffset() $loadedAliases = $urlAliasService->listGlobalAliases(null, 1); /* END: Use Case */ - $this->assertIsArray($loadedAliases); - $this->assertCount(2, $loadedAliases); + self::assertIsArray($loadedAliases); + self::assertCount(2, $loadedAliases); } /** @@ -823,8 +826,8 @@ public function testListGlobalAliasesWithLimit() $loadedAliases = $urlAliasService->listGlobalAliases(null, 0, 1); /* END: Use Case */ - $this->assertIsArray($loadedAliases); - $this->assertCount(1, $loadedAliases); + self::assertIsArray($loadedAliases); + self::assertCount(1, $loadedAliases); } /** @@ -862,7 +865,7 @@ public function testRemoveAliases() $urlAliasService->removeAliases($customAliases); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( $initialAliases, $urlAliasService->listLocationAliases($someLocation) ); @@ -912,7 +915,7 @@ public function testLookUp() $loadedAlias = $urlAliasService->lookup('/Setup2'); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( URLAlias::class, $loadedAlias ); @@ -938,11 +941,11 @@ public function testLookUpWithLanguageFilter() $loadedAlias = $urlAliasService->lookup('/My/Special-Support', 'eng-US'); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( URLAlias::class, $loadedAlias ); - $this->assertEquals( + self::assertEquals( 'content/search?SearchText=Ibexa', $loadedAlias->destination ); @@ -1009,6 +1012,7 @@ public function testLookUpThrowsInvalidArgumentException() * Test for the lookUp() method after renaming parent which is a part of the lookup path. * * @see https://issues.ibexa.co/browse/EZP-28046 + * * @covers \Ibexa\Contracts\Core\Repository\URLAliasService::lookUp * @covers \Ibexa\Contracts\Core\Repository\URLAliasService::listLocationAliases */ @@ -1062,7 +1066,7 @@ public function testLookupOnRenamedParent() $urlAliasService->lookup('/My-Folder/My-Article'); $aliases = $urlAliasService->listLocationAliases($articleLocation, false); - $this->assertEquals('/My-Folder-Modified/My-Article', $aliases[0]->path); + self::assertEquals('/My-Folder-Modified/My-Article', $aliases[0]->path); } /** @@ -1657,7 +1661,7 @@ protected function changeContentTypeUrlAliasSchema($contentTypeIdentifier, $newU private function assertUrlAliasPropertiesSame(array $expectedValues, URLAlias $urlAlias): void { - $this->assertSame( + self::assertSame( $expectedValues, [ 'type' => $urlAlias->type, diff --git a/tests/integration/Core/Repository/URLServiceAuthorizationTest.php b/tests/integration/Core/Repository/URLServiceAuthorizationTest.php index 578e79a484..c5a73c928b 100644 --- a/tests/integration/Core/Repository/URLServiceAuthorizationTest.php +++ b/tests/integration/Core/Repository/URLServiceAuthorizationTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; diff --git a/tests/integration/Core/Repository/URLServiceTest.php b/tests/integration/Core/Repository/URLServiceTest.php index e9dc181353..09a9d55065 100644 --- a/tests/integration/Core/Repository/URLServiceTest.php +++ b/tests/integration/Core/Repository/URLServiceTest.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\Integration\Core\Repository; use DateTime; @@ -21,6 +22,7 @@ * Test case for operations in the UserService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\URLService + * * @group integration * @group url */ @@ -243,6 +245,7 @@ public function testFindUrlsWithoutCounting() * Test for URLService::findUrls() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::findUrls() + * * @depends testFindUrls */ public function testFindUrlsUsingMatchNone() @@ -257,6 +260,7 @@ public function testFindUrlsUsingMatchNone() * Test for URLService::findUrls() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::findUrls() + * * @depends testFindUrls */ public function testFindUrlsUsingPatternCriterion() @@ -279,6 +283,7 @@ public function testFindUrlsUsingPatternCriterion() * Test for URLService::findUrls() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::findUrls() + * * @depends testFindUrls */ public function testFindUrlsUsingValidityCriterionValid() @@ -315,6 +320,7 @@ public function testFindUrlsUsingValidityCriterionValid() * Test for URLService::findUrls() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::findUrls + * * @depends testFindUrls */ public function testFindUrlsUsingSectionIdCriterion(): void @@ -335,6 +341,7 @@ public function testFindUrlsUsingSectionIdCriterion(): void * Test for URLService::findUrls() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::findUrls() + * * @depends testFindUrls */ public function testFindUrlsUsingSectionIdAndValidityCriterionValid(): void @@ -358,6 +365,7 @@ public function testFindUrlsUsingSectionIdAndValidityCriterionValid(): void * Test for URLService::findUrls() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::findUrls + * * @depends testFindUrls */ public function testFindUrlsUsingSectionIdentifierCriterion(): void @@ -378,6 +386,7 @@ public function testFindUrlsUsingSectionIdentifierCriterion(): void * Test for URLService::findUrls() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::findUrls() + * * @depends testFindUrls */ public function testFindUrlsUsingSectionIdentifierAndValidityCriterionValid(): void @@ -403,6 +412,7 @@ public function testFindUrlsUsingSectionIdentifierAndValidityCriterionValid(): v * Test for URLService::findUrls() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::findUrls() + * * @depends testFindUrls */ public function testFindUrlsUsingSectionIdentifierOrSectionIdCriterion(): void @@ -428,6 +438,7 @@ public function testFindUrlsUsingSectionIdentifierOrSectionIdCriterion(): void * Test for URLService::findUrls() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::findUrls() + * * @depends testFindUrls */ public function testFindUrlsUsingValidityCriterionInvalid() @@ -446,6 +457,7 @@ public function testFindUrlsUsingValidityCriterionInvalid() * Test for URLService::findUrls() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::findUrls() + * * @depends testFindUrls */ public function testFindUrlsUsingVisibleOnlyCriterion() @@ -545,6 +557,7 @@ public function testFindUrlsWithInvalidLimitThrowsInvalidArgumentException() * Test for URLService::findUrls() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::findUrls() + * * @depends testFindUrls */ public function testFindUrlsWithOffset() @@ -574,6 +587,7 @@ public function testFindUrlsWithOffset() * Test for URLService::findUrls() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::findUrls() + * * @depends testFindUrls */ public function testFindUrlsWithOffsetAndLimit() @@ -597,6 +611,7 @@ public function testFindUrlsWithOffsetAndLimit() * Test for URLService::findUrls() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::findUrls() + * * @depends testFindUrls */ public function testFindUrlsWithLimitZero() @@ -612,7 +627,9 @@ public function testFindUrlsWithLimitZero() * Test for URLService::findUrls() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::findUrls() + * * @depends testFindUrls + * * @dataProvider dataProviderForFindUrlsWithSorting */ public function testFindUrlsWithSorting(SortClause $sortClause, array $expectedUrls) @@ -681,7 +698,7 @@ public function testUpdateUrl() $urlAfterUpdate = $urlService->updateUrl($urlBeforeUpdate, $updateStruct); /* END: Use Case */ - $this->assertInstanceOf(URL::class, $urlAfterUpdate); + self::assertInstanceOf(URL::class, $urlAfterUpdate); $this->assertPropertiesCorrect([ 'id' => 23, 'url' => 'https://someurl.com/', @@ -690,7 +707,7 @@ public function testUpdateUrl() 'lastChecked' => null, 'created' => new DateTime('@1343140541'), ], $urlAfterUpdate); - $this->assertGreaterThanOrEqual($urlBeforeUpdate->modified, $urlAfterUpdate->modified); + self::assertGreaterThanOrEqual($urlBeforeUpdate->modified, $urlAfterUpdate->modified); } /** @@ -717,7 +734,7 @@ public function testUpdateUrlStatus() $urlAfterUpdate = $urlService->updateUrl($urlBeforeUpdate, $updateStruct); /* END: Use Case */ - $this->assertInstanceOf(URL::class, $urlAfterUpdate); + self::assertInstanceOf(URL::class, $urlAfterUpdate); $this->assertPropertiesCorrect([ 'id' => $id, 'url' => '/content/view/sitemap/2', @@ -726,13 +743,14 @@ public function testUpdateUrlStatus() 'lastChecked' => $checked, 'created' => new DateTime('@1343140541'), ], $urlAfterUpdate); - $this->assertGreaterThanOrEqual($urlBeforeUpdate->modified, $urlAfterUpdate->modified); + self::assertGreaterThanOrEqual($urlBeforeUpdate->modified, $urlAfterUpdate->modified); } /** * Test for URLService::updateUrl() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::updateUrl() + * * @depends testUpdateUrl */ public function testUpdateUrlWithNonUniqueUrl() @@ -772,7 +790,7 @@ public function testLoadById() $url = $urlService->loadById($id); /* END: Use Case */ - $this->assertInstanceOf(URL::class, $url); + self::assertInstanceOf(URL::class, $url); $this->assertPropertiesCorrect([ 'id' => 23, 'url' => '/content/view/sitemap/2', @@ -787,6 +805,7 @@ public function testLoadById() * Test for URLService::loadById() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::loadById + * * @depends testLoadById */ public function testLoadByIdThrowsNotFoundException() @@ -819,7 +838,7 @@ public function testLoadByUrl() /* END: Use Case */ - $this->assertInstanceOf(URL::class, $url); + self::assertInstanceOf(URL::class, $url); $this->assertPropertiesCorrect([ 'id' => 23, 'url' => '/content/view/sitemap/2', @@ -834,6 +853,7 @@ public function testLoadByUrl() * Test for URLService::loadByUrl() method. * * @covers \Ibexa\Contracts\Core\Repository\URLService::loadByUrl + * * @depends testLoadByUrl */ public function testLoadByUrlThrowsNotFoundException() @@ -865,7 +885,7 @@ public function testCreateUpdateStruct() $updateStruct = $urlService->createUpdateStruct(); /* END: Use Case */ - $this->assertInstanceOf(URLUpdateStruct::class, $updateStruct); + self::assertInstanceOf(URLUpdateStruct::class, $updateStruct); return $updateStruct; } @@ -874,6 +894,7 @@ public function testCreateUpdateStruct() * Test for URLService::createUpdateStruct() method. * * @param \Ibexa\Contracts\Core\Repository\Values\URL\URLUpdateStruct $updateStruct + * * @depends testCreateUpdateStruct */ public function testCreateUpdateStructValues(URLUpdateStruct $updateStruct) @@ -889,6 +910,7 @@ public function testCreateUpdateStructValues(URLUpdateStruct $updateStruct) * Test for URLService::testFindUsages() method. * * @depends testLoadById + * * @dataProvider dataProviderForFindUsages */ public function testFindUsages($urlId, $offset, $limit, array $expectedContentInfos, $expectedTotalCount = null) @@ -904,8 +926,8 @@ public function testFindUsages($urlId, $offset, $limit, array $expectedContentIn $usagesSearchResults = $urlService->findUsages($loadedUrl, $offset, $limit); /* END: Use Case */ - $this->assertInstanceOf(UsageSearchResult::class, $usagesSearchResults); - $this->assertEquals($expectedTotalCount, $usagesSearchResults->totalCount); + self::assertInstanceOf(UsageSearchResult::class, $usagesSearchResults); + self::assertEquals($expectedTotalCount, $usagesSearchResults->totalCount); $this->assertUsagesSearchResultItems($usagesSearchResults, $expectedContentInfos); } @@ -936,7 +958,7 @@ public function testFindUsagesReturnsEmptySearchResults() $usagesSearchResults = $urlService->findUsages($loadedUrl); /* END: Use Case */ - $this->assertInstanceOf(UsageSearchResult::class, $usagesSearchResults); + self::assertInstanceOf(UsageSearchResult::class, $usagesSearchResults); $this->assertPropertiesCorrect([ 'totalCount' => 0, 'items' => [], diff --git a/tests/integration/Core/Repository/URLWildcardService/CriterionTest.php b/tests/integration/Core/Repository/URLWildcardService/CriterionTest.php index f44887ac4d..c5cccd7dc9 100644 --- a/tests/integration/Core/Repository/URLWildcardService/CriterionTest.php +++ b/tests/integration/Core/Repository/URLWildcardService/CriterionTest.php @@ -19,6 +19,7 @@ * Test case criterion for URLWildcard. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService + * * @group url-wildcard */ class CriterionTest extends BaseTest diff --git a/tests/integration/Core/Repository/URLWildcardServiceAuthorizationTest.php b/tests/integration/Core/Repository/URLWildcardServiceAuthorizationTest.php index dd0f093b90..ed098462bc 100644 --- a/tests/integration/Core/Repository/URLWildcardServiceAuthorizationTest.php +++ b/tests/integration/Core/Repository/URLWildcardServiceAuthorizationTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -12,6 +13,7 @@ * Test case for operations in the URLWildcardService. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService + * * @group integration * @group authorization */ @@ -19,6 +21,7 @@ class URLWildcardServiceAuthorizationTest extends BaseTest { /** * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::create + * * @depends Ibexa\Tests\Integration\Core\Repository\URLWildcardServiceTest::testCreate */ public function testCreateThrowsUnauthorizedException(): void @@ -46,6 +49,7 @@ public function testCreateThrowsUnauthorizedException(): void * Test for the remove() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::remove() + * * @depends Ibexa\Tests\Integration\Core\Repository\URLWildcardServiceTest::testRemove */ public function testRemoveThrowsUnauthorizedException() diff --git a/tests/integration/Core/Repository/URLWildcardServiceTest.php b/tests/integration/Core/Repository/URLWildcardServiceTest.php index 2e6e6871ad..4526cccfd1 100644 --- a/tests/integration/Core/Repository/URLWildcardServiceTest.php +++ b/tests/integration/Core/Repository/URLWildcardServiceTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\ContentValidationException; @@ -17,6 +18,7 @@ * Test case for operations in the URLWildcardService. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService + * * @group url-wildcard */ class URLWildcardServiceTest extends BaseTest @@ -39,7 +41,7 @@ public function testCreate() $urlWildcard = $urlWildcardService->create('/articles/*', '/content/{1}'); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( URLWildcard::class, $urlWildcard ); @@ -53,11 +55,12 @@ public function testCreate() * @param \Ibexa\Contracts\Core\Repository\Values\Content\URLWildcard $urlWildcard * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::create() + * * @depends testCreate */ public function testCreateSetsIdPropertyOnURLWildcard(URLWildcard $urlWildcard) { - $this->assertNotNull($urlWildcard->id); + self::assertNotNull($urlWildcard->id); } /** @@ -66,6 +69,7 @@ public function testCreateSetsIdPropertyOnURLWildcard(URLWildcard $urlWildcard) * @param \Ibexa\Contracts\Core\Repository\Values\Content\URLWildcard $urlWildcard * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::create() + * * @depends testCreate */ public function testCreateSetsPropertiesOnURLWildcard(URLWildcard $urlWildcard) @@ -84,6 +88,7 @@ public function testCreateSetsPropertiesOnURLWildcard(URLWildcard $urlWildcard) * Test for the create() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::create() + * * @depends testCreate */ public function testCreateWithOptionalForwardParameter() @@ -111,6 +116,7 @@ public function testCreateWithOptionalForwardParameter() * Test for the create() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::create() + * * @depends testCreate */ public function testCreateThrowsInvalidArgumentExceptionOnDuplicateSourceUrl() @@ -135,6 +141,7 @@ public function testCreateThrowsInvalidArgumentExceptionOnDuplicateSourceUrl() * Test for the create() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::create() + * * @depends testCreate */ public function testCreateThrowsContentValidationExceptionWhenPatternsAndPlaceholdersNotMatch() @@ -156,6 +163,7 @@ public function testCreateThrowsContentValidationExceptionWhenPatternsAndPlaceho * Test for the create() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::create() + * * @depends testCreate */ public function testCreateThrowsContentValidationExceptionWhenPlaceholdersNotValidNumberSequence() @@ -179,6 +187,7 @@ public function testCreateThrowsContentValidationExceptionWhenPlaceholdersNotVal * @return \Ibexa\Contracts\Core\Repository\Values\Content\URLWildcard * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::load() + * * @depends testCreate */ public function testLoad() @@ -195,7 +204,7 @@ public function testLoad() $urlWildcard = $urlWildcardService->load($urlWildcardId); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( URLWildcard::class, $urlWildcard ); @@ -209,6 +218,7 @@ public function testLoad() * @param \Ibexa\Contracts\Core\Repository\Values\Content\URLWildcard $urlWildcard * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::load() + * * @depends testLoad */ public function testLoadSetsPropertiesOnURLWildcard(URLWildcard $urlWildcard) @@ -229,6 +239,7 @@ public function testLoadSetsPropertiesOnURLWildcard(URLWildcard $urlWildcard) * @param \Ibexa\Contracts\Core\Repository\Values\Content\URLWildcard $urlWildcard * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::load() + * * @depends testLoad */ public function testLoadThrowsNotFoundException(URLWildcard $urlWildcard) @@ -273,7 +284,7 @@ public function testUpdate(): void $urlWildcardUpdated = $urlWildcardService->load($urlWildcard->id); - $this->assertEquals( + self::assertEquals( [ $urlWildcard->id, $updateStruct->sourceUrl, @@ -293,6 +304,7 @@ public function testUpdate(): void * Test for the remove() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::remove() + * * @depends testLoad */ public function testRemove() @@ -322,6 +334,7 @@ public function testRemove() * Test for the loadAll() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::loadAll() + * * @depends testCreate */ public function testLoadAll() @@ -339,7 +352,7 @@ public function testLoadAll() $allUrlWildcards = $urlWildcardService->loadAll(); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( [ $urlWildcardOne, $urlWildcardTwo, @@ -352,6 +365,7 @@ public function testLoadAll() * Test for the loadAll() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::loadAll() + * * @depends testLoadAll */ public function testLoadAllWithOffsetParameter() @@ -369,13 +383,14 @@ public function testLoadAllWithOffsetParameter() $allUrlWildcards = $urlWildcardService->loadAll(1); /* END: Use Case */ - $this->assertEquals([$urlWildcardTwo], $allUrlWildcards); + self::assertEquals([$urlWildcardTwo], $allUrlWildcards); } /** * Test for the loadAll() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::loadAll() + * * @depends testLoadAll */ public function testLoadAllWithOffsetAndLimitParameter() @@ -393,13 +408,14 @@ public function testLoadAllWithOffsetAndLimitParameter() $allUrlWildcards = $urlWildcardService->loadAll(0, 1); /* END: Use Case */ - $this->assertEquals([$urlWildcardOne], $allUrlWildcards); + self::assertEquals([$urlWildcardOne], $allUrlWildcards); } /** * Test for the loadAll() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::loadAll() + * * @depends testLoadAll */ public function testLoadAllReturnsEmptyArrayByDefault() @@ -413,7 +429,7 @@ public function testLoadAllReturnsEmptyArrayByDefault() $allUrlWildcards = $urlWildcardService->loadAll(); /* END: Use Case */ - $this->assertSame([], $allUrlWildcards); + self::assertSame([], $allUrlWildcards); } /** @@ -422,6 +438,7 @@ public function testLoadAllReturnsEmptyArrayByDefault() * @return \Ibexa\Contracts\Core\Repository\Values\Content\URLWildcardTranslationResult * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::translate() + * * @depends testCreate */ public function testTranslate() @@ -438,7 +455,7 @@ public function testTranslate() $result = $urlWildcardService->translate('/articles/2012/05/sindelfingen'); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( URLWildcardTranslationResult::class, $result ); @@ -452,6 +469,7 @@ public function testTranslate() * @param \Ibexa\Contracts\Core\Repository\Values\Content\URLWildcardTranslationResult $result * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::translate() + * * @depends testTranslate */ public function testTranslateSetsPropertiesOnTranslationResult(URLWildcardTranslationResult $result) @@ -469,6 +487,7 @@ public function testTranslateSetsPropertiesOnTranslationResult(URLWildcardTransl * Test for the translate() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::translate() + * * @depends testTranslate */ public function testTranslateWithForwardSetToTrue() @@ -498,6 +517,7 @@ public function testTranslateWithForwardSetToTrue() * Test for the translate() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::translate() + * * @depends testTranslate */ public function testTranslateReturnsLongestMatchingWildcard() @@ -515,13 +535,14 @@ public function testTranslateReturnsLongestMatchingWildcard() $result = $urlWildcardService->translate('/articles/2012/05/sindelfingen/42'); /* END: Use Case */ - $this->assertEquals('/content/42/bar/2012', $result->uri); + self::assertEquals('/content/42/bar/2012', $result->uri); } /** * Test for the translate() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::translate() + * * @depends testTranslate */ public function testTranslateThrowsNotFoundExceptionWhenNotAliasOrWildcardMatches() @@ -544,7 +565,7 @@ public function testCountAllReturnsZeroByDefault(): void $repository = $this->getRepository(); $urlWildcardService = $repository->getURLWildcardService(); - $this->assertSame(0, $urlWildcardService->countAll()); + self::assertSame(0, $urlWildcardService->countAll()); } public function testCountAll(): void @@ -554,7 +575,7 @@ public function testCountAll(): void $urlWildcardService->create('/articles/*', '/content/{1}'); - $this->assertSame(1, $urlWildcardService->countAll()); + self::assertSame(1, $urlWildcardService->countAll()); } } diff --git a/tests/integration/Core/Repository/UserPreferenceServiceTest.php b/tests/integration/Core/Repository/UserPreferenceServiceTest.php index 808c9ba2b2..6ad5bb6876 100644 --- a/tests/integration/Core/Repository/UserPreferenceServiceTest.php +++ b/tests/integration/Core/Repository/UserPreferenceServiceTest.php @@ -32,10 +32,10 @@ public function testLoadUserPreferences() $userPreferenceList = $userPreferenceService->loadUserPreferences(0, 25); /* END: Use Case */ - $this->assertInstanceOf(UserPreferenceList::class, $userPreferenceList); - $this->assertIsArray($userPreferenceList->items); - $this->assertIsInt($userPreferenceList->totalCount); - $this->assertEquals(5, $userPreferenceList->totalCount); + self::assertInstanceOf(UserPreferenceList::class, $userPreferenceList); + self::assertIsArray($userPreferenceList->items); + self::assertIsInt($userPreferenceList->totalCount); + self::assertEquals(5, $userPreferenceList->totalCount); } /** @@ -53,12 +53,13 @@ public function testGetUserPreference() $userPreference = $userPreferenceService->getUserPreference($userPreferenceName); /* END: Use Case */ - $this->assertInstanceOf(UserPreference::class, $userPreference); - $this->assertEquals($userPreferenceName, $userPreference->name); + self::assertInstanceOf(UserPreference::class, $userPreference); + self::assertEquals($userPreferenceName, $userPreference->name); } /** * @covers \Ibexa\Contracts\Core\Repository\UserPreferenceService::setUserPreference() + * * @depends testGetUserPreference */ public function testSetUserPreference() @@ -79,12 +80,13 @@ public function testSetUserPreference() $userPreference = $userPreferenceService->getUserPreference($userPreferenceName); /* END: Use Case */ - $this->assertInstanceOf(UserPreference::class, $userPreference); - $this->assertEquals($userPreferenceName, $userPreference->name); + self::assertInstanceOf(UserPreference::class, $userPreference); + self::assertEquals($userPreferenceName, $userPreference->name); } /** * @covers \Ibexa\Contracts\Core\Repository\UserPreferenceService::setUserPreference() + * * @depends testSetUserPreference */ public function testSetUserPreferenceThrowsInvalidArgumentExceptionOnInvalidValue() @@ -108,6 +110,7 @@ public function testSetUserPreferenceThrowsInvalidArgumentExceptionOnInvalidValu /** * @covers \Ibexa\Contracts\Core\Repository\UserPreferenceService::setUserPreference() + * * @depends testSetUserPreference */ public function testSetUserPreferenceThrowsInvalidArgumentExceptionOnEmptyName() @@ -140,7 +143,7 @@ public function testGetUserPreferenceCount() $userPreferenceCount = $userPreferenceService->getUserPreferenceCount(); /* END: Use Case */ - $this->assertEquals(5, $userPreferenceCount); + self::assertEquals(5, $userPreferenceCount); } } diff --git a/tests/integration/Core/Repository/UserServiceAuthorizationTest.php b/tests/integration/Core/Repository/UserServiceAuthorizationTest.php index 865301f4e3..7a45131194 100644 --- a/tests/integration/Core/Repository/UserServiceAuthorizationTest.php +++ b/tests/integration/Core/Repository/UserServiceAuthorizationTest.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\Integration\Core\Repository; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -12,6 +13,7 @@ * Test case for operations in the UserService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\UserService + * * @group integration * @group authorization */ @@ -21,6 +23,7 @@ class UserServiceAuthorizationTest extends BaseTest * Test for the loadUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUserGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testLoadUserGroup */ public function testLoadUserGroupThrowsUnauthorizedException() @@ -48,6 +51,7 @@ public function testLoadUserGroupThrowsUnauthorizedException() * Test for the loadUserGroupByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUserGroupByRemoteId() + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testLoadUserGroupByRemoteId */ public function testLoadUserGroupByRemoteIdThrowsUnauthorizedException(): void @@ -73,6 +77,7 @@ public function testLoadUserGroupByRemoteIdThrowsUnauthorizedException(): void * Test for the loadSubUserGroups() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadSubUserGroups() + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testLoadSubUserGroups */ public function testLoadSubUserGroupsThrowsUnauthorizedException() @@ -100,6 +105,7 @@ public function testLoadSubUserGroupsThrowsUnauthorizedException() * Test for the createUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUserGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUserGroup */ public function testCreateUserGroupThrowsUnauthorizedException() @@ -134,6 +140,7 @@ public function testCreateUserGroupThrowsUnauthorizedException() * Test for the deleteUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::deleteUserGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testDeleteUserGroup */ public function testDeleteUserGroupThrowsUnauthorizedException() @@ -161,6 +168,7 @@ public function testDeleteUserGroupThrowsUnauthorizedException() * Test for the moveUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::moveUserGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testMoveUserGroup */ public function testMoveUserGroupThrowsUnauthorizedException() @@ -195,6 +203,7 @@ public function testMoveUserGroupThrowsUnauthorizedException() * Test for the updateUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::updateUserGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testUpdateUserGroup */ public function testUpdateUserGroupThrowsUnauthorizedException() @@ -232,6 +241,7 @@ public function testUpdateUserGroupThrowsUnauthorizedException() * Test for the createUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUser() + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testCreateUser */ public function testCreateUserThrowsUnauthorizedException() @@ -275,6 +285,7 @@ public function testCreateUserThrowsUnauthorizedException() * Test for the deleteUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::deleteUser() + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testDeleteUser */ public function testDeleteUserThrowsUnauthorizedException() @@ -353,6 +364,7 @@ public function testUpdateUserPasswordThrowsUnauthorizedException(): void * Test for the assignUserToUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::assignUserToUserGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testAssignUserToUserGroup */ public function testAssignUserToUserGroupThrowsUnauthorizedException() @@ -385,6 +397,7 @@ public function testAssignUserToUserGroupThrowsUnauthorizedException() * Test for the unAssignUssrFromUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::unAssignUssrFromUserGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testUnAssignUserFromUserGroup */ public function testUnAssignUserFromUserGroupThrowsUnauthorizedException() @@ -425,6 +438,7 @@ public function testUnAssignUserFromUserGroupThrowsUnauthorizedException() * Test for the loadUserGroupsOfUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUserGroupsOfUser() + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testLoadUserGroupsOfUser */ public function testLoadUserGroupsOfUserThrowsUnauthorizedException() @@ -451,6 +465,7 @@ public function testLoadUserGroupsOfUserThrowsUnauthorizedException() * Test for the loadUsersOfUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUsersOfUserGroup() + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testLoadUsersOfUserGroup */ public function testLoadUsersOfUserGroupThrowsUnauthorizedException() diff --git a/tests/integration/Core/Repository/UserServiceTest.php b/tests/integration/Core/Repository/UserServiceTest.php index d1d02f8fdd..3665012aa3 100644 --- a/tests/integration/Core/Repository/UserServiceTest.php +++ b/tests/integration/Core/Repository/UserServiceTest.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\Integration\Core\Repository; use DateInterval; @@ -39,6 +40,7 @@ * Test case for operations in the UserService using in memory storage. * * @covers \Ibexa\Contracts\Core\Repository\UserService + * * @group integration * @group user */ @@ -68,12 +70,12 @@ public function testLoadUserGroup() $userGroup = $userService->loadUserGroup($mainGroupId); /* END: Use Case */ - $this->assertInstanceOf(UserGroup::class, $userGroup); + self::assertInstanceOf(UserGroup::class, $userGroup); // User group happens to also be a Content; isUserGroup() should be true and isUser() should be false - $this->assertTrue($userService->isUserGroup($userGroup), 'isUserGroup() => false on a user group'); - $this->assertFalse($userService->isUser($userGroup), 'isUser() => true on a user group'); - $this->assertSame(0, $userGroup->parentId, 'parentId should be equal `0` because it is top level node'); + self::assertTrue($userService->isUserGroup($userGroup), 'isUserGroup() => false on a user group'); + self::assertFalse($userService->isUser($userGroup), 'isUser() => true on a user group'); + self::assertSame(0, $userGroup->parentId, 'parentId should be equal `0` because it is top level node'); } /** @@ -88,11 +90,11 @@ public function testLoadUserGroupByRemoteId(): void $userService = $this->getRepository()->getUserService(); $userGroup = $userService->loadUserGroupByRemoteId($existingRemoteId); - $this->assertInstanceOf(UserGroup::class, $userGroup); - $this->assertEquals($existingRemoteId, $userGroup->contentInfo->remoteId); + self::assertInstanceOf(UserGroup::class, $userGroup); + self::assertEquals($existingRemoteId, $userGroup->contentInfo->remoteId); // User group happens to also be a Content; isUserGroup() should be true and isUser() should be false - $this->assertTrue($userService->isUserGroup($userGroup), 'isUserGroup() => false on a user group'); - $this->assertFalse($userService->isUser($userGroup), 'isUser() => true on a user group'); + self::assertTrue($userService->isUserGroup($userGroup), 'isUserGroup() => false on a user group'); + self::assertFalse($userService->isUser($userGroup), 'isUser() => true on a user group'); } /** @@ -123,18 +125,19 @@ public function testLoadUserGroupWithNoAccessToParent() $userGroup = $userService->loadUserGroup($mainGroupId); /* END: Use Case */ - $this->assertInstanceOf(UserGroup::class, $userGroup); + self::assertInstanceOf(UserGroup::class, $userGroup); // User group happens to also be a Content; isUserGroup() should be true and isUser() should be false - $this->assertTrue($userService->isUserGroup($userGroup), 'isUserGroup() => false on a user group'); - $this->assertFalse($userService->isUser($userGroup), 'isUser() => true on a user group'); - $this->assertSame(0, $userGroup->parentId, 'parentId should be equal `0` because it is top level node'); + self::assertTrue($userService->isUserGroup($userGroup), 'isUserGroup() => false on a user group'); + self::assertFalse($userService->isUser($userGroup), 'isUser() => true on a user group'); + self::assertSame(0, $userGroup->parentId, 'parentId should be equal `0` because it is top level node'); } /** * Test for the loadUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUserGroup() + * * @depends testLoadUserGroup */ public function testLoadUserGroupThrowsNotFoundException() @@ -156,6 +159,7 @@ public function testLoadUserGroupThrowsNotFoundException() * Test for the loadUserGroupByRemoteId() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUserGroupByRemoteId() + * * @depends Ibexa\Tests\Integration\Core\Repository\UserServiceTest::testLoadUserGroupByRemoteId */ public function testLoadUserGroupByRemoteIdThrowsNotFoundException(): void @@ -172,6 +176,7 @@ public function testLoadUserGroupByRemoteIdThrowsNotFoundException(): void * Test for the loadSubUserGroups() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadSubUserGroups() + * * @depends testLoadUserGroup */ public function testLoadSubUserGroups() @@ -189,7 +194,7 @@ public function testLoadSubUserGroups() $subUserGroups = $userService->loadSubUserGroups($userGroup); foreach ($subUserGroups as $subUserGroup) { // Do something with the $subUserGroup - $this->assertInstanceOf(UserGroup::class, $subUserGroup); + self::assertInstanceOf(UserGroup::class, $subUserGroup); } /* END: Use Case */ } @@ -256,11 +261,12 @@ public function testNewUserGroupCreateStruct() * @param \Ibexa\Contracts\Core\Repository\Values\User\UserGroupCreateStruct $groupCreate * * @covers \Ibexa\Contracts\Core\Repository\UserService::newUserGroupCreateStruct() + * * @depends testNewUserGroupCreateStruct */ public function testNewUserGroupCreateStructSetsMainLanguageCode($groupCreate) { - $this->assertEquals('eng-US', $groupCreate->mainLanguageCode); + self::assertEquals('eng-US', $groupCreate->mainLanguageCode); } /** @@ -269,11 +275,12 @@ public function testNewUserGroupCreateStructSetsMainLanguageCode($groupCreate) * @param \Ibexa\Contracts\Core\Repository\Values\User\UserGroupCreateStruct $groupCreate * * @covers \Ibexa\Contracts\Core\Repository\UserService::newUserGroupCreateStruct() + * * @depends testNewUserGroupCreateStruct */ public function testNewUserGroupCreateStructSetsContentType($groupCreate) { - $this->assertInstanceOf( + self::assertInstanceOf( ContentType::class, $groupCreate->contentType ); @@ -283,6 +290,7 @@ public function testNewUserGroupCreateStructSetsContentType($groupCreate) * Test for the newUserGroupCreateStruct() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::newUserGroupCreateStruct($mainLanguageCode, $contentType) + * * @depends testNewUserGroupCreateStruct */ public function testNewUserGroupCreateStructWithSecondParameter() @@ -303,7 +311,7 @@ public function testNewUserGroupCreateStructWithSecondParameter() ); /* END: Use Case */ - $this->assertSame($groupType, $groupCreate->contentType); + self::assertSame($groupType, $groupCreate->contentType); } /** @@ -312,6 +320,7 @@ public function testNewUserGroupCreateStructWithSecondParameter() * @return \Ibexa\Contracts\Core\Repository\Values\User\UserGroup * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUserGroup() + * * @depends testNewUserGroupCreateStruct * @depends testLoadUserGroup */ @@ -321,15 +330,15 @@ public function testCreateUserGroup() $userGroup = $this->createUserGroupVersion1(); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( UserGroup::class, $userGroup ); $versionInfo = $userGroup->getVersionInfo(); - $this->assertEquals(APIVersionInfo::STATUS_PUBLISHED, $versionInfo->status); - $this->assertEquals(1, $versionInfo->versionNo); + self::assertEquals(APIVersionInfo::STATUS_PUBLISHED, $versionInfo->status); + self::assertEquals(1, $versionInfo->versionNo); return $userGroup; } @@ -340,11 +349,12 @@ public function testCreateUserGroup() * @param \Ibexa\Contracts\Core\Repository\Values\User\UserGroup $userGroup * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUserGroup() + * * @depends testCreateUserGroup */ public function testCreateUserGroupSetsExpectedProperties($userGroup) { - $this->assertEquals( + self::assertEquals( [ 'parentId' => $this->generateId('group', 4), ], @@ -358,6 +368,7 @@ public function testCreateUserGroupSetsExpectedProperties($userGroup) * Test for the createUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUserGroup() + * * @depends testCreateUserGroup */ public function testCreateUserGroupThrowsInvalidArgumentException() @@ -393,6 +404,7 @@ public function testCreateUserGroupThrowsInvalidArgumentException() * Test for the createUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUserGroup() + * * @depends testCreateUserGroup */ public function testCreateUserGroupThrowsInvalidArgumentExceptionFieldTypeNotAccept() @@ -427,6 +439,7 @@ public function testCreateUserGroupThrowsInvalidArgumentExceptionFieldTypeNotAcc * Test for the createUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUserGroup() + * * @depends testCreateUserGroup */ public function testCreateUserGroupWhenMissingField() @@ -457,6 +470,7 @@ public function testCreateUserGroupWhenMissingField() * Test for the createUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUserGroup + * * @depends testNewUserGroupCreateStruct * @depends testLoadUserGroup */ @@ -501,13 +515,14 @@ public function testCreateUserGroupInTransactionWithRollback(): void } /* END: Use Case */ - $this->fail('User group object still exists after rollback.'); + self::fail('User group object still exists after rollback.'); } /** * Test for the deleteUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::deleteUserGroup() + * * @depends testCreateUserGroup */ public function testDeleteUserGroup() @@ -559,6 +574,7 @@ public function testDeleteUserGroupThrowsNotFoundException() * Test for the moveUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::moveUserGroup() + * * @depends testCreateUserGroup * @depends testLoadSubUserGroups */ @@ -598,8 +614,8 @@ static function ($content) { $subUserGroups ); - $this->assertEquals($membersGroupId, $userGroup->parentId); - $this->assertEquals([$userGroup->id], $subUserGroupIds); + self::assertEquals($membersGroupId, $userGroup->parentId); + self::assertEquals([$userGroup->id], $subUserGroupIds); } /** @@ -656,19 +672,20 @@ public function testNewUserGroupUpdateStruct() $groupUpdate = $userService->newUserGroupUpdateStruct(); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( UserGroupUpdateStruct::class, $groupUpdate ); - $this->assertNull($groupUpdate->contentUpdateStruct); - $this->assertNull($groupUpdate->contentMetadataUpdateStruct); + self::assertNull($groupUpdate->contentUpdateStruct); + self::assertNull($groupUpdate->contentMetadataUpdateStruct); } /** * Test for the updateUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::updateUserGroup() + * * @depends testCreateUserGroup * @depends testNewUserGroupUpdateStruct */ @@ -690,18 +707,19 @@ public function testUpdateUserGroup() ); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( UserGroup::class, $userGroup ); - $this->assertEquals(1, $userGroup->getVersionInfo()->versionNo); + self::assertEquals(1, $userGroup->getVersionInfo()->versionNo); } /** * Test for the updateUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::updateUserGroup() + * * @depends testUpdateUserGroup */ public function testUpdateUserGroupWithSubContentUpdateStruct() @@ -730,18 +748,19 @@ public function testUpdateUserGroupWithSubContentUpdateStruct() ); /* END: Use Case */ - $this->assertEquals('Sindelfingen', $userGroup->getFieldValue('name', 'eng-US')); + self::assertEquals('Sindelfingen', $userGroup->getFieldValue('name', 'eng-US')); $versionInfo = $userGroup->getVersionInfo(); - $this->assertEquals(APIVersionInfo::STATUS_PUBLISHED, $versionInfo->status); - $this->assertEquals(2, $versionInfo->versionNo); + self::assertEquals(APIVersionInfo::STATUS_PUBLISHED, $versionInfo->status); + self::assertEquals(2, $versionInfo->versionNo); } /** * Test for the updateUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::updateUserGroup() + * * @depends testUpdateUserGroup */ public function testUpdateUserGroupWithSubContentMetadataUpdateStruct() @@ -770,21 +789,22 @@ public function testUpdateUserGroupWithSubContentMetadataUpdateStruct() ); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( '3c61299780663bafa3af2101e52125da', $userGroup->contentInfo->remoteId ); $versionInfo = $userGroup->getVersionInfo(); - $this->assertEquals(APIVersionInfo::STATUS_PUBLISHED, $versionInfo->status); - $this->assertEquals(1, $versionInfo->versionNo); + self::assertEquals(APIVersionInfo::STATUS_PUBLISHED, $versionInfo->status); + self::assertEquals(1, $versionInfo->versionNo); } /** * Test for the updateUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::updateUserGroup() + * * @depends testUpdateUserGroup */ public function testUpdateUserGroupThrowsInvalidArgumentExceptionOnFieldTypeNotAccept() @@ -870,11 +890,12 @@ public function testUpdateUserGroupThrowsContentFieldValidationExceptionOnRequir * @param \Ibexa\Contracts\Core\Repository\Values\User\UserCreateStruct $userCreate * * @covers \Ibexa\Contracts\Core\Repository\UserService::newUserCreateStruct() + * * @depends testNewUserCreateStruct */ public function testNewUserCreateStructSetsExpectedProperties($userCreate) { - $this->assertEquals( + self::assertEquals( [ 'login' => 'user', 'email' => 'user@example.com', @@ -894,6 +915,7 @@ public function testNewUserCreateStructSetsExpectedProperties($userCreate) * Test for the newUserCreateStruct() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::newUserCreateStruct($login, $email, $password, $mainLanguageCode, $contentType) + * * @depends testNewUserCreateStruct */ public function testNewUserCreateStructWithFifthParameter() @@ -915,7 +937,7 @@ public function testNewUserCreateStructWithFifthParameter() ); /* END: Use Case */ - $this->assertSame($userType, $userCreate->contentType); + self::assertSame($userType, $userCreate->contentType); } public function testNewUserWithDomainName(): void @@ -937,6 +959,7 @@ public function testNewUserWithDomainName(): void * @return \Ibexa\Contracts\Core\Repository\Values\User\User * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUser() + * * @depends testLoadUserGroup * @depends testNewUserCreateStruct */ @@ -946,7 +969,7 @@ public function testCreateUser() $user = $this->createUserVersion1(); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( User::class, $user ); @@ -960,11 +983,12 @@ public function testCreateUser() * @param \Ibexa\Contracts\Core\Repository\Values\User\User $user * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUser() + * * @depends testCreateUser */ public function testCreateUserSetsExpectedProperties(User $user) { - $this->assertEquals( + self::assertEquals( [ 'login' => 'user', 'email' => 'user@example.com', @@ -982,6 +1006,7 @@ public function testCreateUserSetsExpectedProperties(User $user) * Test for the createUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUser() + * * @depends testCreateUser */ public function testCreateUserWhenMissingField() @@ -1022,6 +1047,7 @@ public function testCreateUserWhenMissingField() * Test for the createUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUser() + * * @depends testCreateUser */ public function testCreateUserThrowsInvalidArgumentExceptionOnFieldTypeNotAccept() @@ -1062,6 +1088,7 @@ public function testCreateUserThrowsInvalidArgumentExceptionOnFieldTypeNotAccept * Test for the createUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUser + * * @depends testCreateUser */ public function testCreateUserThrowsInvalidArgumentException() @@ -1103,13 +1130,14 @@ public function testCreateUserThrowsInvalidArgumentException() return; } - $this->fail('Expected ValidationError messages did not occur.'); + self::fail('Expected ValidationError messages did not occur.'); } /** * Test for the createUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUser + * * @depends testCreateUser */ public function testCreateUserWithEmailAlreadyTaken(): void @@ -1160,13 +1188,14 @@ public function testCreateUserWithEmailAlreadyTaken(): void return; } - $this->fail('Expected ValidationError messages did not occur.'); + self::fail('Expected ValidationError messages did not occur.'); } /** * Test for the createUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUser + * * @depends testCreateUser */ public function testCreateInvalidFormatUsername(): void @@ -1211,13 +1240,14 @@ public function testCreateInvalidFormatUsername(): void return; } - $this->fail('Expected ValidationError messages did not occur.'); + self::fail('Expected ValidationError messages did not occur.'); } /** * Test for the createUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::createUser + * * @depends testLoadUserGroup * @depends testNewUserCreateStruct */ @@ -1247,7 +1277,7 @@ public function testCreateUserInTransactionWithRollback(): void } /* END: Use Case */ - $this->fail('User object still exists after rollback.'); + self::fail('User object still exists after rollback.'); } /** @@ -1311,7 +1341,7 @@ public function testCreateUserWithWeakPasswordThrowsUserPasswordValidationExcept return; } - $this->fail('Expected ValidationError messages did not occur.'); + self::fail('Expected ValidationError messages did not occur.'); } /** @@ -1327,7 +1357,7 @@ public function testCreateUserWithStrongPassword() $user = $this->createTestUserWithPassword('H@xxi0r!', $userContentType); /* END: Use Case */ - $this->assertInstanceOf(User::class, $user); + self::assertInstanceOf(User::class, $user); } /** @@ -1361,6 +1391,7 @@ public function testLoadUser(): void * Test for the loadUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUser() + * * @depends testLoadUser */ public function testLoadUserThrowsNotFoundException() @@ -1381,6 +1412,7 @@ public function testLoadUserThrowsNotFoundException() /** * @covers \Ibexa\Contracts\Core\Repository\UserService::checkUserCredentials() + * * @depends testCreateUser */ public function testCheckUserCredentialsValid(): void @@ -1396,11 +1428,12 @@ public function testCheckUserCredentialsValid(): void $credentialsValid = $userService->checkUserCredentials($user, 'VerySecret@Password.1234'); /* END: Use Case */ - $this->assertTrue($credentialsValid); + self::assertTrue($credentialsValid); } /** * @covers \Ibexa\Contracts\Core\Repository\UserService::checkUserCredentials() + * * @depends testCreateUser */ public function testCheckUserCredentialsInvalid(): void @@ -1416,13 +1449,14 @@ public function testCheckUserCredentialsInvalid(): void $credentialsValid = $userService->checkUserCredentials($user, 'NotSoSecretPassword'); /* END: Use Case */ - $this->assertFalse($credentialsValid); + self::assertFalse($credentialsValid); } /** * Test for the loadUserByLogin() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUserByLogin() + * * @depends testCreateUser */ public function testLoadUserByLogin() @@ -1459,6 +1493,7 @@ public function testLoadUserByLogin() * Test for the loadUserByLogin() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUserByLogin() + * * @depends testLoadUserByLogin */ public function testLoadUserByLoginThrowsNotFoundExceptionForUnknownLogin() @@ -1482,6 +1517,7 @@ public function testLoadUserByLoginThrowsNotFoundExceptionForUnknownLogin() * Test for the loadUserByLogin() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUserByLogin() + * * @depends testLoadUserByLogin */ public function testLoadUserByLoginWorksForLoginWithWrongCase() @@ -1520,6 +1556,7 @@ public function testLoadUserByLoginWorksForLoginWithWrongCase() * In some cases people use email as login name, make sure system works as exepcted when asking for user by email. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUserByLogin() + * * @depends testLoadUserByLogin */ public function testLoadUserByLoginThrowsNotFoundExceptionForUnknownLoginByEmail() @@ -1562,6 +1599,7 @@ public function testLoadUserByEmail(): void * Test for the loadUsersByEmail() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUsersByEmail() + * * @depends testLoadUserByEmail */ public function testLoadUserByEmailReturnsEmptyInUnknownEmail() @@ -1578,13 +1616,14 @@ public function testLoadUserByEmailReturnsEmptyInUnknownEmail() $emptyUserList = $userService->loadUsersByEmail('user42@example.com'); /* END: Use Case */ - $this->assertEquals([], $emptyUserList); + self::assertEquals([], $emptyUserList); } /** * Test for the deleteUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::deleteUser() + * * @depends testCreateUser * @depends testLoadUser */ @@ -1611,6 +1650,7 @@ public function testDeleteUser() * Test for the deleteUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::deleteUser() + * * @depends testCreateUser * @depends testLoadUser */ @@ -1639,7 +1679,7 @@ public function testDeleteUserDeletesRelatedBookmarks() $repository->getPermissionResolver()->setCurrentUserReference($user); /* END: Use Case */ - $this->assertEquals(0, $bookmarkService->loadBookmarks(0, 9999)->totalCount); + self::assertEquals(0, $bookmarkService->loadBookmarks(0, 9999)->totalCount); } /** @@ -1658,13 +1698,13 @@ public function testNewUserUpdateStruct() $userUpdate = $userService->newUserUpdateStruct(); /* END: Use Case */ - $this->assertInstanceOf( + self::assertInstanceOf( UserUpdateStruct::class, $userUpdate ); - $this->assertNull($userUpdate->contentUpdateStruct); - $this->assertNull($userUpdate->contentMetadataUpdateStruct); + self::assertNull($userUpdate->contentUpdateStruct); + self::assertNull($userUpdate->contentMetadataUpdateStruct); $this->assertPropertiesCorrect( [ @@ -1683,6 +1723,7 @@ public function testNewUserUpdateStruct() * @return \Ibexa\Contracts\Core\Repository\Values\User\User * * @covers \Ibexa\Contracts\Core\Repository\UserService::updateUser() + * * @depends testCreateUser * @depends testNewUserUpdateStruct */ @@ -1707,7 +1748,7 @@ public function testUpdateUser() $userVersion2 = $userService->updateUser($user, $userUpdate); /* END: Use Case */ - $this->assertInstanceOf(User::class, $userVersion2); + self::assertInstanceOf(User::class, $userVersion2); return $userVersion2; } @@ -1725,22 +1766,23 @@ public function testUpdateUserEmail(): void // Check we get what we expect (and implicit warmup any kind of cache) $users = $userService->loadUsersByEmail('user2@example.com'); - $this->assertCount(0, $users); + self::assertCount(0, $users); // Update user with the given email address $userUpdate = $userService->newUserUpdateStruct(); $userUpdate->email = 'user2@example.com'; $updatedUser = $userService->updateUser($user, $userUpdate); - $this->assertInstanceOf(User::class, $updatedUser); + self::assertInstanceOf(User::class, $updatedUser); // Check that we can load user by email $users = $userService->loadUsersByEmail('user2@example.com'); - $this->assertCount(1, $users); - $this->assertInstanceOf(User::class, $users[0]); + self::assertCount(1, $users); + self::assertInstanceOf(User::class, $users[0]); } /** * @covers \Ibexa\Contracts\Core\Repository\UserService::updateUser + * * @depends testCreateUser * @depends testNewUserUpdateStruct */ @@ -1763,9 +1805,9 @@ public function testUpdateUserNoPassword(): void $userVersion2 = $userService->updateUser($user, $userUpdate); /* END: Use Case */ - $this->assertInstanceOf(User::class, $user); + self::assertInstanceOf(User::class, $user); - $this->assertEquals( + self::assertEquals( [ 'login' => $user->login, 'email' => $user->email, @@ -1791,11 +1833,12 @@ public function testUpdateUserNoPassword(): void * @param \Ibexa\Contracts\Core\Repository\Values\User\User $user * * @covers \Ibexa\Contracts\Core\Repository\UserService::updateUser() + * * @depends testUpdateUser */ public function testUpdateUserUpdatesExpectedProperties(User $user) { - $this->assertEquals( + self::assertEquals( [ 'login' => 'user', 'email' => 'user@example.com', @@ -1811,8 +1854,8 @@ public function testUpdateUserUpdatesExpectedProperties(User $user) ); // Make sure passwordUpdatedAt field has been updated together with password - $this->assertNotNull($user->passwordUpdatedAt); - $this->assertEqualsWithDelta( + self::assertNotNull($user->passwordUpdatedAt); + self::assertEqualsWithDelta( $user->getVersionInfo()->modificationDate->getTimestamp(), $user->passwordUpdatedAt->getTimestamp(), 2.0 @@ -1825,11 +1868,12 @@ public function testUpdateUserUpdatesExpectedProperties(User $user) * @param \Ibexa\Contracts\Core\Repository\Values\User\User $user * * @covers \Ibexa\Contracts\Core\Repository\UserService::updateUser() + * * @depends testUpdateUser */ public function testUpdateUserReturnsPublishedVersion(User $user) { - $this->assertEquals( + self::assertEquals( APIVersionInfo::STATUS_PUBLISHED, $user->getVersionInfo()->status ); @@ -1839,6 +1883,7 @@ public function testUpdateUserReturnsPublishedVersion(User $user) * Test for the updateUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::updateUser() + * * @depends testUpdateUser */ public function testUpdateUserWithContentMetadataUpdateStruct() @@ -1870,13 +1915,14 @@ public function testUpdateUserWithContentMetadataUpdateStruct() $remoteId = $userVersion2->contentInfo->remoteId; /* END: Use Case */ - $this->assertEquals('85e10037d1ac0a00aa75443ced483e08', $remoteId); + self::assertEquals('85e10037d1ac0a00aa75443ced483e08', $remoteId); } /** * Test for the updateUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::updateUser() + * * @depends testUpdateUser */ public function testUpdateUserWithContentUpdateStruct() @@ -1912,13 +1958,14 @@ public function testUpdateUserWithContentUpdateStruct() ); /* END: Use Case */ - $this->assertEquals('Hello World', $name); + self::assertEquals('Hello World', $name); } /** * Test for the updateUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::updateUser() + * * @depends testUpdateUser */ public function testUpdateUserWhenMissingField() @@ -1956,6 +2003,7 @@ public function testUpdateUserWhenMissingField() * Test for the updateUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::updateUser() + * * @depends testUpdateUser */ public function testUpdateUserThrowsInvalidArgumentExceptionOnFieldTypeNotAccept() @@ -2021,7 +2069,7 @@ public function testUpdateUserWithWeakPasswordThrowsUserPasswordValidationExcept return; } - $this->fail('Expected ValidationError messages did not occur.'); + self::fail('Expected ValidationError messages did not occur.'); } /** @@ -2043,7 +2091,7 @@ public function testUpdateUserWithStrongPassword() $user = $userService->updateUser($user, $userUpdate); /* END: Use Case */ - $this->assertInstanceOf(User::class, $user); + self::assertInstanceOf(User::class, $user); } /** @@ -2104,7 +2152,7 @@ public function testUpdateUserPasswordWorksWithUserPasswordRole(): void $userService->updateUserPassword($user, 'new password'); $user = $userService->loadUserByLogin('with_role_password'); - $this->assertNotEquals($previousHash, $user->passwordHash); + self::assertNotEquals($previousHash, $user->passwordHash); } /** @@ -2135,6 +2183,7 @@ public function testUpdateUserPasswordWithUnsupportedHashType(): void * Test for the loadUserGroupsOfUser() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUserGroupsOfUser + * * @depends testCreateUser */ public function testLoadUserGroupsOfUser() @@ -2149,18 +2198,19 @@ public function testLoadUserGroupsOfUser() // This array will contain the "Editors" user group name $userGroupNames = []; foreach ($userService->loadUserGroupsOfUser($user) as $userGroup) { - $this->assertInstanceOf(UserGroup::class, $userGroup); + self::assertInstanceOf(UserGroup::class, $userGroup); $userGroupNames[] = $userGroup->getFieldValue('name'); } /* END: Use Case */ - $this->assertEquals(['Editors'], $userGroupNames); + self::assertEquals(['Editors'], $userGroupNames); } /** * Test for the loadUsersOfUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUsersOfUserGroup + * * @depends testCreateUser */ public function testLoadUsersOfUserGroup() @@ -2178,17 +2228,18 @@ public function testLoadUsersOfUserGroup() // This array will contain the email of the newly created "Editor" user $email = []; foreach ($userService->loadUsersOfUserGroup($group) as $user) { - $this->assertInstanceOf(User::class, $user); + self::assertInstanceOf(User::class, $user); $email[] = $user->email; } /* END: Use Case */ - $this->assertEquals(['user@example.com'], $email); + self::assertEquals(['user@example.com'], $email); } /** * Test for the assignUserToUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::assignUserToUserGroup() + * * @depends testLoadUserGroupsOfUser */ public function testAssignUserToUserGroup() @@ -2218,7 +2269,7 @@ public function testAssignUserToUserGroup() sort($userGroupNames, SORT_STRING); - $this->assertEquals( + self::assertEquals( [ 'Administrator users', 'Editors', @@ -2231,6 +2282,7 @@ public function testAssignUserToUserGroup() * Test for the assignUserToUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::assignUserToUserGroup + * * @depends testAssignUserToUserGroup */ public function testAssignUserToUserGroupThrowsInvalidArgumentException() @@ -2293,6 +2345,7 @@ public function testAssignUserToGroupWithLocationsValidation(): void * Test for the unAssignUssrFromUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::unAssignUssrFromUserGroup() + * * @depends testLoadUserGroupsOfUser */ public function testUnAssignUserFromUserGroup() @@ -2328,13 +2381,14 @@ public function testUnAssignUserFromUserGroup() } /* END: Use Case */ - $this->assertEquals(['Anonymous users'], $userGroupNames); + self::assertEquals(['Anonymous users'], $userGroupNames); } /** * Test for the unAssignUserFromUserGroup() method. * * @covers \Ibexa\Contracts\Core\Repository\UserService::unAssignUserFromUserGroup() + * * @depends testUnAssignUserFromUserGroup */ public function testUnAssignUserFromUserGroupThrowsInvalidArgumentException() @@ -2363,6 +2417,7 @@ public function testUnAssignUserFromUserGroupThrowsInvalidArgumentException() * Test for the unAssignUserFromUserGroup() method removing user from the last group. * * @covers \Ibexa\Contracts\Core\Repository\UserService::unAssignUserFromUserGroup + * * @depends testUnAssignUserFromUserGroup */ public function testUnAssignUserFromUserGroupThrowsBadStateArgumentException() @@ -2432,6 +2487,7 @@ public function testUnAssignUserToGroupWithLocationValidation(): void * Test that multi-language logic for the loadUserGroup method respects prioritized language list. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUserGroup + * * @dataProvider getPrioritizedLanguageList * * @param string[] $prioritizedLanguages @@ -2465,6 +2521,7 @@ public function testLoadUserGroupWithPrioritizedLanguagesList( * Test that multi-language logic works correctly after updating user group main language. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUserGroup + * * @dataProvider getPrioritizedLanguageList * * @param string[] $prioritizedLanguages @@ -2505,6 +2562,7 @@ public function testLoadUserGroupWithPrioritizedLanguagesListAfterMainLanguageUp * Test that multi-language logic for the loadSubUserGroups method respects prioritized language list. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadSubUserGroups + * * @dataProvider getPrioritizedLanguageList * * @param string[] $prioritizedLanguages @@ -2546,6 +2604,7 @@ public function testLoadSubUserGroupsWithPrioritizedLanguagesList( * Test that multi-language logic for the loadUser method respects prioritized language list. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUser + * * @dataProvider getPrioritizedLanguageList * * @param string[] $prioritizedLanguages @@ -2583,6 +2642,7 @@ public function testLoadUserWithPrioritizedLanguagesList( * user content main language. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUserGroup + * * @dataProvider getPrioritizedLanguageList * * @param string[] $prioritizedLanguages @@ -2627,6 +2687,7 @@ public function testLoadUserWithPrioritizedLanguagesListAfterMainLanguageUpdate( * Test that multi-language logic for the loadUserByLogin method respects prioritized language list. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUserByLogin + * * @dataProvider getPrioritizedLanguageList * * @param string[] $prioritizedLanguages @@ -2664,6 +2725,7 @@ public function testLoadUserByLoginWithPrioritizedLanguagesList( * prioritized language list. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUsersByEmail + * * @dataProvider getPrioritizedLanguageList * * @param string[] $prioritizedLanguages @@ -2703,6 +2765,7 @@ public function testLoadUsersByEmailWithPrioritizedLanguagesList( * prioritized language list. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUserGroupsOfUser + * * @dataProvider getPrioritizedLanguageList * * @param string[] $prioritizedLanguages @@ -2735,6 +2798,7 @@ public function testLoadUserGroupsOfUserWithPrioritizedLanguagesList( * prioritized language list. * * @covers \Ibexa\Contracts\Core\Repository\UserService::loadUsersOfUserGroup + * * @dataProvider getPrioritizedLanguageList * * @param string[] $prioritizedLanguages @@ -2923,7 +2987,7 @@ public function testCreateUserWithDefaultPasswordHashTypeWhenHashTypeIsUnsupport } if (!$userFieldDef) { - $this->fail('User FieldType not found in userCreateStruct!'); + self::fail('User FieldType not found in userCreateStruct!'); } /** @var \Ibexa\Core\FieldType\User\Value $userValue */ @@ -3037,11 +3101,12 @@ public function testValidatePasswordWithDefaultContext() $errors = $userService->validatePassword('pass'); /* END: Use Case */ - $this->assertEmpty($errors); + self::assertEmpty($errors); } /** * @covers \Ibexa\Contracts\Core\Repository\UserService::validatePassword() + * * @dataProvider dataProviderForValidatePassword */ public function testValidatePassword(string $password, array $expectedErrors) @@ -3057,7 +3122,7 @@ public function testValidatePassword(string $password, array $expectedErrors) $actualErrors = $userService->validatePassword($password, $context); /* END: Use Case */ - $this->assertEquals($expectedErrors, $actualErrors); + self::assertEquals($expectedErrors, $actualErrors); } public function testValidatePasswordReturnsErrorWhenOldPasswordIsReused(): void @@ -3077,7 +3142,7 @@ public function testValidatePasswordReturnsErrorWhenOldPasswordIsReused(): void $actualErrors = $userService->validatePassword($password, $context); - $this->assertEquals( + self::assertEquals( [new ValidationError('New password cannot be the same as old password', null, [], 'password')], $actualErrors ); @@ -3207,7 +3272,7 @@ public function testGetPasswordInfo(): void new DateInterval(sprintf('P%dD', self::EXAMPLE_PASSWORD_TTL - self::EXAMPLE_PASSWORD_TTL_WARNING)) ); - $this->assertEquals(new PasswordInfo( + self::assertEquals(new PasswordInfo( $expectedPasswordExpirationDate, $expectedPasswordExpirationWarningDate ), $passwordInfo); @@ -3224,7 +3289,7 @@ public function testGetPasswordInfoIfExpirationIsDisabled(): void $passwordInfo = $userService->getPasswordInfo($user); /* END: Use Case */ - $this->assertEquals(new PasswordInfo(), $passwordInfo); + self::assertEquals(new PasswordInfo(), $passwordInfo); } public function testGetPasswordInfoIfExpirationWarningIsDisabled(): void @@ -3247,7 +3312,7 @@ public function testGetPasswordInfoIfExpirationWarningIsDisabled(): void new DateInterval(sprintf('P%dD', self::EXAMPLE_PASSWORD_TTL)) ); - $this->assertEquals(new PasswordInfo($expectedPasswordExpirationDate, null), $passwordInfo); + self::assertEquals(new PasswordInfo($expectedPasswordExpirationDate, null), $passwordInfo); } public function createTestUser(ContentType $contentType): User diff --git a/tests/integration/Core/Repository/Values/User/Limitation/BaseLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/BaseLimitationTest.php index 0dc2300afd..cefdd9cddb 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/BaseLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/BaseLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Values\Content\Content; diff --git a/tests/integration/Core/Repository/Values/User/Limitation/ChangeOwnerLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/ChangeOwnerLimitationTest.php index 81f1ff6e97..1180f31a51 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/ChangeOwnerLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/ChangeOwnerLimitationTest.php @@ -21,6 +21,7 @@ /** * @covers \Ibexa\Contracts\Core\Repository\Values\User\Limitation\ChangeOwnerLimitation + * * @group integration * @group limitation */ diff --git a/tests/integration/Core/Repository/Values/User/Limitation/ContentTypeLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/ContentTypeLimitationTest.php index e98cfc7e6c..8230b83db7 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/ContentTypeLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/ContentTypeLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -11,6 +12,7 @@ /** * @covers \Ibexa\Contracts\Core\Repository\Values\User\Limitation\ContentTypeLimitation + * * @group integration * @group limitation */ @@ -80,7 +82,7 @@ public function testContentTypeLimitationAllow() ); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( 'Your wiki page', $updateContent->getFieldValue('title')->text ); diff --git a/tests/integration/Core/Repository/Values/User/Limitation/LanguageLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/LanguageLimitationTest.php index ccad8afbfc..22c4609ade 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/LanguageLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/LanguageLimitationTest.php @@ -389,7 +389,7 @@ public function testPublishVersionTranslation(): void $permissionResolver->setCurrentUserReference($admin); $content = $contentService->loadContent($draft->contentInfo->id); - $this->assertEquals( + self::assertEquals( [ self::ENG_US => 'Published US', self::GER_DE => 'Draft 1 DE', diff --git a/tests/integration/Core/Repository/Values/User/Limitation/LocationLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/LocationLimitationTest.php index b7089c4248..f6fdbe96e7 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/LocationLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/LocationLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -11,6 +12,7 @@ /** * @covers \Ibexa\Contracts\Core\Repository\Values\User\Limitation\LocationLimitation + * * @group integration * @group limitation */ @@ -48,7 +50,7 @@ public function testLocationLimitationAllow() $draft = $this->createWikiPageDraft(); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( 'An awesome wiki page', $draft->getFieldValue('title')->text ); diff --git a/tests/integration/Core/Repository/Values/User/Limitation/NewObjectStateLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/NewObjectStateLimitationTest.php index 32cb00d697..46df7d0a86 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/NewObjectStateLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/NewObjectStateLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -11,6 +12,7 @@ /** * @covers \Ibexa\Contracts\Core\Repository\Values\User\Limitation\NewObjectStateLimitation + * * @group integration * @group limitation */ diff --git a/tests/integration/Core/Repository/Values/User/Limitation/NewSectionLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/NewSectionLimitationTest.php index e5f4d1e6a4..fce555f8a5 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/NewSectionLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/NewSectionLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -11,6 +12,7 @@ /** * @covers \Ibexa\Contracts\Core\Repository\Values\User\Limitation\NewSectionLimitation + * * @group integration * @group limitation */ @@ -61,7 +63,7 @@ public function testNewSectionLimitationAllow() ); /* END: Use Case */ - $this->assertSame( + self::assertSame( $sectionId, $contentService->loadContentInfo($contentId)->getSectionId() ); diff --git a/tests/integration/Core/Repository/Values/User/Limitation/ObjectStateLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/ObjectStateLimitationTest.php index 512cc06a47..ff4bcacbfb 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/ObjectStateLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/ObjectStateLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; diff --git a/tests/integration/Core/Repository/Values/User/Limitation/OwnerLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/OwnerLimitationTest.php index 30a35ee928..b37e378818 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/OwnerLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/OwnerLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException; @@ -12,6 +13,7 @@ /** * @covers \Ibexa\Contracts\Core\Repository\Values\User\Limitation\OwnerLimitation + * * @group integration * @group limitation */ diff --git a/tests/integration/Core/Repository/Values/User/Limitation/ParentContentTypeLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/ParentContentTypeLimitationTest.php index 998cff0a1d..724edc6bbb 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/ParentContentTypeLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/ParentContentTypeLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -12,6 +13,7 @@ /** * @covers \Ibexa\Contracts\Core\Repository\Values\User\Limitation\ParentContentTypeLimitation + * * @group integration * @group limitation */ @@ -59,7 +61,7 @@ public function testParentContentTypeLimitationAllow() $content = $contentService->publishVersion($draft->versionInfo); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( 'An awesome wiki page', $content->getFieldValue('title')->text ); diff --git a/tests/integration/Core/Repository/Values/User/Limitation/ParentDepthLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/ParentDepthLimitationTest.php index 46a83de63b..5a1a85ae28 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/ParentDepthLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/ParentDepthLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -12,6 +13,7 @@ /** * @covers \Ibexa\Contracts\Core\Repository\Values\User\Limitation\ParentDepthLimitation + * * @group integration * @group limitation */ @@ -51,7 +53,7 @@ public function testParentDepthLimitationForbid() $draft = $this->createWikiPageDraft(); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( 'An awesome wiki page', $draft->getFieldValue('title')->text ); diff --git a/tests/integration/Core/Repository/Values/User/Limitation/ParentOwnerLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/ParentOwnerLimitationTest.php index 6ddc4b6c2d..a5752f61a7 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/ParentOwnerLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/ParentOwnerLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -11,6 +12,7 @@ /** * @covers \Ibexa\Contracts\Core\Repository\Values\User\Limitation\ParentOwnerLimitation + * * @group integration * @group limitation */ @@ -53,7 +55,7 @@ public function testParentOwnerLimitationAllow() $draft = $this->createWikiPageDraft(); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( 'An awesome wiki page', $draft->getFieldValue('title')->text ); diff --git a/tests/integration/Core/Repository/Values/User/Limitation/ParentUserGroupLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/ParentUserGroupLimitationTest.php index 142e85dac9..fede641c40 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/ParentUserGroupLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/ParentUserGroupLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -11,6 +12,7 @@ /** * @covers \Ibexa\Contracts\Core\Repository\Values\User\Limitation\ParentUserGroupLimitation + * * @group integration * @group limitation */ @@ -72,7 +74,7 @@ public function testParentUserGroupLimitationAllow() $draft = $this->createWikiPageDraft(); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( 'An awesome wiki page', $draft->getFieldValue('title')->text ); diff --git a/tests/integration/Core/Repository/Values/User/Limitation/RolePolicyLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/RolePolicyLimitationTest.php index 909bf0be17..c6c84e2022 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/RolePolicyLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/RolePolicyLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery; @@ -23,7 +24,7 @@ public function providerForTestRolePoliciesWithOverlappingLimitations() { // get actual locations count for the given subtree when user is (by default) an admin $actualSubtreeLocationsCount = $this->getSubtreeLocationsCount('/1/2/'); - $this->assertGreaterThan(0, $actualSubtreeLocationsCount); + self::assertGreaterThan(0, $actualSubtreeLocationsCount); return [ [$actualSubtreeLocationsCount, 'content', '*'], @@ -90,10 +91,10 @@ public function testRolePoliciesWithOverlappingLimitations( $this->refreshSearch($repository); // check if searching by subtree returns the same result as for an admin - $this->assertEquals($expectedSubtreeLocationsCount, $this->getSubtreeLocationsCount($subtreePathString)); + self::assertEquals($expectedSubtreeLocationsCount, $this->getSubtreeLocationsCount($subtreePathString)); // check if searching by subtree which is not a part of role assignment limitation does not return results - $this->assertEquals(0, $this->getSubtreeLocationsCount('/1/5/')); + self::assertEquals(0, $this->getSubtreeLocationsCount('/1/5/')); } /** diff --git a/tests/integration/Core/Repository/Values/User/Limitation/SectionLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/SectionLimitationTest.php index e3f6e48068..b8c9ab94c0 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/SectionLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/SectionLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -11,6 +12,7 @@ /** * @covers \Ibexa\Contracts\Core\Repository\Values\User\Limitation\SectionLimitation + * * @group integration * @group limitation */ @@ -68,7 +70,7 @@ public function testSectionLimitationAllow() $images = $contentService->loadContentByRemoteId('e7ff633c6b8e0fd3531e74c6e712bead'); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( 'Images', $images->getFieldValue('name')->text ); diff --git a/tests/integration/Core/Repository/Values/User/Limitation/StatusLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/StatusLimitationTest.php index a2b5481b71..e947bc50d0 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/StatusLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/StatusLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -12,6 +13,7 @@ /** * @covers \Ibexa\Contracts\Core\Repository\Values\User\Limitation\StatusLimitation + * * @group integration * @group limitation */ @@ -72,7 +74,7 @@ public function testStatusLimitationAllow() ); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( 'An awesome wiki page', $loadedDraft->getFieldValue('title')->text ); diff --git a/tests/integration/Core/Repository/Values/User/Limitation/SubtreeLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/SubtreeLimitationTest.php index 0fd2fa41d4..6f78d4a62c 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/SubtreeLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/SubtreeLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -13,6 +14,7 @@ /** * @covers \Ibexa\Contracts\Core\Repository\Values\User\Limitation\SubtreeLimitation + * * @group integration * @group limitation */ @@ -50,7 +52,7 @@ public function testSubtreeLimitationAllow() $userService->updateUserGroup($userGroup, $groupUpdate); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( 'Ibexa Editors', $userService->loadUserGroup($userGroupId) ->getFieldValue('name') diff --git a/tests/integration/Core/Repository/Values/User/Limitation/UserGroupLimitationTest.php b/tests/integration/Core/Repository/Values/User/Limitation/UserGroupLimitationTest.php index 8f7fe568b5..842b3d4a66 100644 --- a/tests/integration/Core/Repository/Values/User/Limitation/UserGroupLimitationTest.php +++ b/tests/integration/Core/Repository/Values/User/Limitation/UserGroupLimitationTest.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\Integration\Core\Repository\Values\User\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException; @@ -13,6 +14,7 @@ /** * @covers \Ibexa\Contracts\Core\Repository\Values\User\Limitation\UserGroupLimitation + * * @group integration * @group limitation */ @@ -36,7 +38,7 @@ public function testUserGroupLimitationAllow() $draft = $this->prepareLimitationAndContent($user, $userGroup); /* END: Use Case */ - $this->assertEquals( + self::assertEquals( 'An awesome wiki page', $draft->getFieldValue('title')->text ); diff --git a/tests/integration/Core/User/UserStorage/UserStorageGatewayTest.php b/tests/integration/Core/User/UserStorage/UserStorageGatewayTest.php index 4725712a56..0236ac340d 100644 --- a/tests/integration/Core/User/UserStorage/UserStorageGatewayTest.php +++ b/tests/integration/Core/User/UserStorage/UserStorageGatewayTest.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\Integration\Core\User\UserStorage; use Ibexa\Contracts\Core\Test\Persistence\Fixture\FixtureImporter; diff --git a/tests/lib/Base/Container/Compiler/FieldTypeRegistryPassTest.php b/tests/lib/Base/Container/Compiler/FieldTypeRegistryPassTest.php index 9eb8e855bc..fe7b747785 100644 --- a/tests/lib/Base/Container/Compiler/FieldTypeRegistryPassTest.php +++ b/tests/lib/Base/Container/Compiler/FieldTypeRegistryPassTest.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\Core\Base\Container\Compiler; use Ibexa\Core\Base\Container\Compiler\FieldTypeRegistryPass; diff --git a/tests/lib/Base/Container/Compiler/Search/FieldTypeRegistryPassTest.php b/tests/lib/Base/Container/Compiler/Search/FieldTypeRegistryPassTest.php index f3aa1f4720..a0f410457b 100644 --- a/tests/lib/Base/Container/Compiler/Search/FieldTypeRegistryPassTest.php +++ b/tests/lib/Base/Container/Compiler/Search/FieldTypeRegistryPassTest.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\Core\Base\Container\Compiler\Search; use Ibexa\Core\Base\Container\Compiler\Search\FieldRegistryPass; diff --git a/tests/lib/Base/Container/Compiler/Search/Legacy/CriteriaConverterPassTest.php b/tests/lib/Base/Container/Compiler/Search/Legacy/CriteriaConverterPassTest.php index e0baf23b1c..2681e2efaa 100644 --- a/tests/lib/Base/Container/Compiler/Search/Legacy/CriteriaConverterPassTest.php +++ b/tests/lib/Base/Container/Compiler/Search/Legacy/CriteriaConverterPassTest.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\Core\Base\Container\Compiler\Search\Legacy; use Ibexa\Core\Base\Container\Compiler\Search\Legacy\CriteriaConverterPass; diff --git a/tests/lib/Base/Container/Compiler/Search/Legacy/CriterionFieldValueHandlerRegistryPassTest.php b/tests/lib/Base/Container/Compiler/Search/Legacy/CriterionFieldValueHandlerRegistryPassTest.php index e7a62c26bd..e9151158c9 100644 --- a/tests/lib/Base/Container/Compiler/Search/Legacy/CriterionFieldValueHandlerRegistryPassTest.php +++ b/tests/lib/Base/Container/Compiler/Search/Legacy/CriterionFieldValueHandlerRegistryPassTest.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\Core\Base\Container\Compiler\Search\Legacy; use Ibexa\Core\Base\Container\Compiler\Search\Legacy\CriterionFieldValueHandlerRegistryPass; diff --git a/tests/lib/Base/Container/Compiler/Search/Legacy/SortClauseConverterPassTest.php b/tests/lib/Base/Container/Compiler/Search/Legacy/SortClauseConverterPassTest.php index d4f5ca5e27..3e4f5e3c51 100644 --- a/tests/lib/Base/Container/Compiler/Search/Legacy/SortClauseConverterPassTest.php +++ b/tests/lib/Base/Container/Compiler/Search/Legacy/SortClauseConverterPassTest.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\Core\Base\Container\Compiler\Search\Legacy; use Ibexa\Core\Base\Container\Compiler\Search\Legacy\SortClauseConverterPass; diff --git a/tests/lib/Base/Container/Compiler/Storage/ExternalStorageRegistryPassTest.php b/tests/lib/Base/Container/Compiler/Storage/ExternalStorageRegistryPassTest.php index 8e22e13311..2a69585ed3 100644 --- a/tests/lib/Base/Container/Compiler/Storage/ExternalStorageRegistryPassTest.php +++ b/tests/lib/Base/Container/Compiler/Storage/ExternalStorageRegistryPassTest.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\Core\Base\Container\Compiler\Storage; use Ibexa\Core\Base\Container\Compiler\Storage\ExternalStorageRegistryPass; diff --git a/tests/lib/Base/Container/Compiler/Storage/Legacy/FieldValueConverterRegistryPassTest.php b/tests/lib/Base/Container/Compiler/Storage/Legacy/FieldValueConverterRegistryPassTest.php index 5fb61ebc96..30e890a5d0 100644 --- a/tests/lib/Base/Container/Compiler/Storage/Legacy/FieldValueConverterRegistryPassTest.php +++ b/tests/lib/Base/Container/Compiler/Storage/Legacy/FieldValueConverterRegistryPassTest.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\Core\Base\Container\Compiler\Storage\Legacy; use Ibexa\Core\Base\Container\Compiler\Storage\Legacy\FieldValueConverterRegistryPass; diff --git a/tests/lib/Base/Container/Compiler/Storage/Legacy/RoleLimitationConverterPassTest.php b/tests/lib/Base/Container/Compiler/Storage/Legacy/RoleLimitationConverterPassTest.php index 95f9e1db5c..8d5ec2d4a6 100644 --- a/tests/lib/Base/Container/Compiler/Storage/Legacy/RoleLimitationConverterPassTest.php +++ b/tests/lib/Base/Container/Compiler/Storage/Legacy/RoleLimitationConverterPassTest.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\Core\Base\Container\Compiler\Storage\Legacy; use Ibexa\Core\Base\Container\Compiler\Storage\Legacy\RoleLimitationConverterPass; diff --git a/tests/lib/Base/Container/Compiler/Stubs/GatewayBasedStorageHandler.php b/tests/lib/Base/Container/Compiler/Stubs/GatewayBasedStorageHandler.php index f25b98a7a5..e20ddf153f 100644 --- a/tests/lib/Base/Container/Compiler/Stubs/GatewayBasedStorageHandler.php +++ b/tests/lib/Base/Container/Compiler/Stubs/GatewayBasedStorageHandler.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\Core\Base\Container\Compiler\Stubs; use Ibexa\Contracts\Core\Persistence\Content\Field; diff --git a/tests/lib/Base/Container/Compiler/TaggedServiceIdsIterator/BackwardCompatibleIteratorTest.php b/tests/lib/Base/Container/Compiler/TaggedServiceIdsIterator/BackwardCompatibleIteratorTest.php index 936d947ce7..effbe631c2 100644 --- a/tests/lib/Base/Container/Compiler/TaggedServiceIdsIterator/BackwardCompatibleIteratorTest.php +++ b/tests/lib/Base/Container/Compiler/TaggedServiceIdsIterator/BackwardCompatibleIteratorTest.php @@ -67,7 +67,7 @@ public function testGetIterator(): void self::EXAMPLE_DEPRECATED_SERVICE_TAG ); - $this->assertEquals([ + self::assertEquals([ 'app.service.foo' => [ ['alias' => 'foo'], ], @@ -95,7 +95,7 @@ private function assertDeprecationError(string $expectedMessage): void } } - $this->fail(sprintf( + self::fail(sprintf( 'Failed asserting that deprecation warning with message "%s" has been triggered', $expectedMessage )); diff --git a/tests/lib/Event/AbstractServiceTest.php b/tests/lib/Event/AbstractServiceTest.php index 8dd461c73c..28781248ea 100644 --- a/tests/lib/Event/AbstractServiceTest.php +++ b/tests/lib/Event/AbstractServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\Event\AfterEvent; diff --git a/tests/lib/Event/BookmarkServiceTest.php b/tests/lib/Event/BookmarkServiceTest.php index e052c50b13..c87848a866 100644 --- a/tests/lib/Event/BookmarkServiceTest.php +++ b/tests/lib/Event/BookmarkServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\BookmarkService as BookmarkServiceInterface; @@ -34,11 +35,11 @@ public function testCreateBookmarkEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeCreateBookmarkEvent::class, 0], [CreateBookmarkEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateBookmarkStopPropagationInBeforeEvents() @@ -64,10 +65,10 @@ public function testCreateBookmarkStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeCreateBookmarkEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateBookmarkEvent::class, 0], [CreateBookmarkEvent::class, 0], ]); @@ -91,11 +92,11 @@ public function testDeleteBookmarkEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteBookmarkEvent::class, 0], [DeleteBookmarkEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteBookmarkStopPropagationInBeforeEvents() @@ -121,10 +122,10 @@ public function testDeleteBookmarkStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteBookmarkEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteBookmarkEvent::class, 0], [DeleteBookmarkEvent::class, 0], ]); diff --git a/tests/lib/Event/ContentServiceTest.php b/tests/lib/Event/ContentServiceTest.php index 3a5761249b..c58032f77f 100644 --- a/tests/lib/Event/ContentServiceTest.php +++ b/tests/lib/Event/ContentServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\ContentService as ContentServiceInterface; @@ -66,12 +67,12 @@ public function testDeleteContentEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($locations, $result); - $this->assertSame($calledListeners, [ + self::assertSame($locations, $result); + self::assertSame($calledListeners, [ [BeforeDeleteContentEvent::class, 0], [DeleteContentEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnDeleteContentResultInBeforeEvents() @@ -99,13 +100,13 @@ public function testReturnDeleteContentResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventLocations, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventLocations, $result); + self::assertSame($calledListeners, [ [BeforeDeleteContentEvent::class, 10], [BeforeDeleteContentEvent::class, 0], [DeleteContentEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteContentStopPropagationInBeforeEvents() @@ -135,11 +136,11 @@ public function testDeleteContentStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventLocations, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventLocations, $result); + self::assertSame($calledListeners, [ [BeforeDeleteContentEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteContentEvent::class, 0], [DeleteContentEvent::class, 0], ]); @@ -167,12 +168,12 @@ public function testCopyContentEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($content, $result); - $this->assertSame($calledListeners, [ + self::assertSame($content, $result); + self::assertSame($calledListeners, [ [BeforeCopyContentEvent::class, 0], [CopyContentEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCopyContentResultInBeforeEvents() @@ -202,13 +203,13 @@ public function testReturnCopyContentResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventContent, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContent, $result); + self::assertSame($calledListeners, [ [BeforeCopyContentEvent::class, 10], [BeforeCopyContentEvent::class, 0], [CopyContentEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCopyContentStopPropagationInBeforeEvents() @@ -240,11 +241,11 @@ public function testCopyContentStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventContent, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContent, $result); + self::assertSame($calledListeners, [ [BeforeCopyContentEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCopyContentEvent::class, 0], [CopyContentEvent::class, 0], ]); @@ -271,12 +272,12 @@ public function testUpdateContentEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($content, $result); - $this->assertSame($calledListeners, [ + self::assertSame($content, $result); + self::assertSame($calledListeners, [ [BeforeUpdateContentEvent::class, 0], [UpdateContentEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnUpdateContentResultInBeforeEvents() @@ -305,13 +306,13 @@ public function testReturnUpdateContentResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventContent, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContent, $result); + self::assertSame($calledListeners, [ [BeforeUpdateContentEvent::class, 10], [BeforeUpdateContentEvent::class, 0], [UpdateContentEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateContentStopPropagationInBeforeEvents() @@ -342,11 +343,11 @@ public function testUpdateContentStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventContent, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContent, $result); + self::assertSame($calledListeners, [ [BeforeUpdateContentEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateContentEvent::class, 0], [UpdateContentEvent::class, 0], ]); @@ -371,11 +372,11 @@ public function testDeleteRelationEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteRelationEvent::class, 0], [DeleteRelationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteRelationStopPropagationInBeforeEvents() @@ -402,10 +403,10 @@ public function testDeleteRelationStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteRelationEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteRelationEvent::class, 0], [DeleteRelationEvent::class, 0], ]); @@ -432,12 +433,12 @@ public function testCreateContentEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($content, $result); - $this->assertSame($calledListeners, [ + self::assertSame($content, $result); + self::assertSame($calledListeners, [ [BeforeCreateContentEvent::class, 0], [CreateContentEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateContentResultInBeforeEvents() @@ -466,13 +467,13 @@ public function testReturnCreateContentResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventContent, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContent, $result); + self::assertSame($calledListeners, [ [BeforeCreateContentEvent::class, 10], [BeforeCreateContentEvent::class, 0], [CreateContentEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateContentStopPropagationInBeforeEvents() @@ -503,11 +504,11 @@ public function testCreateContentStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventContent, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContent, $result); + self::assertSame($calledListeners, [ [BeforeCreateContentEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateContentEvent::class, 0], [CreateContentEvent::class, 0], ]); @@ -531,11 +532,11 @@ public function testHideContentEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeHideContentEvent::class, 0], [HideContentEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testHideContentStopPropagationInBeforeEvents() @@ -561,10 +562,10 @@ public function testHideContentStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeHideContentEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeHideContentEvent::class, 0], [HideContentEvent::class, 0], ]); @@ -588,11 +589,11 @@ public function testDeleteVersionEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteVersionEvent::class, 0], [DeleteVersionEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteVersionStopPropagationInBeforeEvents() @@ -618,10 +619,10 @@ public function testDeleteVersionStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteVersionEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteVersionEvent::class, 0], [DeleteVersionEvent::class, 0], ]); @@ -648,12 +649,12 @@ public function testAddRelationEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($relation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($relation, $result); + self::assertSame($calledListeners, [ [BeforeAddRelationEvent::class, 0], [AddRelationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnAddRelationResultInBeforeEvents() @@ -682,13 +683,13 @@ public function testReturnAddRelationResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventRelation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventRelation, $result); + self::assertSame($calledListeners, [ [BeforeAddRelationEvent::class, 10], [BeforeAddRelationEvent::class, 0], [AddRelationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testAddRelationStopPropagationInBeforeEvents() @@ -719,11 +720,11 @@ public function testAddRelationStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventRelation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventRelation, $result); + self::assertSame($calledListeners, [ [BeforeAddRelationEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [AddRelationEvent::class, 0], [BeforeAddRelationEvent::class, 0], ]); @@ -750,12 +751,12 @@ public function testUpdateContentMetadataEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($content, $result); - $this->assertSame($calledListeners, [ + self::assertSame($content, $result); + self::assertSame($calledListeners, [ [BeforeUpdateContentMetadataEvent::class, 0], [UpdateContentMetadataEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnUpdateContentMetadataResultInBeforeEvents() @@ -784,13 +785,13 @@ public function testReturnUpdateContentMetadataResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventContent, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContent, $result); + self::assertSame($calledListeners, [ [BeforeUpdateContentMetadataEvent::class, 10], [BeforeUpdateContentMetadataEvent::class, 0], [UpdateContentMetadataEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateContentMetadataStopPropagationInBeforeEvents() @@ -821,11 +822,11 @@ public function testUpdateContentMetadataStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventContent, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContent, $result); + self::assertSame($calledListeners, [ [BeforeUpdateContentMetadataEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateContentMetadataEvent::class, 0], [UpdateContentMetadataEvent::class, 0], ]); @@ -850,11 +851,11 @@ public function testDeleteTranslationEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteTranslationEvent::class, 0], [DeleteTranslationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteTranslationStopPropagationInBeforeEvents() @@ -881,10 +882,10 @@ public function testDeleteTranslationStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteTranslationEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteTranslationEvent::class, 0], [DeleteTranslationEvent::class, 0], ]); @@ -911,12 +912,12 @@ public function testPublishVersionEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($content, $result); - $this->assertSame($calledListeners, [ + self::assertSame($content, $result); + self::assertSame($calledListeners, [ [BeforePublishVersionEvent::class, 0], [PublishVersionEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnPublishVersionResultInBeforeEvents() @@ -945,13 +946,13 @@ public function testReturnPublishVersionResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventContent, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContent, $result); + self::assertSame($calledListeners, [ [BeforePublishVersionEvent::class, 10], [BeforePublishVersionEvent::class, 0], [PublishVersionEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testPublishVersionStopPropagationInBeforeEvents() @@ -982,11 +983,11 @@ public function testPublishVersionStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventContent, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContent, $result); + self::assertSame($calledListeners, [ [BeforePublishVersionEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforePublishVersionEvent::class, 0], [PublishVersionEvent::class, 0], ]); @@ -1014,12 +1015,12 @@ public function testCreateContentDraftEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($contentDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($contentDraft, $result); + self::assertSame($calledListeners, [ [BeforeCreateContentDraftEvent::class, 0], [CreateContentDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateContentDraftResultInBeforeEvents() @@ -1049,13 +1050,13 @@ public function testReturnCreateContentDraftResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventContentDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContentDraft, $result); + self::assertSame($calledListeners, [ [BeforeCreateContentDraftEvent::class, 10], [BeforeCreateContentDraftEvent::class, 0], [CreateContentDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateContentDraftStopPropagationInBeforeEvents() @@ -1087,11 +1088,11 @@ public function testCreateContentDraftStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventContentDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContentDraft, $result); + self::assertSame($calledListeners, [ [BeforeCreateContentDraftEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateContentDraftEvent::class, 0], [CreateContentDraftEvent::class, 0], ]); @@ -1115,11 +1116,11 @@ public function testRevealContentEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeRevealContentEvent::class, 0], [RevealContentEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testRevealContentStopPropagationInBeforeEvents() @@ -1145,10 +1146,10 @@ public function testRevealContentStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeRevealContentEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeRevealContentEvent::class, 0], [RevealContentEvent::class, 0], ]); diff --git a/tests/lib/Event/ContentTypeServiceTest.php b/tests/lib/Event/ContentTypeServiceTest.php index baac131341..0679fcdba0 100644 --- a/tests/lib/Event/ContentTypeServiceTest.php +++ b/tests/lib/Event/ContentTypeServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\ContentTypeService as ContentTypeServiceInterface; @@ -71,11 +72,11 @@ public function testAddFieldDefinitionEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeAddFieldDefinitionEvent::class, 0], [AddFieldDefinitionEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testAddFieldDefinitionStopPropagationInBeforeEvents() @@ -102,10 +103,10 @@ public function testAddFieldDefinitionStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeAddFieldDefinitionEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [AddFieldDefinitionEvent::class, 0], [BeforeAddFieldDefinitionEvent::class, 0], ]); @@ -129,11 +130,11 @@ public function testDeleteContentTypeGroupEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteContentTypeGroupEvent::class, 0], [DeleteContentTypeGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteContentTypeGroupStopPropagationInBeforeEvents() @@ -159,10 +160,10 @@ public function testDeleteContentTypeGroupStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteContentTypeGroupEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteContentTypeGroupEvent::class, 0], [DeleteContentTypeGroupEvent::class, 0], ]); @@ -188,12 +189,12 @@ public function testCreateContentTypeDraftEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($contentTypeDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($contentTypeDraft, $result); + self::assertSame($calledListeners, [ [BeforeCreateContentTypeDraftEvent::class, 0], [CreateContentTypeDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateContentTypeDraftResultInBeforeEvents() @@ -221,13 +222,13 @@ public function testReturnCreateContentTypeDraftResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventContentTypeDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContentTypeDraft, $result); + self::assertSame($calledListeners, [ [BeforeCreateContentTypeDraftEvent::class, 10], [BeforeCreateContentTypeDraftEvent::class, 0], [CreateContentTypeDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateContentTypeDraftStopPropagationInBeforeEvents() @@ -257,11 +258,11 @@ public function testCreateContentTypeDraftStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventContentTypeDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContentTypeDraft, $result); + self::assertSame($calledListeners, [ [BeforeCreateContentTypeDraftEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateContentTypeDraftEvent::class, 0], [CreateContentTypeDraftEvent::class, 0], ]); @@ -287,12 +288,12 @@ public function testCreateContentTypeGroupEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($contentTypeGroup, $result); - $this->assertSame($calledListeners, [ + self::assertSame($contentTypeGroup, $result); + self::assertSame($calledListeners, [ [BeforeCreateContentTypeGroupEvent::class, 0], [CreateContentTypeGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateContentTypeGroupResultInBeforeEvents() @@ -320,13 +321,13 @@ public function testReturnCreateContentTypeGroupResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventContentTypeGroup, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContentTypeGroup, $result); + self::assertSame($calledListeners, [ [BeforeCreateContentTypeGroupEvent::class, 10], [BeforeCreateContentTypeGroupEvent::class, 0], [CreateContentTypeGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateContentTypeGroupStopPropagationInBeforeEvents() @@ -356,11 +357,11 @@ public function testCreateContentTypeGroupStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventContentTypeGroup, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContentTypeGroup, $result); + self::assertSame($calledListeners, [ [BeforeCreateContentTypeGroupEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateContentTypeGroupEvent::class, 0], [CreateContentTypeGroupEvent::class, 0], ]); @@ -385,11 +386,11 @@ public function testUpdateContentTypeGroupEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeUpdateContentTypeGroupEvent::class, 0], [UpdateContentTypeGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateContentTypeGroupStopPropagationInBeforeEvents() @@ -416,10 +417,10 @@ public function testUpdateContentTypeGroupStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeUpdateContentTypeGroupEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateContentTypeGroupEvent::class, 0], [UpdateContentTypeGroupEvent::class, 0], ]); @@ -446,12 +447,12 @@ public function testCreateContentTypeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($contentTypeDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($contentTypeDraft, $result); + self::assertSame($calledListeners, [ [BeforeCreateContentTypeEvent::class, 0], [CreateContentTypeEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateContentTypeResultInBeforeEvents() @@ -480,13 +481,13 @@ public function testReturnCreateContentTypeResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventContentTypeDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContentTypeDraft, $result); + self::assertSame($calledListeners, [ [BeforeCreateContentTypeEvent::class, 10], [BeforeCreateContentTypeEvent::class, 0], [CreateContentTypeEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateContentTypeStopPropagationInBeforeEvents() @@ -517,11 +518,11 @@ public function testCreateContentTypeStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventContentTypeDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContentTypeDraft, $result); + self::assertSame($calledListeners, [ [BeforeCreateContentTypeEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateContentTypeEvent::class, 0], [CreateContentTypeEvent::class, 0], ]); @@ -548,12 +549,12 @@ public function testRemoveContentTypeTranslationEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($newContentTypeDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($newContentTypeDraft, $result); + self::assertSame($calledListeners, [ [BeforeRemoveContentTypeTranslationEvent::class, 0], [RemoveContentTypeTranslationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnRemoveContentTypeTranslationResultInBeforeEvents() @@ -582,13 +583,13 @@ public function testReturnRemoveContentTypeTranslationResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventNewContentTypeDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventNewContentTypeDraft, $result); + self::assertSame($calledListeners, [ [BeforeRemoveContentTypeTranslationEvent::class, 10], [BeforeRemoveContentTypeTranslationEvent::class, 0], [RemoveContentTypeTranslationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testRemoveContentTypeTranslationStopPropagationInBeforeEvents() @@ -619,11 +620,11 @@ public function testRemoveContentTypeTranslationStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventNewContentTypeDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventNewContentTypeDraft, $result); + self::assertSame($calledListeners, [ [BeforeRemoveContentTypeTranslationEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeRemoveContentTypeTranslationEvent::class, 0], [RemoveContentTypeTranslationEvent::class, 0], ]); @@ -648,11 +649,11 @@ public function testUnassignContentTypeGroupEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeUnassignContentTypeGroupEvent::class, 0], [UnassignContentTypeGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUnassignContentTypeGroupStopPropagationInBeforeEvents() @@ -679,10 +680,10 @@ public function testUnassignContentTypeGroupStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeUnassignContentTypeGroupEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUnassignContentTypeGroupEvent::class, 0], [UnassignContentTypeGroupEvent::class, 0], ]); @@ -706,11 +707,11 @@ public function testPublishContentTypeDraftEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforePublishContentTypeDraftEvent::class, 0], [PublishContentTypeDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testPublishContentTypeDraftStopPropagationInBeforeEvents() @@ -736,10 +737,10 @@ public function testPublishContentTypeDraftStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforePublishContentTypeDraftEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforePublishContentTypeDraftEvent::class, 0], [PublishContentTypeDraftEvent::class, 0], ]); @@ -765,11 +766,11 @@ public function testUpdateFieldDefinitionEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeUpdateFieldDefinitionEvent::class, 0], [UpdateFieldDefinitionEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateFieldDefinitionStopPropagationInBeforeEvents() @@ -797,10 +798,10 @@ public function testUpdateFieldDefinitionStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeUpdateFieldDefinitionEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateFieldDefinitionEvent::class, 0], [UpdateFieldDefinitionEvent::class, 0], ]); @@ -825,11 +826,11 @@ public function testRemoveFieldDefinitionEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeRemoveFieldDefinitionEvent::class, 0], [RemoveFieldDefinitionEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testRemoveFieldDefinitionStopPropagationInBeforeEvents() @@ -856,10 +857,10 @@ public function testRemoveFieldDefinitionStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeRemoveFieldDefinitionEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeRemoveFieldDefinitionEvent::class, 0], [RemoveFieldDefinitionEvent::class, 0], ]); @@ -884,11 +885,11 @@ public function testAssignContentTypeGroupEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeAssignContentTypeGroupEvent::class, 0], [AssignContentTypeGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testAssignContentTypeGroupStopPropagationInBeforeEvents() @@ -915,10 +916,10 @@ public function testAssignContentTypeGroupStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeAssignContentTypeGroupEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [AssignContentTypeGroupEvent::class, 0], [BeforeAssignContentTypeGroupEvent::class, 0], ]); @@ -943,11 +944,11 @@ public function testUpdateContentTypeDraftEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeUpdateContentTypeDraftEvent::class, 0], [UpdateContentTypeDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateContentTypeDraftStopPropagationInBeforeEvents() @@ -974,10 +975,10 @@ public function testUpdateContentTypeDraftStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeUpdateContentTypeDraftEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateContentTypeDraftEvent::class, 0], [UpdateContentTypeDraftEvent::class, 0], ]); @@ -1001,11 +1002,11 @@ public function testDeleteContentTypeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteContentTypeEvent::class, 0], [DeleteContentTypeEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteContentTypeStopPropagationInBeforeEvents() @@ -1031,10 +1032,10 @@ public function testDeleteContentTypeStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteContentTypeEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteContentTypeEvent::class, 0], [DeleteContentTypeEvent::class, 0], ]); @@ -1061,12 +1062,12 @@ public function testCopyContentTypeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($contentTypeCopy, $result); - $this->assertSame($calledListeners, [ + self::assertSame($contentTypeCopy, $result); + self::assertSame($calledListeners, [ [BeforeCopyContentTypeEvent::class, 0], [CopyContentTypeEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCopyContentTypeResultInBeforeEvents() @@ -1095,13 +1096,13 @@ public function testReturnCopyContentTypeResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventContentTypeCopy, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContentTypeCopy, $result); + self::assertSame($calledListeners, [ [BeforeCopyContentTypeEvent::class, 10], [BeforeCopyContentTypeEvent::class, 0], [CopyContentTypeEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCopyContentTypeStopPropagationInBeforeEvents() @@ -1132,11 +1133,11 @@ public function testCopyContentTypeStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventContentTypeCopy, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventContentTypeCopy, $result); + self::assertSame($calledListeners, [ [BeforeCopyContentTypeEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCopyContentTypeEvent::class, 0], [CopyContentTypeEvent::class, 0], ]); diff --git a/tests/lib/Event/LanguageServiceTest.php b/tests/lib/Event/LanguageServiceTest.php index 0995fca95a..ae40b2ca40 100644 --- a/tests/lib/Event/LanguageServiceTest.php +++ b/tests/lib/Event/LanguageServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\Events\Language\BeforeCreateLanguageEvent; @@ -41,11 +42,11 @@ public function testDeleteLanguageEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteLanguageEvent::class, 0], [DeleteLanguageEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteLanguageStopPropagationInBeforeEvents() @@ -71,10 +72,10 @@ public function testDeleteLanguageStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteLanguageEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteLanguageEvent::class, 0], [DeleteLanguageEvent::class, 0], ]); @@ -100,12 +101,12 @@ public function testCreateLanguageEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($language, $result); - $this->assertSame($calledListeners, [ + self::assertSame($language, $result); + self::assertSame($calledListeners, [ [BeforeCreateLanguageEvent::class, 0], [CreateLanguageEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateLanguageResultInBeforeEvents() @@ -133,13 +134,13 @@ public function testReturnCreateLanguageResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventLanguage, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventLanguage, $result); + self::assertSame($calledListeners, [ [BeforeCreateLanguageEvent::class, 10], [BeforeCreateLanguageEvent::class, 0], [CreateLanguageEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateLanguageStopPropagationInBeforeEvents() @@ -169,11 +170,11 @@ public function testCreateLanguageStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventLanguage, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventLanguage, $result); + self::assertSame($calledListeners, [ [BeforeCreateLanguageEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateLanguageEvent::class, 0], [CreateLanguageEvent::class, 0], ]); @@ -200,12 +201,12 @@ public function testUpdateLanguageNameEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($updatedLanguage, $result); - $this->assertSame($calledListeners, [ + self::assertSame($updatedLanguage, $result); + self::assertSame($calledListeners, [ [BeforeUpdateLanguageNameEvent::class, 0], [UpdateLanguageNameEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnUpdateLanguageNameResultInBeforeEvents() @@ -234,13 +235,13 @@ public function testReturnUpdateLanguageNameResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUpdatedLanguage, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedLanguage, $result); + self::assertSame($calledListeners, [ [BeforeUpdateLanguageNameEvent::class, 10], [BeforeUpdateLanguageNameEvent::class, 0], [UpdateLanguageNameEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateLanguageNameStopPropagationInBeforeEvents() @@ -271,11 +272,11 @@ public function testUpdateLanguageNameStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUpdatedLanguage, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedLanguage, $result); + self::assertSame($calledListeners, [ [BeforeUpdateLanguageNameEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateLanguageNameEvent::class, 0], [UpdateLanguageNameEvent::class, 0], ]); @@ -301,12 +302,12 @@ public function testDisableLanguageEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($disabledLanguage, $result); - $this->assertSame($calledListeners, [ + self::assertSame($disabledLanguage, $result); + self::assertSame($calledListeners, [ [BeforeDisableLanguageEvent::class, 0], [DisableLanguageEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnDisableLanguageResultInBeforeEvents() @@ -334,13 +335,13 @@ public function testReturnDisableLanguageResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventDisabledLanguage, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventDisabledLanguage, $result); + self::assertSame($calledListeners, [ [BeforeDisableLanguageEvent::class, 10], [BeforeDisableLanguageEvent::class, 0], [DisableLanguageEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDisableLanguageStopPropagationInBeforeEvents() @@ -370,11 +371,11 @@ public function testDisableLanguageStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventDisabledLanguage, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventDisabledLanguage, $result); + self::assertSame($calledListeners, [ [BeforeDisableLanguageEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDisableLanguageEvent::class, 0], [DisableLanguageEvent::class, 0], ]); @@ -400,12 +401,12 @@ public function testEnableLanguageEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($enabledLanguage, $result); - $this->assertSame($calledListeners, [ + self::assertSame($enabledLanguage, $result); + self::assertSame($calledListeners, [ [BeforeEnableLanguageEvent::class, 0], [EnableLanguageEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnEnableLanguageResultInBeforeEvents() @@ -433,13 +434,13 @@ public function testReturnEnableLanguageResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventEnabledLanguage, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventEnabledLanguage, $result); + self::assertSame($calledListeners, [ [BeforeEnableLanguageEvent::class, 10], [BeforeEnableLanguageEvent::class, 0], [EnableLanguageEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testEnableLanguageStopPropagationInBeforeEvents() @@ -469,11 +470,11 @@ public function testEnableLanguageStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventEnabledLanguage, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventEnabledLanguage, $result); + self::assertSame($calledListeners, [ [BeforeEnableLanguageEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeEnableLanguageEvent::class, 0], [EnableLanguageEvent::class, 0], ]); diff --git a/tests/lib/Event/LocationServiceTest.php b/tests/lib/Event/LocationServiceTest.php index 277fbe6b19..81bb2f752b 100644 --- a/tests/lib/Event/LocationServiceTest.php +++ b/tests/lib/Event/LocationServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\Events\Location\BeforeCopySubtreeEvent; @@ -52,12 +53,12 @@ public function testCopySubtreeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($location, $result); - $this->assertSame($calledListeners, [ + self::assertSame($location, $result); + self::assertSame($calledListeners, [ [BeforeCopySubtreeEvent::class, 0], [CopySubtreeEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCopySubtreeResultInBeforeEvents() @@ -86,13 +87,13 @@ public function testReturnCopySubtreeResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventLocation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventLocation, $result); + self::assertSame($calledListeners, [ [BeforeCopySubtreeEvent::class, 10], [BeforeCopySubtreeEvent::class, 0], [CopySubtreeEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCopySubtreeStopPropagationInBeforeEvents() @@ -123,11 +124,11 @@ public function testCopySubtreeStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventLocation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventLocation, $result); + self::assertSame($calledListeners, [ [BeforeCopySubtreeEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCopySubtreeEvent::class, 0], [CopySubtreeEvent::class, 0], ]); @@ -151,11 +152,11 @@ public function testDeleteLocationEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteLocationEvent::class, 0], [DeleteLocationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteLocationStopPropagationInBeforeEvents() @@ -181,10 +182,10 @@ public function testDeleteLocationStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteLocationEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteLocationEvent::class, 0], [DeleteLocationEvent::class, 0], ]); @@ -210,12 +211,12 @@ public function testUnhideLocationEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($revealedLocation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($revealedLocation, $result); + self::assertSame($calledListeners, [ [BeforeUnhideLocationEvent::class, 0], [UnhideLocationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnUnhideLocationResultInBeforeEvents() @@ -243,13 +244,13 @@ public function testReturnUnhideLocationResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventRevealedLocation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventRevealedLocation, $result); + self::assertSame($calledListeners, [ [BeforeUnhideLocationEvent::class, 10], [BeforeUnhideLocationEvent::class, 0], [UnhideLocationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUnhideLocationStopPropagationInBeforeEvents() @@ -279,11 +280,11 @@ public function testUnhideLocationStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventRevealedLocation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventRevealedLocation, $result); + self::assertSame($calledListeners, [ [BeforeUnhideLocationEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUnhideLocationEvent::class, 0], [UnhideLocationEvent::class, 0], ]); @@ -309,12 +310,12 @@ public function testHideLocationEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($hiddenLocation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($hiddenLocation, $result); + self::assertSame($calledListeners, [ [BeforeHideLocationEvent::class, 0], [HideLocationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnHideLocationResultInBeforeEvents() @@ -342,13 +343,13 @@ public function testReturnHideLocationResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventHiddenLocation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventHiddenLocation, $result); + self::assertSame($calledListeners, [ [BeforeHideLocationEvent::class, 10], [BeforeHideLocationEvent::class, 0], [HideLocationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testHideLocationStopPropagationInBeforeEvents() @@ -378,11 +379,11 @@ public function testHideLocationStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventHiddenLocation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventHiddenLocation, $result); + self::assertSame($calledListeners, [ [BeforeHideLocationEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeHideLocationEvent::class, 0], [HideLocationEvent::class, 0], ]); @@ -407,11 +408,11 @@ public function testSwapLocationEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeSwapLocationEvent::class, 0], [SwapLocationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testSwapLocationStopPropagationInBeforeEvents() @@ -438,10 +439,10 @@ public function testSwapLocationStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeSwapLocationEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeSwapLocationEvent::class, 0], [SwapLocationEvent::class, 0], ]); @@ -466,11 +467,11 @@ public function testMoveSubtreeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeMoveSubtreeEvent::class, 0], [MoveSubtreeEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testMoveSubtreeStopPropagationInBeforeEvents() @@ -497,10 +498,10 @@ public function testMoveSubtreeStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeMoveSubtreeEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeMoveSubtreeEvent::class, 0], [MoveSubtreeEvent::class, 0], ]); @@ -527,12 +528,12 @@ public function testUpdateLocationEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($updatedLocation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($updatedLocation, $result); + self::assertSame($calledListeners, [ [BeforeUpdateLocationEvent::class, 0], [UpdateLocationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnUpdateLocationResultInBeforeEvents() @@ -561,13 +562,13 @@ public function testReturnUpdateLocationResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUpdatedLocation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedLocation, $result); + self::assertSame($calledListeners, [ [BeforeUpdateLocationEvent::class, 10], [BeforeUpdateLocationEvent::class, 0], [UpdateLocationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateLocationStopPropagationInBeforeEvents() @@ -598,11 +599,11 @@ public function testUpdateLocationStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUpdatedLocation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedLocation, $result); + self::assertSame($calledListeners, [ [BeforeUpdateLocationEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateLocationEvent::class, 0], [UpdateLocationEvent::class, 0], ]); @@ -629,12 +630,12 @@ public function testCreateLocationEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($location, $result); - $this->assertSame($calledListeners, [ + self::assertSame($location, $result); + self::assertSame($calledListeners, [ [BeforeCreateLocationEvent::class, 0], [CreateLocationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateLocationResultInBeforeEvents() @@ -663,13 +664,13 @@ public function testReturnCreateLocationResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventLocation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventLocation, $result); + self::assertSame($calledListeners, [ [BeforeCreateLocationEvent::class, 10], [BeforeCreateLocationEvent::class, 0], [CreateLocationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateLocationStopPropagationInBeforeEvents() @@ -700,11 +701,11 @@ public function testCreateLocationStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventLocation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventLocation, $result); + self::assertSame($calledListeners, [ [BeforeCreateLocationEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateLocationEvent::class, 0], [CreateLocationEvent::class, 0], ]); diff --git a/tests/lib/Event/NotificationServiceTest.php b/tests/lib/Event/NotificationServiceTest.php index eb032d16a6..4d136553eb 100644 --- a/tests/lib/Event/NotificationServiceTest.php +++ b/tests/lib/Event/NotificationServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\Events\Notification\BeforeCreateNotificationEvent; @@ -39,12 +40,12 @@ public function testCreateNotificationEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($notification, $result); - $this->assertSame($calledListeners, [ + self::assertSame($notification, $result); + self::assertSame($calledListeners, [ [BeforeCreateNotificationEvent::class, 0], [CreateNotificationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateNotificationResultInBeforeEvents() @@ -72,13 +73,13 @@ public function testReturnCreateNotificationResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventNotification, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventNotification, $result); + self::assertSame($calledListeners, [ [BeforeCreateNotificationEvent::class, 10], [BeforeCreateNotificationEvent::class, 0], [CreateNotificationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateNotificationStopPropagationInBeforeEvents() @@ -108,11 +109,11 @@ public function testCreateNotificationStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventNotification, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventNotification, $result); + self::assertSame($calledListeners, [ [BeforeCreateNotificationEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateNotificationEvent::class, 0], [CreateNotificationEvent::class, 0], ]); @@ -136,11 +137,11 @@ public function testDeleteNotificationEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteNotificationEvent::class, 0], [DeleteNotificationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteNotificationStopPropagationInBeforeEvents() @@ -166,10 +167,10 @@ public function testDeleteNotificationStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteNotificationEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteNotificationEvent::class, 0], [DeleteNotificationEvent::class, 0], ]); @@ -193,11 +194,11 @@ public function testMarkNotificationAsReadEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeMarkNotificationAsReadEvent::class, 0], [MarkNotificationAsReadEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testMarkNotificationAsReadStopPropagationInBeforeEvents() @@ -223,10 +224,10 @@ public function testMarkNotificationAsReadStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeMarkNotificationAsReadEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeMarkNotificationAsReadEvent::class, 0], [MarkNotificationAsReadEvent::class, 0], ]); diff --git a/tests/lib/Event/ObjectStateServiceTest.php b/tests/lib/Event/ObjectStateServiceTest.php index 3efb09df1d..4f9a3b0d03 100644 --- a/tests/lib/Event/ObjectStateServiceTest.php +++ b/tests/lib/Event/ObjectStateServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\Events\ObjectState\BeforeCreateObjectStateEvent; @@ -54,11 +55,11 @@ public function testSetContentStateEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeSetContentStateEvent::class, 0], [SetContentStateEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testSetContentStateStopPropagationInBeforeEvents() @@ -86,10 +87,10 @@ public function testSetContentStateStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeSetContentStateEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeSetContentStateEvent::class, 0], [SetContentStateEvent::class, 0], ]); @@ -115,12 +116,12 @@ public function testCreateObjectStateGroupEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($objectStateGroup, $result); - $this->assertSame($calledListeners, [ + self::assertSame($objectStateGroup, $result); + self::assertSame($calledListeners, [ [BeforeCreateObjectStateGroupEvent::class, 0], [CreateObjectStateGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateObjectStateGroupResultInBeforeEvents() @@ -148,13 +149,13 @@ public function testReturnCreateObjectStateGroupResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventObjectStateGroup, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventObjectStateGroup, $result); + self::assertSame($calledListeners, [ [BeforeCreateObjectStateGroupEvent::class, 10], [BeforeCreateObjectStateGroupEvent::class, 0], [CreateObjectStateGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateObjectStateGroupStopPropagationInBeforeEvents() @@ -184,11 +185,11 @@ public function testCreateObjectStateGroupStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventObjectStateGroup, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventObjectStateGroup, $result); + self::assertSame($calledListeners, [ [BeforeCreateObjectStateGroupEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateObjectStateGroupEvent::class, 0], [CreateObjectStateGroupEvent::class, 0], ]); @@ -215,12 +216,12 @@ public function testUpdateObjectStateEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($updatedObjectState, $result); - $this->assertSame($calledListeners, [ + self::assertSame($updatedObjectState, $result); + self::assertSame($calledListeners, [ [BeforeUpdateObjectStateEvent::class, 0], [UpdateObjectStateEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnUpdateObjectStateResultInBeforeEvents() @@ -249,13 +250,13 @@ public function testReturnUpdateObjectStateResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUpdatedObjectState, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedObjectState, $result); + self::assertSame($calledListeners, [ [BeforeUpdateObjectStateEvent::class, 10], [BeforeUpdateObjectStateEvent::class, 0], [UpdateObjectStateEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateObjectStateStopPropagationInBeforeEvents() @@ -286,11 +287,11 @@ public function testUpdateObjectStateStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUpdatedObjectState, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedObjectState, $result); + self::assertSame($calledListeners, [ [BeforeUpdateObjectStateEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateObjectStateEvent::class, 0], [UpdateObjectStateEvent::class, 0], ]); @@ -317,12 +318,12 @@ public function testCreateObjectStateEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($objectState, $result); - $this->assertSame($calledListeners, [ + self::assertSame($objectState, $result); + self::assertSame($calledListeners, [ [BeforeCreateObjectStateEvent::class, 0], [CreateObjectStateEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateObjectStateResultInBeforeEvents() @@ -351,13 +352,13 @@ public function testReturnCreateObjectStateResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventObjectState, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventObjectState, $result); + self::assertSame($calledListeners, [ [BeforeCreateObjectStateEvent::class, 10], [BeforeCreateObjectStateEvent::class, 0], [CreateObjectStateEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateObjectStateStopPropagationInBeforeEvents() @@ -388,11 +389,11 @@ public function testCreateObjectStateStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventObjectState, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventObjectState, $result); + self::assertSame($calledListeners, [ [BeforeCreateObjectStateEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateObjectStateEvent::class, 0], [CreateObjectStateEvent::class, 0], ]); @@ -419,12 +420,12 @@ public function testUpdateObjectStateGroupEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($updatedObjectStateGroup, $result); - $this->assertSame($calledListeners, [ + self::assertSame($updatedObjectStateGroup, $result); + self::assertSame($calledListeners, [ [BeforeUpdateObjectStateGroupEvent::class, 0], [UpdateObjectStateGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnUpdateObjectStateGroupResultInBeforeEvents() @@ -453,13 +454,13 @@ public function testReturnUpdateObjectStateGroupResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUpdatedObjectStateGroup, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedObjectStateGroup, $result); + self::assertSame($calledListeners, [ [BeforeUpdateObjectStateGroupEvent::class, 10], [BeforeUpdateObjectStateGroupEvent::class, 0], [UpdateObjectStateGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateObjectStateGroupStopPropagationInBeforeEvents() @@ -490,11 +491,11 @@ public function testUpdateObjectStateGroupStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUpdatedObjectStateGroup, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedObjectStateGroup, $result); + self::assertSame($calledListeners, [ [BeforeUpdateObjectStateGroupEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateObjectStateGroupEvent::class, 0], [UpdateObjectStateGroupEvent::class, 0], ]); @@ -519,11 +520,11 @@ public function testSetPriorityOfObjectStateEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeSetPriorityOfObjectStateEvent::class, 0], [SetPriorityOfObjectStateEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testSetPriorityOfObjectStateStopPropagationInBeforeEvents() @@ -550,10 +551,10 @@ public function testSetPriorityOfObjectStateStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeSetPriorityOfObjectStateEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeSetPriorityOfObjectStateEvent::class, 0], [SetPriorityOfObjectStateEvent::class, 0], ]); @@ -577,11 +578,11 @@ public function testDeleteObjectStateGroupEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteObjectStateGroupEvent::class, 0], [DeleteObjectStateGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteObjectStateGroupStopPropagationInBeforeEvents() @@ -607,10 +608,10 @@ public function testDeleteObjectStateGroupStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteObjectStateGroupEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteObjectStateGroupEvent::class, 0], [DeleteObjectStateGroupEvent::class, 0], ]); @@ -634,11 +635,11 @@ public function testDeleteObjectStateEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteObjectStateEvent::class, 0], [DeleteObjectStateEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteObjectStateStopPropagationInBeforeEvents() @@ -664,10 +665,10 @@ public function testDeleteObjectStateStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteObjectStateEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteObjectStateEvent::class, 0], [DeleteObjectStateEvent::class, 0], ]); diff --git a/tests/lib/Event/RoleServiceTest.php b/tests/lib/Event/RoleServiceTest.php index a4a33e1439..d2c5f88ad0 100644 --- a/tests/lib/Event/RoleServiceTest.php +++ b/tests/lib/Event/RoleServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\Events\Role\AddPolicyByRoleDraftEvent; @@ -64,11 +65,11 @@ public function testPublishRoleDraftEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforePublishRoleDraftEvent::class, 0], [PublishRoleDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testPublishRoleDraftStopPropagationInBeforeEvents() @@ -94,10 +95,10 @@ public function testPublishRoleDraftStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforePublishRoleDraftEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforePublishRoleDraftEvent::class, 0], [PublishRoleDraftEvent::class, 0], ]); @@ -123,11 +124,11 @@ public function testAssignRoleToUserEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeAssignRoleToUserEvent::class, 0], [AssignRoleToUserEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testAssignRoleToUserStopPropagationInBeforeEvents() @@ -155,10 +156,10 @@ public function testAssignRoleToUserStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeAssignRoleToUserEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [AssignRoleToUserEvent::class, 0], [BeforeAssignRoleToUserEvent::class, 0], ]); @@ -185,12 +186,12 @@ public function testUpdateRoleDraftEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($updatedRoleDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($updatedRoleDraft, $result); + self::assertSame($calledListeners, [ [BeforeUpdateRoleDraftEvent::class, 0], [UpdateRoleDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnUpdateRoleDraftResultInBeforeEvents() @@ -219,13 +220,13 @@ public function testReturnUpdateRoleDraftResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUpdatedRoleDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedRoleDraft, $result); + self::assertSame($calledListeners, [ [BeforeUpdateRoleDraftEvent::class, 10], [BeforeUpdateRoleDraftEvent::class, 0], [UpdateRoleDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateRoleDraftStopPropagationInBeforeEvents() @@ -256,11 +257,11 @@ public function testUpdateRoleDraftStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUpdatedRoleDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedRoleDraft, $result); + self::assertSame($calledListeners, [ [BeforeUpdateRoleDraftEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateRoleDraftEvent::class, 0], [UpdateRoleDraftEvent::class, 0], ]); @@ -286,11 +287,11 @@ public function testAssignRoleToUserGroupEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeAssignRoleToUserGroupEvent::class, 0], [AssignRoleToUserGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testAssignRoleToUserGroupStopPropagationInBeforeEvents() @@ -318,10 +319,10 @@ public function testAssignRoleToUserGroupStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeAssignRoleToUserGroupEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [AssignRoleToUserGroupEvent::class, 0], [BeforeAssignRoleToUserGroupEvent::class, 0], ]); @@ -349,12 +350,12 @@ public function testUpdatePolicyByRoleDraftEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($updatedPolicyDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($updatedPolicyDraft, $result); + self::assertSame($calledListeners, [ [BeforeUpdatePolicyByRoleDraftEvent::class, 0], [UpdatePolicyByRoleDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnUpdatePolicyByRoleDraftResultInBeforeEvents() @@ -384,13 +385,13 @@ public function testReturnUpdatePolicyByRoleDraftResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUpdatedPolicyDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedPolicyDraft, $result); + self::assertSame($calledListeners, [ [BeforeUpdatePolicyByRoleDraftEvent::class, 10], [BeforeUpdatePolicyByRoleDraftEvent::class, 0], [UpdatePolicyByRoleDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdatePolicyByRoleDraftStopPropagationInBeforeEvents() @@ -422,11 +423,11 @@ public function testUpdatePolicyByRoleDraftStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUpdatedPolicyDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedPolicyDraft, $result); + self::assertSame($calledListeners, [ [BeforeUpdatePolicyByRoleDraftEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdatePolicyByRoleDraftEvent::class, 0], [UpdatePolicyByRoleDraftEvent::class, 0], ]); @@ -452,12 +453,12 @@ public function testCreateRoleEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($roleDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($roleDraft, $result); + self::assertSame($calledListeners, [ [BeforeCreateRoleEvent::class, 0], [CreateRoleEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateRoleResultInBeforeEvents() @@ -485,13 +486,13 @@ public function testReturnCreateRoleResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventRoleDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventRoleDraft, $result); + self::assertSame($calledListeners, [ [BeforeCreateRoleEvent::class, 10], [BeforeCreateRoleEvent::class, 0], [CreateRoleEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateRoleStopPropagationInBeforeEvents() @@ -521,11 +522,11 @@ public function testCreateRoleStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventRoleDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventRoleDraft, $result); + self::assertSame($calledListeners, [ [BeforeCreateRoleEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateRoleEvent::class, 0], [CreateRoleEvent::class, 0], ]); @@ -552,12 +553,12 @@ public function testRemovePolicyByRoleDraftEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($updatedRoleDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($updatedRoleDraft, $result); + self::assertSame($calledListeners, [ [BeforeRemovePolicyByRoleDraftEvent::class, 0], [RemovePolicyByRoleDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnRemovePolicyByRoleDraftResultInBeforeEvents() @@ -586,13 +587,13 @@ public function testReturnRemovePolicyByRoleDraftResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUpdatedRoleDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedRoleDraft, $result); + self::assertSame($calledListeners, [ [BeforeRemovePolicyByRoleDraftEvent::class, 10], [BeforeRemovePolicyByRoleDraftEvent::class, 0], [RemovePolicyByRoleDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testRemovePolicyByRoleDraftStopPropagationInBeforeEvents() @@ -623,11 +624,11 @@ public function testRemovePolicyByRoleDraftStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUpdatedRoleDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedRoleDraft, $result); + self::assertSame($calledListeners, [ [BeforeRemovePolicyByRoleDraftEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeRemovePolicyByRoleDraftEvent::class, 0], [RemovePolicyByRoleDraftEvent::class, 0], ]); @@ -654,12 +655,12 @@ public function testAddPolicyByRoleDraftEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($updatedRoleDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($updatedRoleDraft, $result); + self::assertSame($calledListeners, [ [BeforeAddPolicyByRoleDraftEvent::class, 0], [AddPolicyByRoleDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnAddPolicyByRoleDraftResultInBeforeEvents() @@ -688,13 +689,13 @@ public function testReturnAddPolicyByRoleDraftResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUpdatedRoleDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedRoleDraft, $result); + self::assertSame($calledListeners, [ [BeforeAddPolicyByRoleDraftEvent::class, 10], [BeforeAddPolicyByRoleDraftEvent::class, 0], [AddPolicyByRoleDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testAddPolicyByRoleDraftStopPropagationInBeforeEvents() @@ -725,11 +726,11 @@ public function testAddPolicyByRoleDraftStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUpdatedRoleDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedRoleDraft, $result); + self::assertSame($calledListeners, [ [BeforeAddPolicyByRoleDraftEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [AddPolicyByRoleDraftEvent::class, 0], [BeforeAddPolicyByRoleDraftEvent::class, 0], ]); @@ -753,11 +754,11 @@ public function testDeleteRoleEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteRoleEvent::class, 0], [DeleteRoleEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteRoleStopPropagationInBeforeEvents() @@ -783,10 +784,10 @@ public function testDeleteRoleStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteRoleEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteRoleEvent::class, 0], [DeleteRoleEvent::class, 0], ]); @@ -810,11 +811,11 @@ public function testDeleteRoleDraftEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteRoleDraftEvent::class, 0], [DeleteRoleDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteRoleDraftStopPropagationInBeforeEvents() @@ -840,10 +841,10 @@ public function testDeleteRoleDraftStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteRoleDraftEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteRoleDraftEvent::class, 0], [DeleteRoleDraftEvent::class, 0], ]); @@ -867,11 +868,11 @@ public function testRemoveRoleAssignmentEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeRemoveRoleAssignmentEvent::class, 0], [RemoveRoleAssignmentEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testRemoveRoleAssignmentStopPropagationInBeforeEvents() @@ -897,10 +898,10 @@ public function testRemoveRoleAssignmentStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeRemoveRoleAssignmentEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeRemoveRoleAssignmentEvent::class, 0], [RemoveRoleAssignmentEvent::class, 0], ]); @@ -926,12 +927,12 @@ public function testCreateRoleDraftEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($roleDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($roleDraft, $result); + self::assertSame($calledListeners, [ [BeforeCreateRoleDraftEvent::class, 0], [CreateRoleDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateRoleDraftResultInBeforeEvents() @@ -959,13 +960,13 @@ public function testReturnCreateRoleDraftResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventRoleDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventRoleDraft, $result); + self::assertSame($calledListeners, [ [BeforeCreateRoleDraftEvent::class, 10], [BeforeCreateRoleDraftEvent::class, 0], [CreateRoleDraftEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateRoleDraftStopPropagationInBeforeEvents() @@ -995,11 +996,11 @@ public function testCreateRoleDraftStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventRoleDraft, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventRoleDraft, $result); + self::assertSame($calledListeners, [ [BeforeCreateRoleDraftEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateRoleDraftEvent::class, 0], [CreateRoleDraftEvent::class, 0], ]); diff --git a/tests/lib/Event/SectionServiceTest.php b/tests/lib/Event/SectionServiceTest.php index e988fe6c00..56c0f02622 100644 --- a/tests/lib/Event/SectionServiceTest.php +++ b/tests/lib/Event/SectionServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\Events\Section\AssignSectionEvent; @@ -45,11 +46,11 @@ public function testAssignSectionEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeAssignSectionEvent::class, 0], [AssignSectionEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testAssignSectionStopPropagationInBeforeEvents() @@ -76,10 +77,10 @@ public function testAssignSectionStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeAssignSectionEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [AssignSectionEvent::class, 0], [BeforeAssignSectionEvent::class, 0], ]); @@ -106,12 +107,12 @@ public function testUpdateSectionEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($updatedSection, $result); - $this->assertSame($calledListeners, [ + self::assertSame($updatedSection, $result); + self::assertSame($calledListeners, [ [BeforeUpdateSectionEvent::class, 0], [UpdateSectionEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnUpdateSectionResultInBeforeEvents() @@ -140,13 +141,13 @@ public function testReturnUpdateSectionResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUpdatedSection, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedSection, $result); + self::assertSame($calledListeners, [ [BeforeUpdateSectionEvent::class, 10], [BeforeUpdateSectionEvent::class, 0], [UpdateSectionEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateSectionStopPropagationInBeforeEvents() @@ -177,11 +178,11 @@ public function testUpdateSectionStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUpdatedSection, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedSection, $result); + self::assertSame($calledListeners, [ [BeforeUpdateSectionEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateSectionEvent::class, 0], [UpdateSectionEvent::class, 0], ]); @@ -206,11 +207,11 @@ public function testAssignSectionToSubtreeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeAssignSectionToSubtreeEvent::class, 0], [AssignSectionToSubtreeEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testAssignSectionToSubtreeStopPropagationInBeforeEvents() @@ -237,10 +238,10 @@ public function testAssignSectionToSubtreeStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeAssignSectionToSubtreeEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [AssignSectionToSubtreeEvent::class, 0], [BeforeAssignSectionToSubtreeEvent::class, 0], ]); @@ -264,11 +265,11 @@ public function testDeleteSectionEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteSectionEvent::class, 0], [DeleteSectionEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteSectionStopPropagationInBeforeEvents() @@ -294,10 +295,10 @@ public function testDeleteSectionStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeDeleteSectionEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteSectionEvent::class, 0], [DeleteSectionEvent::class, 0], ]); @@ -323,12 +324,12 @@ public function testCreateSectionEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($section, $result); - $this->assertSame($calledListeners, [ + self::assertSame($section, $result); + self::assertSame($calledListeners, [ [BeforeCreateSectionEvent::class, 0], [CreateSectionEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateSectionResultInBeforeEvents() @@ -356,13 +357,13 @@ public function testReturnCreateSectionResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventSection, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventSection, $result); + self::assertSame($calledListeners, [ [BeforeCreateSectionEvent::class, 10], [BeforeCreateSectionEvent::class, 0], [CreateSectionEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateSectionStopPropagationInBeforeEvents() @@ -392,11 +393,11 @@ public function testCreateSectionStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventSection, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventSection, $result); + self::assertSame($calledListeners, [ [BeforeCreateSectionEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateSectionEvent::class, 0], [CreateSectionEvent::class, 0], ]); diff --git a/tests/lib/Event/SettingServiceTest.php b/tests/lib/Event/SettingServiceTest.php index 6e0779a0a6..709117966f 100644 --- a/tests/lib/Event/SettingServiceTest.php +++ b/tests/lib/Event/SettingServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\Events\Setting\BeforeCreateSettingEvent; diff --git a/tests/lib/Event/TrashServiceTest.php b/tests/lib/Event/TrashServiceTest.php index 34fddd915a..3329daef28 100644 --- a/tests/lib/Event/TrashServiceTest.php +++ b/tests/lib/Event/TrashServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\Events\Trash\BeforeDeleteTrashItemEvent; @@ -42,12 +43,12 @@ public function testEmptyTrashEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($resultList, $result); - $this->assertSame($calledListeners, [ + self::assertSame($resultList, $result); + self::assertSame($calledListeners, [ [BeforeEmptyTrashEvent::class, 0], [EmptyTrashEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnEmptyTrashResultInBeforeEvents() @@ -74,13 +75,13 @@ public function testReturnEmptyTrashResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventResultList, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventResultList, $result); + self::assertSame($calledListeners, [ [BeforeEmptyTrashEvent::class, 10], [BeforeEmptyTrashEvent::class, 0], [EmptyTrashEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testEmptyTrashStopPropagationInBeforeEvents() @@ -109,11 +110,11 @@ public function testEmptyTrashStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventResultList, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventResultList, $result); + self::assertSame($calledListeners, [ [BeforeEmptyTrashEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeEmptyTrashEvent::class, 0], [EmptyTrashEvent::class, 0], ]); @@ -139,12 +140,12 @@ public function testTrashEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($trashItem, $result); - $this->assertSame($calledListeners, [ + self::assertSame($trashItem, $result); + self::assertSame($calledListeners, [ [BeforeTrashEvent::class, 0], [TrashEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnTrashResultInBeforeEvents() @@ -172,13 +173,13 @@ public function testReturnTrashResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventTrashItem, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventTrashItem, $result); + self::assertSame($calledListeners, [ [BeforeTrashEvent::class, 10], [BeforeTrashEvent::class, 0], [TrashEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testTrashStopPropagationInBeforeEvents() @@ -208,11 +209,11 @@ public function testTrashStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventTrashItem, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventTrashItem, $result); + self::assertSame($calledListeners, [ [BeforeTrashEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeTrashEvent::class, 0], [TrashEvent::class, 0], ]); @@ -274,12 +275,12 @@ public function testRecoverEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($location, $result); - $this->assertSame($calledListeners, [ + self::assertSame($location, $result); + self::assertSame($calledListeners, [ [BeforeRecoverEvent::class, 0], [RecoverEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnRecoverResultInBeforeEvents() @@ -308,13 +309,13 @@ public function testReturnRecoverResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventLocation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventLocation, $result); + self::assertSame($calledListeners, [ [BeforeRecoverEvent::class, 10], [BeforeRecoverEvent::class, 0], [RecoverEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testRecoverStopPropagationInBeforeEvents() @@ -345,11 +346,11 @@ public function testRecoverStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventLocation, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventLocation, $result); + self::assertSame($calledListeners, [ [BeforeRecoverEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeRecoverEvent::class, 0], [RecoverEvent::class, 0], ]); @@ -375,12 +376,12 @@ public function testDeleteTrashItemEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($result, $result); - $this->assertSame($calledListeners, [ + self::assertSame($result, $result); + self::assertSame($calledListeners, [ [BeforeDeleteTrashItemEvent::class, 0], [DeleteTrashItemEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnDeleteTrashItemResultInBeforeEvents() @@ -408,13 +409,13 @@ public function testReturnDeleteTrashItemResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventResult, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventResult, $result); + self::assertSame($calledListeners, [ [BeforeDeleteTrashItemEvent::class, 10], [BeforeDeleteTrashItemEvent::class, 0], [DeleteTrashItemEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteTrashItemStopPropagationInBeforeEvents() @@ -444,11 +445,11 @@ public function testDeleteTrashItemStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventResult, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventResult, $result); + self::assertSame($calledListeners, [ [BeforeDeleteTrashItemEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteTrashItemEvent::class, 0], [DeleteTrashItemEvent::class, 0], ]); diff --git a/tests/lib/Event/URLAliasServiceTest.php b/tests/lib/Event/URLAliasServiceTest.php index 65f450bf65..ce85f42a9c 100644 --- a/tests/lib/Event/URLAliasServiceTest.php +++ b/tests/lib/Event/URLAliasServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\Events\URLAlias\BeforeCreateGlobalUrlAliasEvent; @@ -45,12 +46,12 @@ public function testCreateGlobalUrlAliasEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($urlAlias, $result); - $this->assertSame($calledListeners, [ + self::assertSame($urlAlias, $result); + self::assertSame($calledListeners, [ [BeforeCreateGlobalUrlAliasEvent::class, 0], [CreateGlobalUrlAliasEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateGlobalUrlAliasResultInBeforeEvents() @@ -82,13 +83,13 @@ public function testReturnCreateGlobalUrlAliasResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUrlAlias, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUrlAlias, $result); + self::assertSame($calledListeners, [ [BeforeCreateGlobalUrlAliasEvent::class, 10], [BeforeCreateGlobalUrlAliasEvent::class, 0], [CreateGlobalUrlAliasEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateGlobalUrlAliasStopPropagationInBeforeEvents() @@ -122,11 +123,11 @@ public function testCreateGlobalUrlAliasStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUrlAlias, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUrlAlias, $result); + self::assertSame($calledListeners, [ [BeforeCreateGlobalUrlAliasEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateGlobalUrlAliasEvent::class, 0], [CreateGlobalUrlAliasEvent::class, 0], ]); @@ -150,11 +151,11 @@ public function testRefreshSystemUrlAliasesForLocationEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeRefreshSystemUrlAliasesForLocationEvent::class, 0], [RefreshSystemUrlAliasesForLocationEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testRefreshSystemUrlAliasesForLocationStopPropagationInBeforeEvents() @@ -180,10 +181,10 @@ public function testRefreshSystemUrlAliasesForLocationStopPropagationInBeforeEve $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeRefreshSystemUrlAliasesForLocationEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeRefreshSystemUrlAliasesForLocationEvent::class, 0], [RefreshSystemUrlAliasesForLocationEvent::class, 0], ]); @@ -213,12 +214,12 @@ public function testCreateUrlAliasEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($urlAlias, $result); - $this->assertSame($calledListeners, [ + self::assertSame($urlAlias, $result); + self::assertSame($calledListeners, [ [BeforeCreateUrlAliasEvent::class, 0], [CreateUrlAliasEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateUrlAliasResultInBeforeEvents() @@ -250,13 +251,13 @@ public function testReturnCreateUrlAliasResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUrlAlias, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUrlAlias, $result); + self::assertSame($calledListeners, [ [BeforeCreateUrlAliasEvent::class, 10], [BeforeCreateUrlAliasEvent::class, 0], [CreateUrlAliasEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateUrlAliasStopPropagationInBeforeEvents() @@ -290,11 +291,11 @@ public function testCreateUrlAliasStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUrlAlias, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUrlAlias, $result); + self::assertSame($calledListeners, [ [BeforeCreateUrlAliasEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateUrlAliasEvent::class, 0], [CreateUrlAliasEvent::class, 0], ]); @@ -318,11 +319,11 @@ public function testRemoveAliasesEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeRemoveAliasesEvent::class, 0], [RemoveAliasesEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testRemoveAliasesStopPropagationInBeforeEvents() @@ -348,10 +349,10 @@ public function testRemoveAliasesStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeRemoveAliasesEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeRemoveAliasesEvent::class, 0], [RemoveAliasesEvent::class, 0], ]); diff --git a/tests/lib/Event/URLServiceTest.php b/tests/lib/Event/URLServiceTest.php index de76868972..9ffba6ac2b 100644 --- a/tests/lib/Event/URLServiceTest.php +++ b/tests/lib/Event/URLServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\Events\URL\BeforeUpdateUrlEvent; @@ -36,12 +37,12 @@ public function testUpdateUrlEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($updatedUrl, $result); - $this->assertSame($calledListeners, [ + self::assertSame($updatedUrl, $result); + self::assertSame($calledListeners, [ [BeforeUpdateUrlEvent::class, 0], [UpdateUrlEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnUpdateUrlResultInBeforeEvents() @@ -70,13 +71,13 @@ public function testReturnUpdateUrlResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUpdatedUrl, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedUrl, $result); + self::assertSame($calledListeners, [ [BeforeUpdateUrlEvent::class, 10], [BeforeUpdateUrlEvent::class, 0], [UpdateUrlEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateUrlStopPropagationInBeforeEvents() @@ -107,11 +108,11 @@ public function testUpdateUrlStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUpdatedUrl, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedUrl, $result); + self::assertSame($calledListeners, [ [BeforeUpdateUrlEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateUrlEvent::class, 0], [UpdateUrlEvent::class, 0], ]); diff --git a/tests/lib/Event/URLWildcardServiceTest.php b/tests/lib/Event/URLWildcardServiceTest.php index 56d5e1c3ad..be0cb55405 100644 --- a/tests/lib/Event/URLWildcardServiceTest.php +++ b/tests/lib/Event/URLWildcardServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\Events\URLWildcard\BeforeCreateEvent; @@ -43,11 +44,11 @@ public function testRemoveEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeRemoveEvent::class, 0], [RemoveEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } /** @@ -76,10 +77,10 @@ public function testRemoveStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeRemoveEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeRemoveEvent::class, 0], [RemoveEvent::class, 0], ]); @@ -110,12 +111,12 @@ public function testUpdateEvents(): void $traceableEventDispatcher->getCalledListeners() ); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeUpdateEvent::class, 0], [UpdateEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateStopPropagationInBeforeEvents(): void @@ -148,11 +149,11 @@ static function (BeforeUpdateEvent $event) { $traceableEventDispatcher->getNotCalledListeners() ); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeUpdateEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateEvent::class, 0], [UpdateEvent::class, 0], ]); @@ -180,12 +181,12 @@ public function testCreateEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($urlWildcard, $result); - $this->assertSame($calledListeners, [ + self::assertSame($urlWildcard, $result); + self::assertSame($calledListeners, [ [BeforeCreateEvent::class, 0], [CreateEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateResultInBeforeEvents() @@ -215,13 +216,13 @@ public function testReturnCreateResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUrlWildcard, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUrlWildcard, $result); + self::assertSame($calledListeners, [ [BeforeCreateEvent::class, 10], [BeforeCreateEvent::class, 0], [CreateEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateStopPropagationInBeforeEvents() @@ -253,11 +254,11 @@ public function testCreateStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUrlWildcard, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUrlWildcard, $result); + self::assertSame($calledListeners, [ [BeforeCreateEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateEvent::class, 0], [CreateEvent::class, 0], ]); @@ -283,12 +284,12 @@ public function testTranslateEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($result, $result); - $this->assertSame($calledListeners, [ + self::assertSame($result, $result); + self::assertSame($calledListeners, [ [BeforeTranslateEvent::class, 0], [TranslateEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnTranslateResultInBeforeEvents() @@ -316,13 +317,13 @@ public function testReturnTranslateResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventResult, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventResult, $result); + self::assertSame($calledListeners, [ [BeforeTranslateEvent::class, 10], [BeforeTranslateEvent::class, 0], [TranslateEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testTranslateStopPropagationInBeforeEvents() @@ -352,11 +353,11 @@ public function testTranslateStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventResult, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventResult, $result); + self::assertSame($calledListeners, [ [BeforeTranslateEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeTranslateEvent::class, 0], [TranslateEvent::class, 0], ]); diff --git a/tests/lib/Event/UserPreferenceServiceTest.php b/tests/lib/Event/UserPreferenceServiceTest.php index a40317bb0b..f91c97bbb8 100644 --- a/tests/lib/Event/UserPreferenceServiceTest.php +++ b/tests/lib/Event/UserPreferenceServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\Events\UserPreference\BeforeSetUserPreferenceEvent; @@ -31,11 +32,11 @@ public function testSetUserPreferenceEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeSetUserPreferenceEvent::class, 0], [SetUserPreferenceEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testSetUserPreferenceStopPropagationInBeforeEvents() @@ -61,10 +62,10 @@ public function testSetUserPreferenceStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeSetUserPreferenceEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeSetUserPreferenceEvent::class, 0], [SetUserPreferenceEvent::class, 0], ]); diff --git a/tests/lib/Event/UserServiceTest.php b/tests/lib/Event/UserServiceTest.php index 1f80d6537f..84fb778489 100644 --- a/tests/lib/Event/UserServiceTest.php +++ b/tests/lib/Event/UserServiceTest.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\Core\Event; use Ibexa\Contracts\Core\Repository\Events\User\AssignUserToUserGroupEvent; @@ -59,12 +60,12 @@ public function testUpdateUserGroupEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($updatedUserGroup, $result); - $this->assertSame($calledListeners, [ + self::assertSame($updatedUserGroup, $result); + self::assertSame($calledListeners, [ [BeforeUpdateUserGroupEvent::class, 0], [UpdateUserGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnUpdateUserGroupResultInBeforeEvents() @@ -93,13 +94,13 @@ public function testReturnUpdateUserGroupResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUpdatedUserGroup, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedUserGroup, $result); + self::assertSame($calledListeners, [ [BeforeUpdateUserGroupEvent::class, 10], [BeforeUpdateUserGroupEvent::class, 0], [UpdateUserGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateUserGroupStopPropagationInBeforeEvents() @@ -130,11 +131,11 @@ public function testUpdateUserGroupStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUpdatedUserGroup, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedUserGroup, $result); + self::assertSame($calledListeners, [ [BeforeUpdateUserGroupEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateUserGroupEvent::class, 0], [UpdateUserGroupEvent::class, 0], ]); @@ -161,12 +162,12 @@ public function testUpdateUserEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($updatedUser, $result); - $this->assertSame($calledListeners, [ + self::assertSame($updatedUser, $result); + self::assertSame($calledListeners, [ [BeforeUpdateUserEvent::class, 0], [UpdateUserEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnUpdateUserResultInBeforeEvents() @@ -195,13 +196,13 @@ public function testReturnUpdateUserResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUpdatedUser, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedUser, $result); + self::assertSame($calledListeners, [ [BeforeUpdateUserEvent::class, 10], [BeforeUpdateUserEvent::class, 0], [UpdateUserEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateUserStopPropagationInBeforeEvents() @@ -232,11 +233,11 @@ public function testUpdateUserStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUpdatedUser, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedUser, $result); + self::assertSame($calledListeners, [ [BeforeUpdateUserEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateUserEvent::class, 0], [UpdateUserEvent::class, 0], ]); @@ -261,11 +262,11 @@ public function testUnAssignUserFromUserGroupEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeUnAssignUserFromUserGroupEvent::class, 0], [UnAssignUserFromUserGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUnAssignUserFromUserGroupStopPropagationInBeforeEvents() @@ -292,10 +293,10 @@ public function testUnAssignUserFromUserGroupStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeUnAssignUserFromUserGroupEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUnAssignUserFromUserGroupEvent::class, 0], [UnAssignUserFromUserGroupEvent::class, 0], ]); @@ -321,12 +322,12 @@ public function testDeleteUserGroupEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($locations, $result); - $this->assertSame($calledListeners, [ + self::assertSame($locations, $result); + self::assertSame($calledListeners, [ [BeforeDeleteUserGroupEvent::class, 0], [DeleteUserGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnDeleteUserGroupResultInBeforeEvents() @@ -354,13 +355,13 @@ public function testReturnDeleteUserGroupResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventLocations, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventLocations, $result); + self::assertSame($calledListeners, [ [BeforeDeleteUserGroupEvent::class, 10], [BeforeDeleteUserGroupEvent::class, 0], [DeleteUserGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteUserGroupStopPropagationInBeforeEvents() @@ -390,11 +391,11 @@ public function testDeleteUserGroupStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventLocations, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventLocations, $result); + self::assertSame($calledListeners, [ [BeforeDeleteUserGroupEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteUserGroupEvent::class, 0], [DeleteUserGroupEvent::class, 0], ]); @@ -419,11 +420,11 @@ public function testAssignUserToUserGroupEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeAssignUserToUserGroupEvent::class, 0], [AssignUserToUserGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testAssignUserToUserGroupStopPropagationInBeforeEvents() @@ -450,10 +451,10 @@ public function testAssignUserToUserGroupStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeAssignUserToUserGroupEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [AssignUserToUserGroupEvent::class, 0], [BeforeAssignUserToUserGroupEvent::class, 0], ]); @@ -479,12 +480,12 @@ public function testDeleteUserEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($locations, $result); - $this->assertSame($calledListeners, [ + self::assertSame($locations, $result); + self::assertSame($calledListeners, [ [BeforeDeleteUserEvent::class, 0], [DeleteUserEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnDeleteUserResultInBeforeEvents() @@ -512,13 +513,13 @@ public function testReturnDeleteUserResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventLocations, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventLocations, $result); + self::assertSame($calledListeners, [ [BeforeDeleteUserEvent::class, 10], [BeforeDeleteUserEvent::class, 0], [DeleteUserEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testDeleteUserStopPropagationInBeforeEvents() @@ -548,11 +549,11 @@ public function testDeleteUserStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventLocations, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventLocations, $result); + self::assertSame($calledListeners, [ [BeforeDeleteUserEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeDeleteUserEvent::class, 0], [DeleteUserEvent::class, 0], ]); @@ -577,11 +578,11 @@ public function testMoveUserGroupEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeMoveUserGroupEvent::class, 0], [MoveUserGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testMoveUserGroupStopPropagationInBeforeEvents() @@ -608,10 +609,10 @@ public function testMoveUserGroupStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($calledListeners, [ + self::assertSame($calledListeners, [ [BeforeMoveUserGroupEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeMoveUserGroupEvent::class, 0], [MoveUserGroupEvent::class, 0], ]); @@ -638,12 +639,12 @@ public function testCreateUserEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($user, $result); - $this->assertSame($calledListeners, [ + self::assertSame($user, $result); + self::assertSame($calledListeners, [ [BeforeCreateUserEvent::class, 0], [CreateUserEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateUserResultInBeforeEvents() @@ -672,13 +673,13 @@ public function testReturnCreateUserResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUser, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUser, $result); + self::assertSame($calledListeners, [ [BeforeCreateUserEvent::class, 10], [BeforeCreateUserEvent::class, 0], [CreateUserEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateUserStopPropagationInBeforeEvents() @@ -709,11 +710,11 @@ public function testCreateUserStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUser, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUser, $result); + self::assertSame($calledListeners, [ [BeforeCreateUserEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateUserEvent::class, 0], [CreateUserEvent::class, 0], ]); @@ -740,12 +741,12 @@ public function testCreateUserGroupEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($userGroup, $result); - $this->assertSame($calledListeners, [ + self::assertSame($userGroup, $result); + self::assertSame($calledListeners, [ [BeforeCreateUserGroupEvent::class, 0], [CreateUserGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnCreateUserGroupResultInBeforeEvents() @@ -774,13 +775,13 @@ public function testReturnCreateUserGroupResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUserGroup, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUserGroup, $result); + self::assertSame($calledListeners, [ [BeforeCreateUserGroupEvent::class, 10], [BeforeCreateUserGroupEvent::class, 0], [CreateUserGroupEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testCreateUserGroupStopPropagationInBeforeEvents() @@ -811,11 +812,11 @@ public function testCreateUserGroupStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUserGroup, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUserGroup, $result); + self::assertSame($calledListeners, [ [BeforeCreateUserGroupEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeCreateUserGroupEvent::class, 0], [CreateUserGroupEvent::class, 0], ]); @@ -842,12 +843,12 @@ public function testUpdateUserTokenEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($updatedUser, $result); - $this->assertSame($calledListeners, [ + self::assertSame($updatedUser, $result); + self::assertSame($calledListeners, [ [BeforeUpdateUserTokenEvent::class, 0], [UpdateUserTokenEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testReturnUpdateUserTokenResultInBeforeEvents() @@ -876,13 +877,13 @@ public function testReturnUpdateUserTokenResultInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); - $this->assertSame($eventUpdatedUser, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedUser, $result); + self::assertSame($calledListeners, [ [BeforeUpdateUserTokenEvent::class, 10], [BeforeUpdateUserTokenEvent::class, 0], [UpdateUserTokenEvent::class, 0], ]); - $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + self::assertSame([], $traceableEventDispatcher->getNotCalledListeners()); } public function testUpdateUserTokenStopPropagationInBeforeEvents() @@ -913,11 +914,11 @@ public function testUpdateUserTokenStopPropagationInBeforeEvents() $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); - $this->assertSame($eventUpdatedUser, $result); - $this->assertSame($calledListeners, [ + self::assertSame($eventUpdatedUser, $result); + self::assertSame($calledListeners, [ [BeforeUpdateUserTokenEvent::class, 10], ]); - $this->assertSame($notCalledListeners, [ + self::assertSame($notCalledListeners, [ [BeforeUpdateUserTokenEvent::class, 0], [UpdateUserTokenEvent::class, 0], ]); diff --git a/tests/lib/FieldType/APIFieldTypeTest.php b/tests/lib/FieldType/APIFieldTypeTest.php index 6575577aa1..97817e0c54 100644 --- a/tests/lib/FieldType/APIFieldTypeTest.php +++ b/tests/lib/FieldType/APIFieldTypeTest.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\FieldType as SPIFieldType; @@ -33,7 +34,7 @@ public function testValidateValidatorConfigurationNoError() $validatorConfig = ['foo' => 'bar']; $validationErrors = []; $this->innerFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('validateValidatorConfiguration') ->with($validatorConfig) ->willReturn($validationErrors); @@ -50,7 +51,7 @@ public function testValidateValidatorConfiguration() $this->createMock(ValidationError::class), ]; $this->innerFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('validateValidatorConfiguration') ->with($validatorConfig) ->willReturn($validationErrors); @@ -63,7 +64,7 @@ public function testValidateFieldSettingsNoError() $fieldSettings = ['foo' => 'bar']; $validationErrors = []; $this->innerFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('validateFieldSettings') ->with($fieldSettings) ->willReturn($validationErrors); @@ -80,7 +81,7 @@ public function testValidateFieldSettings() $this->createMock(ValidationError::class), ]; $this->innerFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('validateFieldSettings') ->with($fieldSettings) ->willReturn($validationErrors); @@ -94,7 +95,7 @@ public function testValidateValueNoError() $value = $this->getMockForAbstractClass(Value::class); $validationErrors = []; $this->innerFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('validate') ->with($fieldDefinition, $value) ->willReturn($validationErrors); @@ -112,7 +113,7 @@ public function testValidateValue() $this->createMock(ValidationError::class), ]; $this->innerFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('validate') ->with($fieldDefinition, $value) ->willReturn($validationErrors); diff --git a/tests/lib/FieldType/AuthorTest.php b/tests/lib/FieldType/AuthorTest.php index 4e98d24e44..d7ea36f48f 100644 --- a/tests/lib/FieldType/AuthorTest.php +++ b/tests/lib/FieldType/AuthorTest.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\Core\FieldType; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/tests/lib/FieldType/BaseFieldTypeTest.php b/tests/lib/FieldType/BaseFieldTypeTest.php index c36e00fdb5..d13a8844e3 100644 --- a/tests/lib/FieldType/BaseFieldTypeTest.php +++ b/tests/lib/FieldType/BaseFieldTypeTest.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\FieldType; @@ -562,7 +563,7 @@ public function testEmptyValue() { $fieldType = $this->getFieldTypeUnderTest(); - $this->assertEquals( + self::assertEquals( $this->getEmptyValueExpectation(), $fieldType->getEmptyValue() ); @@ -580,7 +581,7 @@ public function testAcceptValue($inputValue, $expectedOutputValue) $outputValue = $fieldType->acceptValue($inputValue); - $this->assertEquals( + self::assertEquals( $expectedOutputValue, $outputValue, 'acceptValue() did not convert properly.' @@ -597,7 +598,7 @@ public function testAcceptGetEmptyValue() $acceptedEmptyValue = $fieldType->acceptValue($emptyValue); - $this->assertEquals( + self::assertEquals( $emptyValue, $acceptedEmptyValue, 'acceptValue() did not convert properly.' @@ -636,13 +637,13 @@ public function testToHash($inputValue, $expectedResult) $this->assertIsValidHashValue($actualResult); if (is_object($expectedResult) || is_array($expectedResult)) { - $this->assertEquals( + self::assertEquals( $expectedResult, $actualResult, 'toHash() method did not create expected result.' ); } else { - $this->assertSame( + self::assertSame( $expectedResult, $actualResult, 'toHash() method did not create expected result.' @@ -665,13 +666,13 @@ public function testFromHash($inputHash, $expectedResult) $actualResult = $fieldType->fromHash($inputHash); if (is_object($expectedResult) || is_array($expectedResult)) { - $this->assertEquals( + self::assertEquals( $expectedResult, $actualResult, 'fromHash() method did not create expected result.' ); } else { - $this->assertSame( + self::assertSame( $expectedResult, $actualResult, 'fromHash() method did not create expected result.' @@ -683,7 +684,7 @@ public function testEmptyValueIsEmpty() { $fieldType = $this->getFieldTypeUnderTest(); - $this->assertTrue( + self::assertTrue( $fieldType->isEmptyValue($fieldType->getEmptyValue()) ); } @@ -699,11 +700,11 @@ public function testValidateFieldSettingsValid($inputSettings) $validationResult = $fieldType->validateFieldSettings($inputSettings); - $this->assertIsArray( + self::assertIsArray( $validationResult, 'The method validateFieldSettings() must return an array.' ); - $this->assertEquals( + self::assertEquals( [], $validationResult, 'validateFieldSettings() did not consider the input settings valid.' @@ -721,19 +722,19 @@ public function testValidateFieldSettingsInvalid($inputSettings) $validationResult = $fieldType->validateFieldSettings($inputSettings); - $this->assertIsArray( + self::assertIsArray( $validationResult, 'The method validateFieldSettings() must return an array.' ); - $this->assertNotEquals( + self::assertNotEquals( [], $validationResult, 'validateFieldSettings() did consider the input settings valid, which should be invalid.' ); foreach ($validationResult as $actualResultElement) { - $this->assertInstanceOf( + self::assertInstanceOf( ValidationError::class, $actualResultElement, 'Validation result of incorrect type.' @@ -752,11 +753,11 @@ public function testValidateValidatorConfigurationValid($inputConfiguration) $validationResult = $fieldType->validateValidatorConfiguration($inputConfiguration); - $this->assertIsArray( + self::assertIsArray( $validationResult, 'The method validateValidatorConfiguration() must return an array.' ); - $this->assertEquals( + self::assertEquals( [], $validationResult, 'validateValidatorConfiguration() did not consider the input configuration valid.' @@ -774,19 +775,19 @@ public function testValidateValidatorConfigurationInvalid($inputConfiguration) $validationResult = $fieldType->validateValidatorConfiguration($inputConfiguration); - $this->assertIsArray( + self::assertIsArray( $validationResult, 'The method validateValidatorConfiguration() must return an array.' ); - $this->assertNotEquals( + self::assertNotEquals( [], $validationResult, 'validateValidatorConfiguration() did consider the input settings valid, which should be invalid.' ); foreach ($validationResult as $actualResultElement) { - $this->assertInstanceOf( + self::assertInstanceOf( ValidationError::class, $actualResultElement, 'Validation result of incorrect type.' @@ -834,7 +835,7 @@ public function testFieldSettingsFromHash($inputSettings) $hash = $fieldType->fieldSettingsToHash($inputSettings); $restoredSettings = $fieldType->fieldSettingsFromHash($hash); - $this->assertEquals($inputSettings, $restoredSettings); + self::assertEquals($inputSettings, $restoredSettings); } /** @@ -849,7 +850,7 @@ public function testValidatorConfigurationFromHash($inputConfiguration) $hash = $fieldType->validatorConfigurationToHash($inputConfiguration); $restoredConfiguration = $fieldType->validatorConfigurationFromHash($hash); - $this->assertEquals($inputConfiguration, $restoredConfiguration); + self::assertEquals($inputConfiguration, $restoredConfiguration); } /** @@ -881,7 +882,7 @@ protected function assertIsValidHashValue($actualHash, $keyChain = []) case 'resource': case 'object': - $this->fail( + self::fail( sprintf( 'Value for $hash[%s] is of invalid type "%s".', implode('][', $keyChain), @@ -898,8 +899,8 @@ public function testValidateValid($fieldDefinitionData, $value) { $validationErrors = $this->doValidate($fieldDefinitionData, $value); - $this->assertIsArray($validationErrors); - $this->assertEmpty($validationErrors, "Got value:\n" . var_export($validationErrors, true)); + self::assertIsArray($validationErrors); + self::assertEmpty($validationErrors, "Got value:\n" . var_export($validationErrors, true)); } /** @@ -909,8 +910,8 @@ public function testValidateInvalid($fieldDefinitionData, $value, $errors) { $validationErrors = $this->doValidate($fieldDefinitionData, $value); - $this->assertIsArray($validationErrors); - $this->assertEquals($errors, $validationErrors); + self::assertIsArray($validationErrors); + self::assertEquals($errors, $validationErrors); } protected function doValidate($fieldDefinitionData, $value) diff --git a/tests/lib/FieldType/BinaryBaseTest.php b/tests/lib/FieldType/BinaryBaseTest.php index 436ead5880..b43a34f420 100644 --- a/tests/lib/FieldType/BinaryBaseTest.php +++ b/tests/lib/FieldType/BinaryBaseTest.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\Core\FieldType; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; diff --git a/tests/lib/FieldType/BinaryFileTest.php b/tests/lib/FieldType/BinaryFileTest.php index b8cf9bfcfe..f1b6b729ed 100644 --- a/tests/lib/FieldType/BinaryFileTest.php +++ b/tests/lib/FieldType/BinaryFileTest.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\BinaryBase\RouteAwarePathGenerator; diff --git a/tests/lib/FieldType/CheckboxTest.php b/tests/lib/FieldType/CheckboxTest.php index 284c9bcb33..67b4686e00 100644 --- a/tests/lib/FieldType/CheckboxTest.php +++ b/tests/lib/FieldType/CheckboxTest.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\Core\FieldType; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/tests/lib/FieldType/CountryTest.php b/tests/lib/FieldType/CountryTest.php index d20c28ebda..ec06220972 100644 --- a/tests/lib/FieldType/CountryTest.php +++ b/tests/lib/FieldType/CountryTest.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\Core\FieldType; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/tests/lib/FieldType/DateAndTimeTest.php b/tests/lib/FieldType/DateAndTimeTest.php index 61a3c9a6e9..2caa49a075 100644 --- a/tests/lib/FieldType/DateAndTimeTest.php +++ b/tests/lib/FieldType/DateAndTimeTest.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\Core\FieldType; use DateInterval; @@ -206,13 +207,13 @@ public function testFromHash($inputHash, $expectedResult) $actualResult = $fieldType->fromHash($inputHash); // Tests may run slowly. Allow 20 seconds margin of error. - $this->assertGreaterThanOrEqual( + self::assertGreaterThanOrEqual( $expectedResult, $actualResult, 'fromHash() method did not create expected result.' ); if ($expectedResult->value !== null) { - $this->assertLessThan( + self::assertLessThan( $expectedResult->value->add(new DateInterval('PT20S')), $actualResult->value, 'fromHash() method did not create expected result.' @@ -271,13 +272,13 @@ public function testTimeStringFromHash($inputHash, $intervalSpec) $actualResult = $fieldType->fromHash($inputHash); // Tests may run slowly. Allow 20 seconds margin of error. - $this->assertGreaterThanOrEqual( + self::assertGreaterThanOrEqual( $expectedResult, $actualResult, 'fromHash() method did not create expected result.' ); if ($expectedResult->value !== null) { - $this->assertLessThan( + self::assertLessThan( $expectedResult->value->add(new DateInterval('PT20S')), $actualResult->value, 'fromHash() method did not create expected result.' diff --git a/tests/lib/FieldType/DateTest.php b/tests/lib/FieldType/DateTest.php index 45b9072d43..41e531703c 100644 --- a/tests/lib/FieldType/DateTest.php +++ b/tests/lib/FieldType/DateTest.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\Core\FieldType; use DateTime; diff --git a/tests/lib/FieldType/EmailAddressTest.php b/tests/lib/FieldType/EmailAddressTest.php index dd536abb3e..c2619769e9 100644 --- a/tests/lib/FieldType/EmailAddressTest.php +++ b/tests/lib/FieldType/EmailAddressTest.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\Core\FieldType; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; @@ -32,11 +33,11 @@ protected function createFieldTypeUnderTest() { $transformationProcessorMock = $this->getTransformationProcessorMock(); - $transformationProcessorMock->expects($this->any()) + $transformationProcessorMock->expects(self::any()) ->method('transformByGroup') - ->with($this->anything(), 'lowercase') + ->with(self::anything(), 'lowercase') ->will( - $this->returnCallback( + self::returnCallback( static function ($value, $group) { return strtolower($value); } diff --git a/tests/lib/FieldType/EmailAddressValidatorTest.php b/tests/lib/FieldType/EmailAddressValidatorTest.php index d9f56d5ae5..8e3aa98cac 100644 --- a/tests/lib/FieldType/EmailAddressValidatorTest.php +++ b/tests/lib/FieldType/EmailAddressValidatorTest.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\Core\FieldType; use Ibexa\Core\FieldType\EmailAddress\Value as EmailAddressValue; @@ -13,6 +14,7 @@ /** * @todo add more tests, like on validateConstraints method + * * @group fieldType * @group validator */ @@ -23,7 +25,7 @@ class EmailAddressValidatorTest extends TestCase */ public function testConstructor() { - $this->assertInstanceOf( + self::assertInstanceOf( Validator::class, new EmailAddressValidator() ); @@ -44,7 +46,7 @@ public function testConstraintsInitializeGet() $validator->initializeWithConstraints( $constraints ); - $this->assertSame($constraints['Extent'], $validator->Extent); + self::assertSame($constraints['Extent'], $validator->Extent); } /** @@ -61,7 +63,7 @@ public function testGetConstraintsSchema() ], ]; $validator = new EmailAddressValidator(); - $this->assertSame($constraintsSchema, $validator->getConstraintsSchema()); + self::assertSame($constraintsSchema, $validator->getConstraintsSchema()); } /** @@ -77,7 +79,7 @@ public function testConstraintsSetGet() ]; $validator = new EmailAddressValidator(); $validator->Extent = $constraints['Extent']; - $this->assertSame($constraints['Extent'], $validator->Extent); + self::assertSame($constraints['Extent'], $validator->Extent); } public function testValidateCorrectEmailAddresses() @@ -86,8 +88,8 @@ public function testValidateCorrectEmailAddresses() $validator->Extent = 'regex'; $emailAddresses = ['john.doe@example.com', 'Info@Ibexa.Co']; foreach ($emailAddresses as $value) { - $this->assertTrue($validator->validate(new EmailAddressValue($value))); - $this->assertSame([], $validator->getMessage()); + self::assertTrue($validator->validate(new EmailAddressValue($value))); + self::assertSame([], $validator->getMessage()); } } @@ -102,7 +104,7 @@ public function testValidateWrongEmailAddresses() $validator->Extent = 'regex'; $emailAddresses = ['.john.doe@example.com', 'Info-at-Ibexa.Co']; foreach ($emailAddresses as $value) { - $this->assertFalse($validator->validate(new EmailAddressValue($value))); + self::assertFalse($validator->validate(new EmailAddressValue($value))); } } } diff --git a/tests/lib/FieldType/FieldTypeMockTest.php b/tests/lib/FieldType/FieldTypeMockTest.php index 424eda9b85..80a50dc574 100644 --- a/tests/lib/FieldType/FieldTypeMockTest.php +++ b/tests/lib/FieldType/FieldTypeMockTest.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\Core\FieldType; use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException; @@ -48,10 +49,10 @@ public function testApplyDefaultSettings($initialSettings, $expectedSettings) ); $stub - ->expects($this->any()) + ->expects(self::any()) ->method('getSettingsSchema') ->will( - $this->returnValue( + self::returnValue( [ 'true' => [ 'default' => true, @@ -87,7 +88,7 @@ public function testApplyDefaultSettings($initialSettings, $expectedSettings) $fieldSettings = $initialSettings; $stub->applyDefaultSettings($fieldSettings); - $this->assertSame( + self::assertSame( $expectedSettings, $fieldSettings ); @@ -191,15 +192,15 @@ public function testApplyDefaultValidatorConfigurationEmpty() ); $stub - ->expects($this->any()) + ->expects(self::any()) ->method('getValidatorConfigurationSchema') ->will( - $this->returnValue([]) + self::returnValue([]) ); $validatorConfiguration = null; $stub->applyDefaultValidatorConfiguration($validatorConfiguration); - $this->assertNull( + self::assertNull( $validatorConfiguration ); } @@ -221,10 +222,10 @@ public function testApplyDefaultValidatorConfiguration($initialConfiguration, $e ); $stub - ->expects($this->any()) + ->expects(self::any()) ->method('getValidatorConfigurationSchema') ->will( - $this->returnValue( + self::returnValue( [ 'TestValidator' => [ 'valueClick' => [ @@ -240,7 +241,7 @@ public function testApplyDefaultValidatorConfiguration($initialConfiguration, $e $validatorConfiguration = $initialConfiguration; $stub->applyDefaultValidatorConfiguration($validatorConfiguration); - $this->assertSame( + self::assertSame( $expectedConfiguration, $validatorConfiguration ); diff --git a/tests/lib/FieldType/FieldTypeTest.php b/tests/lib/FieldType/FieldTypeTest.php index 1950cfdbe9..f2d0c7dff9 100644 --- a/tests/lib/FieldType/FieldTypeTest.php +++ b/tests/lib/FieldType/FieldTypeTest.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/tests/lib/FieldType/FileSizeValidatorTest.php b/tests/lib/FieldType/FileSizeValidatorTest.php index a8f65652a7..bfaa295927 100644 --- a/tests/lib/FieldType/FileSizeValidatorTest.php +++ b/tests/lib/FieldType/FileSizeValidatorTest.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\ValidationError; @@ -36,7 +37,7 @@ protected function getMaxFileSize() */ public function testConstructor() { - $this->assertInstanceOf( + self::assertInstanceOf( Validator::class, new FileSizeValidator() ); @@ -57,7 +58,7 @@ public function testConstraintsInitializeGet() $validator->initializeWithConstraints( $constraints ); - $this->assertSame($constraints['maxFileSize'], $validator->maxFileSize); + self::assertSame($constraints['maxFileSize'], $validator->maxFileSize); } /** @@ -74,7 +75,7 @@ public function testGetConstraintsSchema() ], ]; $validator = new FileSizeValidator(); - $this->assertSame($constraintsSchema, $validator->getConstraintsSchema()); + self::assertSame($constraintsSchema, $validator->getConstraintsSchema()); } /** @@ -90,7 +91,7 @@ public function testConstraintsSetGet() ]; $validator = new FileSizeValidator(); $validator->maxFileSize = $constraints['maxFileSize']; - $this->assertSame($constraints['maxFileSize'], $validator->maxFileSize); + self::assertSame($constraints['maxFileSize'], $validator->maxFileSize); } /** @@ -143,16 +144,17 @@ public function testGetBadConstraint() * @param int $size * * @dataProvider providerForValidateOK + * * @covers \Ibexa\Core\FieldType\Validator\FileSizeValidator::validate * @covers \Ibexa\Core\FieldType\Validator::getMessage */ public function testValidateCorrectValues($size) { - $this->markTestSkipped('BinaryFile field type does not use this validator anymore.'); + self::markTestSkipped('BinaryFile field type does not use this validator anymore.'); $validator = new FileSizeValidator(); $validator->maxFileSize = 4096; - $this->assertTrue($validator->validate($this->getBinaryFileValue($size))); - $this->assertSame([], $validator->getMessage()); + self::assertTrue($validator->validate($this->getBinaryFileValue($size))); + self::assertSame([], $validator->getMessage()); } /** @@ -162,7 +164,7 @@ public function testValidateCorrectValues($size) */ protected function getBinaryFileValue($size) { - $this->markTestSkipped('BinaryFile field type does not use this validator anymore.'); + self::markTestSkipped('BinaryFile field type does not use this validator anymore.'); $value = new BinaryFileValue($this->createMock(IOServiceInterface::class)); $value->file = new BinaryFile(['size' => $size]); @@ -182,33 +184,34 @@ public function providerForValidateOK() * Tests validating a wrong value. * * @dataProvider providerForValidateKO + * * @covers \Ibexa\Core\FieldType\Validator\FileSizeValidator::validate */ public function testValidateWrongValues($size, $message, $values) { - $this->markTestSkipped('BinaryFile field type does not use this validator anymore.'); + self::markTestSkipped('BinaryFile field type does not use this validator anymore.'); $validator = new FileSizeValidator(); $validator->maxFileSize = $this->getMaxFileSize(); - $this->assertFalse($validator->validate($this->getBinaryFileValue($size))); + self::assertFalse($validator->validate($this->getBinaryFileValue($size))); $messages = $validator->getMessage(); - $this->assertCount(1, $messages); - $this->assertInstanceOf( + self::assertCount(1, $messages); + self::assertInstanceOf( ValidationError::class, $messages[0] ); - $this->assertInstanceOf( + self::assertInstanceOf( Plural::class, $messages[0]->getTranslatableMessage() ); - $this->assertEquals( + self::assertEquals( $message[0], $messages[0]->getTranslatableMessage()->singular ); - $this->assertEquals( + self::assertEquals( $message[1], $messages[0]->getTranslatableMessage()->plural ); - $this->assertEquals( + self::assertEquals( $values, $messages[0]->getTranslatableMessage()->values ); @@ -232,13 +235,14 @@ public function providerForValidateKO() * Tests validation of constraints. * * @dataProvider providerForValidateConstraintsOK + * * @covers \Ibexa\Core\FieldType\Validator\FileSizeValidator::validateConstraints */ public function testValidateConstraintsCorrectValues($constraints) { $validator = new FileSizeValidator(); - $this->assertEmpty( + self::assertEmpty( $validator->validateConstraints($constraints) ); } @@ -260,6 +264,7 @@ public function providerForValidateConstraintsOK() * Tests validation of constraints. * * @dataProvider providerForValidateConstraintsKO + * * @covers \Ibexa\Core\FieldType\Validator\FileSizeValidator::validateConstraints */ public function testValidateConstraintsWrongValues($constraints, $expectedMessages, $values) @@ -267,15 +272,15 @@ public function testValidateConstraintsWrongValues($constraints, $expectedMessag $validator = new FileSizeValidator(); $messages = $validator->validateConstraints($constraints); - $this->assertInstanceOf( + self::assertInstanceOf( Message::class, $messages[0]->getTranslatableMessage() ); - $this->assertEquals( + self::assertEquals( $expectedMessages[0], $messages[0]->getTranslatableMessage()->message ); - $this->assertEquals( + self::assertEquals( $values, $messages[0]->getTranslatableMessage()->values ); diff --git a/tests/lib/FieldType/FloatTest.php b/tests/lib/FieldType/FloatTest.php index 907e4a6a95..ef791701d7 100644 --- a/tests/lib/FieldType/FloatTest.php +++ b/tests/lib/FieldType/FloatTest.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\Core\FieldType; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/tests/lib/FieldType/FloatValueValidatorTest.php b/tests/lib/FieldType/FloatValueValidatorTest.php index b566148841..cb4e984b45 100644 --- a/tests/lib/FieldType/FloatValueValidatorTest.php +++ b/tests/lib/FieldType/FloatValueValidatorTest.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\ValidationError; @@ -41,7 +42,7 @@ protected function getMaxFloatValue() */ public function testConstructor() { - $this->assertInstanceOf( + self::assertInstanceOf( Validator::class, new FloatValueValidator() ); @@ -63,8 +64,8 @@ public function testConstraintsInitializeGet() $validator->initializeWithConstraints( $constraints ); - $this->assertSame($constraints['minFloatValue'], $validator->minFloatValue); - $this->assertSame($constraints['maxFloatValue'], $validator->maxFloatValue); + self::assertSame($constraints['minFloatValue'], $validator->minFloatValue); + self::assertSame($constraints['maxFloatValue'], $validator->maxFloatValue); } /** @@ -85,7 +86,7 @@ public function testGetConstraintsSchema() ], ]; $validator = new FloatValueValidator(); - $this->assertSame($constraintsSchema, $validator->getConstraintsSchema()); + self::assertSame($constraintsSchema, $validator->getConstraintsSchema()); } /** @@ -103,8 +104,8 @@ public function testConstraintsSetGet() $validator = new FloatValueValidator(); $validator->minFloatValue = $constraints['minFloatValue']; $validator->maxFloatValue = $constraints['maxFloatValue']; - $this->assertSame($constraints['minFloatValue'], $validator->minFloatValue); - $this->assertSame($constraints['maxFloatValue'], $validator->maxFloatValue); + self::assertSame($constraints['minFloatValue'], $validator->minFloatValue); + self::assertSame($constraints['maxFloatValue'], $validator->maxFloatValue); } /** @@ -155,6 +156,7 @@ public function testGetBadConstraint() * Tests validating a correct value. * * @dataProvider providerForValidateOK + * * @covers \Ibexa\Core\FieldType\Validator\FloatValueValidator::validate * @covers \Ibexa\Core\FieldType\Validator::getMessage */ @@ -163,8 +165,8 @@ public function testValidateCorrectValues($value) $validator = new FloatValueValidator(); $validator->minFloatValue = 10 / 7; $validator->maxFloatValue = 11 / 7; - $this->assertTrue($validator->validate(new FloatValue($value))); - $this->assertSame([], $validator->getMessage()); + self::assertTrue($validator->validate(new FloatValue($value))); + self::assertSame([], $validator->getMessage()); } public function providerForValidateOK() @@ -182,6 +184,7 @@ public function providerForValidateOK() * Tests validating a wrong value. * * @dataProvider providerForValidateKO + * * @covers \Ibexa\Core\FieldType\Validator\FloatValueValidator::validate */ public function testValidateWrongValues($value, $message, $values) @@ -189,22 +192,22 @@ public function testValidateWrongValues($value, $message, $values) $validator = new FloatValueValidator(); $validator->minFloatValue = $this->getMinFloatValue(); $validator->maxFloatValue = $this->getMaxFloatValue(); - $this->assertFalse($validator->validate(new FloatValue($value))); + self::assertFalse($validator->validate(new FloatValue($value))); $messages = $validator->getMessage(); - $this->assertCount(1, $messages); - $this->assertInstanceOf( + self::assertCount(1, $messages); + self::assertInstanceOf( ValidationError::class, $messages[0] ); - $this->assertInstanceOf( + self::assertInstanceOf( Message::class, $messages[0]->getTranslatableMessage() ); - $this->assertEquals( + self::assertEquals( $message, $messages[0]->getTranslatableMessage()->message ); - $this->assertEquals( + self::assertEquals( $values, $messages[0]->getTranslatableMessage()->values ); @@ -224,13 +227,14 @@ public function providerForValidateKO() * Tests validation of constraints. * * @dataProvider providerForValidateConstraintsOK + * * @covers \Ibexa\Core\FieldType\Validator\FileSizeValidator::validateConstraints */ public function testValidateConstraintsCorrectValues($constraints) { $validator = new FloatValueValidator(); - $this->assertEmpty( + self::assertEmpty( $validator->validateConstraints($constraints) ); } @@ -270,6 +274,7 @@ public function providerForValidateConstraintsOK() * Tests validation of constraints. * * @dataProvider providerForValidateConstraintsKO + * * @covers \Ibexa\Core\FieldType\Validator\FileSizeValidator::validateConstraints */ public function testValidateConstraintsWrongValues($constraints, $expectedMessages, $values) @@ -278,15 +283,15 @@ public function testValidateConstraintsWrongValues($constraints, $expectedMessag $messages = $validator->validateConstraints($constraints); foreach ($expectedMessages as $index => $expectedMessage) { - $this->assertInstanceOf( + self::assertInstanceOf( Message::class, $messages[0]->getTranslatableMessage() ); - $this->assertEquals( + self::assertEquals( $expectedMessage, $messages[$index]->getTranslatableMessage()->message ); - $this->assertEquals( + self::assertEquals( $values[$index], $messages[$index]->getTranslatableMessage()->values ); diff --git a/tests/lib/FieldType/Generic/ValueSerializer/SymfonySerializerAdapterTest.php b/tests/lib/FieldType/Generic/ValueSerializer/SymfonySerializerAdapterTest.php index 58f8f40def..606453bdb9 100644 --- a/tests/lib/FieldType/Generic/ValueSerializer/SymfonySerializerAdapterTest.php +++ b/tests/lib/FieldType/Generic/ValueSerializer/SymfonySerializerAdapterTest.php @@ -58,12 +58,12 @@ public function testNormalize(): void $data = ['value' => 'test']; $this->normalizer - ->expects($this->once()) + ->expects(self::once()) ->method('normalize') ->with($value, self::TEST_FORMAT, self::TEST_CONTEXT) ->willReturn($data); - $this->assertEquals($data, $this->adapter->normalize($value, self::TEST_CONTEXT)); + self::assertEquals($data, $this->adapter->normalize($value, self::TEST_CONTEXT)); } public function testDenormalize(): void @@ -72,12 +72,12 @@ public function testDenormalize(): void $value = $this->createMock(Value::class); $this->denomalizer - ->expects($this->once()) + ->expects(self::once()) ->method('denormalize') ->with($data, Value::class, self::TEST_FORMAT, self::TEST_CONTEXT) ->willReturn($value); - $this->assertEquals($value, $this->adapter->denormalize($data, Value::class, self::TEST_CONTEXT)); + self::assertEquals($value, $this->adapter->denormalize($data, Value::class, self::TEST_CONTEXT)); } public function testEncode(): void @@ -86,12 +86,12 @@ public function testEncode(): void $json = '{"value": "test"}'; $this->encoder - ->expects($this->once()) + ->expects(self::once()) ->method('encode') ->with($data, self::TEST_FORMAT, self::TEST_CONTEXT) ->willReturn($json); - $this->assertEquals($json, $this->adapter->encode($data, self::TEST_CONTEXT)); + self::assertEquals($json, $this->adapter->encode($data, self::TEST_CONTEXT)); } public function testDecode(): void @@ -100,12 +100,12 @@ public function testDecode(): void $json = '{"value": "test"}'; $this->decoder - ->expects($this->once()) + ->expects(self::once()) ->method('decode') ->with($json, self::TEST_FORMAT, self::TEST_CONTEXT) ->willReturn($data); - $this->assertEquals($data, $this->adapter->decode($json, self::TEST_CONTEXT)); + self::assertEquals($data, $this->adapter->decode($json, self::TEST_CONTEXT)); } } diff --git a/tests/lib/FieldType/ISBNTest.php b/tests/lib/FieldType/ISBNTest.php index 811c2e0673..70850c2b7d 100644 --- a/tests/lib/FieldType/ISBNTest.php +++ b/tests/lib/FieldType/ISBNTest.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\Core\FieldType; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/tests/lib/FieldType/Image/IO/LegacyTest.php b/tests/lib/FieldType/Image/IO/LegacyTest.php index dbe7c3f981..8f042e9a71 100644 --- a/tests/lib/FieldType/Image/IO/LegacyTest.php +++ b/tests/lib/FieldType/Image/IO/LegacyTest.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\Core\FieldType\Image\IO; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; @@ -49,10 +50,10 @@ protected function setUp(): void public function testGetExternalPath() { $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('getExternalPath') ->with('var/test/storage/images/path/file.png') - ->will($this->returnValue('path/file.png')); + ->will(self::returnValue('path/file.png')); self::assertEquals( 'path/file.png', @@ -65,12 +66,12 @@ public function testNewBinaryCreateStructFromLocalFile() $path = '/tmp/file.png'; $struct = new BinaryFileCreateStruct(); $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('newBinaryCreateStructFromLocalFile') ->with($path) - ->will($this->returnValue($struct)); + ->will(self::returnValue($struct)); - $this->draftIoServiceMock->expects($this->never())->method('newBinaryCreateStructFromLocalFile'); + $this->draftIoServiceMock->expects(self::never())->method('newBinaryCreateStructFromLocalFile'); self::assertEquals( $struct, @@ -82,12 +83,12 @@ public function testExists() { $path = 'path/file.png'; $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('exists') ->with($path) - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); - $this->draftIoServiceMock->expects($this->never())->method('exists'); + $this->draftIoServiceMock->expects(self::never())->method('exists'); self::assertTrue( $this->service->exists($path) @@ -100,12 +101,12 @@ public function testGetInternalPath() $internalPath = 'var/test/storage/images/path/file.png'; $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('getInternalPath') ->with($id) - ->will($this->returnValue($internalPath)); + ->will(self::returnValue($internalPath)); - $this->draftIoServiceMock->expects($this->never())->method('getInternalPath'); + $this->draftIoServiceMock->expects(self::never())->method('getInternalPath'); self::assertEquals( $internalPath, @@ -122,12 +123,12 @@ public function testLoadBinaryFile() $binaryFile = new BinaryFile(['id' => $id]); $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFile') ->with($id) - ->will($this->returnValue($binaryFile)); + ->will(self::returnValue($binaryFile)); - $this->draftIoServiceMock->expects($this->never())->method('loadBinaryFile'); + $this->draftIoServiceMock->expects(self::never())->method('loadBinaryFile'); self::assertSame( $binaryFile, @@ -145,18 +146,18 @@ public function testLoadBinaryFileDraftInternalPath() $binaryFile = new BinaryFile(['id' => $id]); $this->draftIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('getExternalPath') ->with($internalId) - ->will($this->returnValue($id)); + ->will(self::returnValue($id)); $this->draftIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFile') ->with($id) - ->will($this->returnValue($binaryFile)); + ->will(self::returnValue($binaryFile)); - $this->publishedIoServiceMock->expects($this->never())->method('loadBinaryFile'); + $this->publishedIoServiceMock->expects(self::never())->method('loadBinaryFile'); self::assertSame( $binaryFile, @@ -174,18 +175,18 @@ public function testLoadBinaryFilePublishedInternalPath() $binaryFile = new BinaryFile(['id' => $id]); $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('getExternalPath') ->with($internalId) - ->will($this->returnValue($id)); + ->will(self::returnValue($id)); $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFile') ->with($id) - ->will($this->returnValue($binaryFile)); + ->will(self::returnValue($binaryFile)); - $this->draftIoServiceMock->expects($this->never())->method('loadBinaryFile'); + $this->draftIoServiceMock->expects(self::never())->method('loadBinaryFile'); self::assertSame( $binaryFile, @@ -201,20 +202,20 @@ public function testLoadBinaryFileDraftExternalPath() $id = 'path/file.jpg'; $binaryFile = new BinaryFile(['id' => $id]); - $this->draftIoServiceMock->expects($this->never())->method('getExternalPath'); - $this->publishedIoServiceMock->expects($this->never())->method('getExternalPath'); + $this->draftIoServiceMock->expects(self::never())->method('getExternalPath'); + $this->publishedIoServiceMock->expects(self::never())->method('getExternalPath'); $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFile') ->with($id) - ->will($this->throwException(new InvalidArgumentException('binaryFileId', "Can't find file with id $id}"))); + ->will(self::throwException(new InvalidArgumentException('binaryFileId', "Can't find file with id $id}"))); $this->draftIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFile') ->with($id) - ->will($this->returnValue($binaryFile)); + ->will(self::returnValue($binaryFile)); self::assertSame( $binaryFile, @@ -227,10 +228,10 @@ public function testLoadBinaryFileByUriWithPublishedFile() $binaryFileUri = 'var/test/images/an/image.png'; $binaryFile = new BinaryFile(['id' => 'an/image.png']); $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFileByUri') ->with($binaryFileUri) - ->will($this->returnValue($binaryFile)); + ->will(self::returnValue($binaryFile)); self::assertSame( $binaryFile, @@ -244,16 +245,16 @@ public function testLoadBinaryFileByUriWithDraftFile() $binaryFile = new BinaryFile(['id' => 'an/image.png']); $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFileByUri') ->with($binaryFileUri) - ->will($this->throwException(new InvalidArgumentException('$id', "Prefix not found in {$binaryFile->id}"))); + ->will(self::throwException(new InvalidArgumentException('$id', "Prefix not found in {$binaryFile->id}"))); $this->draftIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFileByUri') ->with($binaryFileUri) - ->will($this->returnValue($binaryFile)); + ->will(self::returnValue($binaryFile)); self::assertSame( $binaryFile, @@ -268,18 +269,18 @@ public function testGetFileContents() $binaryFile = new BinaryFile(['id' => $path]); $this->draftIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('exists') ->with($path) - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('getFileContents') ->with($binaryFile) - ->will($this->returnValue($contents)); + ->will(self::returnValue($contents)); - $this->draftIoServiceMock->expects($this->never())->method('getFileContents'); + $this->draftIoServiceMock->expects(self::never())->method('getFileContents'); self::assertSame( $contents, @@ -294,18 +295,18 @@ public function testGetFileContentsOfDraft() $binaryFile = new BinaryFile(['id' => $path]); $this->draftIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('exists') ->with($path) - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $this->draftIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('getFileContents') ->with($binaryFile) - ->will($this->returnValue($contents)); + ->will(self::returnValue($contents)); - $this->publishedIoServiceMock->expects($this->never())->method('getFileContents'); + $this->publishedIoServiceMock->expects(self::never())->method('getFileContents'); self::assertSame( $contents, @@ -319,18 +320,18 @@ public function testGetMimeType() $mimeType = 'image/png'; $this->draftIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('exists') ->with($path) - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('getMimeType') ->with($path) - ->will($this->returnValue($mimeType)); + ->will(self::returnValue($mimeType)); - $this->draftIoServiceMock->expects($this->never())->method('getMimeType'); + $this->draftIoServiceMock->expects(self::never())->method('getMimeType'); self::assertSame( $mimeType, @@ -344,18 +345,18 @@ public function testGetMimeTypeOfDraft() $mimeType = 'image/png'; $this->draftIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('exists') ->with($path) - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $this->draftIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('getMimeType') ->with($path) - ->will($this->returnValue($mimeType)); + ->will(self::returnValue($mimeType)); - $this->publishedIoServiceMock->expects($this->never())->method('getMimeType'); + $this->publishedIoServiceMock->expects(self::never())->method('getMimeType'); self::assertSame( $mimeType, @@ -369,12 +370,12 @@ public function testCreateBinaryFile() $binaryFile = new BinaryFile(); $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('createBinaryFile') ->with($createStruct) - ->will($this->returnValue($binaryFile)); + ->will(self::returnValue($binaryFile)); - $this->draftIoServiceMock->expects($this->never())->method('createBinaryFile'); + $this->draftIoServiceMock->expects(self::never())->method('createBinaryFile'); self::assertSame( $binaryFile, @@ -386,12 +387,12 @@ public function testGetUri() { $binaryFile = new BinaryFile(); $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('getUri') ->with($binaryFile) - ->will($this->returnValue('protocol://uri')); + ->will(self::returnValue('protocol://uri')); - $this->draftIoServiceMock->expects($this->never())->method('getUri'); + $this->draftIoServiceMock->expects(self::never())->method('getUri'); self::assertEquals( 'protocol://uri', @@ -403,12 +404,12 @@ public function testGetFileInputStream() { $binaryFile = new BinaryFile(); $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('getFileInputStream') ->with($binaryFile) - ->will($this->returnValue('resource')); + ->will(self::returnValue('resource')); - $this->draftIoServiceMock->expects($this->never())->method('getFileInputStream'); + $this->draftIoServiceMock->expects(self::never())->method('getFileInputStream'); self::assertEquals( 'resource', @@ -420,11 +421,11 @@ public function testDeleteBinaryFile() { $binaryFile = new BinaryFile(); $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('deleteBinaryFile') ->with($binaryFile); - $this->draftIoServiceMock->expects($this->never())->method('deleteBinaryFile'); + $this->draftIoServiceMock->expects(self::never())->method('deleteBinaryFile'); $this->service->deleteBinaryFile($binaryFile); } @@ -433,12 +434,12 @@ public function testNewBinaryCreateStructFromUploadedFile() { $struct = new BinaryFileCreateStruct(); $this->publishedIoServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('newBinaryCreateStructFromUploadedFile') ->with([]) - ->will($this->returnValue($struct)); + ->will(self::returnValue($struct)); - $this->draftIoServiceMock->expects($this->never())->method('newBinaryCreateStructFromUploadedFile'); + $this->draftIoServiceMock->expects(self::never())->method('newBinaryCreateStructFromUploadedFile'); self::assertEquals( $struct, diff --git a/tests/lib/FieldType/Image/PathGenerator/LegacyPathGeneratorTest.php b/tests/lib/FieldType/Image/PathGenerator/LegacyPathGeneratorTest.php index f9fcec89fd..63218a1094 100644 --- a/tests/lib/FieldType/Image/PathGenerator/LegacyPathGeneratorTest.php +++ b/tests/lib/FieldType/Image/PathGenerator/LegacyPathGeneratorTest.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\Core\FieldType\Image\PathGenerator; use Ibexa\Core\FieldType\Image\PathGenerator\LegacyPathGenerator; @@ -25,7 +26,7 @@ public function testGetStoragePathForField($data, $expectedPath) { $pathGenerator = new LegacyPathGenerator(); - $this->assertEquals( + self::assertEquals( $expectedPath, $pathGenerator->getStoragePathForField( $data['fieldId'], diff --git a/tests/lib/FieldType/ImageAsset/AssetMapperTest.php b/tests/lib/FieldType/ImageAsset/AssetMapperTest.php index 9b21c73f8f..5166e9867b 100644 --- a/tests/lib/FieldType/ImageAsset/AssetMapperTest.php +++ b/tests/lib/FieldType/ImageAsset/AssetMapperTest.php @@ -71,41 +71,41 @@ public function testCreateAsset(): void $content = new Content(); $this->contentTypeService - ->expects($this->once()) + ->expects(self::once()) ->method('loadContentTypeByIdentifier') ->with($this->mappings['content_type_identifier']) ->willReturn($contentType); $this->contentService - ->expects($this->once()) + ->expects(self::once()) ->method('newContentCreateStruct') ->with($contentType, $languageCode) ->willReturn($contentCreateStruct); $contentCreateStruct - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('setField') ->with($this->mappings['name_field_identifier'], $name); $contentCreateStruct - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('setField') ->with($this->mappings['content_field_identifier'], $value); $this->locationService - ->expects($this->once()) + ->expects(self::once()) ->method('newLocationCreateStruct') ->with($this->mappings['parent_location_id']) ->willReturn($locationCreateStruct); $this->contentService - ->expects($this->once()) + ->expects(self::once()) ->method('createContent') ->with($contentCreateStruct, [$locationCreateStruct]) ->willReturn($contentDraft); $this->contentService - ->expects($this->once()) + ->expects(self::once()) ->method('publishVersion') ->with($contentDraft->versionInfo) ->willReturn($content); @@ -121,18 +121,18 @@ public function testGetAssetField(): void $mapper = $this->createPartialMapper(['isAsset']); $mapper - ->expects($this->once()) + ->expects(self::once()) ->method('isAsset') ->with($content) ->willReturn(true); $content - ->expects($this->once()) + ->expects(self::once()) ->method('getField') ->with($this->mappings['content_field_identifier']) ->willReturn($expectedValue); - $this->assertEquals($expectedValue, $mapper->getAssetField($content)); + self::assertEquals($expectedValue, $mapper->getAssetField($content)); } public function testGetAssetFieldThrowsInvalidArgumentException(): void @@ -143,7 +143,7 @@ public function testGetAssetFieldThrowsInvalidArgumentException(): void $mapper = $this->createPartialMapper(['isAsset']); $mapper - ->expects($this->once()) + ->expects(self::once()) ->method('isAsset') ->with($content) ->willReturn(false); @@ -157,18 +157,18 @@ public function testGetAssetFieldDefinition(): void $contentType = $this->createMock(ContentType::class); $contentType - ->expects($this->once()) + ->expects(self::once()) ->method('getFieldDefinition') ->with($this->mappings['content_field_identifier']) ->willReturn($fieldDefinition); $this->contentTypeService - ->expects($this->once()) + ->expects(self::once()) ->method('loadContentTypeByIdentifier') ->with($this->mappings['content_type_identifier']) ->willReturn($contentType); - $this->assertEquals($fieldDefinition, $this->createMapper()->getAssetFieldDefinition()); + self::assertEquals($fieldDefinition, $this->createMapper()->getAssetFieldDefinition()); } public function testGetAssetValue(): void @@ -178,18 +178,18 @@ public function testGetAssetValue(): void $mapper = $this->createPartialMapper(['isAsset']); $mapper - ->expects($this->once()) + ->expects(self::once()) ->method('isAsset') ->with($content) ->willReturn(true); $content - ->expects($this->once()) + ->expects(self::once()) ->method('getFieldValue') ->with($this->mappings['content_field_identifier']) ->willReturn($expectedValue); - $this->assertEquals($expectedValue, $mapper->getAssetValue($content)); + self::assertEquals($expectedValue, $mapper->getAssetValue($content)); } public function testGetAssetValueThrowsInvalidArgumentException(): void @@ -200,7 +200,7 @@ public function testGetAssetValueThrowsInvalidArgumentException(): void $mapper = $this->createPartialMapper(['isAsset']); $mapper - ->expects($this->once()) + ->expects(self::once()) ->method('isAsset') ->with($content) ->willReturn(false); @@ -218,7 +218,7 @@ public function testIsAsset(int $contentContentTypeId, int $assetContentTypeId, ]); $this->contentTypeService - ->expects($this->once()) + ->expects(self::once()) ->method('loadContentTypeByIdentifier') ->with($this->mappings['content_type_identifier']) ->willReturn($assetContentType); @@ -227,7 +227,7 @@ public function testIsAsset(int $contentContentTypeId, int $assetContentTypeId, ->createMapper() ->isAsset($this->createContentWithContentType($contentContentTypeId)); - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } public function dataProviderForIsAsset(): array @@ -242,7 +242,7 @@ public function testGetContentFieldIdentifier(): void { $mapper = $this->createMapper(); - $this->assertEquals( + self::assertEquals( $this->mappings['content_field_identifier'], $mapper->getContentFieldIdentifier() ); @@ -252,7 +252,7 @@ public function testGetParentLocationId(): void { $mapper = $this->createMapper(); - $this->assertEquals( + self::assertEquals( $this->mappings['parent_location_id'], $mapper->getParentLocationId() ); @@ -262,7 +262,7 @@ public function testGetContentTypeIdentifier(): void { $mapper = $this->createMapper(); - $this->assertEquals( + self::assertEquals( $this->mappings['content_type_identifier'], $mapper->getContentTypeIdentifier() ); @@ -299,7 +299,7 @@ private function createContentWithId(int $id): Content { $content = $this->createMock(Content::class); $content - ->expects($this->any()) + ->expects(self::any()) ->method('__get') ->with('id') ->willReturn($id); @@ -315,7 +315,7 @@ private function createContentWithContentType(int $contentTypeId): Content $content = $this->createMock(Content::class); $content - ->expects($this->any()) + ->expects(self::any()) ->method('__get') ->with('contentInfo') ->willReturn($contentInfo); diff --git a/tests/lib/FieldType/ImageAssetTest.php b/tests/lib/FieldType/ImageAssetTest.php index fe6d5c32fe..44de353936 100644 --- a/tests/lib/FieldType/ImageAssetTest.php +++ b/tests/lib/FieldType/ImageAssetTest.php @@ -239,7 +239,7 @@ public function testValidateNonAsset() $invalidContentTypeIdentifier = 'article'; $invalidContentType = $this->createMock(ContentType::class); $invalidContentType - ->expects($this->once()) + ->expects(self::once()) ->method('__get') ->with('identifier') ->willReturn($invalidContentTypeIdentifier); @@ -249,21 +249,21 @@ public function testValidateNonAsset() ->willReturn($invalidContentType); $this->contentServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadContent') ->with($destinationContentId) ->willReturn($destinationContent); $this->assetMapperMock - ->expects($this->once()) + ->expects(self::once()) ->method('isAsset') ->with($destinationContent) ->willReturn(false); $validationErrors = $this->doValidate([], new ImageAsset\Value($destinationContentId)); - $this->assertIsArray($validationErrors); - $this->assertEquals([ + self::assertIsArray($validationErrors); + self::assertEquals([ new ValidationError( 'Content %type% is not a valid asset target', null, @@ -301,13 +301,13 @@ public function testValidateValidNonEmptyAssetValue( $destinationContent = $this->createMock(Content::class); $this->contentServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadContent') ->with($destinationContentId) ->willReturn($destinationContent); $this->assetMapperMock - ->expects($this->once()) + ->expects(self::once()) ->method('isAsset') ->with($destinationContent) ->willReturn(true); @@ -318,7 +318,7 @@ public function testValidateValidNonEmptyAssetValue( ->willReturn($fileSize); $this->assetMapperMock - ->expects($this->once()) + ->expects(self::once()) ->method('getAssetValue') ->with($destinationContent) ->willReturn($assetValueMock); @@ -339,7 +339,7 @@ public function testValidateValidNonEmptyAssetValue( ->willReturn($fieldDefinitionMock); $validationErrors = $this->doValidate([], new ImageAsset\Value($destinationContentId)); - $this->assertEquals( + self::assertEquals( $expectedValidationErrors, $validationErrors ); @@ -414,7 +414,7 @@ public function testGetName( public function testIsSearchable() { - $this->assertTrue($this->getFieldTypeUnderTest()->isSearchable()); + self::assertTrue($this->getFieldTypeUnderTest()->isSearchable()); } /** @@ -425,7 +425,7 @@ public function testGetRelations() $destinationContentId = 7; $fieldType = $this->createFieldTypeUnderTest(); - $this->assertEquals( + self::assertEquals( [ Relation::ASSET => [$destinationContentId], ], diff --git a/tests/lib/FieldType/ImageTest.php b/tests/lib/FieldType/ImageTest.php index bcf4b96c2e..bac1f1c0b4 100644 --- a/tests/lib/FieldType/ImageTest.php +++ b/tests/lib/FieldType/ImageTest.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\Core\FieldType; use Ibexa\Contracts\Core\IO\MimeTypeDetector; diff --git a/tests/lib/FieldType/IntegerTest.php b/tests/lib/FieldType/IntegerTest.php index a75f4c8bd9..1a13da68ca 100644 --- a/tests/lib/FieldType/IntegerTest.php +++ b/tests/lib/FieldType/IntegerTest.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\Core\FieldType; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/tests/lib/FieldType/IntegerValueValidatorTest.php b/tests/lib/FieldType/IntegerValueValidatorTest.php index 8f1cf841a3..2ffc7eb2d3 100644 --- a/tests/lib/FieldType/IntegerValueValidatorTest.php +++ b/tests/lib/FieldType/IntegerValueValidatorTest.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\ValidationError; @@ -41,7 +42,7 @@ protected function getMaxIntegerValue() */ public function testConstructor() { - $this->assertInstanceOf( + self::assertInstanceOf( Validator::class, new IntegerValueValidator() ); @@ -63,8 +64,8 @@ public function testConstraintsInitializeGet() $validator->initializeWithConstraints( $constraints ); - $this->assertSame($constraints['minIntegerValue'], $validator->minIntegerValue); - $this->assertSame($constraints['maxIntegerValue'], $validator->maxIntegerValue); + self::assertSame($constraints['minIntegerValue'], $validator->minIntegerValue); + self::assertSame($constraints['maxIntegerValue'], $validator->maxIntegerValue); } /** @@ -85,7 +86,7 @@ public function testGetConstraintsSchema() ], ]; $validator = new IntegerValueValidator(); - $this->assertSame($constraintsSchema, $validator->getConstraintsSchema()); + self::assertSame($constraintsSchema, $validator->getConstraintsSchema()); } /** @@ -103,8 +104,8 @@ public function testConstraintsSetGet() $validator = new IntegerValueValidator(); $validator->minIntegerValue = $constraints['minIntegerValue']; $validator->maxIntegerValue = $constraints['maxIntegerValue']; - $this->assertSame($constraints['minIntegerValue'], $validator->minIntegerValue); - $this->assertSame($constraints['maxIntegerValue'], $validator->maxIntegerValue); + self::assertSame($constraints['minIntegerValue'], $validator->minIntegerValue); + self::assertSame($constraints['maxIntegerValue'], $validator->maxIntegerValue); } /** @@ -155,6 +156,7 @@ public function testGetBadConstraint() * Tests validating a correct value. * * @dataProvider providerForValidateOK + * * @covers \Ibexa\Core\FieldType\Validator\IntegerValueValidator::validate * @covers \Ibexa\Core\FieldType\Validator::getMessage */ @@ -163,8 +165,8 @@ public function testValidateCorrectValues($value) $validator = new IntegerValueValidator(); $validator->minIntegerValue = 10; $validator->maxIntegerValue = 15; - $this->assertTrue($validator->validate(new IntegerValue($value))); - $this->assertSame([], $validator->getMessage()); + self::assertTrue($validator->validate(new IntegerValue($value))); + self::assertSame([], $validator->getMessage()); } public function providerForValidateOK() @@ -184,6 +186,7 @@ public function providerForValidateOK() * Tests validating a wrong value. * * @dataProvider providerForValidateKO + * * @covers \Ibexa\Core\FieldType\Validator\IntegerValueValidator::validate */ public function testValidateWrongValues($value, $message, $values) @@ -191,22 +194,22 @@ public function testValidateWrongValues($value, $message, $values) $validator = new IntegerValueValidator(); $validator->minIntegerValue = $this->getMinIntegerValue(); $validator->maxIntegerValue = $this->getMaxIntegerValue(); - $this->assertFalse($validator->validate(new IntegerValue($value))); + self::assertFalse($validator->validate(new IntegerValue($value))); $messages = $validator->getMessage(); - $this->assertCount(1, $messages); - $this->assertInstanceOf( + self::assertCount(1, $messages); + self::assertInstanceOf( ValidationError::class, $messages[0] ); - $this->assertInstanceOf( + self::assertInstanceOf( Message::class, $messages[0]->getTranslatableMessage() ); - $this->assertEquals( + self::assertEquals( $message, $messages[0]->getTranslatableMessage()->message ); - $this->assertEquals( + self::assertEquals( $values, $messages[0]->getTranslatableMessage()->values ); @@ -226,13 +229,14 @@ public function providerForValidateKO() * Tests validation of constraints. * * @dataProvider providerForValidateConstraintsOK + * * @covers \Ibexa\Core\FieldType\Validator\FileSizeValidator::validateConstraints */ public function testValidateConstraintsCorrectValues($constraints) { $validator = new IntegerValueValidator(); - $this->assertEmpty( + self::assertEmpty( $validator->validateConstraints($constraints) ); } @@ -272,6 +276,7 @@ public function providerForValidateConstraintsOK() * Tests validation of constraints. * * @dataProvider providerForValidateConstraintsKO + * * @covers \Ibexa\Core\FieldType\Validator\FileSizeValidator::validateConstraints */ public function testValidateConstraintsWrongValues($constraints, $expectedMessages, $values) @@ -280,15 +285,15 @@ public function testValidateConstraintsWrongValues($constraints, $expectedMessag $messages = $validator->validateConstraints($constraints); foreach ($expectedMessages as $index => $expectedMessage) { - $this->assertInstanceOf( + self::assertInstanceOf( Message::class, $messages[0]->getTranslatableMessage() ); - $this->assertEquals( + self::assertEquals( $expectedMessage, $messages[$index]->getTranslatableMessage()->message ); - $this->assertEquals( + self::assertEquals( $values[$index], $messages[$index]->getTranslatableMessage()->values ); diff --git a/tests/lib/FieldType/KeywordTest.php b/tests/lib/FieldType/KeywordTest.php index 61a1646137..7f65e10cb9 100644 --- a/tests/lib/FieldType/KeywordTest.php +++ b/tests/lib/FieldType/KeywordTest.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\Core\FieldType; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/tests/lib/FieldType/MapLocationTest.php b/tests/lib/FieldType/MapLocationTest.php index bde9e351d6..c326b0955a 100644 --- a/tests/lib/FieldType/MapLocationTest.php +++ b/tests/lib/FieldType/MapLocationTest.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\Core\FieldType; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/tests/lib/FieldType/MediaTest.php b/tests/lib/FieldType/MediaTest.php index d76f2f684e..129b52d733 100644 --- a/tests/lib/FieldType/MediaTest.php +++ b/tests/lib/FieldType/MediaTest.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\Core\FieldType; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/tests/lib/FieldType/RelationListTest.php b/tests/lib/FieldType/RelationListTest.php index 117972f437..9f6622c61a 100644 --- a/tests/lib/FieldType/RelationListTest.php +++ b/tests/lib/FieldType/RelationListTest.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; @@ -841,7 +842,7 @@ private function generateContentTypeValidationError(string $contentTypeIdentifie public function testGetRelations() { $ft = $this->createFieldTypeUnderTest(); - $this->assertEquals( + self::assertEquals( [ Relation::FIELD => [70, 72], ], diff --git a/tests/lib/FieldType/RelationTest.php b/tests/lib/FieldType/RelationTest.php index 86e4bf177e..c99124c735 100644 --- a/tests/lib/FieldType/RelationTest.php +++ b/tests/lib/FieldType/RelationTest.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; @@ -382,7 +383,7 @@ public function provideInValidFieldSettings() public function testGetRelations() { $ft = $this->createFieldTypeUnderTest(); - $this->assertEquals( + self::assertEquals( [ Relation::FIELD => [70], ], diff --git a/tests/lib/FieldType/SelectionTest.php b/tests/lib/FieldType/SelectionTest.php index 05300261b3..995761b532 100644 --- a/tests/lib/FieldType/SelectionTest.php +++ b/tests/lib/FieldType/SelectionTest.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\Value as SPIValue; diff --git a/tests/lib/FieldType/StringLengthValidatorTest.php b/tests/lib/FieldType/StringLengthValidatorTest.php index 26bfc39b84..c0518e7beb 100644 --- a/tests/lib/FieldType/StringLengthValidatorTest.php +++ b/tests/lib/FieldType/StringLengthValidatorTest.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\Core\FieldType; use Ibexa\Contracts\Core\FieldType\ValidationError; @@ -42,7 +43,7 @@ protected function getMaxStringLength() */ public function testConstructor() { - $this->assertInstanceOf( + self::assertInstanceOf( Validator::class, new StringLengthValidator() ); @@ -64,8 +65,8 @@ public function testConstraintsInitializeGet() $validator->initializeWithConstraints( $constraints ); - $this->assertSame($constraints['minStringLength'], $validator->minStringLength); - $this->assertSame($constraints['maxStringLength'], $validator->maxStringLength); + self::assertSame($constraints['minStringLength'], $validator->minStringLength); + self::assertSame($constraints['maxStringLength'], $validator->maxStringLength); } /** @@ -86,7 +87,7 @@ public function testGetConstraintsSchema() ], ]; $validator = new StringLengthValidator(); - $this->assertSame($constraintsSchema, $validator->getConstraintsSchema()); + self::assertSame($constraintsSchema, $validator->getConstraintsSchema()); } /** @@ -104,8 +105,8 @@ public function testConstraintsSetGet() $validator = new StringLengthValidator(); $validator->minStringLength = $constraints['minStringLength']; $validator->maxStringLength = $constraints['maxStringLength']; - $this->assertSame($constraints['minStringLength'], $validator->minStringLength); - $this->assertSame($constraints['maxStringLength'], $validator->maxStringLength); + self::assertSame($constraints['minStringLength'], $validator->minStringLength); + self::assertSame($constraints['maxStringLength'], $validator->maxStringLength); } /** @@ -156,6 +157,7 @@ public function testGetBadConstraint() * Tests validating a correct value. * * @dataProvider providerForValidateOK + * * @covers \Ibexa\Core\FieldType\Validator\StringLengthValidator::validate * @covers \Ibexa\Core\FieldType\Validator::getMessage */ @@ -164,8 +166,8 @@ public function testValidateCorrectValues($value) $validator = new StringLengthValidator(); $validator->minStringLength = 5; $validator->maxStringLength = 10; - $this->assertTrue($validator->validate(new TextLineValue($value))); - $this->assertSame([], $validator->getMessage()); + self::assertTrue($validator->validate(new TextLineValue($value))); + self::assertSame([], $validator->getMessage()); } public function providerForValidateOK() @@ -182,6 +184,7 @@ public function providerForValidateOK() * Tests validating a wrong value. * * @dataProvider providerForValidateKO + * * @covers \Ibexa\Core\FieldType\Validator\StringLengthValidator::validate */ public function testValidateWrongValues($value, $messageSingular, $messagePlural, $values) @@ -189,26 +192,26 @@ public function testValidateWrongValues($value, $messageSingular, $messagePlural $validator = new StringLengthValidator(); $validator->minStringLength = $this->getMinStringLength(); $validator->maxStringLength = $this->getMaxStringLength(); - $this->assertFalse($validator->validate(new TextLineValue($value))); + self::assertFalse($validator->validate(new TextLineValue($value))); $messages = $validator->getMessage(); - $this->assertCount(1, $messages); - $this->assertInstanceOf( + self::assertCount(1, $messages); + self::assertInstanceOf( ValidationError::class, $messages[0] ); - $this->assertInstanceOf( + self::assertInstanceOf( Plural::class, $messages[0]->getTranslatableMessage() ); - $this->assertEquals( + self::assertEquals( $messageSingular, $messages[0]->getTranslatableMessage()->singular ); - $this->assertEquals( + self::assertEquals( $messagePlural, $messages[0]->getTranslatableMessage()->plural ); - $this->assertEquals( + self::assertEquals( $values, $messages[0]->getTranslatableMessage()->values ); @@ -248,13 +251,14 @@ public function providerForValidateKO() * Tests validation of constraints. * * @dataProvider providerForValidateConstraintsOK + * * @covers \Ibexa\Core\FieldType\Validator\FileSizeValidator::validateConstraints */ public function testValidateConstraintsCorrectValues($constraints) { $validator = new StringLengthValidator(); - $this->assertEmpty( + self::assertEmpty( $validator->validateConstraints($constraints) ); } @@ -294,6 +298,7 @@ public function providerForValidateConstraintsOK() * Tests validation of constraints. * * @dataProvider providerForValidateConstraintsKO + * * @covers \Ibexa\Core\FieldType\Validator\FileSizeValidator::validateConstraints */ public function testValidateConstraintsWrongValues($constraints, $expectedMessages, $values) @@ -302,15 +307,15 @@ public function testValidateConstraintsWrongValues($constraints, $expectedMessag $messages = $validator->validateConstraints($constraints); foreach ($expectedMessages as $index => $expectedMessage) { - $this->assertInstanceOf( + self::assertInstanceOf( Message::class, $messages[0]->getTranslatableMessage() ); - $this->assertEquals( + self::assertEquals( $expectedMessage, $messages[$index]->getTranslatableMessage()->message ); - $this->assertEquals( + self::assertEquals( $values[$index], $messages[$index]->getTranslatableMessage()->values ); diff --git a/tests/lib/FieldType/TextBlockTest.php b/tests/lib/FieldType/TextBlockTest.php index c2fc16a2d5..7881c12199 100644 --- a/tests/lib/FieldType/TextBlockTest.php +++ b/tests/lib/FieldType/TextBlockTest.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\Core\FieldType; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/tests/lib/FieldType/TextLineTest.php b/tests/lib/FieldType/TextLineTest.php index 0a903c134c..29c74be735 100644 --- a/tests/lib/FieldType/TextLineTest.php +++ b/tests/lib/FieldType/TextLineTest.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\Core\FieldType; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/tests/lib/FieldType/TimeTest.php b/tests/lib/FieldType/TimeTest.php index 816baa4607..3848387317 100644 --- a/tests/lib/FieldType/TimeTest.php +++ b/tests/lib/FieldType/TimeTest.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\Core\FieldType; use DateTime; diff --git a/tests/lib/FieldType/Url/Gateway/DoctrineStorageTest.php b/tests/lib/FieldType/Url/Gateway/DoctrineStorageTest.php index 508b892a58..0ca25eabab 100644 --- a/tests/lib/FieldType/Url/Gateway/DoctrineStorageTest.php +++ b/tests/lib/FieldType/Url/Gateway/DoctrineStorageTest.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\Core\FieldType\Url\Gateway; use Ibexa\Core\FieldType\Url\UrlStorage\Gateway; @@ -24,7 +25,7 @@ public function testGetIdUrlMap() $gateway = $this->getStorageGateway(); - $this->assertEquals( + self::assertEquals( [ 23 => '/content/view/sitemap/2', 24 => '/content/view/tagcloud/2', @@ -44,7 +45,7 @@ public function testGetUrlIdMap() $gateway = $this->getStorageGateway(); - $this->assertEquals( + self::assertEquals( [ '/content/view/sitemap/2' => 23, '/content/view/tagcloud/2' => 24, @@ -96,13 +97,13 @@ public function testInsertUrl() ], ]; - $this->assertGreaterThanOrEqual($time, $result[0]['created']); - $this->assertGreaterThanOrEqual($time, $result[0]['modified']); + self::assertGreaterThanOrEqual($time, $result[0]['created']); + self::assertGreaterThanOrEqual($time, $result[0]['modified']); unset($result[0]['created']); unset($result[0]['modified']); - $this->assertEquals($expected, $result); + self::assertEquals($expected, $result); } /** @@ -139,7 +140,7 @@ public function testLinkUrl() ], ]; - $this->assertEquals($expected, $result); + self::assertEquals($expected, $result); } /** @@ -169,7 +170,7 @@ public function testUnlinkUrl() ], ]; - $this->assertEquals($expected, $result); + self::assertEquals($expected, $result); // Check that orphaned URLs are correctly removed $query = $this->connection->createQueryBuilder(); @@ -191,7 +192,7 @@ public function testUnlinkUrl() ], ]; - $this->assertEquals($expected, $result); + self::assertEquals($expected, $result); } protected function getStorageGateway(): Gateway diff --git a/tests/lib/FieldType/Url/UrlStorageTest.php b/tests/lib/FieldType/Url/UrlStorageTest.php index 84e52ed981..ece7509cf8 100644 --- a/tests/lib/FieldType/Url/UrlStorageTest.php +++ b/tests/lib/FieldType/Url/UrlStorageTest.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\Core\FieldType\Url; use Ibexa\Contracts\Core\FieldType\StorageGatewayInterface; @@ -24,18 +25,18 @@ public function testStoreFieldDataWithExistingUrl() $gateway = $this->getGatewayMock(); $gateway - ->expects($this->once()) + ->expects(self::once()) ->method('getUrlIdMap') ->with(['http://ibexa.co']) - ->will($this->returnValue(['http://ibexa.co' => 12])); + ->will(self::returnValue(['http://ibexa.co' => 12])); $gateway - ->expects($this->once()) + ->expects(self::once()) ->method('linkUrl') ->with(12, 42, 24); $gateway - ->expects($this->once()) + ->expects(self::once()) ->method('unlinkUrl') ->with( 42, @@ -46,8 +47,8 @@ public function testStoreFieldDataWithExistingUrl() $storage = $this->getPartlyMockedStorage($gateway); $result = $storage->storeFieldData($versionInfo, $field, $this->getContext()); - $this->assertTrue($result); - $this->assertEquals(12, $field->value->data['urlId']); + self::assertTrue($result); + self::assertEquals(12, $field->value->data['urlId']); } public function testStoreFieldDataWithNewUrl() @@ -58,24 +59,24 @@ public function testStoreFieldDataWithNewUrl() $gateway = $this->getGatewayMock(); $gateway - ->expects($this->once()) + ->expects(self::once()) ->method('getUrlIdMap') ->with(['http://ibexa.co']) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $gateway - ->expects($this->once()) + ->expects(self::once()) ->method('insertUrl') ->with('http://ibexa.co') - ->will($this->returnValue(12)); + ->will(self::returnValue(12)); $gateway - ->expects($this->once()) + ->expects(self::once()) ->method('linkUrl') ->with(12, 42, 24); $gateway - ->expects($this->once()) + ->expects(self::once()) ->method('unlinkUrl') ->with( 42, @@ -86,8 +87,8 @@ public function testStoreFieldDataWithNewUrl() $storage = $this->getPartlyMockedStorage($gateway); $result = $storage->storeFieldData($versionInfo, $field, $this->getContext()); - $this->assertTrue($result); - $this->assertEquals(12, $field->value->data['urlId']); + self::assertTrue($result); + self::assertEquals(12, $field->value->data['urlId']); } public function testStoreFieldDataWithEmptyUrl() @@ -98,26 +99,26 @@ public function testStoreFieldDataWithEmptyUrl() $gateway = $this->getGatewayMock(); $gateway - ->expects($this->never()) + ->expects(self::never()) ->method('getUrlIdMap'); $gateway - ->expects($this->never()) + ->expects(self::never()) ->method('insertUrl'); $gateway - ->expects($this->never()) + ->expects(self::never()) ->method('linkUrl'); $gateway - ->expects($this->never()) + ->expects(self::never()) ->method('unlinkUrl'); $storage = $this->getPartlyMockedStorage($gateway); $result = $storage->storeFieldData($versionInfo, $field, $this->getContext()); - $this->assertFalse($result); - $this->assertNull($field->value->data); + self::assertFalse($result); + self::assertNull($field->value->data); } public function testGetFieldData() @@ -128,15 +129,15 @@ public function testGetFieldData() $gateway = $this->getGatewayMock(); $gateway - ->expects($this->once()) + ->expects(self::once()) ->method('getIdUrlMap') ->with([12]) - ->will($this->returnValue([12 => 'http://ibexa.co'])); + ->will(self::returnValue([12 => 'http://ibexa.co'])); $storage = $this->getPartlyMockedStorage($gateway); $storage->getFieldData($versionInfo, $field, $this->getContext()); - $this->assertEquals('http://ibexa.co', $field->value->externalData); + self::assertEquals('http://ibexa.co', $field->value->externalData); } public function testGetFieldDataNotFound() @@ -147,21 +148,21 @@ public function testGetFieldDataNotFound() $gateway = $this->getGatewayMock(); $gateway - ->expects($this->once()) + ->expects(self::once()) ->method('getIdUrlMap') ->with([12]) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $storage = $this->getPartlyMockedStorage($gateway); $logger = $this->getLoggerMock(); $logger - ->expects($this->once()) + ->expects(self::once()) ->method('error') ->with("URL with ID '12' not found"); $storage->getFieldData($versionInfo, $field, $this->getContext()); - $this->assertEquals('', $field->value->externalData); + self::assertEquals('', $field->value->externalData); } public function testGetFieldDataWithEmptyUrlId() @@ -172,18 +173,18 @@ public function testGetFieldDataWithEmptyUrlId() $gateway = $this->getGatewayMock(); $gateway - ->expects($this->never()) + ->expects(self::never()) ->method('getIdUrlMap'); $logger = $this->getLoggerMock(); $logger - ->expects($this->never()) + ->expects(self::never()) ->method('error'); $storage = $this->getPartlyMockedStorage($gateway); $storage->getFieldData($versionInfo, $field, $this->getContext()); - $this->assertNull($field->value->externalData); + self::assertNull($field->value->externalData); } public function testDeleteFieldData() @@ -194,7 +195,7 @@ public function testDeleteFieldData() foreach ($fieldIds as $index => $id) { $gateway - ->expects($this->at($index)) + ->expects(self::at($index)) ->method('unlinkUrl') ->with($id, 24); } @@ -207,7 +208,7 @@ public function testHasFieldData() { $storage = $this->getPartlyMockedStorage($this->getGatewayMock()); - $this->assertTrue($storage->hasFieldData()); + self::assertTrue($storage->hasFieldData()); } /** diff --git a/tests/lib/FieldType/UrlTest.php b/tests/lib/FieldType/UrlTest.php index 4545043abd..e17e365926 100644 --- a/tests/lib/FieldType/UrlTest.php +++ b/tests/lib/FieldType/UrlTest.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\Core\FieldType; use Ibexa\Core\Base\Exceptions\InvalidArgumentException; diff --git a/tests/lib/FieldType/UserTest.php b/tests/lib/FieldType/UserTest.php index 7381fde02e..38555de353 100644 --- a/tests/lib/FieldType/UserTest.php +++ b/tests/lib/FieldType/UserTest.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\Core\FieldType; use DateTimeImmutable; @@ -361,7 +362,7 @@ public function testValidate( if (null !== $loadByLoginBehaviorCallback) { $loadByLoginBehaviorCallback( $userHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadByLogin') ->with($userValue->login) ); @@ -404,7 +405,7 @@ public function testInvalidLoginFormat(): void $userHandlerMock = $this->createMock(UserHandler::class); $userHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadByLogin') ->with($validateUserValue->login) ->willThrowException(new NotFoundException('', '')); @@ -451,7 +452,7 @@ public function testValidLoginFormat(): void $userHandlerMock = $this->createMock(UserHandler::class); $userHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadByLogin') ->with($validateUserValue->login) ->willThrowException(new NotFoundException('', '')); @@ -497,13 +498,13 @@ public function testEmailAlreadyTaken(): void $userHandlerMock = $this->createMock(UserHandler::class); $userHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadByLogin') ->with($validateUserValue->login) ->willThrowException(new NotFoundException('', '')); $userHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadByEmail') ->with($validateUserValue->email) ->willReturn($existingUser); @@ -624,13 +625,13 @@ public function testEmailFreeToUse(): void $userHandlerMock = $this->createMock(UserHandler::class); $userHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadByLogin') ->with($validateUserValue->login) ->willThrowException(new NotFoundException('', '')); $userHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadByEmail') ->with($validateUserValue->email) ->willThrowException(new NotFoundException('', '')); diff --git a/tests/lib/Helper/ContentInfoLocationLoader/SudoMainLocationLoaderTest.php b/tests/lib/Helper/ContentInfoLocationLoader/SudoMainLocationLoaderTest.php index 8600adae39..b434f052ac 100644 --- a/tests/lib/Helper/ContentInfoLocationLoader/SudoMainLocationLoaderTest.php +++ b/tests/lib/Helper/ContentInfoLocationLoader/SudoMainLocationLoaderTest.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\Core\Helper\ContentInfoLocationLoader; use Ibexa\Contracts\Core\Persistence\User\Handler as SPIUserHandler; @@ -36,7 +37,7 @@ public function testLoadLocationNoMainLocation() $contentInfo = new ContentInfo(); $this->getLocationServiceMock() - ->expects($this->never()) + ->expects(self::never()) ->method('loadLocation'); $this->loader->loadLocation($contentInfo); @@ -48,22 +49,22 @@ public function testLoadLocation() $location = new Location(); $this->getRepositoryMock() - ->expects($this->any()) + ->expects(self::any()) ->method('getPermissionResolver') - ->will($this->returnValue($this->getPermissionResolverMock())); + ->will(self::returnValue($this->getPermissionResolverMock())); $this->getRepositoryMock() - ->expects($this->any()) + ->expects(self::any()) ->method('getLocationService') - ->will($this->returnValue($this->getLocationServiceMock())); + ->will(self::returnValue($this->getLocationServiceMock())); $this->getLocationServiceMock() - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') ->with(42) - ->will($this->returnValue($location)); + ->will(self::returnValue($location)); - $this->assertSame($location, $this->loader->loadLocation($contentInfo)); + self::assertSame($location, $this->loader->loadLocation($contentInfo)); } public function testLoadLocationError() @@ -74,24 +75,24 @@ public function testLoadLocationError() $location = new Location(); $this->getRepositoryMock() - ->expects($this->any()) + ->expects(self::any()) ->method('getPermissionResolver') - ->will($this->returnValue($this->getPermissionResolverMock())); + ->will(self::returnValue($this->getPermissionResolverMock())); $this->getRepositoryMock() - ->expects($this->any()) + ->expects(self::any()) ->method('getLocationService') - ->will($this->returnValue($this->getLocationServiceMock())); + ->will(self::returnValue($this->getLocationServiceMock())); $this->getLocationServiceMock() - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') ->with(42) ->will( - $this->throwException(new NotFoundException('main location of content', 42)) + self::throwException(new NotFoundException('main location of content', 42)) ); - $this->assertSame($location, $this->loader->loadLocation($contentInfo)); + self::assertSame($location, $this->loader->loadLocation($contentInfo)); } /** diff --git a/tests/lib/Helper/ContentPreviewHelperTest.php b/tests/lib/Helper/ContentPreviewHelperTest.php index c177ece44e..680acd9598 100644 --- a/tests/lib/Helper/ContentPreviewHelperTest.php +++ b/tests/lib/Helper/ContentPreviewHelperTest.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\Core\Helper; use Ibexa\Contracts\Core\Repository\Values\Content\Content as APIContent; @@ -41,20 +42,20 @@ public function testChangeConfigScope() $newSiteAccess = new SiteAccess($newSiteAccessName); $this->siteAccessRouter - ->expects($this->once()) + ->expects(self::once()) ->method('matchByName') - ->with($this->equalTo($newSiteAccessName)) + ->with(self::equalTo($newSiteAccessName)) ->willReturn($newSiteAccess); $event = new ScopeChangeEvent($newSiteAccess); $this->eventDispatcher - ->expects($this->once()) + ->expects(self::once()) ->method('dispatch') - ->with($this->equalTo($event), MVCEvents::CONFIG_SCOPE_CHANGE); + ->with(self::equalTo($event), MVCEvents::CONFIG_SCOPE_CHANGE); $originalSiteAccess = new SiteAccess('foo', 'bar'); $this->previewHelper->setSiteAccess($originalSiteAccess); - $this->assertEquals( + self::assertEquals( $newSiteAccess, $this->previewHelper->changeConfigScope($newSiteAccessName) ); @@ -65,12 +66,12 @@ public function testRestoreConfigScope() $originalSiteAccess = new SiteAccess('foo', 'bar'); $event = new ScopeChangeEvent($originalSiteAccess); $this->eventDispatcher - ->expects($this->once()) + ->expects(self::once()) ->method('dispatch') - ->with($this->equalTo($event), MVCEvents::CONFIG_SCOPE_RESTORE); + ->with(self::equalTo($event), MVCEvents::CONFIG_SCOPE_RESTORE); $this->previewHelper->setSiteAccess($originalSiteAccess); - $this->assertEquals( + self::assertEquals( $originalSiteAccess, $this->previewHelper->restoreConfigScope() ); @@ -81,29 +82,29 @@ public function testPreviewActive() $originalSiteAccess = new SiteAccess('foo', 'bar'); $this->previewHelper->setSiteAccess($originalSiteAccess); - $this->assertFalse($this->previewHelper->isPreviewActive()); + self::assertFalse($this->previewHelper->isPreviewActive()); $this->previewHelper->setPreviewActive(true); - $this->assertTrue($this->previewHelper->isPreviewActive()); + self::assertTrue($this->previewHelper->isPreviewActive()); $this->previewHelper->setPreviewActive(false); - $this->assertFalse($this->previewHelper->isPreviewActive()); + self::assertFalse($this->previewHelper->isPreviewActive()); self::assertNotSame($originalSiteAccess, $this->previewHelper->getOriginalSiteAccess()); } public function testPreviewedContent() { - $this->assertNull($this->previewHelper->getPreviewedContent()); + self::assertNull($this->previewHelper->getPreviewedContent()); $content = $this->createMock(APIContent::class); $this->previewHelper->setPreviewedContent($content); - $this->assertSame($content, $this->previewHelper->getPreviewedContent()); + self::assertSame($content, $this->previewHelper->getPreviewedContent()); } public function testPreviewedLocation() { - $this->assertNull($this->previewHelper->getPreviewedLocation()); + self::assertNull($this->previewHelper->getPreviewedLocation()); $location = $this->createMock(APILocation::class); $this->previewHelper->setPreviewedLocation($location); - $this->assertSame($location, $this->previewHelper->getPreviewedLocation()); + self::assertSame($location, $this->previewHelper->getPreviewedLocation()); } } diff --git a/tests/lib/Helper/FieldHelperTest.php b/tests/lib/Helper/FieldHelperTest.php index 6fa0830a6d..6383b30914 100644 --- a/tests/lib/Helper/FieldHelperTest.php +++ b/tests/lib/Helper/FieldHelperTest.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\Core\Helper; use Ibexa\Contracts\Core\Repository\ContentTypeService; @@ -49,10 +50,10 @@ public function testIsFieldEmpty() $contentInfo = new ContentInfo(['contentTypeId' => $contentTypeId]); $content = $this->createMock(APIContent::class); $content - ->expects($this->any()) + ->expects(self::any()) ->method('__get') ->with('contentInfo') - ->will($this->returnValue($contentInfo)); + ->will(self::returnValue($contentInfo)); $fieldDefIdentifier = 'my_field_definition'; $textLineFT = new TextLineType(); @@ -64,29 +65,29 @@ public function testIsFieldEmpty() ->setConstructorArgs([['fieldTypeIdentifier' => 'ezstring']]) ->getMockForAbstractClass(); $contentType - ->expects($this->once()) + ->expects(self::once()) ->method('getFieldDefinition') ->with($fieldDefIdentifier) - ->will($this->returnValue($fieldDefinition)); + ->will(self::returnValue($fieldDefinition)); $content - ->expects($this->any()) + ->expects(self::any()) ->method('getContentType') ->willReturn($contentType); $this->translationHelper - ->expects($this->once()) + ->expects(self::once()) ->method('getTranslatedField') ->with($content, $fieldDefIdentifier) - ->will($this->returnValue($emptyField)); + ->will(self::returnValue($emptyField)); $this->fieldTypeServiceMock - ->expects($this->any()) + ->expects(self::any()) ->method('getFieldType') ->with('ezstring') - ->will($this->returnValue(new FieldType($textLineFT))); + ->will(self::returnValue(new FieldType($textLineFT))); - $this->assertTrue($this->fieldHelper->isFieldEmpty($content, $fieldDefIdentifier)); + self::assertTrue($this->fieldHelper->isFieldEmpty($content, $fieldDefIdentifier)); } public function testIsFieldNotEmpty() @@ -95,10 +96,10 @@ public function testIsFieldNotEmpty() $contentInfo = new ContentInfo(['contentTypeId' => $contentTypeId]); $content = $this->createMock(APIContent::class); $content - ->expects($this->any()) + ->expects(self::any()) ->method('__get') ->with('contentInfo') - ->will($this->returnValue($contentInfo)); + ->will(self::returnValue($contentInfo)); $fieldDefIdentifier = 'my_field_definition'; $textLineFT = new TextLineType(); @@ -110,29 +111,29 @@ public function testIsFieldNotEmpty() ->setConstructorArgs([['fieldTypeIdentifier' => 'ezstring']]) ->getMockForAbstractClass(); $contentType - ->expects($this->once()) + ->expects(self::once()) ->method('getFieldDefinition') ->with($fieldDefIdentifier) - ->will($this->returnValue($fieldDefinition)); + ->will(self::returnValue($fieldDefinition)); $content - ->expects($this->any()) + ->expects(self::any()) ->method('getContentType') ->willReturn($contentType); $this->translationHelper - ->expects($this->once()) + ->expects(self::once()) ->method('getTranslatedField') ->with($content, $fieldDefIdentifier) - ->will($this->returnValue($emptyField)); + ->will(self::returnValue($emptyField)); $this->fieldTypeServiceMock - ->expects($this->any()) + ->expects(self::any()) ->method('getFieldType') ->with('ezstring') - ->will($this->returnValue(new FieldType($textLineFT))); + ->will(self::returnValue(new FieldType($textLineFT))); - $this->assertFalse($this->fieldHelper->isFieldEmpty($content, $fieldDefIdentifier)); + self::assertFalse($this->fieldHelper->isFieldEmpty($content, $fieldDefIdentifier)); } } diff --git a/tests/lib/Helper/FieldsGroups/ArrayTranslatorFieldsGroupsListTest.php b/tests/lib/Helper/FieldsGroups/ArrayTranslatorFieldsGroupsListTest.php index 18fa357960..ced017d8da 100644 --- a/tests/lib/Helper/FieldsGroups/ArrayTranslatorFieldsGroupsListTest.php +++ b/tests/lib/Helper/FieldsGroups/ArrayTranslatorFieldsGroupsListTest.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\Core\Helper\FieldsGroups; use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinition; @@ -58,7 +59,7 @@ public function testGetFieldGroupWhenFieldDefinitionHasGroup(): void $arrayTranslatorFieldsGroupsList = $this->getArrayTranslatorFieldsGroupsList(); - $this->assertSame( + self::assertSame( $fieldDefinitionMock->fieldGroup, $arrayTranslatorFieldsGroupsList->getFieldGroup($fieldDefinitionMock) ); @@ -70,7 +71,7 @@ public function testGetFieldGroupWhenFieldDefinitionMissingGroup(): void $arrayTranslatorFieldsGroupsList = $this->getArrayTranslatorFieldsGroupsList(); - $this->assertSame( + self::assertSame( self::DEFAULT_GROUP_ID, $arrayTranslatorFieldsGroupsList->getFieldGroup($fieldDefinitionMock) ); @@ -79,9 +80,9 @@ public function testGetFieldGroupWhenFieldDefinitionMissingGroup(): void public function testUsesIdentifierIfNoTranslation(): void { $this->getTranslatorMock() - ->expects($this->any()) + ->expects(self::any()) ->method('trans') - ->will($this->returnArgument(0)); + ->will(self::returnArgument(0)); $list = $this->getArrayTranslatorFieldsGroupsList(); @@ -120,10 +121,10 @@ private function getTranslatorMock(): MockObject private function applyTranslationsForTranslationsMock(): void { $this->getTranslatorMock() - ->expects($this->any()) + ->expects(self::any()) ->method('trans') ->will( - $this->returnValueMap([ + self::returnValueMap([ [self::FIRST_GROUP_ID, [], 'ibexa_fields_groups', null, self::FIRST_GROUP_NAME], [self::SECOND_GROUP_ID, [], 'ibexa_fields_groups', null, self::SECOND_GROUP_NAME], ]) diff --git a/tests/lib/Helper/FieldsGroups/RepositoryConfigFieldsGroupsListFactoryTest.php b/tests/lib/Helper/FieldsGroups/RepositoryConfigFieldsGroupsListFactoryTest.php index 89b6aa7b4c..259270903e 100644 --- a/tests/lib/Helper/FieldsGroups/RepositoryConfigFieldsGroupsListFactoryTest.php +++ b/tests/lib/Helper/FieldsGroups/RepositoryConfigFieldsGroupsListFactoryTest.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\Core\Helper\FieldsGroups; use Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider; @@ -20,14 +21,14 @@ class RepositoryConfigFieldsGroupsListFactoryTest extends TestCase public function testBuild() { $this->getRepositoryConfigMock() - ->expects($this->once()) + ->expects(self::once()) ->method('getRepositoryConfig') ->willReturn(['fields_groups' => ['list' => ['group_a', 'group_b'], 'default' => 'group_a']]); $this->getTranslatorMock() - ->expects($this->any()) + ->expects(self::any()) ->method('trans') - ->will($this->returnArgument(0)); + ->will(self::returnArgument(0)); $factory = new RepositoryConfigFieldsGroupsListFactory($this->getRepositoryConfigMock()); $list = $factory->build($this->getTranslatorMock()); diff --git a/tests/lib/Helper/PreviewLocationProviderTest.php b/tests/lib/Helper/PreviewLocationProviderTest.php index fb8f05d18e..25fb173d1c 100644 --- a/tests/lib/Helper/PreviewLocationProviderTest.php +++ b/tests/lib/Helper/PreviewLocationProviderTest.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\Core\Helper; use Ibexa\Contracts\Core\Persistence\Content\Location\Handler as SPILocationHandler; @@ -48,26 +49,26 @@ public function testGetPreviewLocationDraft() $content = $this->getContentMock($contentId); $this->contentService - ->expects($this->once()) + ->expects(self::once()) ->method('loadContent') ->with($contentId) ->willReturn($content); $this->locationService - ->expects($this->never()) + ->expects(self::never()) ->method('loadLocation'); $this->locationHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadParentLocationsForDraftContent') ->with($contentId) - ->will($this->returnValue([new Location(['id' => $parentLocationId])])); + ->will(self::returnValue([new Location(['id' => $parentLocationId])])); $location = $this->provider->loadMainLocation($contentId); - $this->assertInstanceOf(APILocation::class, $location); - $this->assertSame($content, $location->getContent()); - $this->assertNull($location->id); - $this->assertEquals($parentLocationId, $location->parentLocationId); + self::assertInstanceOf(APILocation::class, $location); + self::assertSame($content, $location->getContent()); + self::assertNull($location->id); + self::assertEquals($parentLocationId, $location->parentLocationId); } public function testGetPreviewLocation() @@ -82,22 +83,22 @@ public function testGetPreviewLocation() ->getMockForAbstractClass(); $this->contentService - ->expects($this->once()) + ->expects(self::once()) ->method('loadContent') ->with($contentId) ->willReturn($content); $this->locationService - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') ->with($locationId) - ->will($this->returnValue($location)); + ->will(self::returnValue($location)); - $this->locationHandler->expects($this->never())->method('loadParentLocationsForDraftContent'); + $this->locationHandler->expects(self::never())->method('loadParentLocationsForDraftContent'); $returnedLocation = $this->provider->loadMainLocation($contentId); - $this->assertSame($location, $returnedLocation); - $this->assertSame($content, $location->getContent()); + self::assertSame($location, $returnedLocation); + self::assertSame($content, $location->getContent()); } public function testGetPreviewLocationNoLocation() @@ -106,20 +107,20 @@ public function testGetPreviewLocationNoLocation() $content = $this->getContentMock($contentId); $this->contentService - ->expects($this->once()) + ->expects(self::once()) ->method('loadContent') ->with($contentId) ->willReturn($content); $this->locationHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadParentLocationsForDraftContent') ->with($contentId) - ->will($this->returnValue([])); + ->will(self::returnValue([])); - $this->locationHandler->expects($this->never())->method('loadLocationsByContent'); + $this->locationHandler->expects(self::never())->method('loadLocationsByContent'); - $this->assertNull($this->provider->loadMainLocation($contentId)); + self::assertNull($this->provider->loadMainLocation($contentId)); } private function getContentMock(int $contentId, ?int $mainLocationId = null, bool $published = false): Content @@ -131,12 +132,12 @@ private function getContentMock(int $contentId, ?int $mainLocationId = null, boo ]); $versionInfo = $this->createMock(VersionInfo::class); - $versionInfo->expects($this->once()) + $versionInfo->expects(self::once()) ->method('getContentInfo') ->willReturn($contentInfo); $content = $this->createMock(Content::class); - $content->expects($this->once()) + $content->expects(self::once()) ->method('getVersionInfo') ->willReturn($versionInfo); diff --git a/tests/lib/Helper/TranslationHelperTest.php b/tests/lib/Helper/TranslationHelperTest.php index 812f286504..92a32ae3a5 100644 --- a/tests/lib/Helper/TranslationHelperTest.php +++ b/tests/lib/Helper/TranslationHelperTest.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\Core\Helper; use Ibexa\Contracts\Core\Repository\ContentService; @@ -106,12 +107,12 @@ public function testGetTranslatedName(array $prioritizedLanguages, $expectedLoca { $content = $this->generateContent(); $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('languages') - ->will($this->returnValue($prioritizedLanguages)); + ->will(self::returnValue($prioritizedLanguages)); - $this->assertSame($this->translatedNames[$expectedLocale], $this->translationHelper->getTranslatedContentName($content)); + self::assertSame($this->translatedNames[$expectedLocale], $this->translationHelper->getTranslatedContentName($content)); } /** @@ -125,18 +126,18 @@ public function testGetTranslatedNameByContentInfo(array $prioritizedLanguages, $versionInfo = $this->generateVersionInfo(); $contentInfo = new ContentInfo(['id' => 123]); $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('languages') - ->will($this->returnValue($prioritizedLanguages)); + ->will(self::returnValue($prioritizedLanguages)); $this->contentService - ->expects($this->once()) + ->expects(self::once()) ->method('loadVersionInfo') ->with($contentInfo) - ->will($this->returnValue($versionInfo)); + ->will(self::returnValue($versionInfo)); - $this->assertSame($this->translatedNames[$expectedLocale], $this->translationHelper->getTranslatedContentNameByContentInfo($contentInfo)); + self::assertSame($this->translatedNames[$expectedLocale], $this->translationHelper->getTranslatedContentNameByContentInfo($contentInfo)); } public function getTranslatedNameProvider() @@ -155,17 +156,17 @@ public function testGetTranslatedNameByContentInfoForcedLanguage() $versionInfo = $this->generateVersionInfo(); $contentInfo = new ContentInfo(['id' => 123]); $this->configResolver - ->expects($this->never()) + ->expects(self::never()) ->method('getParameter'); $this->contentService - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('loadVersionInfo') ->with($contentInfo) - ->will($this->returnValue($versionInfo)); + ->will(self::returnValue($versionInfo)); - $this->assertSame('My name in english', $this->translationHelper->getTranslatedContentNameByContentInfo($contentInfo, 'eng-GB')); - $this->assertSame('Mon nom en français', $this->translationHelper->getTranslatedContentNameByContentInfo($contentInfo, 'eng-US')); + self::assertSame('My name in english', $this->translationHelper->getTranslatedContentNameByContentInfo($contentInfo, 'eng-GB')); + self::assertSame('Mon nom en français', $this->translationHelper->getTranslatedContentNameByContentInfo($contentInfo, 'eng-US')); } public function testGetTranslatedNameByContentInfoForcedLanguageMainLanguage() @@ -180,14 +181,14 @@ public function testGetTranslatedNameByContentInfoForcedLanguageMainLanguage() ] ); $this->configResolver - ->expects($this->never()) + ->expects(self::never()) ->method('getParameter'); $this->contentService - ->expects($this->never()) + ->expects(self::never()) ->method('loadContentByContentInfo'); - $this->assertSame( + self::assertSame( $name, $this->translationHelper->getTranslatedContentNameByContentInfo($contentInfo, $mainLanguage) ); @@ -197,11 +198,11 @@ public function testGetTranslatedNameForcedLanguage() { $content = $this->generateContent(); $this->configResolver - ->expects($this->never()) + ->expects(self::never()) ->method('getParameter'); - $this->assertSame('My name in english', $this->translationHelper->getTranslatedContentName($content, 'eng-GB')); - $this->assertSame('Mon nom en français', $this->translationHelper->getTranslatedContentName($content, 'eng-US')); + self::assertSame('My name in english', $this->translationHelper->getTranslatedContentName($content, 'eng-GB')); + self::assertSame('Mon nom en français', $this->translationHelper->getTranslatedContentName($content, 'eng-US')); } /** @@ -214,12 +215,12 @@ public function getTranslatedField(array $prioritizedLanguages, $expectedLocale) { $content = $this->generateContent(); $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('languages') - ->will($this->returnValue($prioritizedLanguages)); + ->will(self::returnValue($prioritizedLanguages)); - $this->assertSame($this->translatedFields[$expectedLocale], $this->translationHelper->getTranslatedField($content, 'test')); + self::assertSame($this->translatedFields[$expectedLocale], $this->translationHelper->getTranslatedField($content, 'test')); } public function getTranslatedFieldProvider() @@ -236,10 +237,10 @@ public function getTranslatedFieldProvider() public function testGetTranslationSiteAccessUnkownLanguage() { $this->configResolver - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['translation_siteaccesses', null, null, []], ['related_siteaccesses', null, null, []], @@ -248,10 +249,10 @@ public function testGetTranslationSiteAccessUnkownLanguage() ); $this->logger - ->expects($this->once()) + ->expects(self::once()) ->method('error'); - $this->assertNull($this->translationHelper->getTranslationSiteAccess('eng-DE')); + self::assertNull($this->translationHelper->getTranslationSiteAccess('eng-DE')); } /** @@ -260,10 +261,10 @@ public function testGetTranslationSiteAccessUnkownLanguage() public function testGetTranslationSiteAccess($language, array $translationSiteAccesses, array $relatedSiteAccesses, $expectedResult) { $this->configResolver - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['translation_siteaccesses', null, null, $translationSiteAccesses], ['related_siteaccesses', null, null, $relatedSiteAccesses], @@ -271,7 +272,7 @@ public function testGetTranslationSiteAccess($language, array $translationSiteAc ) ); - $this->assertSame($expectedResult, $this->translationHelper->getTranslationSiteAccess($language)); + self::assertSame($expectedResult, $this->translationHelper->getTranslationSiteAccess($language)); } public function getTranslationSiteAccessProvider() @@ -295,10 +296,10 @@ public function getTranslationSiteAccessProvider() public function testGetAvailableLanguagesWithTranslationSiteAccesses() { $this->configResolver - ->expects($this->any()) + ->expects(self::any()) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['translation_siteaccesses', null, null, ['fre', 'esl']], ['related_siteaccesses', null, null, ['fre', 'esl', 'heb']], @@ -310,16 +311,16 @@ public function testGetAvailableLanguagesWithTranslationSiteAccesses() ); $expectedLanguages = ['eng-GB', 'esl-ES', 'fre-FR']; - $this->assertSame($expectedLanguages, $this->translationHelper->getAvailableLanguages()); + self::assertSame($expectedLanguages, $this->translationHelper->getAvailableLanguages()); } public function testGetAvailableLanguagesWithoutTranslationSiteAccesses() { $this->configResolver - ->expects($this->any()) + ->expects(self::any()) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['translation_siteaccesses', null, null, []], ['related_siteaccesses', null, null, ['fre', 'esl', 'heb']], @@ -332,7 +333,7 @@ public function testGetAvailableLanguagesWithoutTranslationSiteAccesses() ); $expectedLanguages = ['eng-GB', 'esl-ES', 'fre-FR', 'heb-IL']; - $this->assertSame($expectedLanguages, $this->translationHelper->getAvailableLanguages()); + self::assertSame($expectedLanguages, $this->translationHelper->getAvailableLanguages()); } } diff --git a/tests/lib/IO/ConfigScopeChangeAwareIOServiceTest.php b/tests/lib/IO/ConfigScopeChangeAwareIOServiceTest.php index 0426a3aa51..1b1bb23b3a 100644 --- a/tests/lib/IO/ConfigScopeChangeAwareIOServiceTest.php +++ b/tests/lib/IO/ConfigScopeChangeAwareIOServiceTest.php @@ -52,7 +52,7 @@ protected function setUp(): void public function testConstructor(): void { $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('setPrefix') ->with(self::PREFIX) ; @@ -67,7 +67,7 @@ public function testConstructor(): void public function testSetPrefix(): void { $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('setPrefix') ; @@ -80,7 +80,7 @@ public function testGetExternalPath(): void $expectedExternalPath = '/example/external/path'; $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('getExternalPath') ->with($internalId) ->willReturn($expectedExternalPath) @@ -88,7 +88,7 @@ public function testGetExternalPath(): void $externalPath = $this->ioService->getExternalPath($internalId); - $this->assertEquals($expectedExternalPath, $externalPath); + self::assertEquals($expectedExternalPath, $externalPath); } public function testNewBinaryCreateStructFromLocalFile(): void @@ -97,7 +97,7 @@ public function testNewBinaryCreateStructFromLocalFile(): void $localFile = '/path/to/local/file.txt'; $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('newBinaryCreateStructFromLocalFile') ->with($localFile) ->willReturn($expectedBinaryFileCreateStruct) @@ -105,7 +105,7 @@ public function testNewBinaryCreateStructFromLocalFile(): void $binaryFileCreateStruct = $this->innerIOService->newBinaryCreateStructFromLocalFile($localFile); - $this->assertEquals($expectedBinaryFileCreateStruct, $binaryFileCreateStruct); + self::assertEquals($expectedBinaryFileCreateStruct, $binaryFileCreateStruct); } public function testExists(): void @@ -113,13 +113,13 @@ public function testExists(): void $binaryFileId = 'test-id'; $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('exists') ->with($binaryFileId) ->willReturn(true) ; - $this->assertTrue($this->innerIOService->exists($binaryFileId)); + self::assertTrue($this->innerIOService->exists($binaryFileId)); } public function testGetInternalPath(): void @@ -128,7 +128,7 @@ public function testGetInternalPath(): void $externalId = 'test-id'; $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('getInternalPath') ->with($externalId) ->willReturn($expectedInternalPath) @@ -136,7 +136,7 @@ public function testGetInternalPath(): void $internalPath = $this->innerIOService->getInternalPath($externalId); - $this->assertEquals($expectedInternalPath, $internalPath); + self::assertEquals($expectedInternalPath, $internalPath); } public function testLoadBinaryFile(): void @@ -145,7 +145,7 @@ public function testLoadBinaryFile(): void $binaryFileId = 'test-id'; $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFile') ->with($binaryFileId) ->willReturn($expectedBinaryFile) @@ -153,7 +153,7 @@ public function testLoadBinaryFile(): void $binaryFile = $this->innerIOService->loadBinaryFile($binaryFileId); - $this->assertEquals($expectedBinaryFile, $binaryFile); + self::assertEquals($expectedBinaryFile, $binaryFile); } public function testLoadBinaryFileByUri(): void @@ -162,7 +162,7 @@ public function testLoadBinaryFileByUri(): void $uri = 'http://example.com/file.pdf'; $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('loadBinaryFileByUri') ->with($uri) ->willReturn($expectedBinaryFile) @@ -170,7 +170,7 @@ public function testLoadBinaryFileByUri(): void $binaryFile = $this->innerIOService->loadBinaryFileByUri($uri); - $this->assertEquals($expectedBinaryFile, $binaryFile); + self::assertEquals($expectedBinaryFile, $binaryFile); } public function testGetFileContents(): void @@ -179,7 +179,7 @@ public function testGetFileContents(): void $expectedContents = 'test'; $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('getFileContents') ->with($binaryFile) ->willReturn($expectedContents) @@ -187,7 +187,7 @@ public function testGetFileContents(): void $contents = $this->innerIOService->getFileContents($binaryFile); - $this->assertEquals($expectedContents, $contents); + self::assertEquals($expectedContents, $contents); } public function testCreateBinaryFile(): void @@ -196,7 +196,7 @@ public function testCreateBinaryFile(): void $binaryFileCreateStruct = new BinaryFileCreateStruct(); $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('createBinaryFile') ->with($binaryFileCreateStruct) ->willReturn($expectedBinaryFile) @@ -204,7 +204,7 @@ public function testCreateBinaryFile(): void $binaryFile = $this->innerIOService->createBinaryFile($binaryFileCreateStruct); - $this->assertEquals($expectedBinaryFile, $binaryFile); + self::assertEquals($expectedBinaryFile, $binaryFile); } public function testGetUri(): void @@ -213,7 +213,7 @@ public function testGetUri(): void $binaryFileId = 'file-id'; $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('getUri') ->with($binaryFileId) ->willReturn($expectedUri) @@ -221,7 +221,7 @@ public function testGetUri(): void $uri = $this->innerIOService->getUri($binaryFileId); - $this->assertEquals($expectedUri, $uri); + self::assertEquals($expectedUri, $uri); } public function testGetMimeType(): void @@ -230,7 +230,7 @@ public function testGetMimeType(): void $binaryFileId = 'file-id'; $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('getMimeType') ->with($binaryFileId) ->willReturn($expectedMimeType) @@ -238,7 +238,7 @@ public function testGetMimeType(): void $mimeType = $this->innerIOService->getMimeType($binaryFileId); - $this->assertEquals($expectedMimeType, $mimeType); + self::assertEquals($expectedMimeType, $mimeType); } public function testGetFileInputStream(): void @@ -247,7 +247,7 @@ public function testGetFileInputStream(): void $binaryFile = new BinaryFile(); $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('getFileInputStream') ->with($binaryFile) ->willReturn($expectedFileInputStream) @@ -255,7 +255,7 @@ public function testGetFileInputStream(): void $fileInputStream = $this->innerIOService->getFileInputStream($binaryFile); - $this->assertEquals($expectedFileInputStream, $fileInputStream); + self::assertEquals($expectedFileInputStream, $fileInputStream); } public function testDeleteBinaryFile(): void @@ -263,7 +263,7 @@ public function testDeleteBinaryFile(): void $binaryFile = new BinaryFile(); $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('deleteBinaryFile') ->with($binaryFile) ; @@ -283,7 +283,7 @@ public function testNewBinaryCreateStructFromUploadedFile(): void ]; $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('newBinaryCreateStructFromUploadedFile') ->with($uploadedFile) ->willReturn($expectedBinaryFileCreateStruct) @@ -291,7 +291,7 @@ public function testNewBinaryCreateStructFromUploadedFile(): void $binaryFileCreateStruct = $this->innerIOService->newBinaryCreateStructFromUploadedFile($uploadedFile); - $this->assertEquals($expectedBinaryFileCreateStruct, $binaryFileCreateStruct); + self::assertEquals($expectedBinaryFileCreateStruct, $binaryFileCreateStruct); } public function testDeleteDirectory(): void @@ -299,7 +299,7 @@ public function testDeleteDirectory(): void $path = '/path/to/directory'; $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('deleteDirectory') ->with($path) ; @@ -311,7 +311,7 @@ public function testOnConfigScopeChange(): void { $event = $this->createMock(ScopeChangeEvent::class); $this->innerIOService - ->expects($this->once()) + ->expects(self::once()) ->method('setPrefix') ->with(self::PREFIX); diff --git a/tests/lib/IO/IOBinarydataHandler/FlysystemTest.php b/tests/lib/IO/IOBinarydataHandler/FlysystemTest.php index 8a790a4cae..c15be33f15 100644 --- a/tests/lib/IO/IOBinarydataHandler/FlysystemTest.php +++ b/tests/lib/IO/IOBinarydataHandler/FlysystemTest.php @@ -42,12 +42,12 @@ public function testCreate(): void $spiBinaryFileCreateStruct->setInputStream($stream); $this->filesystem - ->expects($this->once()) + ->expects(self::once()) ->method('writeStream') ->with( - $this->equalTo($spiBinaryFileCreateStruct->id), - $this->equalTo($stream), - $this->equalTo( + self::equalTo($spiBinaryFileCreateStruct->id), + self::equalTo($stream), + self::equalTo( [ 'mimetype' => 'image/png', 'visibility' => 'public', @@ -62,7 +62,7 @@ public function testCreate(): void public function testDelete() { $this->filesystem - ->expects($this->once()) + ->expects(self::once()) ->method('delete') ->with('prefix/my/file.png'); @@ -74,7 +74,7 @@ public function testDeleteNotFound(): void // Note: technically Flysystem's v2+ Local Adapter silently skips non-existent file $filePath = 'prefix/my/file.png'; $this->filesystem - ->expects($this->once()) + ->expects(self::once()) ->method('delete') ->with($filePath) ->willThrowException(UnableToDeleteFile::atLocation($filePath)); @@ -92,7 +92,7 @@ public function testGetContents(): void $filePath = 'prefix/my/file.png'; $fileContents = 'This is my contents'; $this->filesystem - ->expects($this->once()) + ->expects(self::once()) ->method('read') ->with($filePath) ->willReturn($fileContents); @@ -107,7 +107,7 @@ public function testGetContentsNotFound(): void { $filePath = 'prefix/my/file.png'; $this->filesystem - ->expects($this->once()) + ->expects(self::once()) ->method('read') ->with($filePath) ->willThrowException(UnableToReadFile::fromLocation($filePath)); @@ -125,7 +125,7 @@ public function testGetResource(): void $filePath = 'prefix/my/file.png'; $this->filesystem - ->expects($this->once()) + ->expects(self::once()) ->method('readStream') ->with($filePath) ->willReturn($resource); @@ -143,7 +143,7 @@ public function testGetResourceNotFound(): void { $filePath = 'prefix/my/file.png'; $this->filesystem - ->expects($this->once()) + ->expects(self::once()) ->method('readStream') ->with($filePath) ->willThrowException(UnableToReadFile::fromLocation($filePath)); @@ -163,7 +163,7 @@ public function testGetUri(): void public function testDeleteDirectory(): void { $this->filesystem - ->expects($this->once()) + ->expects(self::once()) ->method('deleteDirectory') ->with('some/path'); diff --git a/tests/lib/IO/IOMetadataHandler/FlysystemTest.php b/tests/lib/IO/IOMetadataHandler/FlysystemTest.php index 9c21d97d74..658f01be74 100644 --- a/tests/lib/IO/IOMetadataHandler/FlysystemTest.php +++ b/tests/lib/IO/IOMetadataHandler/FlysystemTest.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\Core\IO\IOMetadataHandler; use DateTime; @@ -58,13 +59,13 @@ public function testCreate(): void $spiBinaryFile = $this->handler->create($spiCreateStruct); - $this->assertInstanceOf(SPIBinaryFile::class, $spiBinaryFile); - $this->assertEquals($expectedSpiBinaryFile, $spiBinaryFile); + self::assertInstanceOf(SPIBinaryFile::class, $spiBinaryFile); + self::assertEquals($expectedSpiBinaryFile, $spiBinaryFile); } public function testDelete() { - $this->filesystem->expects($this->never())->method('delete'); + $this->filesystem->expects(self::never())->method('delete'); $this->handler->delete('prefix/my/file.png'); } @@ -90,8 +91,8 @@ public function testLoad(): void $spiBinaryFile = $this->handler->load($filePath); - $this->assertInstanceOf(SPIBinaryFile::class, $spiBinaryFile); - $this->assertEquals($expectedSpiBinaryFile, $spiBinaryFile); + self::assertInstanceOf(SPIBinaryFile::class, $spiBinaryFile); + self::assertEquals($expectedSpiBinaryFile, $spiBinaryFile); } public function testLoadNotFound(): void @@ -114,7 +115,7 @@ public function testLoadNotFound(): void public function testExists(string $filePath, bool $exists): void { $this->filesystem - ->expects($this->once()) + ->expects(self::once()) ->method('fileExists') ->with($filePath) // Note: test proper proxying of Flysystem call as this is a unit test diff --git a/tests/lib/IO/IOMetadataHandler/LegacyDFSClusterTest.php b/tests/lib/IO/IOMetadataHandler/LegacyDFSClusterTest.php index eac55e27d6..418b6e0aef 100644 --- a/tests/lib/IO/IOMetadataHandler/LegacyDFSClusterTest.php +++ b/tests/lib/IO/IOMetadataHandler/LegacyDFSClusterTest.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\Core\IO\IOMetadataHandler; use DateTime; diff --git a/tests/lib/IO/IOServiceTest.php b/tests/lib/IO/IOServiceTest.php index 9035c0f86d..26862fa070 100644 --- a/tests/lib/IO/IOServiceTest.php +++ b/tests/lib/IO/IOServiceTest.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\Core\IO; use Ibexa\Contracts\Core\IO\BinaryFile as SPIBinaryFile; @@ -90,10 +91,10 @@ public function testNewBinaryCreateStructFromLocalFile() $file = __FILE__; $this->mimeTypeDetectorMock - ->expects($this->once()) + ->expects(self::once()) ->method('getFromPath') - ->with($this->equalTo($file)) - ->will($this->returnValue('text/x-php')); + ->with(self::equalTo($file)) + ->will(self::returnValue('text/x-php')); $binaryCreateStruct = $this->getIOService()->newBinaryCreateStructFromLocalFile( $file @@ -123,10 +124,10 @@ public function testCreateBinaryFile(BinaryFileCreateStruct $createStruct) $spiBinaryFile->mimeType = 'text/x-php'; $this->binarydataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('create') ->with( - $this->callback( + self::callback( static function ($subject) use ($id) { if (!$subject instanceof SPIBinaryFileCreateStruct) { return false; @@ -138,10 +139,10 @@ static function ($subject) use ($id) { ); $this->metadataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('create') - ->with($this->callback($this->getSPIBinaryFileCreateStructCallback($id))) - ->will($this->returnValue($spiBinaryFile)); + ->with(self::callback($this->getSPIBinaryFileCreateStructCallback($id))) + ->will(self::returnValue($spiBinaryFile)); $binaryFile = $this->IOService->createBinaryFile($createStruct); self::assertInstanceOf(BinaryFile::class, $binaryFile); @@ -162,10 +163,10 @@ public function testLoadBinaryFile() $spiBinaryFile->uri = $spiId; $this->metadataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with($spiId) - ->will($this->returnValue($spiBinaryFile)); + ->will(self::returnValue($spiBinaryFile)); $binaryFile = $this->getIOService()->loadBinaryFile($id); self::assertEquals($id, $binaryFile->id); @@ -182,16 +183,16 @@ public function testLoadBinaryFileNoMetadataUri() $spiBinaryFile->size = 12345; $this->metadataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with($spiId) - ->will($this->returnValue($spiBinaryFile)); + ->will(self::returnValue($spiBinaryFile)); $this->binarydataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('getUri') ->with($spiId) - ->will($this->returnValue("/$spiId")); + ->will(self::returnValue("/$spiId")); $binaryFile = $this->getIOService()->loadBinaryFile($id); @@ -223,16 +224,16 @@ public function testLoadBinaryFileByUri() $spiBinaryFile->uri = $spiId; $this->binarydataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('getIdFromUri') ->with($spiId) - ->will($this->returnValue($spiId)); + ->will(self::returnValue($spiId)); $this->metadataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with($spiId) - ->will($this->returnValue($spiBinaryFile)); + ->will(self::returnValue($spiBinaryFile)); $binaryFile = $this->getIOService()->loadBinaryFileByUri($spiId); self::assertEquals($id, $binaryFile->id); @@ -266,10 +267,10 @@ public function testGetFileContents(BinaryFile $binaryFile) $expectedContents = file_get_contents(__FILE__); $this->binarydataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('getContents') - ->with($this->equalTo($this->getPrefixedUri($binaryFile->id))) - ->will($this->returnValue($expectedContents)); + ->with(self::equalTo($this->getPrefixedUri($binaryFile->id))) + ->will(self::returnValue($expectedContents)); self::assertEquals( $expectedContents, @@ -283,10 +284,10 @@ public function testGetFileContents(BinaryFile $binaryFile) public function testExists(BinaryFile $binaryFile) { $this->metadataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('exists') - ->with($this->equalTo($this->getPrefixedUri($binaryFile->id))) - ->will($this->returnValue(true)); + ->with(self::equalTo($this->getPrefixedUri($binaryFile->id))) + ->will(self::returnValue(true)); self::assertTrue( $this->getIOService()->exists( @@ -298,10 +299,10 @@ public function testExists(BinaryFile $binaryFile) public function testExistsNot() { $this->metadataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('exists') - ->with($this->equalTo($this->getPrefixedUri(__METHOD__))) - ->will($this->returnValue(false)); + ->with(self::equalTo($this->getPrefixedUri(__METHOD__))) + ->will(self::returnValue(false)); self::assertFalse( $this->getIOService()->exists( @@ -316,10 +317,10 @@ public function testExistsNot() public function testGetMimeType(BinaryFile $binaryFile) { $this->metadataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('getMimeType') - ->with($this->equalTo($this->getPrefixedUri($binaryFile->id))) - ->will($this->returnValue($binaryFile->mimeType)); + ->with(self::equalTo($this->getPrefixedUri($binaryFile->id))) + ->will(self::returnValue($binaryFile->mimeType)); self::assertEquals( $binaryFile->mimeType, @@ -335,14 +336,14 @@ public function testGetMimeType(BinaryFile $binaryFile) public function testDeleteBinaryFile(BinaryFile $binaryFile) { $this->metadataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('delete') - ->with($this->equalTo($this->getPrefixedUri($binaryFile->id))); + ->with(self::equalTo($this->getPrefixedUri($binaryFile->id))); $this->binarydataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('delete') - ->with($this->equalTo($this->getPrefixedUri($binaryFile->id))); + ->with(self::equalTo($this->getPrefixedUri($binaryFile->id))); $this->getIOService()->deleteBinaryFile($binaryFile); } @@ -353,12 +354,12 @@ public function testDeleteDirectory() $spiId = $this->getPrefixedUri($id); $this->binarydataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('deleteDirectory') ->with($spiId); $this->metadataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('deleteDirectory') ->with($spiId); @@ -415,10 +416,10 @@ protected function loadBinaryFileNotFound() $id = 'id.ext'; $prefixedUri = $this->getPrefixedUri($id); $this->metadataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with($prefixedUri) - ->will($this->throwException(new BinaryFileNotFoundException($prefixedUri))); + ->will(self::throwException(new BinaryFileNotFoundException($prefixedUri))); return $this->getIOService()->loadBinaryFile($id); } @@ -431,10 +432,10 @@ protected function deleteBinaryFileNotFound(): void $prefixedId = $this->getPrefixedUri($binaryFile->id); $this->metadataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('delete') - ->with($this->equalTo($prefixedId)) - ->will($this->throwException(new BinaryFileNotFoundException($prefixedId))); + ->with(self::equalTo($prefixedId)) + ->will(self::throwException(new BinaryFileNotFoundException($prefixedId))); $this->getIOService()->deleteBinaryFile($binaryFile); } @@ -451,16 +452,16 @@ protected function loadBinaryFileByUriNotFound() $spiId = $this->getPrefixedUri($id); $this->binarydataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('getIdFromUri') ->with($spiId) - ->will($this->returnValue($spiId)); + ->will(self::returnValue($spiId)); $this->metadataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with($spiId) - ->will($this->throwException(new BinaryFileNotFoundException($spiId))); + ->will(self::throwException(new BinaryFileNotFoundException($spiId))); return $this->getIOService()->loadBinaryFileByUri($spiId); } diff --git a/tests/lib/IO/MetadataHandler/ImageSizeTest.php b/tests/lib/IO/MetadataHandler/ImageSizeTest.php index 69d113660b..5996935050 100644 --- a/tests/lib/IO/MetadataHandler/ImageSizeTest.php +++ b/tests/lib/IO/MetadataHandler/ImageSizeTest.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\Core\IO\MetadataHandler; use Ibexa\Core\IO\MetadataHandler\ImageSize as ImageSizeMetadataHandler; diff --git a/tests/lib/IO/MimeTypeDetector/FileInfoTest.php b/tests/lib/IO/MimeTypeDetector/FileInfoTest.php index 57d5d46434..6a0da3d0c4 100644 --- a/tests/lib/IO/MimeTypeDetector/FileInfoTest.php +++ b/tests/lib/IO/MimeTypeDetector/FileInfoTest.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\Core\IO\MimeTypeDetector; use Ibexa\Core\IO\MimeTypeDetector\FileInfo as MimeTypeDetector; diff --git a/tests/lib/IO/TolerantIOServiceTest.php b/tests/lib/IO/TolerantIOServiceTest.php index 18cf68efce..cf3323dd0a 100644 --- a/tests/lib/IO/TolerantIOServiceTest.php +++ b/tests/lib/IO/TolerantIOServiceTest.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\Core\IO; use Ibexa\Core\IO\TolerantIOService; @@ -42,10 +43,10 @@ public function testCreateMissingBinaryFile() $prefixedUri = $this->getPrefixedUri($id); $this->binarydataHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('getUri') ->with($prefixedUri) - ->will($this->returnValue("/$prefixedUri")); + ->will(self::returnValue("/$prefixedUri")); $binaryFile = parent::loadBinaryFileNotFound(); self::assertEquals( diff --git a/tests/lib/IO/UrlRedecoratorTest.php b/tests/lib/IO/UrlRedecoratorTest.php index fe5a278df0..81fd3d9545 100644 --- a/tests/lib/IO/UrlRedecoratorTest.php +++ b/tests/lib/IO/UrlRedecoratorTest.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\Core\IO; use Ibexa\Core\IO\UrlDecorator; @@ -32,16 +33,16 @@ protected function setUp(): void public function testRedecorateFromSource() { $this->sourceDecoratorMock - ->expects($this->once()) + ->expects(self::once()) ->method('undecorate') ->with('http://static.example.com/images/file.png') - ->will($this->returnValue('images/file.png')); + ->will(self::returnValue('images/file.png')); $this->targetDecoratorMock - ->expects($this->once()) + ->expects(self::once()) ->method('decorate') ->with('images/file.png') - ->will($this->returnValue('/var/test/storage/images/file.png')); + ->will(self::returnValue('/var/test/storage/images/file.png')); self::assertEquals( '/var/test/storage/images/file.png', @@ -52,16 +53,16 @@ public function testRedecorateFromSource() public function testRedecorateFromTarget() { $this->targetDecoratorMock - ->expects($this->once()) + ->expects(self::once()) ->method('undecorate') ->with('/var/test/storage/images/file.png') - ->will($this->returnValue('images/file.png')); + ->will(self::returnValue('images/file.png')); $this->sourceDecoratorMock - ->expects($this->once()) + ->expects(self::once()) ->method('decorate') ->with('images/file.png') - ->will($this->returnValue('http://static.example.com/images/file.png')); + ->will(self::returnValue('http://static.example.com/images/file.png')); self::assertEquals( 'http://static.example.com/images/file.png', diff --git a/tests/lib/Limitation/Base.php b/tests/lib/Limitation/Base.php index 56c6a15434..f48406ec47 100644 --- a/tests/lib/Limitation/Base.php +++ b/tests/lib/Limitation/Base.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\Core\Limitation; use Ibexa\Contracts\Core\Persistence\Handler as SPIHandler; diff --git a/tests/lib/Limitation/BlockingLimitationTypeTest.php b/tests/lib/Limitation/BlockingLimitationTypeTest.php index 61d8343fe1..83537108db 100644 --- a/tests/lib/Limitation/BlockingLimitationTypeTest.php +++ b/tests/lib/Limitation/BlockingLimitationTypeTest.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\Core\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException; @@ -44,6 +45,7 @@ public function providerForTestAcceptValue() /** * @dataProvider providerForTestAcceptValue + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation\BlockingLimitation $limitation @@ -66,6 +68,7 @@ public function providerForTestAcceptValueException() /** * @dataProvider providerForTestAcceptValueException + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation $limitation @@ -124,8 +127,8 @@ public function providerForTestValidateError() public function testValidateError(BlockingLimitation $limitation, $errorCount) { $this->getPersistenceMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); // Need to create inline instead of depending on testConstruct() to get correct mock instance $limitationType = $this->testConstruct(); @@ -201,13 +204,13 @@ public function testEvaluate( $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $persistenceMock = $this->getPersistenceMock(); $persistenceMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $value = $limitationType->evaluate( $limitation, @@ -249,13 +252,13 @@ public function testEvaluateInvalidArgument( $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $persistenceMock = $this->getPersistenceMock(); $persistenceMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $v = $limitationType->evaluate( $limitation, diff --git a/tests/lib/Limitation/ContentTypeLimitationTypeTest.php b/tests/lib/Limitation/ContentTypeLimitationTypeTest.php index 5d3666d391..1719dbcc30 100644 --- a/tests/lib/Limitation/ContentTypeLimitationTypeTest.php +++ b/tests/lib/Limitation/ContentTypeLimitationTypeTest.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Target\Builder\VersionBuilder; @@ -72,6 +73,7 @@ public function providerForTestAcceptValue() /** * @dataProvider providerForTestAcceptValue + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation\ContentTypeLimitation $limitation @@ -95,6 +97,7 @@ public function providerForTestAcceptValueException() /** * @dataProvider providerForTestAcceptValueException + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation $limitation @@ -128,13 +131,13 @@ public function testValidatePass(ContentTypeLimitation $limitation) { if (!empty($limitation->limitationValues)) { $this->getPersistenceMock() - ->expects($this->any()) + ->expects(self::any()) ->method('contentTypeHandler') - ->will($this->returnValue($this->contentTypeHandlerMock)); + ->will(self::returnValue($this->contentTypeHandlerMock)); foreach ($limitation->limitationValues as $key => $value) { $this->contentTypeHandlerMock - ->expects($this->at($key)) + ->expects(self::at($key)) ->method('load') ->with($value); } @@ -169,21 +172,21 @@ public function testValidateError(ContentTypeLimitation $limitation, $errorCount { if (!empty($limitation->limitationValues)) { $this->getPersistenceMock() - ->expects($this->any()) + ->expects(self::any()) ->method('contentTypeHandler') - ->will($this->returnValue($this->contentTypeHandlerMock)); + ->will(self::returnValue($this->contentTypeHandlerMock)); foreach ($limitation->limitationValues as $key => $value) { $this->contentTypeHandlerMock - ->expects($this->at($key)) + ->expects(self::at($key)) ->method('load') ->with($value) - ->will($this->throwException(new NotFoundException('contentType', $value))); + ->will(self::throwException(new NotFoundException('contentType', $value))); } } else { $this->getPersistenceMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); } // Need to create inline instead of depending on testConstruct() to get correct mock instance @@ -218,21 +221,21 @@ public function providerForTestEvaluate() $versionInfoMock = $this->createMock(APIVersionInfo::class); $contentMock - ->expects($this->once()) + ->expects(self::once()) ->method('getVersionInfo') - ->will($this->returnValue($versionInfoMock)); + ->will(self::returnValue($versionInfoMock)); $versionInfoMock - ->expects($this->once()) + ->expects(self::once()) ->method('getContentInfo') - ->will($this->returnValue(new ContentInfo(['contentTypeId' => 66]))); + ->will(self::returnValue(new ContentInfo(['contentTypeId' => 66]))); $versionInfoMock2 = $this->createMock(APIVersionInfo::class); $versionInfoMock2 - ->expects($this->once()) + ->expects(self::once()) ->method('getContentInfo') - ->will($this->returnValue(new ContentInfo(['contentTypeId' => 66]))); + ->will(self::returnValue(new ContentInfo(['contentTypeId' => 66]))); return [ // ContentInfo, no access @@ -315,13 +318,13 @@ public function testEvaluate( $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $persistenceMock = $this->getPersistenceMock(); $persistenceMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $value = $limitationType->evaluate( $limitation, @@ -370,13 +373,13 @@ public function testEvaluateInvalidArgument( $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $persistenceMock = $this->getPersistenceMock(); $persistenceMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $v = $limitationType->evaluate( $limitation, diff --git a/tests/lib/Limitation/LocationLimitationTypeTest.php b/tests/lib/Limitation/LocationLimitationTypeTest.php index 0f130c4727..670c3cb4c9 100644 --- a/tests/lib/Limitation/LocationLimitationTypeTest.php +++ b/tests/lib/Limitation/LocationLimitationTypeTest.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\Core\Limitation; use Ibexa\Contracts\Core\Persistence\Content\Location\Handler as SPIHandler; @@ -71,6 +72,7 @@ public function providerForTestAcceptValue() /** * @dataProvider providerForTestAcceptValue + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation\LocationLimitation $limitation @@ -94,6 +96,7 @@ public function providerForTestAcceptValueException() /** * @dataProvider providerForTestAcceptValueException + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation $limitation @@ -127,13 +130,13 @@ public function testValidatePass(LocationLimitation $limitation) { if (!empty($limitation->limitationValues)) { $this->getPersistenceMock() - ->expects($this->any()) + ->expects(self::any()) ->method('locationHandler') - ->will($this->returnValue($this->locationHandlerMock)); + ->will(self::returnValue($this->locationHandlerMock)); foreach ($limitation->limitationValues as $key => $value) { $this->locationHandlerMock - ->expects($this->at($key)) + ->expects(self::at($key)) ->method('load') ->with($value); } @@ -168,21 +171,21 @@ public function testValidateError(LocationLimitation $limitation, $errorCount) { if (!empty($limitation->limitationValues)) { $this->getPersistenceMock() - ->expects($this->any()) + ->expects(self::any()) ->method('locationHandler') - ->will($this->returnValue($this->locationHandlerMock)); + ->will(self::returnValue($this->locationHandlerMock)); foreach ($limitation->limitationValues as $key => $value) { $this->locationHandlerMock - ->expects($this->at($key)) + ->expects(self::at($key)) ->method('load') ->with($value) - ->will($this->throwException(new NotFoundException('location', $value))); + ->will(self::throwException(new NotFoundException('location', $value))); } } else { $this->getPersistenceMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); } // Need to create inline instead of depending on testConstruct() to get correct mock instance @@ -217,21 +220,21 @@ public function providerForTestEvaluate() $versionInfoMock = $this->createMock(APIVersionInfo::class); $contentMock - ->expects($this->once()) + ->expects(self::once()) ->method('getVersionInfo') - ->will($this->returnValue($versionInfoMock)); + ->will(self::returnValue($versionInfoMock)); $versionInfoMock - ->expects($this->once()) + ->expects(self::once()) ->method('getContentInfo') - ->will($this->returnValue(new ContentInfo(['published' => true]))); + ->will(self::returnValue(new ContentInfo(['published' => true]))); $versionInfoMock2 = $this->createMock(APIVersionInfo::class); $versionInfoMock2 - ->expects($this->once()) + ->expects(self::once()) ->method('getContentInfo') - ->will($this->returnValue(new ContentInfo(['published' => true]))); + ->will(self::returnValue(new ContentInfo(['published' => true]))); return [ // ContentInfo, with targets, no access @@ -348,25 +351,25 @@ public function testEvaluate( $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $persistenceMock = $this->getPersistenceMock(); if (empty($persistenceLocations) && $targets !== null) { $persistenceMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); } else { $this->getPersistenceMock() - ->expects($this->once()) + ->expects(self::once()) ->method('locationHandler') - ->will($this->returnValue($this->locationHandlerMock)); + ->will(self::returnValue($this->locationHandlerMock)); $this->locationHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method($object instanceof ContentInfo && $object->published ? 'loadLocationsByContent' : 'loadParentLocationsForDraftContent') ->with($object->id) - ->will($this->returnValue($persistenceLocations)); + ->will(self::returnValue($persistenceLocations)); } $value = $limitationType->evaluate( @@ -433,13 +436,13 @@ public function testEvaluateInvalidArgument( $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $persistenceMock = $this->getPersistenceMock(); $persistenceMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $v = $limitationType->evaluate( $limitation, diff --git a/tests/lib/Limitation/MemberOfLimitationTypeTest.php b/tests/lib/Limitation/MemberOfLimitationTypeTest.php index eaad7bbf5b..5aaea11cc8 100644 --- a/tests/lib/Limitation/MemberOfLimitationTypeTest.php +++ b/tests/lib/Limitation/MemberOfLimitationTypeTest.php @@ -130,7 +130,7 @@ public function testValidateError(MemberOfLimitation $limitation, int $errorCoun ->method('loadContentInfo') ->withConsecutive([14], [18]) ->willReturnOnConsecutiveCalls( - $this->throwException(new NotFoundException('UserGroup', 18)), + self::throwException(new NotFoundException('UserGroup', 18)), new ContentInfo() ); @@ -349,6 +349,7 @@ public function providerForTestEvaluate(): array /** * @param \Ibexa\Core\Repository\Values\User\User|\Ibexa\Core\Repository\Values\User\UserRoleAssignment $object + * * @dataProvider providerForTestEvaluateSelfGroup */ public function testEvaluateSelfGroup( diff --git a/tests/lib/Limitation/NewObjectStateLimitationTypeTest.php b/tests/lib/Limitation/NewObjectStateLimitationTypeTest.php index 616646f92d..c6e3907c88 100644 --- a/tests/lib/Limitation/NewObjectStateLimitationTypeTest.php +++ b/tests/lib/Limitation/NewObjectStateLimitationTypeTest.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\Core\Limitation; use Ibexa\Contracts\Core\Persistence\Content\ObjectState\Handler as SPIHandler; @@ -69,6 +70,7 @@ public function providerForTestAcceptValue() /** * @dataProvider providerForTestAcceptValue + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation\NewObjectStateLimitation $limitation @@ -92,6 +94,7 @@ public function providerForTestAcceptValueException() /** * @dataProvider providerForTestAcceptValueException + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation $limitation @@ -125,13 +128,13 @@ public function testValidatePass(NewObjectStateLimitation $limitation) { if (!empty($limitation->limitationValues)) { $this->getPersistenceMock() - ->expects($this->any()) + ->expects(self::any()) ->method('objectStateHandler') - ->will($this->returnValue($this->objectStateHandlerMock)); + ->will(self::returnValue($this->objectStateHandlerMock)); foreach ($limitation->limitationValues as $key => $value) { $this->objectStateHandlerMock - ->expects($this->at($key)) + ->expects(self::at($key)) ->method('load') ->with($value); } @@ -166,21 +169,21 @@ public function testValidateError(NewObjectStateLimitation $limitation, $errorCo { if (!empty($limitation->limitationValues)) { $this->getPersistenceMock() - ->expects($this->any()) + ->expects(self::any()) ->method('objectStateHandler') - ->will($this->returnValue($this->objectStateHandlerMock)); + ->will(self::returnValue($this->objectStateHandlerMock)); foreach ($limitation->limitationValues as $key => $value) { $this->objectStateHandlerMock - ->expects($this->at($key)) + ->expects(self::at($key)) ->method('load') ->with($value) - ->will($this->throwException(new NotFoundException('contentType', $value))); + ->will(self::throwException(new NotFoundException('contentType', $value))); } } else { $this->getPersistenceMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); } // Need to create inline instead of depending on testConstruct() to get correct mock instance @@ -270,13 +273,13 @@ public function testEvaluate( $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $persistenceMock = $this->getPersistenceMock(); $persistenceMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $value = $limitationType->evaluate( $limitation, @@ -331,13 +334,13 @@ public function testEvaluateInvalidArgument( $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $persistenceMock = $this->getPersistenceMock(); $persistenceMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $v = $limitationType->evaluate( $limitation, diff --git a/tests/lib/Limitation/ObjectStateLimitationTypeTest.php b/tests/lib/Limitation/ObjectStateLimitationTypeTest.php index 3b1273ed90..e4c41c2844 100644 --- a/tests/lib/Limitation/ObjectStateLimitationTypeTest.php +++ b/tests/lib/Limitation/ObjectStateLimitationTypeTest.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\Core\Limitation; use Ibexa\Contracts\Core\Persistence\Content\ObjectState; @@ -185,14 +186,14 @@ public function testEvaluate( ->willReturnMap($getContentStateMap); } else { $this->getPersistenceMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); } $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); // Need to create inline instead of depending on testConstruct() to get correct mock instance $limitationType = $this->testConstruct(); diff --git a/tests/lib/Limitation/ParentContentTypeLimitationTypeTest.php b/tests/lib/Limitation/ParentContentTypeLimitationTypeTest.php index f58c3ebfba..d51bf65168 100644 --- a/tests/lib/Limitation/ParentContentTypeLimitationTypeTest.php +++ b/tests/lib/Limitation/ParentContentTypeLimitationTypeTest.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\Core\Limitation; use Ibexa\Contracts\Core\Persistence\Content\ContentInfo as SPIContentInfo; @@ -83,6 +84,7 @@ public function providerForTestAcceptValue() /** * @dataProvider providerForTestAcceptValue + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation\ParentContentTypeLimitation $limitation @@ -107,6 +109,7 @@ public function providerForTestAcceptValueException() /** * @dataProvider providerForTestAcceptValueException + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation $limitation @@ -140,16 +143,16 @@ public function testValidatePass(ParentContentTypeLimitation $limitation) { if (!empty($limitation->limitationValues)) { $this->getPersistenceMock() - ->expects($this->any()) + ->expects(self::any()) ->method('contentTypeHandler') - ->will($this->returnValue($this->contentTypeHandlerMock)); + ->will(self::returnValue($this->contentTypeHandlerMock)); foreach ($limitation->limitationValues as $key => $value) { $this->contentTypeHandlerMock - ->expects($this->at($key)) + ->expects(self::at($key)) ->method('load') ->with($value) - ->will($this->returnValue(42)); + ->will(self::returnValue(42)); } } @@ -182,21 +185,21 @@ public function testValidateError(ParentContentTypeLimitation $limitation, $erro { if (!empty($limitation->limitationValues)) { $this->getPersistenceMock() - ->expects($this->any()) + ->expects(self::any()) ->method('contentTypeHandler') - ->will($this->returnValue($this->contentTypeHandlerMock)); + ->will(self::returnValue($this->contentTypeHandlerMock)); foreach ($limitation->limitationValues as $key => $value) { $this->contentTypeHandlerMock - ->expects($this->at($key)) + ->expects(self::at($key)) ->method('load') ->with($value) - ->will($this->throwException(new NotFoundException('location', $value))); + ->will(self::throwException(new NotFoundException('location', $value))); } } else { $this->getPersistenceMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); } // Need to create inline instead of depending on testConstruct() to get correct mock instance @@ -226,9 +229,9 @@ protected function getTestEvaluateContentMock() $contentMock = $this->createMock(APIContent::class); $contentMock - ->expects($this->once()) + ->expects(self::once()) ->method('getVersionInfo') - ->will($this->returnValue($this->getTestEvaluateVersionInfoMock())); + ->will(self::returnValue($this->getTestEvaluateVersionInfoMock())); return $contentMock; } @@ -238,9 +241,9 @@ protected function getTestEvaluateVersionInfoMock() $versionInfoMock = $this->createMock(APIVersionInfo::class); $versionInfoMock - ->expects($this->once()) + ->expects(self::once()) ->method('getContentInfo') - ->will($this->returnValue(new ContentInfo(['published' => true]))); + ->will(self::returnValue(new ContentInfo(['published' => true]))); return $versionInfoMock; } @@ -447,15 +450,15 @@ public function providerForTestEvaluate() protected function assertContentHandlerExpectations($callNo, $persistenceCalled, $contentId, $contentInfo) { $this->getPersistenceMock() - ->expects($this->at($callNo + ($persistenceCalled ? 1 : 0))) + ->expects(self::at($callNo + ($persistenceCalled ? 1 : 0))) ->method('contentHandler') - ->will($this->returnValue($this->contentHandlerMock)); + ->will(self::returnValue($this->contentHandlerMock)); $this->contentHandlerMock - ->expects($this->at($callNo)) + ->expects(self::at($callNo)) ->method('loadContentInfo') ->with($contentId) - ->will($this->returnValue($contentInfo)); + ->will(self::returnValue($contentInfo)); } /** @@ -473,33 +476,33 @@ public function testEvaluate( $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $persistenceMock = $this->getPersistenceMock(); // ContentTypeHandler is never used in evaluate() $persistenceMock - ->expects($this->never()) + ->expects(self::never()) ->method('contentTypeHandler'); if (empty($persistence)) { // Covers API targets, where no additional loading is required $persistenceMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); } elseif (!empty($targets)) { foreach ($targets as $index => $target) { if ($target instanceof LocationCreateStruct) { $this->getPersistenceMock() - ->expects($this->once($index)) + ->expects(self::once()) ->method('locationHandler') - ->will($this->returnValue($this->locationHandlerMock)); + ->will(self::returnValue($this->locationHandlerMock)); $this->locationHandlerMock - ->expects($this->at($index)) + ->expects(self::at($index)) ->method('load') ->with($target->parentLocationId) - ->will($this->returnValue($location = $persistence['locations'][$index])); + ->will(self::returnValue($location = $persistence['locations'][$index])); $contentId = $location->contentId; } else { @@ -516,25 +519,25 @@ public function testEvaluate( } else { $this->getPersistenceMock() ->method('locationHandler') - ->will($this->returnValue($this->locationHandlerMock)); + ->will(self::returnValue($this->locationHandlerMock)); $this->getPersistenceMock() ->method('contentHandler') - ->will($this->returnValue($this->contentHandlerMock)); + ->will(self::returnValue($this->contentHandlerMock)); $this->locationHandlerMock ->method( $object instanceof ContentInfo && $object->published ? 'loadLocationsByContent' : 'loadParentLocationsForDraftContent' ) ->with($object->id) - ->will($this->returnValue($persistence['locations'])); + ->will(self::returnValue($persistence['locations'])); foreach ($persistence['locations'] as $location) { if (!empty($persistence['parentLocations'][$location->parentId])) { $this->locationHandlerMock ->method('load') ->with($location->parentId) - ->will($this->returnValue($persistence['parentLocations'][$location->parentId])); + ->will(self::returnValue($persistence['parentLocations'][$location->parentId])); } if (!empty($persistence['parentLocations'][$location->parentId])) { @@ -615,13 +618,13 @@ public function testEvaluateInvalidArgument(Limitation $limitation, ValueObject $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $persistenceMock = $this->getPersistenceMock(); $persistenceMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $limitationType->evaluate( $limitation, @@ -653,7 +656,7 @@ public function testGetCriterionInvalidValue(ParentContentTypeLimitationType $li */ public function testValueSchema(ParentContentTypeLimitationType $limitationType) { - $this->markTestIncomplete('Method is not implemented yet: ' . __METHOD__); + self::markTestIncomplete('Method is not implemented yet: ' . __METHOD__); } } diff --git a/tests/lib/Limitation/ParentDepthLimitationTypeTest.php b/tests/lib/Limitation/ParentDepthLimitationTypeTest.php index 6dc9111334..0f4aa0bb00 100644 --- a/tests/lib/Limitation/ParentDepthLimitationTypeTest.php +++ b/tests/lib/Limitation/ParentDepthLimitationTypeTest.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\Core\Limitation; use Ibexa\Contracts\Core\Persistence\Content\Location\Handler as SPILocationHandler; @@ -68,6 +69,7 @@ public function providerForTestAcceptValue() /** * @dataProvider providerForTestAcceptValue + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation\ParentDepthLimitation $limitation @@ -91,6 +93,7 @@ public function providerForTestAcceptValueException() /** * @dataProvider providerForTestAcceptValueException + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation $limitation @@ -117,6 +120,7 @@ public function providerForTestValidatePass() /** * @dataProvider providerForTestValidatePass + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation\ParentDepthLimitation $limitation @@ -155,21 +159,21 @@ public function providerForTestEvaluate() $versionInfoMock = $this->createMock(APIVersionInfo::class); $contentMock - ->expects($this->once()) + ->expects(self::once()) ->method('getVersionInfo') - ->will($this->returnValue($versionInfoMock)); + ->will(self::returnValue($versionInfoMock)); $versionInfoMock - ->expects($this->once()) + ->expects(self::once()) ->method('getContentInfo') - ->will($this->returnValue(new ContentInfo(['published' => true]))); + ->will(self::returnValue(new ContentInfo(['published' => true]))); $versionInfoMock2 = $this->createMock(APIVersionInfo::class); $versionInfoMock2 - ->expects($this->once()) + ->expects(self::once()) ->method('getContentInfo') - ->will($this->returnValue(new ContentInfo(['published' => true]))); + ->will(self::returnValue(new ContentInfo(['published' => true]))); return [ // ContentInfo, with targets, no access @@ -290,42 +294,42 @@ public function testEvaluate( $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $persistenceMock = $this->getPersistenceMock(); if (empty($persistenceLocations)) { $persistenceMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); } elseif ($object instanceof ContentCreateStruct) { $this->getPersistenceMock() - ->expects($this->once()) + ->expects(self::once()) ->method('locationHandler') - ->will($this->returnValue($this->locationHandlerMock)); + ->will(self::returnValue($this->locationHandlerMock)); foreach ($targets as $target) { $this->locationHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with($target->parentLocationId) - ->will($this->returnValue($persistenceLocations[$target->parentLocationId])); + ->will(self::returnValue($persistenceLocations[$target->parentLocationId])); } } else { $this->getPersistenceMock() - ->expects($this->once()) + ->expects(self::once()) ->method('locationHandler') - ->will($this->returnValue($this->locationHandlerMock)); + ->will(self::returnValue($this->locationHandlerMock)); $this->locationHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method( $object instanceof ContentInfo && $object->published ? 'loadLocationsByContent' : 'loadParentLocationsForDraftContent' ) ->with($object->id) - ->will($this->returnValue($persistenceLocations)); + ->will(self::returnValue($persistenceLocations)); } $value = $limitationType->evaluate( @@ -392,13 +396,13 @@ public function testEvaluateInvalidArgument( $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $persistenceMock = $this->getPersistenceMock(); $persistenceMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $v = $limitationType->evaluate( $limitation, diff --git a/tests/lib/Limitation/RoleLimitationTypeTest.php b/tests/lib/Limitation/RoleLimitationTypeTest.php index 1ee992769f..ea6035ea61 100644 --- a/tests/lib/Limitation/RoleLimitationTypeTest.php +++ b/tests/lib/Limitation/RoleLimitationTypeTest.php @@ -144,7 +144,7 @@ public function testValidateError(UserRoleLimitation $limitation, int $errorCoun ->method('loadRole') ->withConsecutive([4, Role::STATUS_DEFINED], [8, Role::STATUS_DEFINED]) ->willReturnOnConsecutiveCalls( - $this->throwException(new NotFoundException('Role', 4)), + self::throwException(new NotFoundException('Role', 4)), new Role() ); diff --git a/tests/lib/Limitation/SectionLimitationTypeTest.php b/tests/lib/Limitation/SectionLimitationTypeTest.php index ef0967c57d..8151ab3cf9 100644 --- a/tests/lib/Limitation/SectionLimitationTypeTest.php +++ b/tests/lib/Limitation/SectionLimitationTypeTest.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Type as LimitationType; @@ -74,6 +75,7 @@ public function providerForTestAcceptValue() /** * @dataProvider providerForTestAcceptValue + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation\SectionLimitation $limitation @@ -100,6 +102,7 @@ public function providerForTestAcceptValueException() /** * @dataProvider providerForTestAcceptValueException + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation $limitation @@ -133,17 +136,17 @@ public function testValidatePass(SectionLimitation $limitation) { if (!empty($limitation->limitationValues)) { $this->getPersistenceMock() - ->expects($this->any()) + ->expects(self::any()) ->method('sectionHandler') - ->will($this->returnValue($this->sectionHandlerMock)); + ->will(self::returnValue($this->sectionHandlerMock)); foreach ($limitation->limitationValues as $key => $value) { $this->sectionHandlerMock - ->expects($this->at($key)) + ->expects(self::at($key)) ->method('load') ->with($value) ->will( - $this->returnValue( + self::returnValue( new SPISection(['id' => $value]) ) ); @@ -179,21 +182,21 @@ public function testValidateError(SectionLimitation $limitation, $errorCount) { if (!empty($limitation->limitationValues)) { $this->getPersistenceMock() - ->expects($this->any()) + ->expects(self::any()) ->method('sectionHandler') - ->will($this->returnValue($this->sectionHandlerMock)); + ->will(self::returnValue($this->sectionHandlerMock)); foreach ($limitation->limitationValues as $key => $value) { $this->sectionHandlerMock - ->expects($this->at($key)) + ->expects(self::at($key)) ->method('load') ->with($value) - ->will($this->throwException(new NotFoundException('Section', $value))); + ->will(self::throwException(new NotFoundException('Section', $value))); } } else { $this->getPersistenceMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); } // Need to create inline instead of depending on testConstruct() to get correct mock instance @@ -228,21 +231,21 @@ public function providerForTestEvaluate() $versionInfoMock = $this->createMock(APIVersionInfo::class); $contentMock - ->expects($this->once()) + ->expects(self::once()) ->method('getVersionInfo') - ->will($this->returnValue($versionInfoMock)); + ->will(self::returnValue($versionInfoMock)); $versionInfoMock - ->expects($this->once()) + ->expects(self::once()) ->method('getContentInfo') - ->will($this->returnValue(new ContentInfo(['sectionId' => 2]))); + ->will(self::returnValue(new ContentInfo(['sectionId' => 2]))); $versionInfoMock2 = $this->createMock(APIVersionInfo::class); $versionInfoMock2 - ->expects($this->once()) + ->expects(self::once()) ->method('getContentInfo') - ->will($this->returnValue(new ContentInfo(['sectionId' => 2]))); + ->will(self::returnValue(new ContentInfo(['sectionId' => 2]))); return [ // ContentInfo, with targets, no access @@ -360,12 +363,12 @@ public function testEvaluate( $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $this->getPersistenceMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $value = $limitationType->evaluate( $limitation, @@ -407,12 +410,12 @@ public function testEvaluateInvalidArgument( $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $this->getPersistenceMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $v = $limitationType->evaluate( $limitation, diff --git a/tests/lib/Limitation/SiteAccessLimitationTypeTest.php b/tests/lib/Limitation/SiteAccessLimitationTypeTest.php index c6d65fb3a8..e62d4bbb96 100644 --- a/tests/lib/Limitation/SiteAccessLimitationTypeTest.php +++ b/tests/lib/Limitation/SiteAccessLimitationTypeTest.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\Core\Limitation; use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException; @@ -81,6 +82,7 @@ public function providerForTestAcceptValue() /** * @depends testConstruct + * * @dataProvider providerForTestAcceptValue * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation\SiteAccessLimitation $limitation @@ -104,6 +106,7 @@ public function providerForTestAcceptValueException() /** * @depends testConstruct + * * @dataProvider providerForTestAcceptValueException * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation $limitation @@ -161,6 +164,7 @@ public function providerForTestValidateError() /** * @dataProvider providerForTestValidateError + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation\SiteAccessLimitation $limitation @@ -217,6 +221,7 @@ public function providerForTestEvaluate() /** * @depends testConstruct + * * @dataProvider providerForTestEvaluate */ public function testEvaluate( @@ -226,7 +231,7 @@ public function testEvaluate( SiteAccessLimitationType $limitationType ) { $userMock = $this->getUserMock(); - $userMock->expects($this->never())->method($this->anything()); + $userMock->expects(self::never())->method(self::anything()); $value = $limitationType->evaluate( $limitation, @@ -259,6 +264,7 @@ public function providerForTestEvaluateInvalidArgument() /** * @depends testConstruct + * * @dataProvider providerForTestEvaluateInvalidArgument */ public function testEvaluateInvalidArgument( @@ -269,7 +275,7 @@ public function testEvaluateInvalidArgument( $this->expectException(InvalidArgumentException::class); $userMock = $this->getUserMock(); - $userMock->expects($this->never())->method($this->anything()); + $userMock->expects(self::never())->method(self::anything()); $limitationType->evaluate( $limitation, diff --git a/tests/lib/Limitation/StatusLimitationTypeTest.php b/tests/lib/Limitation/StatusLimitationTypeTest.php index e4ba35d9ee..983611d0d9 100644 --- a/tests/lib/Limitation/StatusLimitationTypeTest.php +++ b/tests/lib/Limitation/StatusLimitationTypeTest.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\Core\Limitation; use Ibexa\Contracts\Core\Persistence\Content\VersionInfo as SPIVersionInfo; @@ -56,6 +57,7 @@ public function providerForTestAcceptValue() /** * @depends testConstruct + * * @dataProvider providerForTestAcceptValue * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation\StatusLimitation $limitation @@ -79,6 +81,7 @@ public function providerForTestAcceptValueException() /** * @depends testConstruct + * * @dataProvider providerForTestAcceptValueException * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation $limitation @@ -147,6 +150,7 @@ public function providerForTestValidateError() /** * @dataProvider providerForTestValidateError + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation\StatusLimitation $limitation @@ -183,13 +187,13 @@ protected function getVersionInfoMock($shouldBeCalled = true) if ($shouldBeCalled) { $versionInfoMock - ->expects($this->once()) + ->expects(self::once()) ->method('__get') ->with('status') - ->will($this->returnValue(24)); + ->will(self::returnValue(24)); } else { $versionInfoMock - ->expects($this->never()) + ->expects(self::never()) ->method('__get') ->with('status'); } @@ -205,9 +209,9 @@ protected function getContentMock() ->getMock(); $contentMock - ->expects($this->once()) + ->expects(self::once()) ->method('getVersionInfo') - ->will($this->returnValue($this->getVersionInfoMock())); + ->will(self::returnValue($this->getVersionInfoMock())); return $contentMock; } @@ -259,6 +263,7 @@ public function providerForTestEvaluate() /** * @depends testConstruct + * * @dataProvider providerForTestEvaluate */ public function testEvaluate( @@ -268,8 +273,8 @@ public function testEvaluate( StatusLimitationType $limitationType ) { $userMock = $this->getUserMock(); - $userMock->expects($this->never()) - ->method($this->anything()); + $userMock->expects(self::never()) + ->method(self::anything()); $userMock = new User(); $value = $limitationType->evaluate( @@ -308,6 +313,7 @@ public function providerForTestEvaluateInvalidArgument() /** * @depends testConstruct + * * @dataProvider providerForTestEvaluateInvalidArgument */ public function testEvaluateInvalidArgument( @@ -318,7 +324,7 @@ public function testEvaluateInvalidArgument( $this->expectException(InvalidArgumentException::class); $userMock = $this->getUserMock(); - $userMock->expects($this->never())->method($this->anything()); + $userMock->expects(self::never())->method(self::anything()); $userMock = new User(); $limitationType->evaluate( diff --git a/tests/lib/Limitation/SubtreeLimitationTypeTest.php b/tests/lib/Limitation/SubtreeLimitationTypeTest.php index a75e17330a..eaeed389f6 100644 --- a/tests/lib/Limitation/SubtreeLimitationTypeTest.php +++ b/tests/lib/Limitation/SubtreeLimitationTypeTest.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\Core\Limitation; use Ibexa\Contracts\Core\Limitation\Type as LimitationType; @@ -74,6 +75,7 @@ public function providerForTestAcceptValue() /** * @dataProvider providerForTestAcceptValue + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation\SubtreeLimitation $limitation @@ -100,6 +102,7 @@ public function providerForTestAcceptValueException() /** * @dataProvider providerForTestAcceptValueException + * * @depends testConstruct * * @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation $limitation @@ -133,18 +136,18 @@ public function testValidatePass(SubtreeLimitation $limitation) { if (!empty($limitation->limitationValues)) { $this->getPersistenceMock() - ->expects($this->any()) + ->expects(self::any()) ->method('locationHandler') - ->will($this->returnValue($this->locationHandlerMock)); + ->will(self::returnValue($this->locationHandlerMock)); foreach ($limitation->limitationValues as $key => $value) { $pathArray = explode('/', trim($value, '/')); $this->locationHandlerMock - ->expects($this->at($key)) + ->expects(self::at($key)) ->method('load') ->with(end($pathArray)) ->will( - $this->returnValue( + self::returnValue( new SPILocation(['pathString' => $value]) ) ); @@ -180,22 +183,22 @@ public function testValidateError(SubtreeLimitation $limitation, $errorCount) { if (!empty($limitation->limitationValues)) { $this->getPersistenceMock() - ->expects($this->any()) + ->expects(self::any()) ->method('locationHandler') - ->will($this->returnValue($this->locationHandlerMock)); + ->will(self::returnValue($this->locationHandlerMock)); foreach ($limitation->limitationValues as $key => $value) { $pathArray = explode('/', trim($value, '/')); $this->locationHandlerMock - ->expects($this->at($key)) + ->expects(self::at($key)) ->method('load') ->with(end($pathArray)) - ->will($this->throwException(new NotFoundException('location', $value))); + ->will(self::throwException(new NotFoundException('location', $value))); } } else { $this->getPersistenceMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); } // Need to create inline instead of depending on testConstruct() to get correct mock instance @@ -210,18 +213,18 @@ public function testValidateErrorWrongPath() $limitation = new SubtreeLimitation(['limitationValues' => ['/1/2/42/']]); $this->getPersistenceMock() - ->expects($this->any()) + ->expects(self::any()) ->method('locationHandler') - ->will($this->returnValue($this->locationHandlerMock)); + ->will(self::returnValue($this->locationHandlerMock)); foreach ($limitation->limitationValues as $key => $value) { $pathArray = explode('/', trim($value, '/')); $this->locationHandlerMock - ->expects($this->at($key)) + ->expects(self::at($key)) ->method('load') ->with(end($pathArray)) ->will( - $this->returnValue( + self::returnValue( new SPILocation(['pathString' => '/1/5/42']) ) ); @@ -259,19 +262,19 @@ public function providerForTestEvaluate() $versionInfoMock = $this->createMock(APIVersionInfo::class); $contentMock - ->expects($this->once()) + ->expects(self::once()) ->method('getVersionInfo') - ->will($this->returnValue($versionInfoMock)); + ->will(self::returnValue($versionInfoMock)); $versionInfoMock - ->expects($this->once()) + ->expects(self::once()) ->method('getContentInfo') ->willReturn(new ContentInfo(['published' => true, 'status' => ContentInfo::STATUS_PUBLISHED])); $versionInfoMock2 = $this->createMock(APIVersionInfo::class); $versionInfoMock2 - ->expects($this->once()) + ->expects(self::once()) ->method('getContentInfo') ->willReturn(new ContentInfo(['published' => true, 'status' => ContentInfo::STATUS_PUBLISHED])); @@ -406,38 +409,38 @@ public function testEvaluate( $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $persistenceMock = $this->getPersistenceMock(); if (empty($persistenceLocations) && $targets !== null) { $persistenceMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); } elseif ($object instanceof ContentCreateStruct) { foreach ((array)$targets as $key => $target) { $this->getPersistenceMock() - ->expects($this->at($key)) + ->expects(self::at($key)) ->method('locationHandler') - ->will($this->returnValue($this->locationHandlerMock)); + ->will(self::returnValue($this->locationHandlerMock)); $this->locationHandlerMock - ->expects($this->at($key)) + ->expects(self::at($key)) ->method('load') ->with($target->parentLocationId) - ->will($this->returnValue($persistenceLocations[$key])); + ->will(self::returnValue($persistenceLocations[$key])); } } else { $this->getPersistenceMock() - ->expects($this->once()) + ->expects(self::once()) ->method('locationHandler') - ->will($this->returnValue($this->locationHandlerMock)); + ->will(self::returnValue($this->locationHandlerMock)); $this->locationHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method($object instanceof ContentInfo && $object->published ? 'loadLocationsByContent' : 'loadParentLocationsForDraftContent') ->with($object->id) - ->will($this->returnValue($persistenceLocations)); + ->will(self::returnValue($persistenceLocations)); } $value = $limitationType->evaluate( @@ -489,13 +492,13 @@ public function testEvaluateInvalidArgument( $userMock = $this->getUserMock(); $userMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $persistenceMock = $this->getPersistenceMock(); $persistenceMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $v = $limitationType->evaluate( $limitation, diff --git a/tests/lib/MVC/Symfony/Component/Serializer/CompoundMatcherNormalizerTest.php b/tests/lib/MVC/Symfony/Component/Serializer/CompoundMatcherNormalizerTest.php index 49d56afb87..a24608e804 100644 --- a/tests/lib/MVC/Symfony/Component/Serializer/CompoundMatcherNormalizerTest.php +++ b/tests/lib/MVC/Symfony/Component/Serializer/CompoundMatcherNormalizerTest.php @@ -30,7 +30,7 @@ public function testNormalization(): void $normalizer = new CompoundMatcherNormalizer(); $normalizer->setSerializer(new SerializerStub()); - $this->assertEquals( + self::assertEquals( [ 'subMatchers' => [ 'foo' => ['data' => 'foo'], @@ -48,8 +48,8 @@ public function testSupportsNormalization(): void { $normalizer = new CompoundMatcherNormalizer(); - $this->assertTrue($normalizer->supportsNormalization($this->createMock(Compound::class))); - $this->assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); + self::assertTrue($normalizer->supportsNormalization($this->createMock(Compound::class))); + self::assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); } public function testSupportsDenormalization(): void @@ -66,8 +66,8 @@ public function testSupportsDenormalization(): void ] ); - $this->assertTrue($normalizer->supportsDenormalization($data, Compound::class, 'json')); - $this->assertFalse($normalizer->supportsDenormalization($data, Matcher::class, 'json')); + self::assertTrue($normalizer->supportsDenormalization($data, Compound::class, 'json')); + self::assertFalse($normalizer->supportsDenormalization($data, Matcher::class, 'json')); } } diff --git a/tests/lib/MVC/Symfony/Component/Serializer/HostElementNormalizerTest.php b/tests/lib/MVC/Symfony/Component/Serializer/HostElementNormalizerTest.php index e409df5a27..0776b76a4c 100644 --- a/tests/lib/MVC/Symfony/Component/Serializer/HostElementNormalizerTest.php +++ b/tests/lib/MVC/Symfony/Component/Serializer/HostElementNormalizerTest.php @@ -27,7 +27,7 @@ public function testNormalization(): void $matcher->setRequest(SimplifiedRequest::fromUrl('http://ibexa.dev/foo/bar')); $matcher->match(); - $this->assertEquals( + self::assertEquals( [ 'elementNumber' => 2, 'hostElements' => [ @@ -43,8 +43,8 @@ public function testSupportsNormalization(): void { $normalizer = new HostElementNormalizer(); - $this->assertTrue($normalizer->supportsNormalization($this->createMock(HostElement::class))); - $this->assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); + self::assertTrue($normalizer->supportsNormalization($this->createMock(HostElement::class))); + self::assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); } } diff --git a/tests/lib/MVC/Symfony/Component/Serializer/HostTextNormalizerTest.php b/tests/lib/MVC/Symfony/Component/Serializer/HostTextNormalizerTest.php index ad91c6160b..14efcbde0a 100644 --- a/tests/lib/MVC/Symfony/Component/Serializer/HostTextNormalizerTest.php +++ b/tests/lib/MVC/Symfony/Component/Serializer/HostTextNormalizerTest.php @@ -26,7 +26,7 @@ public function testNormalize(): void 'suffix' => 'bar', ]); - $this->assertEquals( + self::assertEquals( [ 'siteAccessesConfiguration' => [ 'prefix' => 'foo', @@ -41,8 +41,8 @@ public function testSupportsNormalization(): void { $normalizer = new HostTextNormalizer(); - $this->assertTrue($normalizer->supportsNormalization($this->createMock(HostText::class))); - $this->assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); + self::assertTrue($normalizer->supportsNormalization($this->createMock(HostText::class))); + self::assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); } } diff --git a/tests/lib/MVC/Symfony/Component/Serializer/MapNormalizerTest.php b/tests/lib/MVC/Symfony/Component/Serializer/MapNormalizerTest.php index 17ab5c2961..5fde547816 100644 --- a/tests/lib/MVC/Symfony/Component/Serializer/MapNormalizerTest.php +++ b/tests/lib/MVC/Symfony/Component/Serializer/MapNormalizerTest.php @@ -22,7 +22,7 @@ public function testNormalization(): void $matcher = $this->createMock(MapMatcher::class); $matcher->method('getMapKey')->willReturn('foo'); - $this->assertEquals( + self::assertEquals( [ 'key' => 'foo', 'map' => [], @@ -36,8 +36,8 @@ public function testSupportsNormalization(): void { $normalizer = new MapNormalizer(); - $this->assertTrue($normalizer->supportsNormalization($this->createMock(MapMatcher::class))); - $this->assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); + self::assertTrue($normalizer->supportsNormalization($this->createMock(MapMatcher::class))); + self::assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); } } diff --git a/tests/lib/MVC/Symfony/Component/Serializer/RegexHostNormalizerTest.php b/tests/lib/MVC/Symfony/Component/Serializer/RegexHostNormalizerTest.php index eff32ba5cd..d92bc14f35 100644 --- a/tests/lib/MVC/Symfony/Component/Serializer/RegexHostNormalizerTest.php +++ b/tests/lib/MVC/Symfony/Component/Serializer/RegexHostNormalizerTest.php @@ -26,7 +26,7 @@ public function testNormalize(): void 'itemNumber' => 2, ]); - $this->assertEquals( + self::assertEquals( [ 'siteAccessesConfiguration' => [ 'regex' => '/^Foo(.*)/(.*)/', @@ -41,8 +41,8 @@ public function testSupportsNormalization(): void { $normalizer = new RegexHostNormalizer(); - $this->assertTrue($normalizer->supportsNormalization($this->createMock(Host::class))); - $this->assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); + self::assertTrue($normalizer->supportsNormalization($this->createMock(Host::class))); + self::assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); } } diff --git a/tests/lib/MVC/Symfony/Component/Serializer/RegexNormalizerTest.php b/tests/lib/MVC/Symfony/Component/Serializer/RegexNormalizerTest.php index 9fbe7c7f23..86f219ab02 100644 --- a/tests/lib/MVC/Symfony/Component/Serializer/RegexNormalizerTest.php +++ b/tests/lib/MVC/Symfony/Component/Serializer/RegexNormalizerTest.php @@ -21,7 +21,7 @@ public function testNormalize(): void $normalizer = new RegexNormalizer(); $matcher = new RegexMatcherStub('/^Foo(.*)/(.*)/', 2); - $this->assertEquals( + self::assertEquals( [ 'regex' => '/^Foo(.*)/(.*)/', 'itemNumber' => 2, @@ -35,8 +35,8 @@ public function testSupportsNormalization(): void { $normalizer = new RegexNormalizer(); - $this->assertTrue($normalizer->supportsNormalization($this->createMock(RegexMatcher::class))); - $this->assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); + self::assertTrue($normalizer->supportsNormalization($this->createMock(RegexMatcher::class))); + self::assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); } } diff --git a/tests/lib/MVC/Symfony/Component/Serializer/RegexURINormalizerTest.php b/tests/lib/MVC/Symfony/Component/Serializer/RegexURINormalizerTest.php index f9a45dbd8c..5009dd65f3 100644 --- a/tests/lib/MVC/Symfony/Component/Serializer/RegexURINormalizerTest.php +++ b/tests/lib/MVC/Symfony/Component/Serializer/RegexURINormalizerTest.php @@ -26,7 +26,7 @@ public function testNormalize(): void 'itemNumber' => 2, ]); - $this->assertEquals( + self::assertEquals( [ 'siteAccessesConfiguration' => [ 'regex' => '/^Foo(.*)/(.*)/', @@ -41,8 +41,8 @@ public function testSupportsNormalization(): void { $normalizer = new RegexURINormalizer(); - $this->assertTrue($normalizer->supportsNormalization($this->createMock(URI::class))); - $this->assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); + self::assertTrue($normalizer->supportsNormalization($this->createMock(URI::class))); + self::assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); } } diff --git a/tests/lib/MVC/Symfony/Component/Serializer/SimplifiedRequestNormalizerTest.php b/tests/lib/MVC/Symfony/Component/Serializer/SimplifiedRequestNormalizerTest.php index 2c7d02b775..5af03990dc 100644 --- a/tests/lib/MVC/Symfony/Component/Serializer/SimplifiedRequestNormalizerTest.php +++ b/tests/lib/MVC/Symfony/Component/Serializer/SimplifiedRequestNormalizerTest.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\Core\MVC\Symfony\Component\Serializer; use Ibexa\Core\MVC\Symfony\Component\Serializer\SimplifiedRequestNormalizer; @@ -34,7 +35,7 @@ public function testNormalize() $normalizer = new SimplifiedRequestNormalizer(); - $this->assertEquals([ + self::assertEquals([ 'scheme' => 'http', 'host' => 'www.example.com', 'port' => 8080, @@ -49,8 +50,8 @@ public function testSupportsNormalization() { $normalizer = new SimplifiedRequestNormalizer(); - $this->assertTrue($normalizer->supportsNormalization(new SimplifiedRequest())); - $this->assertFalse($normalizer->supportsNormalization(new stdClass())); + self::assertTrue($normalizer->supportsNormalization(new SimplifiedRequest())); + self::assertFalse($normalizer->supportsNormalization(new stdClass())); } } diff --git a/tests/lib/MVC/Symfony/Component/Serializer/Stubs/SerializerStub.php b/tests/lib/MVC/Symfony/Component/Serializer/Stubs/SerializerStub.php index d76cf9f15b..d5eee0133a 100644 --- a/tests/lib/MVC/Symfony/Component/Serializer/Stubs/SerializerStub.php +++ b/tests/lib/MVC/Symfony/Component/Serializer/Stubs/SerializerStub.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\Core\MVC\Symfony\Component\Serializer\Stubs; use Ibexa\Contracts\Core\Repository\Exceptions\NotImplementedException; diff --git a/tests/lib/MVC/Symfony/Component/Serializer/URIElementNormalizerTest.php b/tests/lib/MVC/Symfony/Component/Serializer/URIElementNormalizerTest.php index 3bf5477672..abe0694fc4 100644 --- a/tests/lib/MVC/Symfony/Component/Serializer/URIElementNormalizerTest.php +++ b/tests/lib/MVC/Symfony/Component/Serializer/URIElementNormalizerTest.php @@ -27,7 +27,7 @@ public function testNormalization(): void $matcher->setRequest(SimplifiedRequest::fromUrl('http://ezpublish.dev/foo/bar')); $matcher->match(); - $this->assertEquals( + self::assertEquals( [ 'elementNumber' => 2, 'uriElements' => ['foo', 'bar'], @@ -40,8 +40,8 @@ public function testSupportsNormalization(): void { $normalizer = new URIElementNormalizer(); - $this->assertTrue($normalizer->supportsNormalization($this->createMock(URIElement::class))); - $this->assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); + self::assertTrue($normalizer->supportsNormalization($this->createMock(URIElement::class))); + self::assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); } } diff --git a/tests/lib/MVC/Symfony/Component/Serializer/URITextNormalizerTest.php b/tests/lib/MVC/Symfony/Component/Serializer/URITextNormalizerTest.php index d1a4b77786..1c778a2f1f 100644 --- a/tests/lib/MVC/Symfony/Component/Serializer/URITextNormalizerTest.php +++ b/tests/lib/MVC/Symfony/Component/Serializer/URITextNormalizerTest.php @@ -26,7 +26,7 @@ public function testNormalize(): void 'suffix' => 'bar', ]); - $this->assertEquals( + self::assertEquals( [ 'siteAccessesConfiguration' => [ 'prefix' => 'foo', @@ -41,8 +41,8 @@ public function testSupportsNormalization(): void { $normalizer = new URITextNormalizer(); - $this->assertTrue($normalizer->supportsNormalization($this->createMock(URIText::class))); - $this->assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); + self::assertTrue($normalizer->supportsNormalization($this->createMock(URIText::class))); + self::assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class))); } } diff --git a/tests/lib/MVC/Symfony/Controller/ControllerTest.php b/tests/lib/MVC/Symfony/Controller/ControllerTest.php index 7b552e7fc6..0968b6687f 100644 --- a/tests/lib/MVC/Symfony/Controller/ControllerTest.php +++ b/tests/lib/MVC/Symfony/Controller/ControllerTest.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\Core\MVC\Symfony\Controller; use Ibexa\Core\MVC\Symfony\Controller\Controller; @@ -35,10 +36,10 @@ protected function setUp(): void $this->controller = $this->getMockForAbstractClass(Controller::class); $this->controller->setContainer($this->containerMock); $this->containerMock - ->expects($this->any()) + ->expects(self::any()) ->method('get') ->with('templating') - ->will($this->returnValue($this->templateEngineMock)); + ->will(self::returnValue($this->templateEngineMock)); } public function testRender() @@ -47,10 +48,10 @@ public function testRender() $params = ['foo' => 'bar', 'truc' => 'muche']; $tplResult = "I'm a template result"; $this->templateEngineMock - ->expects($this->once()) + ->expects(self::once()) ->method('render') ->with($view, $params) - ->will($this->returnValue($tplResult)); + ->will(self::returnValue($tplResult)); $response = $this->controller->render($view, $params); self::assertInstanceOf(Response::class, $response); self::assertSame($tplResult, $response->getContent()); @@ -63,10 +64,10 @@ public function testRenderWithResponse() $params = ['foo' => 'bar', 'truc' => 'muche']; $tplResult = "I'm a template result"; $this->templateEngineMock - ->expects($this->once()) + ->expects(self::once()) ->method('render') ->with($view, $params) - ->will($this->returnValue($tplResult)); + ->will(self::returnValue($tplResult)); self::assertSame($response, $this->controller->render($view, $params, $response)); self::assertSame($tplResult, $response->getContent()); diff --git a/tests/lib/MVC/Symfony/Controller/QueryRenderControllerTest.php b/tests/lib/MVC/Symfony/Controller/QueryRenderControllerTest.php index 1e82471efe..60577376b1 100644 --- a/tests/lib/MVC/Symfony/Controller/QueryRenderControllerTest.php +++ b/tests/lib/MVC/Symfony/Controller/QueryRenderControllerTest.php @@ -129,7 +129,7 @@ private function assertRenderQueryResult( array $options, Request $request = null ): void { - $this->assertEquals( + self::assertEquals( $expectedView, $this->controller->renderQuery( $request ?? new Request(), diff --git a/tests/lib/MVC/Symfony/ErrorHandler/Php82HideDeprecationsErrorHandlerTest.php b/tests/lib/MVC/Symfony/ErrorHandler/Php82HideDeprecationsErrorHandlerTest.php index d66552b029..2a359e2b98 100644 --- a/tests/lib/MVC/Symfony/ErrorHandler/Php82HideDeprecationsErrorHandlerTest.php +++ b/tests/lib/MVC/Symfony/ErrorHandler/Php82HideDeprecationsErrorHandlerTest.php @@ -34,7 +34,7 @@ public function testRegisterDebug(): void Php82HideDeprecationsErrorHandler::register(true); $errorReporting = error_reporting(); - $this->assertSame(E_ALL & ~E_DEPRECATED, $errorReporting); + self::assertSame(E_ALL & ~E_DEPRECATED, $errorReporting); } public function testRegisterNoDebug(): void @@ -42,6 +42,6 @@ public function testRegisterNoDebug(): void Php82HideDeprecationsErrorHandler::register(false); $errorReporting = error_reporting(); - $this->assertSame(E_ALL & ~E_DEPRECATED, $errorReporting); + self::assertSame(E_ALL & ~E_DEPRECATED, $errorReporting); } } diff --git a/tests/lib/MVC/Symfony/Event/ContentCacheClearEventTest.php b/tests/lib/MVC/Symfony/Event/ContentCacheClearEventTest.php index 55a973dfb6..0d60df20aa 100644 --- a/tests/lib/MVC/Symfony/Event/ContentCacheClearEventTest.php +++ b/tests/lib/MVC/Symfony/Event/ContentCacheClearEventTest.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\Core\MVC\Symfony\Event; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; @@ -17,7 +18,7 @@ public function testConstruct() { $contentInfo = new ContentInfo(); $event = new ContentCacheClearEvent($contentInfo); - $this->assertSame($contentInfo, $event->getContentInfo()); + self::assertSame($contentInfo, $event->getContentInfo()); } public function testAddLocationsToClear() @@ -28,7 +29,7 @@ public function testAddLocationsToClear() $event->addLocationToClear($locations[0]); $event->addLocationToClear($locations[1]); - $this->assertSame($locations, $event->getLocationsToClear()); + self::assertSame($locations, $event->getLocationsToClear()); } public function setLocationsToClear() @@ -38,11 +39,11 @@ public function setLocationsToClear() $initialLocations = [new Location(), new Location()]; $event->addLocationToClear($initialLocations[0]); $event->addLocationToClear($initialLocations[1]); - $this->assertSame($initialLocations, $event->getLocationsToClear()); + self::assertSame($initialLocations, $event->getLocationsToClear()); $otherLocations = [new Location(), new Location()]; $event->setLocationsToClear($otherLocations); - $this->assertSame($otherLocations, $event->getLocationsToClear()); + self::assertSame($otherLocations, $event->getLocationsToClear()); } } diff --git a/tests/lib/MVC/Symfony/Event/InteractiveLoginEventTest.php b/tests/lib/MVC/Symfony/Event/InteractiveLoginEventTest.php index 4dc8adadf2..a6a3c3223f 100644 --- a/tests/lib/MVC/Symfony/Event/InteractiveLoginEventTest.php +++ b/tests/lib/MVC/Symfony/Event/InteractiveLoginEventTest.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\Core\MVC\Symfony\Event; use Ibexa\Contracts\Core\Repository\Values\User\User; @@ -17,11 +18,11 @@ class InteractiveLoginEventTest extends TestCase public function testGetSetAPIUser() { $event = new InteractiveLoginEvent(new Request(), $this->createMock(TokenInterface::class)); - $this->assertFalse($event->hasAPIUser()); + self::assertFalse($event->hasAPIUser()); $apiUser = $this->createMock(User::class); $event->setApiUser($apiUser); - $this->assertTrue($event->hasAPIUser()); - $this->assertSame($apiUser, $event->getAPIUser()); + self::assertTrue($event->hasAPIUser()); + self::assertSame($apiUser, $event->getAPIUser()); } } diff --git a/tests/lib/MVC/Symfony/Event/RouteReferenceGenerationEventTest.php b/tests/lib/MVC/Symfony/Event/RouteReferenceGenerationEventTest.php index d9f3dda9f1..649a99ea9b 100644 --- a/tests/lib/MVC/Symfony/Event/RouteReferenceGenerationEventTest.php +++ b/tests/lib/MVC/Symfony/Event/RouteReferenceGenerationEventTest.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\Core\MVC\Symfony\Event; use Ibexa\Core\MVC\Symfony\Event\RouteReferenceGenerationEvent; @@ -18,8 +19,8 @@ public function testConstruct() $routeReference = new RouteReference('foo'); $request = new Request(); $event = new RouteReferenceGenerationEvent($routeReference, $request); - $this->assertSame($routeReference, $event->getRouteReference()); - $this->assertSame($request, $event->getRequest()); + self::assertSame($routeReference, $event->getRouteReference()); + self::assertSame($request, $event->getRequest()); } public function testGetSet() @@ -28,12 +29,12 @@ public function testGetSet() $request = new Request(); $event = new RouteReferenceGenerationEvent($routeReference, $request); - $this->assertSame($routeReference, $event->getRouteReference()); - $this->assertSame($request, $event->getRequest()); + self::assertSame($routeReference, $event->getRouteReference()); + self::assertSame($request, $event->getRequest()); $newRouteReference = new RouteReference('bar'); $event->setRouteReference($newRouteReference); - $this->assertSame($newRouteReference, $event->getRouteReference()); + self::assertSame($newRouteReference, $event->getRouteReference()); } } diff --git a/tests/lib/MVC/Symfony/Event/ScopeChangeEventTest.php b/tests/lib/MVC/Symfony/Event/ScopeChangeEventTest.php index 704c0d3aa3..b7a4fe5b5e 100644 --- a/tests/lib/MVC/Symfony/Event/ScopeChangeEventTest.php +++ b/tests/lib/MVC/Symfony/Event/ScopeChangeEventTest.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\Core\MVC\Symfony\Event; use Ibexa\Core\MVC\Symfony\Event\ScopeChangeEvent; @@ -16,7 +17,7 @@ public function testGetSiteAccess() { $siteAccess = new SiteAccess('foo', 'test'); $event = new ScopeChangeEvent($siteAccess); - $this->assertSame($siteAccess, $event->getSiteAccess()); + self::assertSame($siteAccess, $event->getSiteAccess()); } } diff --git a/tests/lib/MVC/Symfony/EventListener/ContentViewTwigVariablesSubscriberTest.php b/tests/lib/MVC/Symfony/EventListener/ContentViewTwigVariablesSubscriberTest.php index c7e16f4d6e..be3ac12a27 100644 --- a/tests/lib/MVC/Symfony/EventListener/ContentViewTwigVariablesSubscriberTest.php +++ b/tests/lib/MVC/Symfony/EventListener/ContentViewTwigVariablesSubscriberTest.php @@ -82,7 +82,7 @@ public function testWithoutVariables(): void $event = new PreContentViewEvent($view); $view - ->expects($this->once()) + ->expects(self::once()) ->method('setParameters') ->with([]); @@ -105,7 +105,7 @@ public function testWithScalarVariables(): void ]); $view - ->expects($this->once()) + ->expects(self::once()) ->method('setParameters') ->with([ 'param_1' => 'scalar_1', @@ -136,7 +136,7 @@ public function testOverwriteVariables(): void ]); $view - ->expects($this->once()) + ->expects(self::once()) ->method('setParameters') ->with([ 'param_1' => 'scalar_1', @@ -167,7 +167,7 @@ public function testWithExpressionParam(): void ]); $view - ->expects($this->once()) + ->expects(self::once()) ->method('setParameters') ->with([ 'random_number' => $randomNumber, @@ -204,7 +204,7 @@ public function testWithNestedParamsAndExpressions(): void ]); $view - ->expects($this->once()) + ->expects(self::once()) ->method('setParameters') ->with([ 'some_number' => $someNumber, @@ -236,7 +236,7 @@ public function testWithProviderExpression(): void ]); $view - ->expects($this->once()) + ->expects(self::once()) ->method('setParameters') ->with([ 'example' => 'test_provider_value', diff --git a/tests/lib/MVC/Symfony/EventListener/LanguageSwitchListenerTest.php b/tests/lib/MVC/Symfony/EventListener/LanguageSwitchListenerTest.php index dcadba49f0..ae4a33f737 100644 --- a/tests/lib/MVC/Symfony/EventListener/LanguageSwitchListenerTest.php +++ b/tests/lib/MVC/Symfony/EventListener/LanguageSwitchListenerTest.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\Core\MVC\Symfony\EventListener; use Ibexa\Core\Helper\TranslationHelper; @@ -29,7 +30,7 @@ protected function setUp(): void public function testGetSubscribedEvents() { - $this->assertSame( + self::assertSame( [MVCEvents::ROUTE_REFERENCE_GENERATION => 'onRouteReferenceGeneration'], LanguageSwitchListener::getSubscribedEvents() ); @@ -38,7 +39,7 @@ public function testGetSubscribedEvents() public function testOnRouteReferenceGenerationNoLanguage() { $this->translationHelper - ->expects($this->never()) + ->expects(self::never()) ->method('getTranslationSiteAccess'); $event = new RouteReferenceGenerationEvent(new RouteReference('foo'), new Request()); @@ -53,16 +54,16 @@ public function testOnRouteReferenceGeneration() $event = new RouteReferenceGenerationEvent($routeReference, new Request()); $expectedSiteAccess = 'phoenix_rises'; $this->translationHelper - ->expects($this->once()) + ->expects(self::once()) ->method('getTranslationSiteAccess') ->with($language) - ->will($this->returnValue($expectedSiteAccess)); + ->will(self::returnValue($expectedSiteAccess)); $listener = new LanguageSwitchListener($this->translationHelper); $listener->onRouteReferenceGeneration($event); - $this->assertFalse($routeReference->has('language')); - $this->assertTrue($routeReference->has('siteaccess')); - $this->assertSame($expectedSiteAccess, $routeReference->get('siteaccess')); + self::assertFalse($routeReference->has('language')); + self::assertTrue($routeReference->has('siteaccess')); + self::assertSame($expectedSiteAccess, $routeReference->get('siteaccess')); } public function testOnRouteReferenceGenerationNoTranslationSiteAccess() @@ -71,15 +72,15 @@ public function testOnRouteReferenceGenerationNoTranslationSiteAccess() $routeReference = new RouteReference('foo', ['language' => $language]); $event = new RouteReferenceGenerationEvent($routeReference, new Request()); $this->translationHelper - ->expects($this->once()) + ->expects(self::once()) ->method('getTranslationSiteAccess') ->with($language) - ->will($this->returnValue(null)); + ->will(self::returnValue(null)); $listener = new LanguageSwitchListener($this->translationHelper); $listener->onRouteReferenceGeneration($event); - $this->assertFalse($routeReference->has('language')); - $this->assertFalse($routeReference->has('siteaccess')); + self::assertFalse($routeReference->has('language')); + self::assertFalse($routeReference->has('siteaccess')); } } diff --git a/tests/lib/MVC/Symfony/EventListener/SiteAccessMatchListenerTest.php b/tests/lib/MVC/Symfony/EventListener/SiteAccessMatchListenerTest.php index 402cbd0c9d..b4f48b5cd9 100644 --- a/tests/lib/MVC/Symfony/EventListener/SiteAccessMatchListenerTest.php +++ b/tests/lib/MVC/Symfony/EventListener/SiteAccessMatchListenerTest.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\Core\MVC\Symfony\EventListener; use Ibexa\Bundle\Core\SiteAccess\SiteAccessMatcherRegistryInterface; @@ -52,7 +53,7 @@ protected function setUp(): void public function testGetSubscribedEvents() { - $this->assertSame( + self::assertSame( [KernelEvents::REQUEST => ['onKernelRequest', 45]], SiteAccessMatchListener::getSubscribedEvents() ); @@ -85,18 +86,18 @@ public function testOnKernelRequestSerializedSA() ); $this->saRouter - ->expects($this->never()) + ->expects(self::never()) ->method('match'); $postSAMatchEvent = new PostSiteAccessMatchEvent($siteAccess, $request, $event->getRequestType()); $this->eventDispatcher - ->expects($this->once()) + ->expects(self::once()) ->method('dispatch') - ->with($this->equalTo($postSAMatchEvent), MVCEvents::SITEACCESS); + ->with(self::equalTo($postSAMatchEvent), MVCEvents::SITEACCESS); $this->listener->onKernelRequest($event); - $this->assertEquals($siteAccess, $request->attributes->get('siteaccess')); - $this->assertFalse($request->attributes->has('serialized_siteaccess')); + self::assertEquals($siteAccess, $request->attributes->get('siteaccess')); + self::assertFalse($request->attributes->has('serialized_siteaccess')); } public function testOnKernelRequestSerializedSAWithCompoundMatcher() @@ -141,18 +142,18 @@ public function testOnKernelRequestSerializedSAWithCompoundMatcher() ); $this->saRouter - ->expects($this->never()) + ->expects(self::never()) ->method('match'); $postSAMatchEvent = new PostSiteAccessMatchEvent($siteAccess, $request, $event->getRequestType()); $this->eventDispatcher - ->expects($this->once()) + ->expects(self::once()) ->method('dispatch') - ->with($this->equalTo($postSAMatchEvent), MVCEvents::SITEACCESS); + ->with(self::equalTo($postSAMatchEvent), MVCEvents::SITEACCESS); $this->listener->onKernelRequest($event); - $this->assertEquals($siteAccess, $request->attributes->get('siteaccess')); - $this->assertFalse($request->attributes->has('serialized_siteaccess')); + self::assertEquals($siteAccess, $request->attributes->get('siteaccess')); + self::assertFalse($request->attributes->has('serialized_siteaccess')); } public function testOnKernelRequestSiteAccessPresent() @@ -167,17 +168,17 @@ public function testOnKernelRequestSiteAccessPresent() ); $this->saRouter - ->expects($this->never()) + ->expects(self::never()) ->method('match'); $postSAMatchEvent = new PostSiteAccessMatchEvent($siteAccess, $request, $event->getRequestType()); $this->eventDispatcher - ->expects($this->once()) + ->expects(self::once()) ->method('dispatch') - ->with($this->equalTo($postSAMatchEvent), MVCEvents::SITEACCESS); + ->with(self::equalTo($postSAMatchEvent), MVCEvents::SITEACCESS); $this->listener->onKernelRequest($event); - $this->assertSame($siteAccess, $request->attributes->get('siteaccess')); + self::assertSame($siteAccess, $request->attributes->get('siteaccess')); } public function testOnKernelRequest() @@ -207,19 +208,19 @@ public function testOnKernelRequest() ); $this->saRouter - ->expects($this->once()) + ->expects(self::once()) ->method('match') - ->with($this->equalTo($simplifiedRequest)) - ->will($this->returnValue($siteAccess)); + ->with(self::equalTo($simplifiedRequest)) + ->will(self::returnValue($siteAccess)); $postSAMatchEvent = new PostSiteAccessMatchEvent($siteAccess, $request, $event->getRequestType()); $this->eventDispatcher - ->expects($this->once()) + ->expects(self::once()) ->method('dispatch') - ->with($this->equalTo($postSAMatchEvent), MVCEvents::SITEACCESS); + ->with(self::equalTo($postSAMatchEvent), MVCEvents::SITEACCESS); $this->listener->onKernelRequest($event); - $this->assertSame($siteAccess, $request->attributes->get('siteaccess')); + self::assertSame($siteAccess, $request->attributes->get('siteaccess')); } public function testOnKernelRequestUserHashWithOriginalRequest() @@ -251,19 +252,19 @@ public function testOnKernelRequestUserHashWithOriginalRequest() ); $this->saRouter - ->expects($this->once()) + ->expects(self::once()) ->method('match') - ->with($this->equalTo($simplifiedRequest)) - ->will($this->returnValue($siteAccess)); + ->with(self::equalTo($simplifiedRequest)) + ->will(self::returnValue($siteAccess)); $postSAMatchEvent = new PostSiteAccessMatchEvent($siteAccess, $request, $event->getRequestType()); $this->eventDispatcher - ->expects($this->once()) + ->expects(self::once()) ->method('dispatch') - ->with($this->equalTo($postSAMatchEvent), MVCEvents::SITEACCESS); + ->with(self::equalTo($postSAMatchEvent), MVCEvents::SITEACCESS); $this->listener->onKernelRequest($event); - $this->assertSame($siteAccess, $request->attributes->get('siteaccess')); + self::assertSame($siteAccess, $request->attributes->get('siteaccess')); } } diff --git a/tests/lib/MVC/Symfony/FieldType/ImageAsset/ParameterProviderTest.php b/tests/lib/MVC/Symfony/FieldType/ImageAsset/ParameterProviderTest.php index 3fb2a5ad16..8d3a0cf8d8 100644 --- a/tests/lib/MVC/Symfony/FieldType/ImageAsset/ParameterProviderTest.php +++ b/tests/lib/MVC/Symfony/FieldType/ImageAsset/ParameterProviderTest.php @@ -93,7 +93,7 @@ public function testGetViewParameters($status, array $expected): void $actual = $this->parameterProvider->getViewParameters($this->createField($destinationContentId)); - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } public function testGetViewParametersHandleNotFoundException(): void @@ -109,7 +109,7 @@ public function testGetViewParametersHandleNotFoundException(): void }; $this->repository - ->expects($this->once()) + ->expects(self::once()) ->method('sudo') ->with($closure) ->willThrowException($this->createMock(NotFoundException::class)); @@ -118,7 +118,7 @@ public function testGetViewParametersHandleNotFoundException(): void $this->createField($destinationContentId) ); - $this->assertEquals([ + self::assertEquals([ 'available' => false, ], $actual); } @@ -139,14 +139,14 @@ public function testGetViewParametersHandleUnauthorizedAccess(): void ; $this->permissionsResolver - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('canUser') ->with('content', 'read', $contentInfo) ->willReturn(false) ; $this->permissionsResolver - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('canUser') ->with('content', 'view_embed', $contentInfo) ->willReturn(false) @@ -156,7 +156,7 @@ public function testGetViewParametersHandleUnauthorizedAccess(): void $this->createField($destinationContentId) ); - $this->assertEquals([ + self::assertEquals([ 'available' => false, ], $actual); } @@ -180,7 +180,7 @@ public function testGetViewParametersHandleEmptyValue(): void $this->createField($destinationContentId) ); - $this->assertEquals([ + self::assertEquals([ 'available' => null, ], $actual); } diff --git a/tests/lib/MVC/Symfony/FieldType/Relation/ParameterProviderTest.php b/tests/lib/MVC/Symfony/FieldType/Relation/ParameterProviderTest.php index 6b89e5646e..007f556d6f 100644 --- a/tests/lib/MVC/Symfony/FieldType/Relation/ParameterProviderTest.php +++ b/tests/lib/MVC/Symfony/FieldType/Relation/ParameterProviderTest.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\Core\MVC\Symfony\FieldType\Relation; use Ibexa\Contracts\Core\Repository\ContentService; diff --git a/tests/lib/MVC/Symfony/FieldType/RelationList/ParameterProviderTest.php b/tests/lib/MVC/Symfony/FieldType/RelationList/ParameterProviderTest.php index 552668f84a..18d523be74 100644 --- a/tests/lib/MVC/Symfony/FieldType/RelationList/ParameterProviderTest.php +++ b/tests/lib/MVC/Symfony/FieldType/RelationList/ParameterProviderTest.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\Core\MVC\Symfony\FieldType\RelationList; use Ibexa\Contracts\Core\Repository\ContentService; @@ -34,7 +35,7 @@ public function testGetViewParameters(array $desinationContentIds, array $expect $contentServiceMock ->method('loadContentInfoList') ->with($desinationContentIds) - ->will($this->returnCallback(static function ($arg) { + ->will(self::returnCallback(static function ($arg) { $return = []; if (in_array(123, $arg)) { $return[123] = new ContentInfo(['status' => ContentInfo::STATUS_DRAFT]); diff --git a/tests/lib/MVC/Symfony/FieldType/User/ParameterProviderTest.php b/tests/lib/MVC/Symfony/FieldType/User/ParameterProviderTest.php index 6f47f029fa..254a096c7a 100644 --- a/tests/lib/MVC/Symfony/FieldType/User/ParameterProviderTest.php +++ b/tests/lib/MVC/Symfony/FieldType/User/ParameterProviderTest.php @@ -61,9 +61,9 @@ public function testGetViewParameters(): void $this->createFieldMock(self::EXAMPLE_USER_ID) ); - $this->assertFalse($parameters['is_password_expired']); - $this->assertEquals($passwordExpiresAt, $parameters['password_expires_at']); - $this->assertEquals($passwordExpiresIn, $parameters['password_expires_in']->days); + self::assertFalse($parameters['is_password_expired']); + self::assertEquals($passwordExpiresAt, $parameters['password_expires_at']); + self::assertEquals($passwordExpiresIn, $parameters['password_expires_in']->days); } public function testGetViewParametersWhenPasswordExpirationDateIsNull(): void @@ -75,7 +75,7 @@ public function testGetViewParametersWhenPasswordExpirationDateIsNull(): void ->with($this->user) ->willReturn(new PasswordInfo()); - $this->assertEquals([ + self::assertEquals([ 'is_password_expired' => false, 'password_expires_at' => null, 'password_expires_in' => null, diff --git a/tests/lib/MVC/Symfony/FieldType/View/ParameterProvider/LocaleParameterProviderTest.php b/tests/lib/MVC/Symfony/FieldType/View/ParameterProvider/LocaleParameterProviderTest.php index c545bba678..b30381211d 100644 --- a/tests/lib/MVC/Symfony/FieldType/View/ParameterProvider/LocaleParameterProviderTest.php +++ b/tests/lib/MVC/Symfony/FieldType/View/ParameterProvider/LocaleParameterProviderTest.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\Core\MVC\Symfony\FieldType\View\ParameterProvider; use Ibexa\Contracts\Core\Repository\Values\Content\Field; @@ -32,7 +33,7 @@ public function testGetViewParameters($hasRequestLocale, $expectedLocale) $field = new Field(['languageCode' => 'cro-HR']); $parameterProvider = new LocaleParameterProvider($this->getLocaleConverterMock()); $parameterProvider->setRequestStack($this->getRequestStackMock($hasRequestLocale)); - $this->assertSame( + self::assertSame( ['locale' => $expectedLocale], $parameterProvider->getViewParameters($field) ); @@ -43,15 +44,15 @@ protected function getRequestStackMock($hasLocale) $requestStack = new RequestStack(); $parameterBagMock = $this->createMock(ParameterBag::class); - $parameterBagMock->expects($this->any()) + $parameterBagMock->expects(self::any()) ->method('has') - ->with($this->equalTo('_locale')) - ->will($this->returnValue($hasLocale)); + ->with(self::equalTo('_locale')) + ->will(self::returnValue($hasLocale)); - $parameterBagMock->expects($this->any()) + $parameterBagMock->expects(self::any()) ->method('get') - ->with($this->equalTo('_locale')) - ->will($this->returnValue('fr_FR')); + ->with(self::equalTo('_locale')) + ->will(self::returnValue('fr_FR')); $requestMock = $this->createMock(Request::class); $requestMock->attributes = $parameterBagMock; @@ -65,10 +66,10 @@ protected function getLocaleConverterMock() { $mock = $this->createMock(LocaleConverterInterface::class); - $mock->expects($this->any()) + $mock->expects(self::any()) ->method('convertToPOSIX') - ->with($this->equalTo('cro-HR')) - ->will($this->returnValue('hr_HR')); + ->with(self::equalTo('cro-HR')) + ->will(self::returnValue('hr_HR')); return $mock; } diff --git a/tests/lib/MVC/Symfony/FieldType/View/ParameterProviderRegistryTest.php b/tests/lib/MVC/Symfony/FieldType/View/ParameterProviderRegistryTest.php index 13060d4e16..9fad4b1b77 100644 --- a/tests/lib/MVC/Symfony/FieldType/View/ParameterProviderRegistryTest.php +++ b/tests/lib/MVC/Symfony/FieldType/View/ParameterProviderRegistryTest.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\Core\MVC\Symfony\FieldType\View; use Ibexa\Core\MVC\Symfony\FieldType\View\ParameterProviderInterface; @@ -18,12 +19,12 @@ class ParameterProviderRegistryTest extends TestCase public function testSetHasParameterProvider() { $registry = new ParameterProviderRegistry(); - $this->assertFalse($registry->hasParameterProvider('foo')); + self::assertFalse($registry->hasParameterProvider('foo')); $registry->setParameterProvider( $this->createMock(ParameterProviderInterface::class), 'foo' ); - $this->assertTrue($registry->hasParameterProvider('foo')); + self::assertTrue($registry->hasParameterProvider('foo')); } public function testGetParameterProviderFail() @@ -39,7 +40,7 @@ public function testGetParameterProvider() $provider = $this->createMock(ParameterProviderInterface::class); $registry = new ParameterProviderRegistry(); $registry->setParameterProvider($provider, 'foo'); - $this->assertSame($provider, $registry->getParameterProvider('foo')); + self::assertSame($provider, $registry->getParameterProvider('foo')); } } diff --git a/tests/lib/MVC/Symfony/Locale/LocaleConverterTest.php b/tests/lib/MVC/Symfony/Locale/LocaleConverterTest.php index 826db2d144..dd6a4129aa 100644 --- a/tests/lib/MVC/Symfony/Locale/LocaleConverterTest.php +++ b/tests/lib/MVC/Symfony/Locale/LocaleConverterTest.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\Core\MVC\Symfony\Locale; use Ibexa\Core\MVC\Symfony\Locale\LocaleConverter; @@ -54,7 +55,7 @@ public function testConvertToPOSIX(string $repositoryLocale, ?string $expected): { if ($expected === null) { $this->logger - ->expects($this->once()) + ->expects(self::once()) ->method('warning'); } @@ -80,7 +81,7 @@ public function testConvertToEz(string $posixLocale, ?string $expected): void { if ($expected === null) { $this->logger - ->expects($this->once()) + ->expects(self::once()) ->method('warning'); } @@ -94,7 +95,7 @@ public function testConvertToRepository(string $posixLocale, ?string $expected): { if ($expected === null) { $this->logger - ->expects($this->once()) + ->expects(self::once()) ->method('warning'); } diff --git a/tests/lib/MVC/Symfony/Locale/UserLanguagePreferenceProviderTest.php b/tests/lib/MVC/Symfony/Locale/UserLanguagePreferenceProviderTest.php index cd58c29164..3ef84fbbc3 100644 --- a/tests/lib/MVC/Symfony/Locale/UserLanguagePreferenceProviderTest.php +++ b/tests/lib/MVC/Symfony/Locale/UserLanguagePreferenceProviderTest.php @@ -72,7 +72,7 @@ public function testGetPreferredLanguagesWithoutUserLanguage(array $userLanguage ); $this ->requestStackMock - ->expects($this->once()) + ->expects(self::once()) ->method('getCurrentRequest') ->willReturn($request); @@ -80,7 +80,7 @@ public function testGetPreferredLanguagesWithoutUserLanguage(array $userLanguage $userPreferenceServiceMock ->method('getUserPreference') ->with(self::LANGUAGE_PREFERENCE_NAME) - ->will($this->throwException(new NotFoundException('User Preference', self::LANGUAGE_PREFERENCE_NAME))); + ->will(self::throwException(new NotFoundException('User Preference', self::LANGUAGE_PREFERENCE_NAME))); $userLanguagePreferenceProvider = new UserLanguagePreferenceProvider( $this->requestStackMock, @@ -111,7 +111,7 @@ public function testGetPreferredLanguagesWithUserPreferredLanguage(array $userLa ); $this ->requestStackMock - ->expects($this->once()) + ->expects(self::once()) ->method('getCurrentRequest') ->willReturn($request); diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/BaseTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/BaseTest.php index cd25aa307f..81cdb54593 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/BaseTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/BaseTest.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\Core\MVC\Symfony\Matcher\ContentBased; use Ibexa\Contracts\Core\Persistence\User\Handler as SPIUserHandler; diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/DepthTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/DepthTest.php index 33694b809b..40e478d22f 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/DepthTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/DepthTest.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\Core\MVC\Symfony\Matcher\ContentBased; use Ibexa\Contracts\Core\Repository\LocationService; @@ -24,6 +25,7 @@ protected function setUp(): void /** * @dataProvider matchLocationProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Depth::matchLocation * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -34,7 +36,7 @@ protected function setUp(): void public function testMatchLocation($matchingConfig, Location $location, $expectedResult) { $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame($expectedResult, $this->matcher->matchLocation($location)); + self::assertSame($expectedResult, $this->matcher->matchLocation($location)); } public function matchLocationProvider() @@ -75,6 +77,7 @@ public function matchLocationProvider() /** * @dataProvider matchContentInfoProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Depth::matchContentInfo * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @covers \Ibexa\Core\MVC\RepositoryAware::setRepository @@ -87,7 +90,7 @@ public function testMatchContentInfo($matchingConfig, Repository $repository, $e { $this->matcher->setRepository($repository); $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame( + self::assertSame( $expectedResult, $this->matcher->matchContentInfo($this->getContentInfoMock(['mainLocationId' => 42])) ); @@ -129,24 +132,24 @@ public function matchContentInfoProvider() private function generateRepositoryMockForDepth($depth) { $locationServiceMock = $this->createMock(LocationService::class); - $locationServiceMock->expects($this->once()) + $locationServiceMock->expects(self::once()) ->method('loadLocation') ->with(42) ->will( - $this->returnValue( + self::returnValue( $this->getLocationMock(['depth' => $depth]) ) ); $repository = $this->getRepositoryMock(); $repository - ->expects($this->once()) + ->expects(self::once()) ->method('getLocationService') - ->will($this->returnValue($locationServiceMock)); + ->will(self::returnValue($locationServiceMock)); $repository - ->expects($this->once()) + ->expects(self::once()) ->method('getPermissionResolver') - ->will($this->returnValue($this->getPermissionResolverMock())); + ->will(self::returnValue($this->getPermissionResolverMock())); return $repository; } diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTest.php index 82a5efe9f5..37be23d31f 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTest.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; @@ -24,6 +25,7 @@ protected function setUp(): void /** * @dataProvider matchLocationProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Id\Content::matchLocation * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -34,7 +36,7 @@ protected function setUp(): void public function testMatchLocation($matchingConfig, Location $location, $expectedResult) { $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame($expectedResult, $this->matcher->matchLocation($location)); + self::assertSame($expectedResult, $this->matcher->matchLocation($location)); } public function matchLocationProvider() @@ -74,10 +76,10 @@ private function generateLocationForContentId($contentId) { $location = $this->getLocationMock(); $location - ->expects($this->any()) + ->expects(self::any()) ->method('getContentInfo') ->will( - $this->returnValue( + self::returnValue( $this->getContentInfoMock(['id' => $contentId]) ) ); @@ -87,6 +89,7 @@ private function generateLocationForContentId($contentId) /** * @dataProvider matchContentInfoProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Id\Content::matchContentInfo * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -97,7 +100,7 @@ private function generateLocationForContentId($contentId) public function testMatchContentInfo($matchingConfig, ContentInfo $contentInfo, $expectedResult) { $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame($expectedResult, $this->matcher->matchContentInfo($contentInfo)); + self::assertSame($expectedResult, $this->matcher->matchContentInfo($contentInfo)); } public function matchContentInfoProvider() diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTypeGroupTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTypeGroupTest.php index 7ee473a299..362bdbddf2 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTypeGroupTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTypeGroupTest.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\ContentTypeService; @@ -26,6 +27,7 @@ protected function setUp(): void /** * @dataProvider matchLocationProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Id\ContentTypeGroup::matchLocation * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -38,7 +40,7 @@ public function testMatchLocation($matchingConfig, Repository $repository, $expe $this->matcher->setRepository($repository); $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame( + self::assertSame( $expectedResult, $this->matcher->matchLocation($this->generateLocationMock()) ); @@ -84,10 +86,10 @@ private function generateLocationMock() { $location = $this->getLocationMock(); $location - ->expects($this->any()) + ->expects(self::any()) ->method('getContentInfo') ->will( - $this->returnValue( + self::returnValue( $this->getContentInfoMock(['contentTypeId' => 42]) ) ); @@ -97,6 +99,7 @@ private function generateLocationMock() /** * @dataProvider matchContentInfoProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Id\ContentTypeGroup::matchContentInfo * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -109,7 +112,7 @@ public function testMatchContentInfo($matchingConfig, Repository $repository, $e $this->matcher->setRepository($repository); $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame( + self::assertSame( $expectedResult, $this->matcher->matchContentInfo($this->getContentInfoMock(['contentTypeId' => 42])) ); @@ -157,14 +160,14 @@ private function generateRepositoryMockForContentTypeGroupId($contentTypeGroupId { $contentTypeServiceMock = $this->createMock(ContentTypeService::class); $contentTypeMock = $this->getMockForAbstractClass(ContentType::class); - $contentTypeServiceMock->expects($this->once()) + $contentTypeServiceMock->expects(self::once()) ->method('loadContentType') ->with(42) - ->will($this->returnValue($contentTypeMock)); - $contentTypeMock->expects($this->once()) + ->will(self::returnValue($contentTypeMock)); + $contentTypeMock->expects(self::once()) ->method('getContentTypeGroups') ->will( - $this->returnValue( + self::returnValue( [ // First a group that will never match, then the right group. // This ensures to test even if the content type belongs to several groups at once. @@ -179,9 +182,9 @@ private function generateRepositoryMockForContentTypeGroupId($contentTypeGroupId $repository = $this->getRepositoryMock(); $repository - ->expects($this->once()) + ->expects(self::once()) ->method('getContentTypeService') - ->will($this->returnValue($contentTypeServiceMock)); + ->will(self::returnValue($contentTypeServiceMock)); return $repository; } diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTypeTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTypeTest.php index 2b5cb9e275..3313c2435d 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTypeTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ContentTypeTest.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; @@ -24,6 +25,7 @@ protected function setUp(): void /** * @dataProvider matchLocationProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Id\ContentType::matchLocation * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -34,7 +36,7 @@ protected function setUp(): void public function testMatchLocation($matchingConfig, Location $location, $expectedResult) { $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame($expectedResult, $this->matcher->matchLocation($location)); + self::assertSame($expectedResult, $this->matcher->matchLocation($location)); } public function matchLocationProvider() @@ -79,10 +81,10 @@ private function generateLocationForContentType($contentTypeId) { $location = $this->getLocationMock(); $location - ->expects($this->any()) + ->expects(self::any()) ->method('getContentInfo') ->will( - $this->returnValue( + self::returnValue( $this->generateContentInfoForContentType($contentTypeId) ) ); @@ -104,6 +106,7 @@ private function generateContentInfoForContentType($contentTypeId) /** * @dataProvider matchContentInfoProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Id\ContentType::matchContentInfo * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -114,7 +117,7 @@ private function generateContentInfoForContentType($contentTypeId) public function testMatchContentInfo($matchingConfig, ContentInfo $contentInfo, $expectedResult) { $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame($expectedResult, $this->matcher->matchContentInfo($contentInfo)); + self::assertSame($expectedResult, $this->matcher->matchContentInfo($contentInfo)); } public function matchContentInfoProvider() diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/LocationTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/LocationTest.php index 00015a98cd..b6f890757b 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/LocationTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/LocationTest.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; @@ -24,6 +25,7 @@ protected function setUp(): void /** * @dataProvider matchLocationProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Id\Location::matchLocation * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -34,7 +36,7 @@ protected function setUp(): void public function testMatchLocation($matchingConfig, Location $location, $expectedResult) { $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame($expectedResult, $this->matcher->matchLocation($location)); + self::assertSame($expectedResult, $this->matcher->matchLocation($location)); } public function matchLocationProvider() @@ -65,6 +67,7 @@ public function matchLocationProvider() /** * @dataProvider matchContentInfoProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Id\Location::matchContentInfo * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -75,7 +78,7 @@ public function matchLocationProvider() public function testMatchContentInfo($matchingConfig, ContentInfo $contentInfo, $expectedResult) { $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame($expectedResult, $this->matcher->matchContentInfo($contentInfo)); + self::assertSame($expectedResult, $this->matcher->matchContentInfo($contentInfo)); } public function matchContentInfoProvider() diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentContentTypeTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentContentTypeTest.php index 9c356b4820..9f88469723 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentContentTypeTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentContentTypeTest.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\LocationService; @@ -42,41 +43,42 @@ private function generateRepositoryMockForContentTypeId($contentTypeId) $parentLocation = $this->getLocationMock([ 'parentLocationId' => self::EXAMPLE_PARENT_LOCATION_ID, ]); - $parentLocation->expects($this->once()) + $parentLocation->expects(self::once()) ->method('getContentInfo') ->will( - $this->returnValue($parentContentInfo) + self::returnValue($parentContentInfo) ); $locationServiceMock = $this->createMock(LocationService::class); - $locationServiceMock->expects($this->atLeastOnce()) + $locationServiceMock->expects(self::atLeastOnce()) ->method('loadLocation') ->will( - $this->returnValue($parentLocation) + self::returnValue($parentLocation) ); // The following is used in the case of a match by contentInfo - $locationServiceMock->expects($this->any()) + $locationServiceMock->expects(self::any()) ->method('loadLocation') ->will( - $this->returnValue($this->getLocationMock()) + self::returnValue($this->getLocationMock()) ); $repository = $this->getRepositoryMock(); $repository - ->expects($this->any()) + ->expects(self::any()) ->method('getLocationService') - ->will($this->returnValue($locationServiceMock)); + ->will(self::returnValue($locationServiceMock)); $repository - ->expects($this->any()) + ->expects(self::any()) ->method('getPermissionResolver') - ->will($this->returnValue($this->getPermissionResolverMock())); + ->will(self::returnValue($this->getPermissionResolverMock())); return $repository; } /** * @dataProvider matchLocationProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Id\ParentContentType::matchLocation * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @covers \Ibexa\Core\MVC\RepositoryAware::setRepository @@ -89,7 +91,7 @@ public function testMatchLocation($matchingConfig, Repository $repository, $expe { $this->matcher->setRepository($repository); $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame( + self::assertSame( $expectedResult, $this->matcher->matchLocation($this->getLocationMock(['parentLocationId' => self::EXAMPLE_LOCATION_ID])) ); @@ -123,6 +125,7 @@ public function matchLocationProvider() /** * @dataProvider matchLocationProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Id\ParentContentType::matchContentInfo * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @covers \Ibexa\Core\MVC\RepositoryAware::setRepository @@ -136,7 +139,7 @@ public function testMatchContentInfo($matchingConfig, Repository $repository, $e $this->matcher->setRepository($repository); $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame( + self::assertSame( $expectedResult, $this->matcher->matchContentInfo($this->getContentInfoMock([ 'mainLocationId' => self::EXAMPLE_LOCATION_ID, diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentLocationTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentLocationTest.php index cf1d0434f0..00b8766011 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentLocationTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/ParentLocationTest.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\LocationService; @@ -25,6 +26,7 @@ protected function setUp(): void /** * @dataProvider matchLocationProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Id\ParentLocation::matchLocation * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -35,7 +37,7 @@ protected function setUp(): void public function testMatchLocation($matchingConfig, Location $location, $expectedResult) { $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame($expectedResult, $this->matcher->matchLocation($location)); + self::assertSame($expectedResult, $this->matcher->matchLocation($location)); } public function matchLocationProvider() @@ -66,6 +68,7 @@ public function matchLocationProvider() /** * @dataProvider matchContentInfoProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Id\ParentLocation::matchContentInfo * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @covers \Ibexa\Core\MVC\RepositoryAware::setRepository @@ -78,7 +81,7 @@ public function testMatchContentInfo($matchingConfig, Repository $repository, $e { $this->matcher->setRepository($repository); $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame( + self::assertSame( $expectedResult, $this->matcher->matchContentInfo($this->getContentInfoMock(['mainLocationId' => 42])) ); @@ -120,24 +123,24 @@ public function matchContentInfoProvider() private function generateRepositoryMockForParentLocationId($parentLocationId) { $locationServiceMock = $this->createMock(LocationService::class); - $locationServiceMock->expects($this->once()) + $locationServiceMock->expects(self::once()) ->method('loadLocation') ->with(42) ->will( - $this->returnValue( + self::returnValue( $this->getLocationMock(['parentLocationId' => $parentLocationId]) ) ); $repository = $this->getRepositoryMock(); $repository - ->expects($this->once()) + ->expects(self::once()) ->method('getLocationService') - ->will($this->returnValue($locationServiceMock)); + ->will(self::returnValue($locationServiceMock)); $repository - ->expects($this->any()) + ->expects(self::any()) ->method('getPermissionResolver') - ->will($this->returnValue($this->getPermissionResolverMock())); + ->will(self::returnValue($this->getPermissionResolverMock())); return $repository; } diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/RemoteTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/RemoteTest.php index 7c9211c354..6b8f3bb0e9 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/RemoteTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/RemoteTest.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; @@ -24,6 +25,7 @@ protected function setUp(): void /** * @dataProvider matchLocationProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Id\Remote::matchLocation * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -34,7 +36,7 @@ protected function setUp(): void public function testMatchLocation($matchingConfig, Location $location, $expectedResult) { $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame($expectedResult, $this->matcher->matchLocation($location)); + self::assertSame($expectedResult, $this->matcher->matchLocation($location)); } public function matchLocationProvider() @@ -65,6 +67,7 @@ public function matchLocationProvider() /** * @dataProvider matchContentInfoProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Id\Remote::matchContentInfo * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -75,7 +78,7 @@ public function matchLocationProvider() public function testMatchContentInfo($matchingConfig, ContentInfo $contentInfo, $expectedResult) { $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame($expectedResult, $this->matcher->matchContentInfo($contentInfo)); + self::assertSame($expectedResult, $this->matcher->matchContentInfo($contentInfo)); } public function matchContentInfoProvider() diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/SectionTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/SectionTest.php index 30dc941dd9..6ff5a2a665 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/SectionTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/Id/SectionTest.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\Core\MVC\Symfony\Matcher\ContentBased\Id; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; @@ -24,6 +25,7 @@ protected function setUp(): void /** * @dataProvider matchLocationProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -34,7 +36,7 @@ protected function setUp(): void public function testMatchLocation($matchingConfig, Location $location, $expectedResult) { $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame($expectedResult, $this->matcher->matchLocation($location)); + self::assertSame($expectedResult, $this->matcher->matchLocation($location)); } public function matchLocationProvider() @@ -74,10 +76,10 @@ private function generateLocationForSectionId($sectionId) { $location = $this->getLocationMock(); $location - ->expects($this->any()) + ->expects(self::any()) ->method('getContentInfo') ->will( - $this->returnValue( + self::returnValue( $this->getContentInfoMock(['sectionId' => $sectionId]) ) ); @@ -87,6 +89,7 @@ private function generateLocationForSectionId($sectionId) /** * @dataProvider matchContentInfoProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Id\Section::matchContentInfo * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -97,7 +100,7 @@ private function generateLocationForSectionId($sectionId) public function testMatchContentInfo($matchingConfig, ContentInfo $contentInfo, $expectedResult) { $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame($expectedResult, $this->matcher->matchContentInfo($contentInfo)); + self::assertSame($expectedResult, $this->matcher->matchContentInfo($contentInfo)); } public function matchContentInfoProvider() diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ContentTypeTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ContentTypeTest.php index 085fe2d57e..b781925924 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ContentTypeTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ContentTypeTest.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\Core\MVC\Symfony\Matcher\ContentBased\Identifier; use Ibexa\Contracts\Core\Repository\ContentTypeService; @@ -25,6 +26,7 @@ protected function setUp(): void /** * @dataProvider matchLocationProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Identifier\ContentType::matchLocation * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -37,7 +39,7 @@ public function testMatchLocation($matchingConfig, Repository $repository, $expe $this->matcher->setRepository($repository); $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame( + self::assertSame( $expectedResult, $this->matcher->matchLocation($this->generateLocationMock()) ); @@ -83,10 +85,10 @@ private function generateLocationMock() { $location = $this->getLocationMock(); $location - ->expects($this->any()) + ->expects(self::any()) ->method('getContentInfo') ->will( - $this->returnValue( + self::returnValue( $this->getContentInfoMock(['contentTypeId' => 42]) ) ); @@ -96,6 +98,7 @@ private function generateLocationMock() /** * @dataProvider matchContentInfoProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Identifier\ContentType::matchLocation * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -108,7 +111,7 @@ public function testMatchContentInfo($matchingConfig, Repository $repository, $e $this->matcher->setRepository($repository); $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame( + self::assertSame( $expectedResult, $this->matcher->matchContentInfo( $this->getContentInfoMock(['contentTypeId' => 42]) @@ -163,18 +166,18 @@ private function generateRepositoryMockForContentTypeIdentifier($contentTypeIden ) ->getMockForAbstractClass(); $contentTypeServiceMock = $this->createMock(ContentTypeService::class); - $contentTypeServiceMock->expects($this->once()) + $contentTypeServiceMock->expects(self::once()) ->method('loadContentType') ->with(42) ->will( - $this->returnValue($contentTypeMock) + self::returnValue($contentTypeMock) ); $repository = $this->getRepositoryMock(); $repository - ->expects($this->any()) + ->expects(self::any()) ->method('getContentTypeService') - ->will($this->returnValue($contentTypeServiceMock)); + ->will(self::returnValue($contentTypeServiceMock)); return $repository; } diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ParentContentTypeTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ParentContentTypeTest.php index ee20362a26..620ae026fc 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ParentContentTypeTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/Identifier/ParentContentTypeTest.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\Core\MVC\Symfony\Matcher\ContentBased\Identifier; use Ibexa\Contracts\Core\Repository\ContentTypeService; @@ -43,31 +44,31 @@ private function generateRepositoryMockForContentTypeIdentifier($contentTypeIden $parentLocation = $this->getLocationMock([ 'parentLocationId' => self::EXAMPLE_PARENT_LOCATION_ID, ]); - $parentLocation->expects($this->once()) + $parentLocation->expects(self::once()) ->method('getContentInfo') ->will( - $this->returnValue($parentContentInfo) + self::returnValue($parentContentInfo) ); $locationServiceMock = $this->createMock(LocationService::class); - $locationServiceMock->expects($this->atLeastOnce()) + $locationServiceMock->expects(self::atLeastOnce()) ->method('loadLocation') ->will( - $this->returnValue($parentLocation) + self::returnValue($parentLocation) ); // The following is used in the case of a match by contentInfo - $locationServiceMock->expects($this->any()) + $locationServiceMock->expects(self::any()) ->method('loadLocation') ->will( - $this->returnValue($this->getLocationMock()) + self::returnValue($this->getLocationMock()) ); $contentTypeServiceMock = $this->createMock(ContentTypeService::class); - $contentTypeServiceMock->expects($this->once()) + $contentTypeServiceMock->expects(self::once()) ->method('loadContentType') ->with(42) ->will( - $this->returnValue( + self::returnValue( $this ->getMockBuilder(ContentType::class) ->setConstructorArgs( @@ -81,23 +82,24 @@ private function generateRepositoryMockForContentTypeIdentifier($contentTypeIden $repository = $this->getRepositoryMock(); $repository - ->expects($this->any()) + ->expects(self::any()) ->method('getLocationService') - ->will($this->returnValue($locationServiceMock)); + ->will(self::returnValue($locationServiceMock)); $repository - ->expects($this->once()) + ->expects(self::once()) ->method('getContentTypeService') - ->will($this->returnValue($contentTypeServiceMock)); + ->will(self::returnValue($contentTypeServiceMock)); $repository - ->expects($this->any()) + ->expects(self::any()) ->method('getPermissionResolver') - ->will($this->returnValue($this->getPermissionResolverMock())); + ->will(self::returnValue($this->getPermissionResolverMock())); return $repository; } /** * @dataProvider matchLocationProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Identifier\ParentContentType::matchLocation * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @covers \Ibexa\Core\MVC\RepositoryAware::setRepository @@ -110,7 +112,7 @@ public function testMatchLocation($matchingConfig, Repository $repository, $expe { $this->matcher->setRepository($repository); $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame( + self::assertSame( $expectedResult, $this->matcher->matchLocation($this->getLocationMock([ 'parentLocationId' => self::EXAMPLE_LOCATION_ID, @@ -146,6 +148,7 @@ public function matchLocationProvider() /** * @dataProvider matchLocationProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Identifier\ParentContentType::matchLocation * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @covers \Ibexa\Core\MVC\RepositoryAware::setRepository @@ -158,7 +161,7 @@ public function testMatchContentInfo($matchingConfig, Repository $repository, $e { $this->matcher->setRepository($repository); $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame( + self::assertSame( $expectedResult, $this->matcher->matchContentInfo($this->getContentInfoMock([ 'mainLocationId' => self::EXAMPLE_LOCATION_ID, diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/Identifier/SectionTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/Identifier/SectionTest.php index cd59972f87..84b170ccd1 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/Identifier/SectionTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/Identifier/SectionTest.php @@ -35,10 +35,10 @@ protected function setUp(): void private function generateRepositoryMockForSectionIdentifier($sectionIdentifier) { $sectionServiceMock = $this->createMock(SectionService::class); - $sectionServiceMock->expects($this->once()) + $sectionServiceMock->expects(self::once()) ->method('loadSection') ->will( - $this->returnValue( + self::returnValue( $this ->getMockBuilder(Section::class) ->setConstructorArgs( @@ -52,19 +52,20 @@ private function generateRepositoryMockForSectionIdentifier($sectionIdentifier) $repository = $this->getRepositoryMock(); $repository - ->expects($this->once()) + ->expects(self::once()) ->method('getSectionService') - ->will($this->returnValue($sectionServiceMock)); + ->will(self::returnValue($sectionServiceMock)); $repository - ->expects($this->any()) + ->expects(self::any()) ->method('getPermissionResolver') - ->will($this->returnValue($this->getPermissionResolverMock())); + ->will(self::returnValue($this->getPermissionResolverMock())); return $repository; } /** * @dataProvider matchSectionProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Identifier\Section::matchLocation * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @covers \Ibexa\Core\MVC\RepositoryAware::setRepository @@ -80,15 +81,15 @@ public function testMatchLocation($matchingConfig, Repository $repository, $expe $location = $this->getLocationMock(); $location - ->expects($this->once()) + ->expects(self::once()) ->method('getContentInfo') ->will( - $this->returnValue( + self::returnValue( $this->getContentInfoMock(['sectionId' => 1]) ) ); - $this->assertSame( + self::assertSame( $expectedResult, $this->matcher->matchLocation($location) ); @@ -122,6 +123,7 @@ public function matchSectionProvider() /** * @dataProvider matchSectionProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\Identifier\Section::matchLocation * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @covers \Ibexa\Core\MVC\RepositoryAware::setRepository @@ -134,7 +136,7 @@ public function testMatchContentInfo($matchingConfig, Repository $repository, $e { $this->matcher->setRepository($repository); $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame( + self::assertSame( $expectedResult, $this->matcher->matchContentInfo($this->getContentInfoMock(['sectionId' => 1])) ); diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/IsPreviewTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/IsPreviewTest.php index 114ce35369..f77b0447de 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/IsPreviewTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/IsPreviewTest.php @@ -27,7 +27,7 @@ protected function setUp(): void } /** - * @return iterable<string, array{\Ibexa\Core\MVC\Symfony\View\View, boolean, boolean}> + * @return iterable<string, array{\Ibexa\Core\MVC\Symfony\View\View, bool, bool}> */ public static function getDataForTestMatch(): iterable { diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/MultipleValuedTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/MultipleValuedTest.php index f1f5e820e8..734eddeb6a 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/MultipleValuedTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/MultipleValuedTest.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\Core\MVC\Symfony\Matcher\ContentBased; use Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued; @@ -12,6 +13,7 @@ class MultipleValuedTest extends BaseTest { /** * @dataProvider matchingConfigProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::getValues */ @@ -20,11 +22,11 @@ public function testSetMatchingConfig($matchingConfig) $matcher = $this->getMultipleValuedMatcherMock(); $matcher->setMatchingConfig($matchingConfig); $values = $matcher->getValues(); - $this->assertIsArray($values); + self::assertIsArray($values); $matchingConfig = is_array($matchingConfig) ? $matchingConfig : [$matchingConfig]; foreach ($matchingConfig as $val) { - $this->assertContains($val, $values); + self::assertContains($val, $values); } } @@ -53,7 +55,7 @@ public function testInjectRepository() { $matcher = $this->getMultipleValuedMatcherMock(); $matcher->setRepository($this->repositoryMock); - $this->assertSame($this->repositoryMock, $matcher->getRepository()); + self::assertSame($this->repositoryMock, $matcher->getRepository()); } private function getMultipleValuedMatcherMock() diff --git a/tests/lib/MVC/Symfony/Matcher/ContentBased/UrlAliasTest.php b/tests/lib/MVC/Symfony/Matcher/ContentBased/UrlAliasTest.php index e729b67dda..140df59248 100644 --- a/tests/lib/MVC/Symfony/Matcher/ContentBased/UrlAliasTest.php +++ b/tests/lib/MVC/Symfony/Matcher/ContentBased/UrlAliasTest.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\Core\MVC\Symfony\Matcher\ContentBased; use Ibexa\Contracts\Core\Repository\Repository; @@ -25,6 +26,7 @@ protected function setUp(): void /** * @dataProvider setMatchingConfigProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\UrlAlias::setMatchingConfig * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @@ -34,7 +36,7 @@ protected function setUp(): void public function testSetMatchingConfig($matchingConfig, $expectedValues) { $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame( + self::assertSame( $this->matcher->getValues(), $expectedValues ); @@ -71,32 +73,33 @@ private function generateRepositoryMockForUrlAlias($path) ]; $urlAliasServiceMock = $this->createMock(URLAliasService::class); - $urlAliasServiceMock->expects($this->at(0)) + $urlAliasServiceMock->expects(self::at(0)) ->method('listLocationAliases') ->with( - $this->isInstanceOf(Location::class), + self::isInstanceOf(Location::class), true ) - ->will($this->returnValue([])); - $urlAliasServiceMock->expects($this->at(1)) + ->will(self::returnValue([])); + $urlAliasServiceMock->expects(self::at(1)) ->method('listLocationAliases') ->with( - $this->isInstanceOf(Location::class), + self::isInstanceOf(Location::class), false ) - ->will($this->returnValue($urlAliasList)); + ->will(self::returnValue($urlAliasList)); $repository = $this->getRepositoryMock(); $repository - ->expects($this->once()) + ->expects(self::once()) ->method('getURLAliasService') - ->will($this->returnValue($urlAliasServiceMock)); + ->will(self::returnValue($urlAliasServiceMock)); return $repository; } /** * @dataProvider matchLocationProvider + * * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\UrlAlias::matchLocation * @covers \Ibexa\Core\MVC\Symfony\Matcher\ContentBased\UrlAlias::setMatchingConfig * @covers \Ibexa\Core\MVC\RepositoryAware::setRepository @@ -109,7 +112,7 @@ public function testMatchLocation($matchingConfig, Repository $repository, $expe { $this->matcher->setRepository($repository); $this->matcher->setMatchingConfig($matchingConfig); - $this->assertSame( + self::assertSame( $expectedResult, $this->matcher->matchLocation($this->getLocationMock()) ); diff --git a/tests/lib/MVC/Symfony/Matcher/DynamicallyConfiguredMatcherFactoryDecoratorTest.php b/tests/lib/MVC/Symfony/Matcher/DynamicallyConfiguredMatcherFactoryDecoratorTest.php index 3f944bbb25..6d8665ccd4 100644 --- a/tests/lib/MVC/Symfony/Matcher/DynamicallyConfiguredMatcherFactoryDecoratorTest.php +++ b/tests/lib/MVC/Symfony/Matcher/DynamicallyConfiguredMatcherFactoryDecoratorTest.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\Core\MVC\Symfony\Matcher; use Ibexa\Bundle\Core\DependencyInjection\Configuration\ConfigResolver; @@ -35,12 +36,12 @@ public function setUp(): void public function testMatch($parameterName, $namespace, $scope, $viewsConfiguration, $matchedConfig): void { $view = $this->createMock(ContentView::class); - $this->configResolver->expects($this->atLeastOnce())->method('getParameter')->with( + $this->configResolver->expects(self::atLeastOnce())->method('getParameter')->with( $parameterName, $namespace, $scope )->willReturn($viewsConfiguration); - $this->innerMatcherFactory->expects($this->once())->method('match')->with($view)->willReturn($matchedConfig); + $this->innerMatcherFactory->expects(self::once())->method('match')->with($view)->willReturn($matchedConfig); $matcherFactory = new DynamicallyConfiguredMatcherFactoryDecorator( $this->innerMatcherFactory, @@ -50,7 +51,7 @@ public function testMatch($parameterName, $namespace, $scope, $viewsConfiguratio $scope ); - $this->assertEquals($matchedConfig, $matcherFactory->match($view)); + self::assertEquals($matchedConfig, $matcherFactory->match($view)); } public function matchConfigProvider(): array diff --git a/tests/lib/MVC/Symfony/Routing/GeneratorTest.php b/tests/lib/MVC/Symfony/Routing/GeneratorTest.php index 28e4290837..b5a5ffe104 100644 --- a/tests/lib/MVC/Symfony/Routing/GeneratorTest.php +++ b/tests/lib/MVC/Symfony/Routing/GeneratorTest.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\Core\MVC\Symfony\Routing; use Ibexa\Core\MVC\Symfony\Routing\Generator; @@ -66,23 +67,23 @@ public function testSimpleGenerate($urlResource, array $parameters, $referenceTy $uri = '/some/thing'; $this->generator - ->expects($this->once()) + ->expects(self::once()) ->method('doGenerate') ->with($urlResource, $parameters) - ->will($this->returnValue($uri)); + ->will(self::returnValue($uri)); $fullUri = $baseUrl . $uri; $matcher - ->expects($this->once()) + ->expects(self::once()) ->method('analyseLink') ->with($uri) - ->will($this->returnValue($uri)); + ->will(self::returnValue($uri)); if ($referenceType === UrlGeneratorInterface::ABSOLUTE_URL) { $fullUri = $requestContext->getScheme() . '://' . $requestContext->getHost() . $baseUrl . $uri; } - $this->assertSame($fullUri, $this->generator->generate($urlResource, $parameters, $referenceType)); + self::assertSame($fullUri, $this->generator->generate($urlResource, $parameters, $referenceType)); } /** @@ -99,17 +100,17 @@ public function testGenerateWithSiteAccessNoReverseMatch($urlResource, array $pa $uri = '/some/thing'; $this->generator - ->expects($this->once()) + ->expects(self::once()) ->method('doGenerate') ->with($urlResource, $parameters) - ->will($this->returnValue($uri)); + ->will(self::returnValue($uri)); $fullUri = $baseUrl . $uri; $matcher - ->expects($this->once()) + ->expects(self::once()) ->method('analyseLink') ->with($uri) - ->will($this->returnValue($uri)); + ->will(self::returnValue($uri)); if ($referenceType === UrlGeneratorInterface::ABSOLUTE_URL) { $fullUri = $requestContext->getScheme() . '://' . $requestContext->getHost() . $baseUrl . $uri; @@ -117,14 +118,14 @@ public function testGenerateWithSiteAccessNoReverseMatch($urlResource, array $pa $siteAccessName = 'fake'; $this->siteAccessRouter - ->expects($this->once()) + ->expects(self::once()) ->method('matchByName') ->with($siteAccessName) - ->will($this->returnValue(null)); + ->will(self::returnValue(null)); $this->logger - ->expects($this->once()) + ->expects(self::once()) ->method('notice'); - $this->assertSame($fullUri, $this->generator->generate($urlResource, $parameters + ['siteaccess' => $siteAccessName], $referenceType)); + self::assertSame($fullUri, $this->generator->generate($urlResource, $parameters + ['siteaccess' => $siteAccessName], $referenceType)); } } diff --git a/tests/lib/MVC/Symfony/Routing/RouteReferenceGeneratorTest.php b/tests/lib/MVC/Symfony/Routing/RouteReferenceGeneratorTest.php index c4cdb0205e..e999a29a14 100644 --- a/tests/lib/MVC/Symfony/Routing/RouteReferenceGeneratorTest.php +++ b/tests/lib/MVC/Symfony/Routing/RouteReferenceGeneratorTest.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\Core\MVC\Symfony\Routing; use Ibexa\Core\MVC\Symfony\Event\RouteReferenceGenerationEvent; @@ -40,16 +41,16 @@ public function testGenerateNullResource() $event = new RouteReferenceGenerationEvent(new RouteReference($currentRouteName, $currentRouteParams), $request); $this->dispatcher - ->expects($this->once()) + ->expects(self::once()) ->method('dispatch') - ->with($this->equalTo($event), MVCEvents::ROUTE_REFERENCE_GENERATION); + ->with(self::equalTo($event), MVCEvents::ROUTE_REFERENCE_GENERATION); $generator = new RouteReferenceGenerator($this->dispatcher); $generator->setRequestStack($requestStack); $reference = $generator->generate(); - $this->assertInstanceOf(RouteReference::class, $reference); - $this->assertSame($currentRouteName, $reference->getRoute()); - $this->assertSame($currentRouteParams, $reference->getParams()); + self::assertInstanceOf(RouteReference::class, $reference); + self::assertSame($currentRouteName, $reference->getRoute()); + self::assertSame($currentRouteParams, $reference->getParams()); } public function testGenerateNullResourceAndPassedParams() @@ -67,16 +68,16 @@ public function testGenerateNullResourceAndPassedParams() $event = new RouteReferenceGenerationEvent(new RouteReference($currentRouteName, $expectedParams), $request); $this->dispatcher - ->expects($this->once()) + ->expects(self::once()) ->method('dispatch') - ->with($this->equalTo($event), MVCEvents::ROUTE_REFERENCE_GENERATION); + ->with(self::equalTo($event), MVCEvents::ROUTE_REFERENCE_GENERATION); $generator = new RouteReferenceGenerator($this->dispatcher); $generator->setRequestStack($requestStack); $reference = $generator->generate(null, $passedParams); - $this->assertInstanceOf(RouteReference::class, $reference); - $this->assertSame($currentRouteName, $reference->getRoute()); - $this->assertSame($expectedParams, $reference->getParams()); + self::assertInstanceOf(RouteReference::class, $reference); + self::assertSame($currentRouteName, $reference->getRoute()); + self::assertSame($expectedParams, $reference->getParams()); } /** @@ -95,16 +96,16 @@ public function testGenerate($resource, array $params) $event = new RouteReferenceGenerationEvent(new RouteReference($resource, $params), $request); $this->dispatcher - ->expects($this->once()) + ->expects(self::once()) ->method('dispatch') - ->with($this->equalTo($event), MVCEvents::ROUTE_REFERENCE_GENERATION); + ->with(self::equalTo($event), MVCEvents::ROUTE_REFERENCE_GENERATION); $generator = new RouteReferenceGenerator($this->dispatcher); $generator->setRequestStack($requestStack); $reference = $generator->generate($resource, $params); - $this->assertInstanceOf(RouteReference::class, $reference); - $this->assertSame($resource, $reference->getRoute()); - $this->assertSame($params, $reference->getParams()); + self::assertInstanceOf(RouteReference::class, $reference); + self::assertSame($resource, $reference->getRoute()); + self::assertSame($params, $reference->getParams()); } public function testGenerateNullResourceWithoutRoute() @@ -118,14 +119,14 @@ public function testGenerateNullResourceWithoutRoute() $event = new RouteReferenceGenerationEvent(new RouteReference(null, []), $request); $this->dispatcher - ->expects($this->once()) + ->expects(self::once()) ->method('dispatch') - ->with($this->equalTo($event), MVCEvents::ROUTE_REFERENCE_GENERATION); + ->with(self::equalTo($event), MVCEvents::ROUTE_REFERENCE_GENERATION); $generator = new RouteReferenceGenerator($this->dispatcher); $generator->setRequestStack($requestStack); $reference = $generator->generate(); - $this->assertInstanceOf(RouteReference::class, $reference); + self::assertInstanceOf(RouteReference::class, $reference); } public function generateGenerator() diff --git a/tests/lib/MVC/Symfony/Routing/RouteReferenceTest.php b/tests/lib/MVC/Symfony/Routing/RouteReferenceTest.php index 60c8249500..f3e054a6b0 100644 --- a/tests/lib/MVC/Symfony/Routing/RouteReferenceTest.php +++ b/tests/lib/MVC/Symfony/Routing/RouteReferenceTest.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\Core\MVC\Symfony\Routing; use Ibexa\Core\MVC\Symfony\Routing\RouteReference; @@ -16,8 +17,8 @@ public function testConstruct() $route = 'my_route'; $params = ['foo' => 'bar', 'some' => 'thing']; $reference = new RouteReference($route, $params); - $this->assertSame($route, $reference->getRoute()); - $this->assertSame($params, $reference->getParams()); + self::assertSame($route, $reference->getRoute()); + self::assertSame($params, $reference->getParams()); } public function testGetSetRoute() @@ -26,41 +27,41 @@ public function testGetSetRoute() $newRoute = 'bar'; $reference = new RouteReference($initialRoute); - $this->assertSame($initialRoute, $reference->getRoute()); + self::assertSame($initialRoute, $reference->getRoute()); $reference->setRoute($newRoute); - $this->assertSame($newRoute, $reference->getRoute()); + self::assertSame($newRoute, $reference->getRoute()); } public function testGetSetParams() { $reference = new RouteReference('foo'); - $this->assertSame([], $reference->getParams()); + self::assertSame([], $reference->getParams()); $reference->set('foo', 'bar'); - $this->assertSame('bar', $reference->get('foo')); + self::assertSame('bar', $reference->get('foo')); $obj = new \stdClass(); $reference->set('object', $obj); - $this->assertSame($obj, $reference->get('object')); + self::assertSame($obj, $reference->get('object')); $reference->set('bool', true); - $this->assertTrue($reference->get('bool')); - $this->assertSame( + self::assertTrue($reference->get('bool')); + self::assertSame( ['foo' => 'bar', 'object' => $obj, 'bool' => true], $reference->getParams() ); $defaultValue = 'http://www.phoenix-rises.fm'; - $this->assertSame($defaultValue, $reference->get('url', $defaultValue)); + self::assertSame($defaultValue, $reference->get('url', $defaultValue)); } public function testRemoveParam() { $reference = new RouteReference('foo'); $reference->set('foo', 'bar'); - $this->assertTrue($reference->has('foo')); - $this->assertSame('bar', $reference->get('foo')); + self::assertTrue($reference->has('foo')); + self::assertSame('bar', $reference->get('foo')); $reference->remove('foo'); - $this->assertFalse($reference->has('foo')); + self::assertFalse($reference->has('foo')); } } diff --git a/tests/lib/MVC/Symfony/Routing/SimplifiedRequestTest.php b/tests/lib/MVC/Symfony/Routing/SimplifiedRequestTest.php index 07d3a6449f..515e1920e4 100644 --- a/tests/lib/MVC/Symfony/Routing/SimplifiedRequestTest.php +++ b/tests/lib/MVC/Symfony/Routing/SimplifiedRequestTest.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\Core\MVC\Symfony\Routing; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/tests/lib/MVC/Symfony/Routing/UrlAliasGeneratorTest.php b/tests/lib/MVC/Symfony/Routing/UrlAliasGeneratorTest.php index 774ae160fb..9523972f0c 100644 --- a/tests/lib/MVC/Symfony/Routing/UrlAliasGeneratorTest.php +++ b/tests/lib/MVC/Symfony/Routing/UrlAliasGeneratorTest.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\Core\MVC\Symfony\Routing; use Ibexa\Contracts\Core\Persistence\User\Handler as SPIUserHandler; @@ -71,17 +72,17 @@ protected function setUp(): void $this->urlAliasService = $this->createMock(URLAliasService::class); $this->locationService = $this->createMock(LocationService::class); $this->repository - ->expects($this->any()) + ->expects(self::any()) ->method('getURLAliasService') - ->will($this->returnValue($this->urlAliasService)); + ->will(self::returnValue($this->urlAliasService)); $this->repository - ->expects($this->any()) + ->expects(self::any()) ->method('getLocationService') - ->will($this->returnValue($this->locationService)); + ->will(self::returnValue($this->locationService)); $repository - ->expects($this->any()) + ->expects(self::any()) ->method('getPermissionResolver') - ->will($this->returnValue($this->getPermissionResolverMock())); + ->will(self::returnValue($this->getPermissionResolverMock())); $urlAliasCharmap = [ '"' => '%22', @@ -106,17 +107,17 @@ public function testGetPathPrefixByRootLocationId() $pathPrefix = '/foo/bar'; $rootUrlAlias = new URLAlias(['path' => $pathPrefix]); $this->locationService - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') ->with($rootLocationId) - ->will($this->returnValue($rootLocation)); + ->will(self::returnValue($rootLocation)); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('reverseLookup') ->with($rootLocation) - ->will($this->returnValue($rootUrlAlias)); + ->will(self::returnValue($rootUrlAlias)); - $this->assertSame($pathPrefix, $this->urlAliasGenerator->getPathPrefixByRootLocationId($rootLocationId)); + self::assertSame($pathPrefix, $this->urlAliasGenerator->getPathPrefixByRootLocationId($rootLocationId)); } /** @@ -131,7 +132,7 @@ public function testIsPrefixExcluded($uri, $expectedIsExcluded) '/something/in-the-way/', ] ); - $this->assertSame($expectedIsExcluded, $this->urlAliasGenerator->isUriPrefixExcluded($uri)); + self::assertSame($expectedIsExcluded, $this->urlAliasGenerator->isUriPrefixExcluded($uri)); } public function providerTestIsPrefixExcluded() @@ -156,10 +157,10 @@ public function testLoadLocation() $locationId = 123; $location = new Location(['id' => $locationId]); $this->locationService - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') ->with($locationId) - ->will($this->returnValue($location)); + ->will(self::returnValue($location)); $this->urlAliasGenerator->loadLocation($locationId); } @@ -170,14 +171,14 @@ public function testDoGenerate(URLAlias $urlAlias, array $parameters, $expected) { $location = new Location(['id' => 123]); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('listLocationAliases') ->with($location, false) - ->will($this->returnValue([$urlAlias])); + ->will(self::returnValue([$urlAlias])); $this->urlAliasGenerator->setSiteAccess(new SiteAccess('test', 'fake', $this->createMock(SiteAccess\URILexer::class))); - $this->assertSame($expected, $this->urlAliasGenerator->doGenerate($location, $parameters)); + self::assertSame($expected, $this->urlAliasGenerator->doGenerate($location, $parameters)); } public function providerTestDoGenerate() @@ -227,10 +228,10 @@ public function testDoGenerateWithSiteAccessParam(URLAlias $urlAlias, array $par ]; $this->configResolver - ->expects($this->any()) + ->expects(self::any()) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['languages', null, 'foo', $languages], ['languages', null, 'bar', $languages], @@ -242,10 +243,10 @@ public function testDoGenerateWithSiteAccessParam(URLAlias $urlAlias, array $par $location = new Location(['id' => 123]); $this->urlAliasService - ->expects($this->exactly(1)) + ->expects(self::exactly(1)) ->method('listLocationAliases') ->will( - $this->returnValueMap( + self::returnValueMap( [ [$location, false, null, null, $languages, [$urlAlias]], ] @@ -253,20 +254,20 @@ public function testDoGenerateWithSiteAccessParam(URLAlias $urlAlias, array $par ); $this->locationService - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') ->will( - $this->returnCallback( + self::returnCallback( static function ($locationId) { return new Location(['id' => $locationId]); } ) ); $this->urlAliasService - ->expects($this->exactly(1)) + ->expects(self::exactly(1)) ->method('reverseLookup') ->will( - $this->returnCallback( + self::returnCallback( static function ($location) use ($treeRootUrlAlias) { return $treeRootUrlAlias[$location->id]; } @@ -275,7 +276,7 @@ static function ($location) use ($treeRootUrlAlias) { $this->urlAliasGenerator->setSiteAccess(new SiteAccess('test', 'fake', $this->createMock(SiteAccess\URILexer::class))); - $this->assertSame($expected, $this->urlAliasGenerator->doGenerate($location, $parameters)); + self::assertSame($expected, $this->urlAliasGenerator->doGenerate($location, $parameters)); } public function providerTestDoGenerateWithSiteaccess() @@ -324,20 +325,20 @@ public function testDoGenerateNoUrlAlias() $location = new Location(['id' => 123, 'contentInfo' => new ContentInfo(['id' => 456])]); $uri = "/content/location/$location->id"; $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('listLocationAliases') ->with($location, false) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->router - ->expects($this->once()) + ->expects(self::once()) ->method('generate') ->with( UrlAliasGenerator::INTERNAL_CONTENT_VIEW_ROUTE, ['contentId' => $location->contentId, 'locationId' => $location->id] ) - ->will($this->returnValue($uri)); + ->will(self::returnValue($uri)); - $this->assertSame($uri, $this->urlAliasGenerator->doGenerate($location, [])); + self::assertSame($uri, $this->urlAliasGenerator->doGenerate($location, [])); } /** @@ -354,29 +355,29 @@ public function testDoGenerateRootLocation(URLAlias $urlAlias, $isOutsideAndNotE $rootLocation = new Location(['id' => $rootLocationId]); $rootUrlAlias = new URLAlias(['path' => $pathPrefix]); $this->locationService - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') ->with($rootLocationId) - ->will($this->returnValue($rootLocation)); + ->will(self::returnValue($rootLocation)); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('reverseLookup') ->with($rootLocation) - ->will($this->returnValue($rootUrlAlias)); + ->will(self::returnValue($rootUrlAlias)); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('listLocationAliases') ->with($location, false) - ->will($this->returnValue([$urlAlias])); + ->will(self::returnValue([$urlAlias])); if ($isOutsideAndNotExcluded) { $this->logger - ->expects($this->once()) + ->expects(self::once()) ->method('warning'); } - $this->assertSame($expected, $this->urlAliasGenerator->doGenerate($location, [])); + self::assertSame($expected, $this->urlAliasGenerator->doGenerate($location, [])); } public function providerTestDoGenerateRootLocation() diff --git a/tests/lib/MVC/Symfony/Routing/UrlAliasRouterTest.php b/tests/lib/MVC/Symfony/Routing/UrlAliasRouterTest.php index 2a6f85f483..a467ee81e4 100644 --- a/tests/lib/MVC/Symfony/Routing/UrlAliasRouterTest.php +++ b/tests/lib/MVC/Symfony/Routing/UrlAliasRouterTest.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\Core\MVC\Symfony\Routing; use Ibexa\Contracts\Core\Repository\ContentService; @@ -100,14 +101,14 @@ protected function getRouter(LocationService $locationService, URLAliasService $ public function testRequestContext() { - $this->assertSame($this->requestContext, $this->router->getContext()); + self::assertSame($this->requestContext, $this->router->getContext()); $newContext = new RequestContext(); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('setRequestContext') ->with($newContext); $this->router->setContext($newContext); - $this->assertSame($newContext, $this->router->getContext()); + self::assertSame($newContext, $this->router->getContext()); } public function testMatch() @@ -122,7 +123,7 @@ public function testMatch() */ public function testSupports($routeReference, $isSupported) { - $this->assertSame($isSupported, $this->router->supports($routeReference)); + self::assertSame($isSupported, $this->router->supports($routeReference)); } public function providerTestSupports() @@ -137,7 +138,7 @@ public function providerTestSupports() public function testGetRouteCollection() { - $this->assertInstanceOf(RouteCollection::class, $this->router->getRouteCollection()); + self::assertInstanceOf(RouteCollection::class, $this->router->getRouteCollection()); } /** @@ -175,14 +176,14 @@ public function testMatchRequestLocation() ); $request = $this->getRequestByPathInfo($pathInfo); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($pathInfo) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') - ->will($this->returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); + ->will(self::returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -192,7 +193,7 @@ public function testMatchRequestLocation() 'viewType' => ViewManager::VIEW_TYPE_FULL, 'layout' => true, ]; - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testMatchRequestLocationWithCaseRedirect() @@ -210,19 +211,19 @@ public function testMatchRequestLocationWithCaseRedirect() ); $request = $this->getRequestByPathInfo($pathInfo); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('isUriPrefixExcluded') ->with($pathInfo) - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($pathInfo) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') - ->will($this->returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); + ->will(self::returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -234,7 +235,7 @@ public function testMatchRequestLocationWithCaseRedirect() 'needsRedirect' => true, 'semanticPathinfo' => $urlAliasPath, ]; - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testMatchRequestLocationWrongCaseUriPrefixExcluded() @@ -252,19 +253,19 @@ public function testMatchRequestLocationWrongCaseUriPrefixExcluded() ); $request = $this->getRequestByPathInfo($pathInfo); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('isUriPrefixExcluded') ->with($pathInfo) - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($pathInfo) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') - ->will($this->returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); + ->will(self::returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -276,7 +277,7 @@ public function testMatchRequestLocationWrongCaseUriPrefixExcluded() 'needsRedirect' => true, 'semanticPathinfo' => $urlAliasPath, ]; - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testMatchRequestLocationCorrectCaseUriPrefixExcluded() @@ -293,19 +294,19 @@ public function testMatchRequestLocationCorrectCaseUriPrefixExcluded() ); $request = $this->getRequestByPathInfo($pathInfo); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('isUriPrefixExcluded') ->with($pathInfo) - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($pathInfo) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') - ->will($this->returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); + ->will(self::returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -315,9 +316,9 @@ public function testMatchRequestLocationCorrectCaseUriPrefixExcluded() 'viewType' => ViewManager::VIEW_TYPE_FULL, 'layout' => true, ]; - $this->assertEquals($expected, $this->router->matchRequest($request)); - $this->assertFalse($request->attributes->has('needsRedirect')); - $this->assertSame($pathInfo, $request->attributes->get('semanticPathinfo')); + self::assertEquals($expected, $this->router->matchRequest($request)); + self::assertFalse($request->attributes->has('needsRedirect')); + self::assertSame($pathInfo, $request->attributes->get('semanticPathinfo')); } public function testMatchRequestLocationHistory() @@ -339,19 +340,19 @@ public function testMatchRequestLocationHistory() ); $request = $this->getRequestByPathInfo($pathInfo); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($pathInfo) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('generate') ->with($destinationLocation) - ->will($this->returnValue($newPathInfo)); + ->will(self::returnValue($newPathInfo)); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') - ->will($this->returnValue($destinationLocation)); + ->will(self::returnValue($destinationLocation)); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -364,7 +365,7 @@ public function testMatchRequestLocationHistory() 'semanticPathinfo' => $newPathInfo, 'prependSiteaccessOnRedirect' => false, ]; - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testMatchRequestLocationCustom() @@ -383,14 +384,14 @@ public function testMatchRequestLocationCustom() ); $request = $this->getRequestByPathInfo($pathInfo); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($pathInfo) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') - ->will($this->returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); + ->will(self::returnValue(new Location(['contentInfo' => new ContentInfo(['id' => 456])]))); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -400,7 +401,7 @@ public function testMatchRequestLocationCustom() 'viewType' => ViewManager::VIEW_TYPE_FULL, 'layout' => true, ]; - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testMatchRequestLocationCustomForward() @@ -424,26 +425,26 @@ public function testMatchRequestLocationCustomForward() ); $request = $this->getRequestByPathInfo($pathInfo); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($pathInfo) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') ->with($destinationId) ->will( - $this->returnValue($destinationLocation) + self::returnValue($destinationLocation) ); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('generate') ->with($destinationLocation) - ->will($this->returnValue($newPathInfo)); + ->will(self::returnValue($newPathInfo)); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') - ->will($this->returnValue($destinationLocation)); + ->will(self::returnValue($destinationLocation)); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -456,7 +457,7 @@ public function testMatchRequestLocationCustomForward() 'semanticPathinfo' => $newPathInfo, 'prependSiteaccessOnRedirect' => false, ]; - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testMatchRequestFail() @@ -466,10 +467,10 @@ public function testMatchRequestFail() $pathInfo = '/foo/bar'; $request = $this->getRequestByPathInfo($pathInfo); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($pathInfo) - ->will($this->throwException(new NotFoundException('URLAlias', $pathInfo))); + ->will(self::throwException(new NotFoundException('URLAlias', $pathInfo))); $this->router->matchRequest($request); } @@ -486,17 +487,17 @@ public function testMatchRequestResource() ); $request = $this->getRequestByPathInfo($pathInfo); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($pathInfo) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, 'semanticPathinfo' => $destination, 'needsForward' => true, ]; - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testMatchRequestResourceWithRedirect() @@ -513,17 +514,17 @@ public function testMatchRequestResourceWithRedirect() ); $request = $this->getRequestByPathInfo($pathInfo); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($pathInfo) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, 'needsRedirect' => true, 'semanticPathinfo' => $destination, ]; - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testMatchRequestResourceWithCaseRedirect() @@ -541,22 +542,22 @@ public function testMatchRequestResourceWithCaseRedirect() ); $request = $this->getRequestByPathInfo($pathInfo); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('isUriPrefixExcluded') ->with($pathInfo) - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($pathInfo) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, 'semanticPathinfo' => $urlAliasPath, 'needsRedirect' => true, ]; - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } /** @@ -578,17 +579,17 @@ public function testMatchRequestResourceCaseIncorrectWithForwardRedirect() ); $request = $this->getRequestByPathInfo($pathInfo); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($pathInfo) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, 'semanticPathinfo' => $destination, 'needsRedirect' => true, ]; - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testMatchRequestVirtual() @@ -602,17 +603,17 @@ public function testMatchRequestVirtual() ); $request = $this->getRequestByPathInfo($pathInfo); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($pathInfo) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, 'semanticPathinfo' => '/', 'needsForward' => true, ]; - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testMatchRequestVirtualWithCaseRedirect() @@ -627,22 +628,22 @@ public function testMatchRequestVirtualWithCaseRedirect() ); $request = $this->getRequestByPathInfo($pathInfo); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('isUriPrefixExcluded') ->with($pathInfo) - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $this->urlAliasService - ->expects($this->once()) + ->expects(self::once()) ->method('lookup') ->with($pathInfo) - ->will($this->returnValue($urlAlias)); + ->will(self::returnValue($urlAlias)); $expected = [ '_route' => UrlAliasRouter::URL_ALIAS_ROUTE_NAME, 'semanticPathinfo' => $urlAliasPath, 'needsRedirect' => true, ]; - $this->assertEquals($expected, $this->router->matchRequest($request)); + self::assertEquals($expected, $this->router->matchRequest($request)); } public function testGenerateFail() @@ -663,12 +664,12 @@ public function testGenerateWithRouteObject(): void $generatedLink = '/foo/bar'; $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('generate') ->with($location, $parameters, $referenceType) - ->will($this->returnValue($generatedLink)); + ->will(self::returnValue($generatedLink)); - $this->assertSame( + self::assertSame( $generatedLink, $this->router->generate( '', @@ -702,16 +703,16 @@ public function testGenerateWithLocationId() $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH; $generatedLink = '/foo/bar'; $this->locationService - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') ->with($locationId) - ->will($this->returnValue($location)); + ->will(self::returnValue($location)); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('generate') ->with($location, $parameters, $referenceType) - ->will($this->returnValue($generatedLink)); - $this->assertSame( + ->will(self::returnValue($generatedLink)); + self::assertSame( $generatedLink, $this->router->generate( UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -729,11 +730,11 @@ public function testGenerateWithLocationAsParameter() $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH; $generatedLink = '/foo/bar'; $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('generate') ->with($location, $parameters, $referenceType) - ->will($this->returnValue($generatedLink)); - $this->assertSame( + ->will(self::returnValue($generatedLink)); + self::assertSame( $generatedLink, $this->router->generate( UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -753,21 +754,21 @@ public function testGenerateWithContentId() $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH; $generatedLink = '/foo/bar'; $this->contentService - ->expects($this->once()) + ->expects(self::once()) ->method('loadContentInfo') ->with($contentId) - ->will($this->returnValue($contentInfo)); + ->will(self::returnValue($contentInfo)); $this->locationService - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') ->with($contentInfo->mainLocationId) - ->will($this->returnValue($location)); + ->will(self::returnValue($location)); $this->urlALiasGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('generate') ->with($location, $parameters, $referenceType) - ->will($this->returnValue($generatedLink)); - $this->assertSame( + ->will(self::returnValue($generatedLink)); + self::assertSame( $generatedLink, $this->router->generate( UrlAliasRouter::URL_ALIAS_ROUTE_NAME, @@ -786,10 +787,10 @@ public function testGenerateWithContentIdWithMissingMainLocation() $parameters = ['some' => 'thing']; $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH; $this->contentService - ->expects($this->once()) + ->expects(self::once()) ->method('loadContentInfo') ->with($contentId) - ->will($this->returnValue($contentInfo)); + ->will(self::returnValue($contentInfo)); $this->router->generate( UrlAliasRouter::URL_ALIAS_ROUTE_NAME, diff --git a/tests/lib/MVC/Symfony/Security/Authentication/AnonymousAuthenticationProviderTest.php b/tests/lib/MVC/Symfony/Security/Authentication/AnonymousAuthenticationProviderTest.php index f9a4a26a3f..c5d2a433d5 100644 --- a/tests/lib/MVC/Symfony/Security/Authentication/AnonymousAuthenticationProviderTest.php +++ b/tests/lib/MVC/Symfony/Security/Authentication/AnonymousAuthenticationProviderTest.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\Core\MVC\Symfony\Security\Authentication; use Ibexa\Contracts\Core\Repository\PermissionResolver; @@ -33,13 +34,13 @@ public function testAuthenticate() { $anonymousUserId = 10; $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('anonymous_user_id') - ->will($this->returnValue($anonymousUserId)); + ->will(self::returnValue($anonymousUserId)); $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('setCurrentUserReference') ->with(new UserReference($anonymousUserId)); @@ -51,7 +52,7 @@ public function testAuthenticate() ->getMockBuilder(AnonymousToken::class) ->setConstructorArgs([$key, $this->createMock(UserInterface::class)]) ->getMockForAbstractClass(); - $this->assertSame($anonymousToken, $authProvider->authenticate($anonymousToken)); + self::assertSame($anonymousToken, $authProvider->authenticate($anonymousToken)); } } diff --git a/tests/lib/MVC/Symfony/Security/Authentication/DefaultAuthenticationSuccessHandlerTest.php b/tests/lib/MVC/Symfony/Security/Authentication/DefaultAuthenticationSuccessHandlerTest.php index d410ada7dc..b48077592a 100644 --- a/tests/lib/MVC/Symfony/Security/Authentication/DefaultAuthenticationSuccessHandlerTest.php +++ b/tests/lib/MVC/Symfony/Security/Authentication/DefaultAuthenticationSuccessHandlerTest.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\Core\MVC\Symfony\Security\Authentication; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; @@ -36,15 +37,15 @@ public function testSetConfigResolver() $refOptions = $refHandler->getProperty('options'); $refOptions->setAccessible(true); $options = $refOptions->getValue($successHandler); - $this->assertSame('/', $options['default_target_path']); + self::assertSame('/', $options['default_target_path']); $defaultPage = '/foo/bar'; $configResolver = $this->createMock(ConfigResolverInterface::class); $configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('default_page') - ->will($this->returnValue($defaultPage)); + ->will(self::returnValue($defaultPage)); $successHandler->setConfigResolver($configResolver); $successHandler->setEventDispatcher($this->createMock(EventDispatcherInterface::class)); @@ -59,7 +60,7 @@ public function testSetConfigResolver() $successHandler->onAuthenticationSuccess($request, $this->createMock(TokenInterface::class)); $options = $refOptions->getValue($successHandler); - $this->assertSame($defaultPage, $options['default_target_path']); + self::assertSame($defaultPage, $options['default_target_path']); } } diff --git a/tests/lib/MVC/Symfony/Security/Authentication/RememberMeRepositoryAuthenticationProviderTest.php b/tests/lib/MVC/Symfony/Security/Authentication/RememberMeRepositoryAuthenticationProviderTest.php index 53aaee14e4..50a90fe430 100644 --- a/tests/lib/MVC/Symfony/Security/Authentication/RememberMeRepositoryAuthenticationProviderTest.php +++ b/tests/lib/MVC/Symfony/Security/Authentication/RememberMeRepositoryAuthenticationProviderTest.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\Core\MVC\Symfony\Security\Authentication; use Ibexa\Contracts\Core\Repository\PermissionResolver; @@ -57,18 +58,18 @@ public function testAuthenticateWrongProviderKey() $user = $this->createMock(UserInterface::class); $user - ->expects($this->any()) + ->expects(self::any()) ->method('getRoles') - ->will($this->returnValue([])); + ->will(self::returnValue([])); $rememberMeToken = $this ->getMockBuilder(RememberMeToken::class) ->setConstructorArgs([$user, 'wrong provider secret', 'my secret']) ->getMock(); $rememberMeToken - ->expects($this->any()) + ->expects(self::any()) ->method('getProviderKey') - ->will($this->returnValue('wrong provider secret')); + ->will(self::returnValue('wrong provider secret')); $this->authProvider->authenticate($rememberMeToken); } @@ -79,22 +80,22 @@ public function testAuthenticateWrongSecret() $user = $this->createMock(UserInterface::class); $user - ->expects($this->any()) + ->expects(self::any()) ->method('getRoles') - ->will($this->returnValue([])); + ->will(self::returnValue([])); $rememberMeToken = $this ->getMockBuilder(RememberMeToken::class) ->setConstructorArgs([$user, 'my provider secret', 'the wrong secret']) ->getMock(); $rememberMeToken - ->expects($this->any()) + ->expects(self::any()) ->method('getProviderKey') - ->will($this->returnValue('my provider secret')); + ->will(self::returnValue('my provider secret')); $rememberMeToken - ->expects($this->any()) + ->expects(self::any()) ->method('getSecret') - ->will($this->returnValue('the wrong secret')); + ->will(self::returnValue('the wrong secret')); $this->authProvider->authenticate($rememberMeToken); } @@ -103,15 +104,15 @@ public function testAuthenticate() { $apiUser = $this->createMock(ApiUser::class); $apiUser - ->expects($this->any()) + ->expects(self::any()) ->method('getUserId') - ->will($this->returnValue(42)); + ->will(self::returnValue(42)); $tokenUser = new User($apiUser); $rememberMeToken = new RememberMeToken($tokenUser, 'my provider secret', 'my secret'); $authenticatedToken = $this->authProvider->authenticate($rememberMeToken); - $this->assertEquals( + self::assertEquals( [$rememberMeToken->getProviderKey(), $rememberMeToken->getSecret(), $rememberMeToken->getUsername()], [$authenticatedToken->getProviderKey(), $authenticatedToken->getSecret(), $authenticatedToken->getUsername()] ); diff --git a/tests/lib/MVC/Symfony/Security/Authentication/RepositoryAuthenticationProviderTest.php b/tests/lib/MVC/Symfony/Security/Authentication/RepositoryAuthenticationProviderTest.php index 2fc7f3f009..97312b75a2 100644 --- a/tests/lib/MVC/Symfony/Security/Authentication/RepositoryAuthenticationProviderTest.php +++ b/tests/lib/MVC/Symfony/Security/Authentication/RepositoryAuthenticationProviderTest.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\Core\MVC\Symfony\Security\Authentication; use Ibexa\Bundle\Core\DependencyInjection\Compiler\SecurityPass; @@ -74,15 +75,15 @@ public function testAuthenticationNotEzUser() $password = 'some_encoded_password'; $user = $this->createMock(UserInterface::class); $user - ->expects($this->any()) + ->expects(self::any()) ->method('getPassword') - ->will($this->returnValue($password)); + ->will(self::returnValue($password)); $tokenUser = $this->createMock(UserInterface::class); $tokenUser - ->expects($this->any()) + ->expects(self::any()) ->method('getPassword') - ->will($this->returnValue($password)); + ->will(self::returnValue($password)); $token = new UsernamePasswordToken($tokenUser, 'foo', 'bar'); $method = new \ReflectionMethod($this->authProvider, 'checkAuthentication'); @@ -99,9 +100,9 @@ public function testCheckAuthenticationCredentialsChanged() ->setMethods(['getUserId']) ->getMockForAbstractClass(); $apiUser - ->expects($this->once()) + ->expects(self::once()) ->method('getUserId') - ->will($this->returnValue(456)); + ->will(self::returnValue(456)); $tokenUser = new User($apiUser); $token = new UsernamePasswordToken($tokenUser, 'foo', 'bar'); @@ -111,9 +112,9 @@ public function testCheckAuthenticationCredentialsChanged() $user = $this->createMock(User::class); $user - ->expects($this->any()) + ->expects(self::any()) ->method('getAPIUser') - ->will($this->returnValue($renewedApiUser)); + ->will(self::returnValue($renewedApiUser)); $method = new \ReflectionMethod($this->authProvider, 'checkAuthentication'); $method->setAccessible(true); @@ -133,12 +134,12 @@ public function testCheckAuthenticationAlreadyLoggedIn() $user = $this->createMock(User::class); $user - ->expects($this->once()) + ->expects(self::once()) ->method('getAPIUser') - ->will($this->returnValue($apiUser)); + ->will(self::returnValue($apiUser)); $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('setCurrentUserReference') ->with($apiUser); @@ -160,7 +161,7 @@ public function testCheckAuthenticationFailed() $token = new UsernamePasswordToken($userName, $password, 'bar'); $this->userService - ->expects($this->once()) + ->expects(self::once()) ->method('checkUserCredentials') ->with($apiUser, $password) ->willReturn(false); @@ -182,13 +183,13 @@ public function testCheckAuthentication() ->willReturn($apiUser); $this->userService - ->expects($this->once()) + ->expects(self::once()) ->method('checkUserCredentials') ->with($apiUser, $password) ->willReturn(true); $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('setCurrentUserReference') ->with($apiUser); @@ -213,7 +214,7 @@ public function testCheckAuthenticationFailedWhenPasswordInUnsupportedFormat() ->willReturn($user); $this->userService - ->expects($this->once()) + ->expects(self::once()) ->method('checkUserCredentials') ->with($apiUser, $password) ->willThrowException(new UnsupportedPasswordHashType(self::UNSUPPORTED_USER_PASSWORD_HASH_TYPE)); diff --git a/tests/lib/MVC/Symfony/Security/EventListener/SecurityListenerTest.php b/tests/lib/MVC/Symfony/Security/EventListener/SecurityListenerTest.php index 1cf8624b4b..584d03d8c5 100644 --- a/tests/lib/MVC/Symfony/Security/EventListener/SecurityListenerTest.php +++ b/tests/lib/MVC/Symfony/Security/EventListener/SecurityListenerTest.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\Core\MVC\Symfony\Security\EventListener; use Ibexa\Contracts\Core\Repository\PermissionResolver; @@ -78,7 +79,7 @@ protected function generateListener() public function testGetSubscribedEvents() { - $this->assertSame( + self::assertSame( [ SecurityEvents::INTERACTIVE_LOGIN => [ ['onInteractiveLogin', 10], @@ -95,13 +96,13 @@ public function testOnInteractiveLoginAlreadyEzUser() $user = $this->createMock(UserInterface::class); $token = $this->createMock(TokenInterface::class); $token - ->expects($this->once()) + ->expects(self::once()) ->method('getUser') - ->will($this->returnValue($user)); + ->will(self::returnValue($user)); $event = new BaseInteractiveLoginEvent(new Request(), $token); $this->eventDispatcher - ->expects($this->never()) + ->expects(self::never()) ->method('dispatch'); $this->listener->onInteractiveLogin($event); @@ -112,13 +113,13 @@ public function testOnInteractiveLoginNotUserObject() $user = 'foobar'; $token = $this->createMock(TokenInterface::class); $token - ->expects($this->once()) + ->expects(self::once()) ->method('getUser') - ->will($this->returnValue($user)); + ->will(self::returnValue($user)); $event = new BaseInteractiveLoginEvent(new Request(), $token); $this->eventDispatcher - ->expects($this->never()) + ->expects(self::never()) ->method('dispatch'); $this->listener->onInteractiveLogin($event); @@ -129,43 +130,43 @@ public function testOnInteractiveLogin() $user = $this->createMock(SymfonyUserInterface::class); $token = $this->createMock(TokenInterface::class); $token - ->expects($this->once()) + ->expects(self::once()) ->method('getUser') - ->will($this->returnValue($user)); + ->will(self::returnValue($user)); $token - ->expects($this->once()) + ->expects(self::once()) ->method('getRoleNames') - ->will($this->returnValue(['ROLE_USER'])); + ->will(self::returnValue(['ROLE_USER'])); $token - ->expects($this->once()) + ->expects(self::once()) ->method('getAttributes') - ->will($this->returnValue(['foo' => 'bar'])); + ->will(self::returnValue(['foo' => 'bar'])); $event = new BaseInteractiveLoginEvent(new Request(), $token); $anonymousUserId = 10; $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('anonymous_user_id') - ->will($this->returnValue($anonymousUserId)); + ->will(self::returnValue($anonymousUserId)); $apiUser = $this->createMock(APIUser::class); $this->userService - ->expects($this->once()) + ->expects(self::once()) ->method('loadUser') ->with($anonymousUserId) - ->will($this->returnValue($apiUser)); + ->will(self::returnValue($apiUser)); $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('setCurrentUserReference') ->with($apiUser); $this->tokenStorage - ->expects($this->once()) + ->expects(self::once()) ->method('setToken') - ->with($this->isInstanceOf(InteractiveLoginToken::class)); + ->with(self::isInstanceOf(InteractiveLoginToken::class)); $this->listener->onInteractiveLogin($event); } @@ -177,19 +178,19 @@ public function testCheckSiteAccessPermissionDenied() $user = $this->createMock(UserInterface::class); $token = $this->createMock(TokenInterface::class); $token - ->expects($this->once()) + ->expects(self::once()) ->method('getUser') - ->will($this->returnValue($user)); + ->will(self::returnValue($user)); $request = new Request(); $siteAccess = new SiteAccess('test'); $request->attributes->set('siteaccess', $siteAccess); $this->authChecker - ->expects($this->once()) + ->expects(self::once()) ->method('isGranted') - ->with($this->equalTo(new Attribute('user', 'login', ['valueObject' => $siteAccess]))) - ->will($this->returnValue(false)); + ->with(self::equalTo(new Attribute('user', 'login', ['valueObject' => $siteAccess]))) + ->will(self::returnValue(false)); $this->listener->checkSiteAccessPermission(new BaseInteractiveLoginEvent($request, $token)); } @@ -199,19 +200,19 @@ public function testCheckSiteAccessPermissionGranted() $user = $this->createMock(UserInterface::class); $token = $this->createMock(TokenInterface::class); $token - ->expects($this->once()) + ->expects(self::once()) ->method('getUser') - ->will($this->returnValue($user)); + ->will(self::returnValue($user)); $request = new Request(); $siteAccess = new SiteAccess('test'); $request->attributes->set('siteaccess', $siteAccess); $this->authChecker - ->expects($this->once()) + ->expects(self::once()) ->method('isGranted') - ->with($this->equalTo(new Attribute('user', 'login', ['valueObject' => $siteAccess]))) - ->will($this->returnValue(true)); + ->with(self::equalTo(new Attribute('user', 'login', ['valueObject' => $siteAccess]))) + ->will(self::returnValue(true)); // Nothing should happen or should be returned. $this->listener->checkSiteAccessPermission(new BaseInteractiveLoginEvent($request, $token)); @@ -222,16 +223,16 @@ public function testCheckSiteAccessNotEzUser() $user = $this->createMock(SymfonyUserInterface::class); $token = $this->createMock(TokenInterface::class); $token - ->expects($this->once()) + ->expects(self::once()) ->method('getUser') - ->will($this->returnValue($user)); + ->will(self::returnValue($user)); $request = new Request(); $siteAccess = new SiteAccess('test'); $request->attributes->set('siteaccess', $siteAccess); $this->authChecker - ->expects($this->never()) + ->expects(self::never()) ->method('isGranted'); $this->listener->checkSiteAccessPermission(new BaseInteractiveLoginEvent($request, $token)); @@ -242,12 +243,12 @@ public function testCheckSiteAccessNoSiteAccess() $user = $this->createMock(UserInterface::class); $token = $this->createMock(TokenInterface::class); $token - ->expects($this->once()) + ->expects(self::once()) ->method('getUser') - ->will($this->returnValue($user)); + ->will(self::returnValue($user)); $this->authChecker - ->expects($this->never()) + ->expects(self::never()) ->method('isGranted'); $this->listener->checkSiteAccessPermission(new BaseInteractiveLoginEvent(new Request(), $token)); @@ -262,10 +263,10 @@ public function testOnKernelRequestSubRequest() ); $this->tokenStorage - ->expects($this->never()) + ->expects(self::never()) ->method('getToken'); $this->authChecker - ->expects($this->never()) + ->expects(self::never()) ->method('isGranted'); $this->listener->onKernelRequest($event); @@ -279,14 +280,14 @@ public function testOnKernelRequestSubRequestFragment() HttpKernelInterface::MASTER_REQUEST ); $this->configResolver - ->expects($this->never()) + ->expects(self::never()) ->method('getParameter'); $this->tokenStorage - ->expects($this->never()) + ->expects(self::never()) ->method('getToken'); $this->authChecker - ->expects($this->never()) + ->expects(self::never()) ->method('isGranted'); $this->listener->onKernelRequest($event); @@ -301,10 +302,10 @@ public function testOnKernelRequestNoSiteAccess() ); $this->tokenStorage - ->expects($this->never()) + ->expects(self::never()) ->method('getToken'); $this->authChecker - ->expects($this->never()) + ->expects(self::never()) ->method('isGranted'); $this->listener->onKernelRequest($event); @@ -321,11 +322,11 @@ public function testOnKernelRequestNullToken() ); $this->tokenStorage - ->expects($this->once()) + ->expects(self::once()) ->method('getToken') - ->will($this->returnValue(null)); + ->will(self::returnValue(null)); $this->authChecker - ->expects($this->never()) + ->expects(self::never()) ->method('isGranted'); $this->listener->onKernelRequest($event); @@ -343,11 +344,11 @@ public function testOnKernelRequestLoginRoute() ); $this->tokenStorage - ->expects($this->once()) + ->expects(self::once()) ->method('getToken') - ->will($this->returnValue(null)); + ->will(self::returnValue(null)); $this->authChecker - ->expects($this->never()) + ->expects(self::never()) ->method('isGranted'); $this->listener->onKernelRequest($event); @@ -367,18 +368,18 @@ public function testOnKernelRequestAccessDenied() $token = $this->createMock(TokenInterface::class); $token - ->expects($this->any()) + ->expects(self::any()) ->method('getUsername') - ->will($this->returnValue('foo')); + ->will(self::returnValue('foo')); $this->tokenStorage - ->expects($this->once()) + ->expects(self::once()) ->method('getToken') - ->will($this->returnValue($token)); + ->will(self::returnValue($token)); $this->authChecker - ->expects($this->once()) + ->expects(self::once()) ->method('isGranted') - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $this->listener->onKernelRequest($event); } @@ -395,18 +396,18 @@ public function testOnKernelRequestAccessGranted() $token = $this->createMock(TokenInterface::class); $token - ->expects($this->any()) + ->expects(self::any()) ->method('getUsername') - ->will($this->returnValue('foo')); + ->will(self::returnValue('foo')); $this->tokenStorage - ->expects($this->once()) + ->expects(self::once()) ->method('getToken') - ->will($this->returnValue($token)); + ->will(self::returnValue($token)); $this->authChecker - ->expects($this->once()) + ->expects(self::once()) ->method('isGranted') - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); // Nothing should happen or should be returned. $this->listener->onKernelRequest($event); diff --git a/tests/lib/MVC/Symfony/Security/HttpUtilsTest.php b/tests/lib/MVC/Symfony/Security/HttpUtilsTest.php index ccf6d99b17..955c02b728 100644 --- a/tests/lib/MVC/Symfony/Security/HttpUtilsTest.php +++ b/tests/lib/MVC/Symfony/Security/HttpUtilsTest.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\Core\MVC\Symfony\Security; use Ibexa\Core\MVC\Symfony\Security\HttpUtils; @@ -29,13 +30,13 @@ public function testGenerateUriStandard($uri, $isUriRouteName, $expected) if ($isUriRouteName) { $urlGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('generate') ->with($uri, $requestAttributes, UrlGeneratorInterface::ABSOLUTE_URL) - ->will($this->returnValue($expected . '?' . http_build_query($requestAttributes))); + ->will(self::returnValue($expected . '?' . http_build_query($requestAttributes))); } - $this->assertSame($expected, $httpUtils->generateUri($request, $uri)); + self::assertSame($expected, $httpUtils->generateUri($request, $uri)); } public function generateUriStandardProvider() @@ -58,10 +59,10 @@ public function testGenerateUri($uri, $isUriRouteName, $siteAccessUri, $expected if ($uri[0] === '/') { $matcher = $this->createMock(SiteAccess\URILexer::class); $matcher - ->expects($this->once()) + ->expects(self::once()) ->method('analyseLink') ->with($uri) - ->will($this->returnValue($siteAccessUri . $uri)); + ->will(self::returnValue($siteAccessUri . $uri)); $siteAccess->matcher = $matcher; } @@ -75,14 +76,14 @@ public function testGenerateUri($uri, $isUriRouteName, $siteAccessUri, $expected if ($isUriRouteName) { $urlGenerator - ->expects($this->once()) + ->expects(self::once()) ->method('generate') ->with($uri, $requestAttributes, UrlGeneratorInterface::ABSOLUTE_URL) - ->will($this->returnValue($expected . '?' . http_build_query($requestAttributes))); + ->will(self::returnValue($expected . '?' . http_build_query($requestAttributes))); } $res = $httpUtils->generateUri($request, $uri); - $this->assertSame($expected, $res); + self::assertSame($expected, $res); } public function generateUriProvider() @@ -101,7 +102,7 @@ public function testCheckRequestPathStandard() $httpUtils = new HttpUtils(); $httpUtils->setSiteAccess(new SiteAccess('test')); $request = Request::create('http://ezpublish.dev/foo/bar'); - $this->assertTrue($httpUtils->checkRequestPath($request, '/foo/bar')); + self::assertTrue($httpUtils->checkRequestPath($request, '/foo/bar')); } /** @@ -113,17 +114,17 @@ public function testCheckRequestPath($path, $siteAccessUri, $requestUri, $expect if ($siteAccessUri !== null) { $matcher = $this->createMock(SiteAccess\URILexer::class); $matcher - ->expects($this->once()) + ->expects(self::once()) ->method('analyseLink') ->with($path) - ->will($this->returnValue($siteAccessUri . $path)); + ->will(self::returnValue($siteAccessUri . $path)); $siteAccess->matcher = $matcher; } $httpUtils = new HttpUtils(); $httpUtils->setSiteAccess($siteAccess); $request = Request::create($requestUri); - $this->assertSame($expected, $httpUtils->checkRequestPath($request, $path)); + self::assertSame($expected, $httpUtils->checkRequestPath($request, $path)); } public function checkRequestPathProvider() diff --git a/tests/lib/MVC/Symfony/Security/InteractiveLoginTokenTest.php b/tests/lib/MVC/Symfony/Security/InteractiveLoginTokenTest.php index 5e9b35cf8d..ed83118f3d 100644 --- a/tests/lib/MVC/Symfony/Security/InteractiveLoginTokenTest.php +++ b/tests/lib/MVC/Symfony/Security/InteractiveLoginTokenTest.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\Core\MVC\Symfony\Security; use Ibexa\Core\MVC\Symfony\Security\InteractiveLoginToken; @@ -29,12 +30,12 @@ public function testConstruct() } $token = new InteractiveLoginToken($user, $originalTokenType, $credentials, $providerKey, $roles); - $this->assertSame($user, $token->getUser()); - $this->assertTrue($token->isAuthenticated()); - $this->assertSame($originalTokenType, $token->getOriginalTokenType()); - $this->assertSame($credentials, $token->getCredentials()); - $this->assertSame($providerKey, $token->getProviderKey()); - $this->assertEquals($expectedRoles, $token->getRoleNames()); + self::assertSame($user, $token->getUser()); + self::assertTrue($token->isAuthenticated()); + self::assertSame($originalTokenType, $token->getOriginalTokenType()); + self::assertSame($credentials, $token->getCredentials()); + self::assertSame($providerKey, $token->getProviderKey()); + self::assertEquals($expectedRoles, $token->getRoleNames()); } public function testSerialize() @@ -48,7 +49,7 @@ public function testSerialize() $token = new InteractiveLoginToken($user, $originalTokenType, $credentials, $providerKey, $roles); $serialized = serialize($token); $unserializedToken = unserialize($serialized); - $this->assertEquals($token, $unserializedToken); + self::assertEquals($token, $unserializedToken); } } diff --git a/tests/lib/MVC/Symfony/Security/User/EmailProviderTest.php b/tests/lib/MVC/Symfony/Security/User/EmailProviderTest.php index a99edb2a58..3013e436e5 100644 --- a/tests/lib/MVC/Symfony/Security/User/EmailProviderTest.php +++ b/tests/lib/MVC/Symfony/Security/User/EmailProviderTest.php @@ -47,7 +47,7 @@ protected function setUp(): void public function testLoadUserByUsernameAlreadyUserObject() { $user = $this->createMock(UserInterface::class); - $this->assertSame($user, $this->userProvider->loadUserByUsername($user)); + self::assertSame($user, $this->userProvider->loadUserByUsername($user)); } public function testLoadUserByUsernameUserNotFound() @@ -56,10 +56,10 @@ public function testLoadUserByUsernameUserNotFound() $username = 'foobar@example.org'; $this->userService - ->expects($this->once()) + ->expects(self::once()) ->method('loadUserByEmail') ->with($username) - ->will($this->throwException(new NotFoundException('user', $username))); + ->will(self::throwException(new NotFoundException('user', $username))); $this->userProvider->loadUserByUsername($username); } @@ -69,15 +69,15 @@ public function testLoadUserByUsername() $apiUser = $this->createMock(APIUser::class); $this->userService - ->expects($this->once()) + ->expects(self::once()) ->method('loadUserByEmail') ->with($username) - ->will($this->returnValue($apiUser)); + ->will(self::returnValue($apiUser)); $user = $this->userProvider->loadUserByUsername($username); - $this->assertInstanceOf(UserInterface::class, $user); - $this->assertSame($apiUser, $user->getAPIUser()); - $this->assertSame(['ROLE_USER'], $user->getRoles()); + self::assertInstanceOf(UserInterface::class, $user); + self::assertSame($apiUser, $user->getAPIUser()); + self::assertSame(['ROLE_USER'], $user->getRoles()); } public function testRefreshUserNotSupported() @@ -105,26 +105,26 @@ public function testRefreshUser() $refreshedAPIUser = clone $apiUser; $user = $this->createMock(UserInterface::class); $user - ->expects($this->once()) + ->expects(self::once()) ->method('getAPIUser') - ->will($this->returnValue($apiUser)); + ->will(self::returnValue($apiUser)); $user - ->expects($this->once()) + ->expects(self::once()) ->method('setAPIUser') ->with($refreshedAPIUser); $this->userService - ->expects($this->once()) + ->expects(self::once()) ->method('loadUser') ->with($userId) - ->will($this->returnValue($refreshedAPIUser)); + ->will(self::returnValue($refreshedAPIUser)); $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('setCurrentUserReference') ->with(new UserReference($apiUser->getUserId())); - $this->assertSame($user, $this->userProvider->refreshUser($user)); + self::assertSame($user, $this->userProvider->refreshUser($user)); } public function testRefreshUserNotFound() @@ -145,15 +145,15 @@ public function testRefreshUserNotFound() ); $user = $this->createMock(UserInterface::class); $user - ->expects($this->once()) + ->expects(self::once()) ->method('getAPIUser') - ->will($this->returnValue($apiUser)); + ->will(self::returnValue($apiUser)); $this->userService - ->expects($this->once()) + ->expects(self::once()) ->method('loadUser') ->with($userId) - ->will($this->throwException(new NotFoundException('user', 'foo'))); + ->will(self::throwException(new NotFoundException('user', 'foo'))); $this->userProvider->refreshUser($user); } @@ -163,7 +163,7 @@ public function testRefreshUserNotFound() */ public function testSupportsClass($class, $supports) { - $this->assertSame($supports, $this->userProvider->supportsClass($class)); + self::assertSame($supports, $this->userProvider->supportsClass($class)); } public function supportsClassProvider() @@ -181,9 +181,9 @@ public function testLoadUserByAPIUser() $user = $this->userProvider->loadUserByAPIUser($apiUser); - $this->assertInstanceOf(MVCUser::class, $user); - $this->assertSame($apiUser, $user->getAPIUser()); - $this->assertSame(['ROLE_USER'], $user->getRoles()); + self::assertInstanceOf(MVCUser::class, $user); + self::assertSame($apiUser, $user->getAPIUser()); + self::assertSame(['ROLE_USER'], $user->getRoles()); } } diff --git a/tests/lib/MVC/Symfony/Security/User/UsernameProviderTest.php b/tests/lib/MVC/Symfony/Security/User/UsernameProviderTest.php index f03117f9d5..42e3a75346 100644 --- a/tests/lib/MVC/Symfony/Security/User/UsernameProviderTest.php +++ b/tests/lib/MVC/Symfony/Security/User/UsernameProviderTest.php @@ -47,7 +47,7 @@ protected function setUp(): void public function testLoadUserByUsernameAlreadyUserObject() { $user = $this->createMock(UserInterface::class); - $this->assertSame($user, $this->userProvider->loadUserByUsername($user)); + self::assertSame($user, $this->userProvider->loadUserByUsername($user)); } public function testLoadUserByUsernameUserNotFound() @@ -56,10 +56,10 @@ public function testLoadUserByUsernameUserNotFound() $username = 'foobar'; $this->userService - ->expects($this->once()) + ->expects(self::once()) ->method('loadUserByLogin') ->with($username) - ->will($this->throwException(new NotFoundException('user', $username))); + ->will(self::throwException(new NotFoundException('user', $username))); $this->userProvider->loadUserByUsername($username); } @@ -69,15 +69,15 @@ public function testLoadUserByUsername() $apiUser = $this->createMock(APIUser::class); $this->userService - ->expects($this->once()) + ->expects(self::once()) ->method('loadUserByLogin') ->with($username) - ->will($this->returnValue($apiUser)); + ->will(self::returnValue($apiUser)); $user = $this->userProvider->loadUserByUsername($username); - $this->assertInstanceOf(UserInterface::class, $user); - $this->assertSame($apiUser, $user->getAPIUser()); - $this->assertSame(['ROLE_USER'], $user->getRoles()); + self::assertInstanceOf(UserInterface::class, $user); + self::assertSame($apiUser, $user->getAPIUser()); + self::assertSame(['ROLE_USER'], $user->getRoles()); } public function testRefreshUserNotSupported() @@ -105,26 +105,26 @@ public function testRefreshUser() $refreshedAPIUser = clone $apiUser; $user = $this->createMock(UserInterface::class); $user - ->expects($this->once()) + ->expects(self::once()) ->method('getAPIUser') - ->will($this->returnValue($apiUser)); + ->will(self::returnValue($apiUser)); $user - ->expects($this->once()) + ->expects(self::once()) ->method('setAPIUser') ->with($refreshedAPIUser); $this->userService - ->expects($this->once()) + ->expects(self::once()) ->method('loadUser') ->with($userId) - ->will($this->returnValue($refreshedAPIUser)); + ->will(self::returnValue($refreshedAPIUser)); $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('setCurrentUserReference') ->with(new UserReference($apiUser->getUserId())); - $this->assertSame($user, $this->userProvider->refreshUser($user)); + self::assertSame($user, $this->userProvider->refreshUser($user)); } public function testRefreshUserNotFound() @@ -145,15 +145,15 @@ public function testRefreshUserNotFound() ); $user = $this->createMock(UserInterface::class); $user - ->expects($this->once()) + ->expects(self::once()) ->method('getAPIUser') - ->will($this->returnValue($apiUser)); + ->will(self::returnValue($apiUser)); $this->userService - ->expects($this->once()) + ->expects(self::once()) ->method('loadUser') ->with($userId) - ->will($this->throwException(new NotFoundException('user', 'foo'))); + ->will(self::throwException(new NotFoundException('user', 'foo'))); $this->userProvider->refreshUser($user); } @@ -163,7 +163,7 @@ public function testRefreshUserNotFound() */ public function testSupportsClass($class, $supports) { - $this->assertSame($supports, $this->userProvider->supportsClass($class)); + self::assertSame($supports, $this->userProvider->supportsClass($class)); } public function supportsClassProvider() @@ -181,9 +181,9 @@ public function testLoadUserByAPIUser() $user = $this->userProvider->loadUserByAPIUser($apiUser); - $this->assertInstanceOf(MVCUser::class, $user); - $this->assertSame($apiUser, $user->getAPIUser()); - $this->assertSame(['ROLE_USER'], $user->getRoles()); + self::assertInstanceOf(MVCUser::class, $user); + self::assertSame($apiUser, $user->getAPIUser()); + self::assertSame(['ROLE_USER'], $user->getRoles()); } } diff --git a/tests/lib/MVC/Symfony/Security/UserTest.php b/tests/lib/MVC/Symfony/Security/UserTest.php index 7f8a25d489..38f29537bb 100644 --- a/tests/lib/MVC/Symfony/Security/UserTest.php +++ b/tests/lib/MVC/Symfony/Security/UserTest.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\Core\MVC\Symfony\Security; use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; @@ -35,16 +36,16 @@ public function testConstruct() $roles = ['ROLE_USER']; $apiUser - ->expects($this->once()) + ->expects(self::once()) ->method('getUserId') - ->will($this->returnValue(42)); + ->will(self::returnValue(42)); $user = new User($apiUser, $roles); - $this->assertSame($apiUser, $user->getAPIUser()); - $this->assertSame($login, $user->getUsername()); - $this->assertSame($passwordHash, $user->getPassword()); - $this->assertSame($roles, $user->getRoles()); - $this->assertNull($user->getSalt()); + self::assertSame($apiUser, $user->getAPIUser()); + self::assertSame($login, $user->getUsername()); + self::assertSame($passwordHash, $user->getPassword()); + self::assertSame($roles, $user->getRoles()); + self::assertNull($user->getSalt()); } public function testIsEqualTo() @@ -52,42 +53,42 @@ public function testIsEqualTo() $userId = 123; $apiUser = $this->createMock(APIUser::class); $apiUser - ->expects($this->once()) + ->expects(self::once()) ->method('getUserId') - ->will($this->returnValue($userId)); + ->will(self::returnValue($userId)); $roles = ['ROLE_USER']; $user = new User($apiUser, $roles); $apiUser2 = $this->createMock(APIUser::class); $apiUser2 - ->expects($this->once()) + ->expects(self::once()) ->method('getUserId') - ->will($this->returnValue($userId)); + ->will(self::returnValue($userId)); $user2 = new User($apiUser2, []); - $this->assertTrue($user->isEqualTo($user2)); + self::assertTrue($user->isEqualTo($user2)); } public function testIsNotEqualTo() { $apiUser = $this->createMock(APIUser::class); $apiUser - ->expects($this->once()) + ->expects(self::once()) ->method('getUserId') - ->will($this->returnValue(123)); + ->will(self::returnValue(123)); $roles = ['ROLE_USER']; $user = new User($apiUser, $roles); $apiUser2 = $this->createMock(APIUser::class); $apiUser2 - ->expects($this->once()) + ->expects(self::once()) ->method('getUserId') - ->will($this->returnValue(456)); + ->will(self::returnValue(456)); $user2 = new User($apiUser2, []); - $this->assertFalse($user->isEqualTo($user2)); + self::assertFalse($user->isEqualTo($user2)); } public function testIsEqualToNotSameUserType() @@ -95,10 +96,10 @@ public function testIsEqualToNotSameUserType() $user = new User($this->createMock(APIUser::class)); $user2 = $this->createMock(ReferenceUserInterface::class); $user2 - ->expects($this->once()) + ->expects(self::once()) ->method('getAPIUserReference') ->willReturn(new UserReference(456)); - $this->assertFalse($user->isEqualTo($user2)); + self::assertFalse($user->isEqualTo($user2)); } public function testSetAPIUser() @@ -108,7 +109,7 @@ public function testSetAPIUser() $user = new User($apiUserA); $user->setAPIUser($apiUserB); - $this->assertSame($apiUserB, $user->getAPIUser()); + self::assertSame($apiUserB, $user->getAPIUser()); } public function testToString() @@ -120,13 +121,13 @@ public function testToString() ->getMockForAbstractClass(); $apiUser = $this->createMock(APIUser::class); $apiUser - ->expects($this->any()) + ->expects(self::any()) ->method('__get') ->with('contentInfo') - ->will($this->returnValue($userContentInfo)); + ->will(self::returnValue($userContentInfo)); $user = new User($apiUser); - $this->assertSame($fullName, (string)$user); + self::assertSame($fullName, (string)$user); } } diff --git a/tests/lib/MVC/Symfony/Security/UserWrappedTest.php b/tests/lib/MVC/Symfony/Security/UserWrappedTest.php index e9c3075730..bda42601c8 100644 --- a/tests/lib/MVC/Symfony/Security/UserWrappedTest.php +++ b/tests/lib/MVC/Symfony/Security/UserWrappedTest.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\Core\MVC\Symfony\Security; use Ibexa\Contracts\Core\Repository\Values\User\User as APIUser; @@ -28,22 +29,22 @@ public function testGetSetAPIUser() { $originalUser = $this->createMock(SymfonyUserInterface::class); $userWrapped = new UserWrapped($originalUser, $this->apiUser); - $this->assertSame($this->apiUser, $userWrapped->getAPIUser()); + self::assertSame($this->apiUser, $userWrapped->getAPIUser()); $newApiUser = $this->createMock(APIUser::class); $userWrapped->setAPIUser($newApiUser); - $this->assertSame($newApiUser, $userWrapped->getAPIUser()); + self::assertSame($newApiUser, $userWrapped->getAPIUser()); } public function testGetSetWrappedUser() { $originalUser = $this->createMock(SymfonyUserInterface::class); $userWrapped = new UserWrapped($originalUser, $this->apiUser); - $this->assertSame($originalUser, $userWrapped->getWrappedUser()); + self::assertSame($originalUser, $userWrapped->getWrappedUser()); $newWrappedUser = $this->createMock(UserInterface::class); $userWrapped->setWrappedUser($newWrappedUser); - $this->assertSame($newWrappedUser, $userWrapped->getWrappedUser()); + self::assertSame($newWrappedUser, $userWrapped->getWrappedUser()); } public function testRegularUser() @@ -51,10 +52,10 @@ public function testRegularUser() $originalUser = $this->createMock(SymfonyUserInterface::class); $user = new UserWrapped($originalUser, $this->apiUser); - $this->assertTrue($user->isEqualTo($this->createMock(SymfonyUserInterface::class))); + self::assertTrue($user->isEqualTo($this->createMock(SymfonyUserInterface::class))); $originalUser - ->expects($this->once()) + ->expects(self::once()) ->method('eraseCredentials'); $user->eraseCredentials(); @@ -63,28 +64,28 @@ public function testRegularUser() $roles = ['ROLE_USER', 'ROLE_TEST']; $salt = md5(microtime(true)); $originalUser - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('getUsername') - ->will($this->returnValue($username)); + ->will(self::returnValue($username)); $originalUser - ->expects($this->once()) + ->expects(self::once()) ->method('getPassword') - ->will($this->returnValue($password)); + ->will(self::returnValue($password)); $originalUser - ->expects($this->once()) + ->expects(self::once()) ->method('getRoles') - ->will($this->returnValue($roles)); + ->will(self::returnValue($roles)); $originalUser - ->expects($this->once()) + ->expects(self::once()) ->method('getSalt') - ->will($this->returnValue($salt)); - - $this->assertSame($username, $user->getUsername()); - $this->assertSame($username, (string)$user); - $this->assertSame($password, $user->getPassword()); - $this->assertSame($roles, $user->getRoles()); - $this->assertSame($salt, $user->getSalt()); - $this->assertSame($originalUser, $user->getWrappedUser()); + ->will(self::returnValue($salt)); + + self::assertSame($username, $user->getUsername()); + self::assertSame($username, (string)$user); + self::assertSame($password, $user->getPassword()); + self::assertSame($roles, $user->getRoles()); + self::assertSame($salt, $user->getSalt()); + self::assertSame($originalUser, $user->getWrappedUser()); } public function testIsEqualTo() @@ -93,11 +94,11 @@ public function testIsEqualTo() $user = new UserWrapped($originalUser, $this->apiUser); $otherUser = $this->createMock(SymfonyUserInterface::class); $originalUser - ->expects($this->once()) + ->expects(self::once()) ->method('isEqualTo') ->with($otherUser) - ->will($this->returnValue(false)); - $this->assertFalse($user->isEqualTo($otherUser)); + ->will(self::returnValue(false)); + self::assertFalse($user->isEqualTo($otherUser)); } public function testNotSerializeApiUser(): void diff --git a/tests/lib/MVC/Symfony/Security/Voter/CoreVoterTest.php b/tests/lib/MVC/Symfony/Security/Voter/CoreVoterTest.php index 7a0c8cd572..1d429d8cda 100644 --- a/tests/lib/MVC/Symfony/Security/Voter/CoreVoterTest.php +++ b/tests/lib/MVC/Symfony/Security/Voter/CoreVoterTest.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\Core\MVC\Symfony\Security\Voter; use Ibexa\Contracts\Core\Repository\PermissionResolver; @@ -32,7 +33,7 @@ protected function setUp(): void public function testSupportsAttribute($attribute, $expectedResult) { $voter = new CoreVoter($this->permissionResolver); - $this->assertSame($expectedResult, $voter->supportsAttribute($attribute)); + self::assertSame($expectedResult, $voter->supportsAttribute($attribute)); } public function supportsAttributeProvider() @@ -60,7 +61,7 @@ public function supportsAttributeProvider() public function testSupportsClass($class) { $voter = new CoreVoter($this->permissionResolver); - $this->assertTrue($voter->supportsClass($class)); + self::assertTrue($voter->supportsClass($class)); } public function supportsClassProvider() @@ -79,7 +80,7 @@ public function supportsClassProvider() public function testVoteInvalidAttribute(array $attributes) { $voter = new CoreVoter($this->permissionResolver); - $this->assertSame( + self::assertSame( VoterInterface::ACCESS_ABSTAIN, $voter->vote( $this->createMock(TokenInterface::class), @@ -117,17 +118,17 @@ public function testVote(Attribute $attribute, $repositoryCanUser, $expectedResu $voter = new CoreVoter($this->permissionResolver); if ($repositoryCanUser !== null) { $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess') ->with($attribute->module, $attribute->function) - ->will($this->returnValue($repositoryCanUser)); + ->will(self::returnValue($repositoryCanUser)); } else { $this->permissionResolver - ->expects($this->never()) + ->expects(self::never()) ->method('hasAccess'); } - $this->assertSame( + self::assertSame( $expectedResult, $voter->vote( $this->createMock(TokenInterface::class), diff --git a/tests/lib/MVC/Symfony/Security/Voter/ValueObjectVoterTest.php b/tests/lib/MVC/Symfony/Security/Voter/ValueObjectVoterTest.php index fd6ff413b3..815c7db73a 100644 --- a/tests/lib/MVC/Symfony/Security/Voter/ValueObjectVoterTest.php +++ b/tests/lib/MVC/Symfony/Security/Voter/ValueObjectVoterTest.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\Core\MVC\Symfony\Security\Voter; use Ibexa\Contracts\Core\Repository\Values\ValueObject; @@ -32,7 +33,7 @@ protected function setUp(): void public function testSupportsAttribute($attribute, $expectedResult) { $voter = new ValueObjectVoter($this->permissionResolver); - $this->assertSame($expectedResult, $voter->supportsAttribute($attribute)); + self::assertSame($expectedResult, $voter->supportsAttribute($attribute)); } public function supportsAttributeProvider() @@ -60,7 +61,7 @@ public function supportsAttributeProvider() public function testSupportsClass($class) { $voter = new ValueObjectVoter($this->permissionResolver); - $this->assertTrue($voter->supportsClass($class)); + self::assertTrue($voter->supportsClass($class)); } public function supportsClassProvider() @@ -79,7 +80,7 @@ public function supportsClassProvider() public function testVoteInvalidAttribute(array $attributes) { $voter = new ValueObjectVoter($this->permissionResolver); - $this->assertSame( + self::assertSame( VoterInterface::ACCESS_ABSTAIN, $voter->vote( $this->createMock(TokenInterface::class), @@ -108,12 +109,12 @@ public function testVote(Attribute $attribute, $repositoryCanUser, $expectedResu $voter = new ValueObjectVoter($this->permissionResolver); $targets = isset($attribute->limitations['targets']) ? $attribute->limitations['targets'] : []; $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('canUser') ->with($attribute->module, $attribute->function, $attribute->limitations['valueObject'], $targets) - ->will($this->returnValue($repositoryCanUser)); + ->will(self::returnValue($repositoryCanUser)); - $this->assertSame( + self::assertSame( $expectedResult, $voter->vote( $this->createMock(TokenInterface::class), diff --git a/tests/lib/MVC/Symfony/SiteAccess/Compound/CompoundAndTest.php b/tests/lib/MVC/Symfony/SiteAccess/Compound/CompoundAndTest.php index 5d33b936e0..996c581088 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/Compound/CompoundAndTest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/Compound/CompoundAndTest.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\Core\MVC\Symfony\SiteAccess\Compound; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; @@ -74,16 +75,16 @@ public function testSetMatcherBuilder(Compound $compoundMatcher) { $this ->matcherBuilder - ->expects($this->any()) + ->expects(self::any()) ->method('buildMatcher') - ->will($this->returnValue($this->createMock(Matcher::class))); + ->will(self::returnValue($this->createMock(Matcher::class))); $compoundMatcher->setRequest($this->createMock(SimplifiedRequest::class)); $compoundMatcher->setMatcherBuilder($this->matcherBuilder); $matchers = $compoundMatcher->getSubMatchers(); - $this->assertIsArray($matchers); + self::assertIsArray($matchers); foreach ($matchers as $matcher) { - $this->assertInstanceOf(Matcher::class, $matcher); + self::assertInstanceOf(Matcher::class, $matcher); } } @@ -98,7 +99,7 @@ public function testMatch(SimplifiedRequest $request, $expectedMatch) $compoundMatcher = $this->buildMatcher(); $compoundMatcher->setRequest($request); $compoundMatcher->setMatcherBuilder(new MatcherBuilder()); - $this->assertSame($expectedMatch, $compoundMatcher->match()); + self::assertSame($expectedMatch, $compoundMatcher->match()); } public function testSetRequest() @@ -118,17 +119,17 @@ public function testSetRequest() $matcher1 = $this->createMock(Matcher::class); $matcher2 = $this->createMock(Matcher::class); $this->matcherBuilder - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('buildMatcher') - ->will($this->onConsecutiveCalls($matcher1, $matcher2)); + ->will(self::onConsecutiveCalls($matcher1, $matcher2)); $request = $this->createMock(SimplifiedRequest::class); $matcher1 - ->expects($this->once()) + ->expects(self::once()) ->method('setRequest') ->with($request); $matcher2 - ->expects($this->once()) + ->expects(self::once()) ->method('setRequest') ->with($request); @@ -155,13 +156,13 @@ public function testReverseMatchSiteAccessNotConfigured() { $compoundMatcher = $this->buildMatcher(); $this->matcherBuilder - ->expects($this->any()) + ->expects(self::any()) ->method('buildMatcher') - ->will($this->returnValue($this->createMock(VersatileMatcher::class))); + ->will(self::returnValue($this->createMock(VersatileMatcher::class))); $compoundMatcher->setRequest($this->createMock(SimplifiedRequest::class)); $compoundMatcher->setMatcherBuilder($this->matcherBuilder); - $this->assertNull($compoundMatcher->reverseMatch('not_configured_sa')); + self::assertNull($compoundMatcher->reverseMatch('not_configured_sa')); } public function testReverseMatchNotVersatile() @@ -190,10 +191,10 @@ public function testReverseMatchNotVersatile() ->getMockForAbstractClass(); $this->matcherBuilder - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('buildMatcher') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['Map\URI', $mapUriConfig, $request, $matcher1], ['Map\Host', $mapHostConfig, $request, $matcher2], @@ -202,16 +203,16 @@ public function testReverseMatchNotVersatile() ); $matcher1 - ->expects($this->once()) + ->expects(self::once()) ->method('reverseMatch') ->with($siteAccessName) - ->will($this->returnValue($this->createMock(VersatileMatcher::class))); + ->will(self::returnValue($this->createMock(VersatileMatcher::class))); $matcher2 - ->expects($this->never()) + ->expects(self::never()) ->method('reverseMatch'); $compoundMatcher->setMatcherBuilder($this->matcherBuilder); - $this->assertNull($compoundMatcher->reverseMatch($siteAccessName)); + self::assertNull($compoundMatcher->reverseMatch($siteAccessName)); } public function testReverseMatchFail() @@ -236,10 +237,10 @@ public function testReverseMatchFail() $matcher1 = $this->createMock(VersatileMatcher::class); $matcher2 = $this->createMock(VersatileMatcher::class); $this->matcherBuilder - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('buildMatcher') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['Map\URI', $mapUriConfig, $request, $matcher1], ['Map\Host', $mapHostConfig, $request, $matcher2], @@ -248,18 +249,18 @@ public function testReverseMatchFail() ); $matcher1 - ->expects($this->once()) + ->expects(self::once()) ->method('reverseMatch') ->with($siteAccessName) - ->will($this->returnValue($this->createMock(VersatileMatcher::class))); + ->will(self::returnValue($this->createMock(VersatileMatcher::class))); $matcher2 - ->expects($this->once()) + ->expects(self::once()) ->method('reverseMatch') ->with($siteAccessName) - ->will($this->returnValue(null)); + ->will(self::returnValue(null)); $compoundMatcher->setMatcherBuilder($this->matcherBuilder); - $this->assertNull($compoundMatcher->reverseMatch($siteAccessName)); + self::assertNull($compoundMatcher->reverseMatch($siteAccessName)); } public function testReverseMatch() @@ -284,10 +285,10 @@ public function testReverseMatch() $matcher1 = $this->createMock(VersatileMatcher::class); $matcher2 = $this->createMock(VersatileMatcher::class); $this->matcherBuilder - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('buildMatcher') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['Map\URI', $mapUriConfig, $request, $matcher1], ['Map\Host', $mapHostConfig, $request, $matcher2], @@ -297,22 +298,22 @@ public function testReverseMatch() $reverseMatchedMatcher1 = $this->createMock(VersatileMatcher::class); $matcher1 - ->expects($this->once()) + ->expects(self::once()) ->method('reverseMatch') ->with($siteAccessName) - ->will($this->returnValue($reverseMatchedMatcher1)); + ->will(self::returnValue($reverseMatchedMatcher1)); $reverseMatchedMatcher2 = $this->createMock(VersatileMatcher::class); $matcher2 - ->expects($this->once()) + ->expects(self::once()) ->method('reverseMatch') ->with($siteAccessName) - ->will($this->returnValue($reverseMatchedMatcher2)); + ->will(self::returnValue($reverseMatchedMatcher2)); $compoundMatcher->setMatcherBuilder($this->matcherBuilder); $result = $compoundMatcher->reverseMatch($siteAccessName); - $this->assertInstanceOf(LogicalAnd::class, $result); + self::assertInstanceOf(LogicalAnd::class, $result); foreach ($result->getSubMatchers() as $subMatcher) { - $this->assertInstanceOf(VersatileMatcher::class, $subMatcher); + self::assertInstanceOf(VersatileMatcher::class, $subMatcher); } } @@ -326,7 +327,7 @@ public function testSerialize() $matcher->setRequest(new SimplifiedRequest(['pathinfo' => '/foo/bar/baz'])); $serializedSA2 = serialize($sa); - $this->assertSame($serializedSA1, $serializedSA2); + self::assertSame($serializedSA1, $serializedSA2); } } diff --git a/tests/lib/MVC/Symfony/SiteAccess/Compound/CompoundOrTest.php b/tests/lib/MVC/Symfony/SiteAccess/Compound/CompoundOrTest.php index bf83f7eb91..fc0c2f08ca 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/Compound/CompoundOrTest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/Compound/CompoundOrTest.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\Core\MVC\Symfony\SiteAccess\Compound; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; @@ -60,16 +61,16 @@ private function buildMatcher(): LogicalOr public function testSetMatcherBuilder(Compound $compoundMatcher) { $this->matcherBuilder - ->expects($this->any()) + ->expects(self::any()) ->method('buildMatcher') - ->will($this->returnValue($this->createMock(Matcher::class))); + ->will(self::returnValue($this->createMock(Matcher::class))); $compoundMatcher->setRequest($this->createMock(SimplifiedRequest::class)); $compoundMatcher->setMatcherBuilder($this->matcherBuilder); $matchers = $compoundMatcher->getSubMatchers(); - $this->assertIsArray($matchers); + self::assertIsArray($matchers); foreach ($matchers as $matcher) { - $this->assertInstanceOf(Matcher::class, $matcher); + self::assertInstanceOf(Matcher::class, $matcher); } } @@ -84,7 +85,7 @@ public function testMatch(SimplifiedRequest $request, $expectedMatch) $compoundMatcher = $this->buildMatcher(); $compoundMatcher->setRequest($request); $compoundMatcher->setMatcherBuilder(new MatcherBuilder()); - $this->assertSame($expectedMatch, $compoundMatcher->match()); + self::assertSame($expectedMatch, $compoundMatcher->match()); } public function matchProvider() @@ -106,13 +107,13 @@ public function testReverseMatchSiteAccessNotConfigured() { $compoundMatcher = $this->buildMatcher(); $this->matcherBuilder - ->expects($this->any()) + ->expects(self::any()) ->method('buildMatcher') - ->will($this->returnValue($this->createMock(VersatileMatcher::class))); + ->will(self::returnValue($this->createMock(VersatileMatcher::class))); $compoundMatcher->setRequest($this->createMock(SimplifiedRequest::class)); $compoundMatcher->setMatcherBuilder($this->matcherBuilder); - $this->assertNull($compoundMatcher->reverseMatch('not_configured_sa')); + self::assertNull($compoundMatcher->reverseMatch('not_configured_sa')); } public function testReverseMatchNotVersatile() @@ -144,10 +145,10 @@ public function testReverseMatchNotVersatile() ->getMockForAbstractClass(); $this->matcherBuilder - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('buildMatcher') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['Map\URI', $mapUriConfig, $request, $matcher1], ['Map\Host', $mapHostConfig, $request, $matcher2], @@ -156,14 +157,14 @@ public function testReverseMatchNotVersatile() ); $matcher1 - ->expects($this->never()) + ->expects(self::never()) ->method('reverseMatch'); $matcher2 - ->expects($this->never()) + ->expects(self::never()) ->method('reverseMatch'); $compoundMatcher->setMatcherBuilder($this->matcherBuilder); - $this->assertNull($compoundMatcher->reverseMatch($siteAccessName)); + self::assertNull($compoundMatcher->reverseMatch($siteAccessName)); } public function testReverseMatchFail() @@ -188,10 +189,10 @@ public function testReverseMatchFail() $matcher1 = $this->createMock(VersatileMatcher::class); $matcher2 = $this->createMock(VersatileMatcher::class); $this->matcherBuilder - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('buildMatcher') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['Map\URI', $mapUriConfig, $request, $matcher1], ['Map\Host', $mapHostConfig, $request, $matcher2], @@ -200,18 +201,18 @@ public function testReverseMatchFail() ); $matcher1 - ->expects($this->once()) + ->expects(self::once()) ->method('reverseMatch') ->with($siteAccessName) - ->will($this->returnValue(null)); + ->will(self::returnValue(null)); $matcher2 - ->expects($this->once()) + ->expects(self::once()) ->method('reverseMatch') ->with($siteAccessName) - ->will($this->returnValue(null)); + ->will(self::returnValue(null)); $compoundMatcher->setMatcherBuilder($this->matcherBuilder); - $this->assertNull($compoundMatcher->reverseMatch($siteAccessName)); + self::assertNull($compoundMatcher->reverseMatch($siteAccessName)); } public function testReverseMatch1() @@ -236,10 +237,10 @@ public function testReverseMatch1() $matcher1 = $this->createMock(VersatileMatcher::class); $matcher2 = $this->createMock(VersatileMatcher::class); $this->matcherBuilder - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('buildMatcher') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['Map\URI', $mapUriConfig, $request, $matcher1], ['Map\Host', $mapHostConfig, $request, $matcher2], @@ -249,19 +250,19 @@ public function testReverseMatch1() $reverseMatchedMatcher1 = $this->createMock(VersatileMatcher::class); $matcher1 - ->expects($this->once()) + ->expects(self::once()) ->method('reverseMatch') ->with($siteAccessName) - ->will($this->returnValue($reverseMatchedMatcher1)); + ->will(self::returnValue($reverseMatchedMatcher1)); $matcher2 - ->expects($this->never()) + ->expects(self::never()) ->method('reverseMatch'); $compoundMatcher->setMatcherBuilder($this->matcherBuilder); $result = $compoundMatcher->reverseMatch($siteAccessName); - $this->assertInstanceOf(LogicalOr::class, $result); + self::assertInstanceOf(LogicalOr::class, $result); foreach ($result->getSubMatchers() as $subMatcher) { - $this->assertInstanceOf(VersatileMatcher::class, $subMatcher); + self::assertInstanceOf(VersatileMatcher::class, $subMatcher); } } @@ -287,10 +288,10 @@ public function testReverseMatch2() $matcher1 = $this->createMock(VersatileMatcher::class); $matcher2 = $this->createMock(VersatileMatcher::class); $this->matcherBuilder - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('buildMatcher') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['Map\URI', $mapUriConfig, $request, $matcher1], ['Map\Host', $mapHostConfig, $request, $matcher2], @@ -299,22 +300,22 @@ public function testReverseMatch2() ); $matcher1 - ->expects($this->once()) + ->expects(self::once()) ->method('reverseMatch') ->with($siteAccessName) - ->will($this->returnValue(null)); + ->will(self::returnValue(null)); $reverseMatchedMatcher2 = $this->createMock(VersatileMatcher::class); $matcher2 - ->expects($this->once()) + ->expects(self::once()) ->method('reverseMatch') ->with($siteAccessName) - ->will($this->returnValue($reverseMatchedMatcher2)); + ->will(self::returnValue($reverseMatchedMatcher2)); $compoundMatcher->setMatcherBuilder($this->matcherBuilder); $result = $compoundMatcher->reverseMatch($siteAccessName); - $this->assertInstanceOf(LogicalOr::class, $result); + self::assertInstanceOf(LogicalOr::class, $result); foreach ($result->getSubMatchers() as $subMatcher) { - $this->assertInstanceOf(VersatileMatcher::class, $subMatcher); + self::assertInstanceOf(VersatileMatcher::class, $subMatcher); } } @@ -328,7 +329,7 @@ public function testSerialize() $matcher->setRequest(new SimplifiedRequest(['pathinfo' => '/foo/bar/baz'])); $serializedSA2 = serialize($sa); - $this->assertSame($serializedSA1, $serializedSA2); + self::assertSame($serializedSA1, $serializedSA2); } } diff --git a/tests/lib/MVC/Symfony/SiteAccess/MatcherSerializationTest.php b/tests/lib/MVC/Symfony/SiteAccess/MatcherSerializationTest.php index 05ebdf65a8..1826d10501 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/MatcherSerializationTest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/MatcherSerializationTest.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Component\Serializer\SerializerTrait; @@ -25,7 +26,7 @@ public function testDeserialize(Matcher $matcher, $expected = null) $unserializedMatcher = $this->deserializeMatcher($serializedMatcher, get_class($matcher)); $expected = $expected ?? $matcher; - $this->assertEquals($expected, $unserializedMatcher); + self::assertEquals($expected, $unserializedMatcher); } /** diff --git a/tests/lib/MVC/Symfony/SiteAccess/Provider/ChainSiteAccessProviderTest.php b/tests/lib/MVC/Symfony/SiteAccess/Provider/ChainSiteAccessProviderTest.php index bb0eaf014b..8e1c555b74 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/Provider/ChainSiteAccessProviderTest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/Provider/ChainSiteAccessProviderTest.php @@ -60,14 +60,14 @@ public function testIsDefined(string $siteAccessName): void { $chainSiteAccessProvider = $this->getChainSiteAccessProvider(); - $this->assertTrue($chainSiteAccessProvider->isDefined($siteAccessName)); + self::assertTrue($chainSiteAccessProvider->isDefined($siteAccessName)); } public function testIsDefinedForUndefinedSiteAccess(): void { $chainSiteAccessProvider = $this->getChainSiteAccessProvider(); - $this->assertFalse($chainSiteAccessProvider->isDefined(self::UNDEFINED_SA_NAME)); + self::assertFalse($chainSiteAccessProvider->isDefined(self::UNDEFINED_SA_NAME)); } public function testGetSiteAccesses(): void @@ -75,7 +75,7 @@ public function testGetSiteAccesses(): void $chainSiteAccessProvider = $this->getChainSiteAccessProvider(); $siteAccesses = iterator_to_array($chainSiteAccessProvider->getSiteAccesses()); - $this->assertCount(4, $siteAccesses); + self::assertCount(4, $siteAccesses); $expectedSiteAccessNames = [ ['name' => self::EXISTING_SA_NAME, 'groups' => [self::SA_GROUP]], @@ -90,7 +90,7 @@ public function testGetSiteAccesses(): void $saData['groups'] ); - $this->assertEquals($expectedSiteAccess, $siteAccesses[$key]); + self::assertEquals($expectedSiteAccess, $siteAccesses[$key]); } $undefinedSiteAccess = $this->createSiteAcccess( @@ -98,7 +98,7 @@ public function testGetSiteAccesses(): void [self::SA_GROUP] ); - $this->assertNotContains( + self::assertNotContains( $undefinedSiteAccess, $siteAccesses ); @@ -130,7 +130,7 @@ public function testGetExistingSiteAccess(string $siteAccessName, array $expecte ); $expectedSiteAccess->groups = $expectedGroups; - $this->assertEquals( + self::assertEquals( $expectedSiteAccess, $chainSiteAccessProvider->getSiteAccess($siteAccessName) ); diff --git a/tests/lib/MVC/Symfony/SiteAccess/RouterBaseTest.php b/tests/lib/MVC/Symfony/SiteAccess/RouterBaseTest.php index 0760b6284e..04cf9acb3d 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/RouterBaseTest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/RouterBaseTest.php @@ -47,10 +47,10 @@ public function testMatch(SimplifiedRequest $request, string $siteAccess) { $router = $this->createRouter(); $sa = $router->match($request); - $this->assertInstanceOf(SiteAccess::class, $sa); - $this->assertSame($siteAccess, $sa->name); + self::assertInstanceOf(SiteAccess::class, $sa); + self::assertSame($siteAccess, $sa->name); // SiteAccess must be serializable as a whole. See https://issues.ibexa.co/browse/EZP-21613 - $this->assertIsString(serialize($sa)); + self::assertIsString(serialize($sa)); $router->setSiteAccess(); } diff --git a/tests/lib/MVC/Symfony/SiteAccess/RouterHostElementTest.php b/tests/lib/MVC/Symfony/SiteAccess/RouterHostElementTest.php index b4ef57fb06..9196cd6be7 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/RouterHostElementTest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/RouterHostElementTest.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; @@ -75,10 +76,10 @@ public function matchProvider(): array public function testGetName() { $matcher = new HostMapMatcher(['host' => 'foo'], []); - $this->assertSame('host:map', $matcher->getName()); + self::assertSame('host:map', $matcher->getName()); $matcherHostElement = new HostElement([1]); - $this->assertSame('host:element', $matcherHostElement->getName()); + self::assertSame('host:element', $matcherHostElement->getName()); } /** @@ -89,8 +90,8 @@ public function testReverseMatch($siteAccessName, $elementNumber, SimplifiedRequ $matcher = new HostElement([$elementNumber]); $matcher->setRequest($request); $result = $matcher->reverseMatch($siteAccessName); - $this->assertInstanceOf(HostElement::class, $result); - $this->assertSame($expectedHost, $result->getRequest()->host); + self::assertInstanceOf(HostElement::class, $result); + self::assertSame($expectedHost, $result->getRequest()->host); } public function reverseMatchProvider() @@ -107,7 +108,7 @@ public function testReverseMatchFail() { $matcher = new HostElement([3]); $matcher->setRequest(new SimplifiedRequest(['host' => 'ibexa.co'])); - $this->assertNull($matcher->reverseMatch('foo')); + self::assertNull($matcher->reverseMatch('foo')); } public function testSerialize() @@ -120,7 +121,7 @@ public function testSerialize() $matcher->setRequest(new SimplifiedRequest(['host' => 'ibexa.co', 'pathinfo' => '/foo/bar/baz'])); $serializedSA2 = serialize($sa); - $this->assertSame($serializedSA1, $serializedSA2); + self::assertSame($serializedSA1, $serializedSA2); } protected function createRouter(): Router diff --git a/tests/lib/MVC/Symfony/SiteAccess/RouterHostPortURITest.php b/tests/lib/MVC/Symfony/SiteAccess/RouterHostPortURITest.php index 691bab36ff..01fb6cfc30 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/RouterHostPortURITest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/RouterHostPortURITest.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; @@ -88,15 +89,15 @@ public function testSetGetRequestMapHost() $request = new SimplifiedRequest(['host' => $mapKey]); $matcher = new Host(['foo' => $mapKey]); $matcher->setRequest($request); - $this->assertSame($request, $matcher->getRequest()); - $this->assertSame($mapKey, $matcher->getMapKey()); + self::assertSame($request, $matcher->getRequest()); + self::assertSame($mapKey, $matcher->getMapKey()); } public function testReverseHostMatchFail() { $config = ['foo' => 'bar']; $matcher = new Host($config); - $this->assertNull($matcher->reverseMatch('non_existent')); + self::assertNull($matcher->reverseMatch('non_existent')); } public function testReverseMatchHost() @@ -109,13 +110,13 @@ public function testReverseMatchHost() $request = new SimplifiedRequest(['host' => 'ibexa.co']); $matcher = new Host($config); $matcher->setRequest($request); - $this->assertSame('ibexa.co', $matcher->getMapKey()); + self::assertSame('ibexa.co', $matcher->getMapKey()); $result = $matcher->reverseMatch('ibexa_demo_site'); - $this->assertInstanceOf(Host::class, $result); - $this->assertSame($request, $matcher->getRequest()); - $this->assertSame('phoenix-rises.fm', $result->getMapKey()); - $this->assertSame('phoenix-rises.fm', $result->getRequest()->host); + self::assertInstanceOf(Host::class, $result); + self::assertSame($request, $matcher->getRequest()); + self::assertSame('phoenix-rises.fm', $result->getMapKey()); + self::assertSame('phoenix-rises.fm', $result->getRequest()->host); } public function testSetGetRequestMapPort() @@ -124,15 +125,15 @@ public function testSetGetRequestMapPort() $request = new SimplifiedRequest(['port' => $mapKey]); $matcher = new Port(['foo' => $mapKey]); $matcher->setRequest($request); - $this->assertSame($request, $matcher->getRequest()); - $this->assertSame($mapKey, $matcher->getMapKey()); + self::assertSame($request, $matcher->getRequest()); + self::assertSame($mapKey, $matcher->getMapKey()); } public function testReversePortMatchFail() { $config = ['foo' => '8080']; $matcher = new Port($config); - $this->assertNull($matcher->reverseMatch('non_existent')); + self::assertNull($matcher->reverseMatch('non_existent')); } public function testReverseMatchPort() @@ -145,14 +146,14 @@ public function testReverseMatchPort() $request = new SimplifiedRequest(['scheme' => 'http', 'host' => 'ibexa.co']); $matcher = new Port($config); $matcher->setRequest($request); - $this->assertSame(80, $matcher->getMapKey()); + self::assertSame(80, $matcher->getMapKey()); $result = $matcher->reverseMatch('ibexa_demo_site'); - $this->assertInstanceOf(Port::class, $result); - $this->assertSame($request, $matcher->getRequest()); - $this->assertSame(8000, $result->getMapKey()); - $this->assertSame(8000, $result->getRequest()->port); - $this->assertSame('http', $result->getRequest()->scheme); + self::assertInstanceOf(Port::class, $result); + self::assertSame($request, $matcher->getRequest()); + self::assertSame(8000, $result->getMapKey()); + self::assertSame(8000, $result->getRequest()->port); + self::assertSame('http', $result->getRequest()->scheme); } protected function createRouter(): Router diff --git a/tests/lib/MVC/Symfony/SiteAccess/RouterHostRegexTest.php b/tests/lib/MVC/Symfony/SiteAccess/RouterHostRegexTest.php index cab1732c82..746a9fe204 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/RouterHostRegexTest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/RouterHostRegexTest.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; @@ -74,7 +75,7 @@ public function matchProvider(): array public function testGetName() { $matcher = new HostRegexMatcher(['host' => 'foo'], []); - $this->assertSame('host:regexp', $matcher->getName()); + self::assertSame('host:regexp', $matcher->getName()); } /** diff --git a/tests/lib/MVC/Symfony/SiteAccess/RouterHostTextTest.php b/tests/lib/MVC/Symfony/SiteAccess/RouterHostTextTest.php index fbd06ca7b1..3643133a58 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/RouterHostTextTest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/RouterHostTextTest.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; @@ -73,7 +74,7 @@ public function matchProvider(): array public function testGetName() { $matcher = new HostTextMatcher(['host' => 'foo'], []); - $this->assertSame('host:text', $matcher->getName()); + self::assertSame('host:text', $matcher->getName()); } public function testReverseMatch() @@ -88,10 +89,10 @@ public function testReverseMatch() $matcher->setRequest(new SimplifiedRequest(['host' => 'www.my_siteaccess.com'])); $result = $matcher->reverseMatch('foobar'); - $this->assertInstanceOf(HostTextMatcher::class, $result); + self::assertInstanceOf(HostTextMatcher::class, $result); $request = $result->getRequest(); - $this->assertInstanceOf(SimplifiedRequest::class, $request); - $this->assertSame('www.foobar.com', $request->host); + self::assertInstanceOf(SimplifiedRequest::class, $request); + self::assertSame('www.foobar.com', $request->host); } protected function createRouter(): Router diff --git a/tests/lib/MVC/Symfony/SiteAccess/RouterMapURITest.php b/tests/lib/MVC/Symfony/SiteAccess/RouterMapURITest.php index 4be7cfdc89..96d96ef533 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/RouterMapURITest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/RouterMapURITest.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; @@ -24,8 +25,8 @@ public function testSetGetRequest($config, $pathinfo, $expectedMapKey) $request = new SimplifiedRequest(['pathinfo' => $pathinfo]); $matcher = new URIMapMatcher($config); $matcher->setRequest($request); - $this->assertSame($request, $matcher->getRequest()); - $this->assertSame($expectedMapKey, $matcher->getMapKey()); + self::assertSame($request, $matcher->getRequest()); + self::assertSame($expectedMapKey, $matcher->getMapKey()); } /** @@ -40,10 +41,10 @@ public function testAnalyseURI($uri, $expectedFixedUpURI) $matcher->setRequest( new SimplifiedRequest(['pathinfo' => $uri]) ); - $this->assertSame($expectedFixedUpURI, $matcher->analyseURI($uri)); + self::assertSame($expectedFixedUpURI, $matcher->analyseURI($uri)); // Unserialized matcher should have the same behavior $unserializedMatcher = unserialize(serialize($matcher)); - $this->assertSame($expectedFixedUpURI, $unserializedMatcher->analyseURI($uri)); + self::assertSame($expectedFixedUpURI, $unserializedMatcher->analyseURI($uri)); } /** @@ -58,10 +59,10 @@ public function testAnalyseLink($fullUri, $linkUri) $matcher->setRequest( new SimplifiedRequest(['pathinfo' => $fullUri]) ); - $this->assertSame($fullUri, $matcher->analyseLink($linkUri)); + self::assertSame($fullUri, $matcher->analyseLink($linkUri)); // Unserialized matcher should have the same behavior $unserializedMatcher = unserialize(serialize($matcher)); - $this->assertSame($fullUri, $unserializedMatcher->analyseLink($linkUri)); + self::assertSame($fullUri, $unserializedMatcher->analyseLink($linkUri)); } public function setRequestProvider() @@ -89,7 +90,7 @@ public function testReverseMatchFail() { $config = ['foo' => 'bar']; $matcher = new URIMapMatcher($config); - $this->assertNull($matcher->reverseMatch('non_existent')); + self::assertNull($matcher->reverseMatch('non_existent')); } public function testReverseMatch() @@ -104,10 +105,10 @@ public function testReverseMatch() $matcher->setRequest($request); $result = $matcher->reverseMatch('ibexa_demo_site'); - $this->assertInstanceOf(URIMapMatcher::class, $result); - $this->assertSame($request, $matcher->getRequest()); - $this->assertSame('toutouyoutou', $result->getMapKey()); - $this->assertSame('/toutouyoutou/foo', $result->getRequest()->pathinfo); + self::assertInstanceOf(URIMapMatcher::class, $result); + self::assertSame($request, $matcher->getRequest()); + self::assertSame('toutouyoutou', $result->getMapKey()); + self::assertSame('/toutouyoutou/foo', $result->getRequest()->pathinfo); } } diff --git a/tests/lib/MVC/Symfony/SiteAccess/RouterPortHostURITest.php b/tests/lib/MVC/Symfony/SiteAccess/RouterPortHostURITest.php index 958ba1cd18..191a04c50f 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/RouterPortHostURITest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/RouterPortHostURITest.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; diff --git a/tests/lib/MVC/Symfony/SiteAccess/RouterSpecialPortsTest.php b/tests/lib/MVC/Symfony/SiteAccess/RouterSpecialPortsTest.php index 60710c9353..5bbf311619 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/RouterSpecialPortsTest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/RouterSpecialPortsTest.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; @@ -77,7 +78,7 @@ public function matchProvider(): array public function testGetName() { $matcher = new PortMatcher(['port' => '8080', 'scheme' => 'http'], []); - $this->assertSame('port', $matcher->getName()); + self::assertSame('port', $matcher->getName()); } protected function createRouter(): Router diff --git a/tests/lib/MVC/Symfony/SiteAccess/RouterTest.php b/tests/lib/MVC/Symfony/SiteAccess/RouterTest.php index 3ee493507f..8c75c92d36 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/RouterTest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/RouterTest.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Exception\InvalidSiteAccessException; @@ -36,10 +37,10 @@ public function testMatch(SimplifiedRequest $request, $siteAccess) { $router = $this->createRouter(); $sa = $router->match($request); - $this->assertInstanceOf(SiteAccess::class, $sa); - $this->assertSame($siteAccess, $sa->name); + self::assertInstanceOf(SiteAccess::class, $sa); + self::assertSame($siteAccess, $sa->name); // SiteAccess must be serializable as a whole. See https://issues.ibexa.co/browse/EZP-21613 - $this->assertIsString(serialize($sa)); + self::assertIsString(serialize($sa)); $router->setSiteAccess(); } @@ -74,9 +75,9 @@ public function testMatchWithEnv() $router = $this->createRouter(); putenv('EZPUBLISH_SITEACCESS=' . self::ENV_SA_NAME); $sa = $router->match(new SimplifiedRequest()); - $this->assertInstanceOf(SiteAccess::class, $sa); - $this->assertSame(self::ENV_SA_NAME, $sa->name); - $this->assertSame('env', $sa->matchingType); + self::assertInstanceOf(SiteAccess::class, $sa); + self::assertSame(self::ENV_SA_NAME, $sa->name); + self::assertSame('env', $sa->matchingType); $router->setSiteAccess(); } @@ -92,9 +93,9 @@ public function testMatchWithRequestHeader(): void ] ) ); - $this->assertInstanceOf(SiteAccess::class, $sa); - $this->assertSame(self::HEADERBASED_SA_NAME, $sa->name); - $this->assertSame('header', $sa->matchingType); + self::assertInstanceOf(SiteAccess::class, $sa); + self::assertSame(self::HEADERBASED_SA_NAME, $sa->name); + self::assertSame('header', $sa->matchingType); $router->setSiteAccess(); } @@ -201,15 +202,15 @@ public function testMatchByName() $matcherInitialSA = $this->createMock(SiteAccess\URILexer::class); $router->setSiteAccess(new SiteAccess('test', 'test', $matcherInitialSA)); $matcherInitialSA - ->expects($this->once()) + ->expects(self::once()) ->method('analyseURI'); $matcher = $this->createMock(VersatileMatcher::class); $matcherBuilder - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('buildMatcher') ->will( - $this->onConsecutiveCalls( + self::onConsecutiveCalls( $this->createMock(Matcher::class), $matcher ) @@ -217,15 +218,15 @@ public function testMatchByName() $reverseMatchedMatcher = $this->createMock(VersatileMatcher::class); $matcher - ->expects($this->once()) + ->expects(self::once()) ->method('reverseMatch') ->with($matchedSiteAccess) - ->will($this->returnValue($reverseMatchedMatcher)); + ->will(self::returnValue($reverseMatchedMatcher)); $siteAccess = $router->matchByName($matchedSiteAccess); - $this->assertInstanceOf(SiteAccess::class, $siteAccess); - $this->assertSame($reverseMatchedMatcher, $siteAccess->matcher); - $this->assertSame($matchedSiteAccess, $siteAccess->name); + self::assertInstanceOf(SiteAccess::class, $siteAccess); + self::assertSame($reverseMatchedMatcher, $siteAccess->matcher); + self::assertSame($matchedSiteAccess, $siteAccess->name); } public function testMatchByNameNoVersatileMatcher() @@ -249,15 +250,15 @@ public function testMatchByNameNoVersatileMatcher() $router->setSiteAccess(new SiteAccess('test', 'test')); $request = $router->getRequest(); $matcherBuilder - ->expects($this->once()) + ->expects(self::once()) ->method('buildMatcher') ->with($matcherClass, $matcherConfig, $request) - ->will($this->returnValue($this->createMock(Matcher::class))); + ->will(self::returnValue($this->createMock(Matcher::class))); $logger - ->expects($this->once()) + ->expects(self::once()) ->method('notice'); - $this->assertEquals(new SiteAccess($defaultSiteAccess, 'default'), $router->matchByName($defaultSiteAccess)); + self::assertEquals(new SiteAccess($defaultSiteAccess, 'default'), $router->matchByName($defaultSiteAccess)); } protected function createRouter($debug = false): Router diff --git a/tests/lib/MVC/Symfony/SiteAccess/RouterURIElement2Test.php b/tests/lib/MVC/Symfony/SiteAccess/RouterURIElement2Test.php index 18110c4be1..94fe00fb30 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/RouterURIElement2Test.php +++ b/tests/lib/MVC/Symfony/SiteAccess/RouterURIElement2Test.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; @@ -79,7 +80,7 @@ public function testAnalyseURI($level, $uri, $expectedFixedUpURI) $matcher->setRequest( new SimplifiedRequest(['pathinfo' => $uri]) ); - $this->assertSame($expectedFixedUpURI, $matcher->analyseURI($uri)); + self::assertSame($expectedFixedUpURI, $matcher->analyseURI($uri)); } /** @@ -95,7 +96,7 @@ public function testAnalyseURILevelAsInt($level, $uri, $expectedFixedUpURI) $matcher->setRequest( new SimplifiedRequest(['pathinfo' => $uri]) ); - $this->assertSame($expectedFixedUpURI, $matcher->analyseURI($uri)); + self::assertSame($expectedFixedUpURI, $matcher->analyseURI($uri)); } /** @@ -111,7 +112,7 @@ public function testAnalyseLink($level, $fullUri, $linkUri) $matcher->setRequest( new SimplifiedRequest(['pathinfo' => $fullUri]) ); - $this->assertSame($fullUri, $matcher->analyseLink($linkUri)); + self::assertSame($fullUri, $matcher->analyseLink($linkUri)); } public function analyseProvider() @@ -142,10 +143,10 @@ public function testReverseMatch($siteAccessName, $originalPathinfo) $matcher->setRequest(new SimplifiedRequest(['pathinfo' => $originalPathinfo])); $result = $matcher->reverseMatch($siteAccessName); - $this->assertInstanceOf(URIElement::class, $result); - $this->assertSame("/{$expectedSiteAccessPath}{$originalPathinfo}", $result->getRequest()->pathinfo); - $this->assertSame("/$expectedSiteAccessPath/some/linked/uri", $result->analyseLink('/some/linked/uri')); - $this->assertSame('/foo/bar/baz', $result->analyseURI("/$expectedSiteAccessPath/foo/bar/baz")); + self::assertInstanceOf(URIElement::class, $result); + self::assertSame("/{$expectedSiteAccessPath}{$originalPathinfo}", $result->getRequest()->pathinfo); + self::assertSame("/$expectedSiteAccessPath/some/linked/uri", $result->analyseLink('/some/linked/uri')); + self::assertSame('/foo/bar/baz', $result->analyseURI("/$expectedSiteAccessPath/foo/bar/baz")); } public function reverseMatchProvider() @@ -160,7 +161,7 @@ public function testReverseMatchFail() { $matcher = new URIElementMatcher([2]); $matcher->setRequest(new SimplifiedRequest(['pathinfo' => '/my/siteaccess/foo/bar'])); - $this->assertNull($matcher->reverseMatch('another_siteaccess_again_dont_tell_me')); + self::assertNull($matcher->reverseMatch('another_siteaccess_again_dont_tell_me')); } public function testSerialize() @@ -173,7 +174,7 @@ public function testSerialize() $matcher->setRequest(new SimplifiedRequest(['pathinfo' => '/foo/bar/baz'])); $serializedSA2 = serialize($sa); - $this->assertSame($serializedSA1, $serializedSA2); + self::assertSame($serializedSA1, $serializedSA2); } protected function createRouter(): Router diff --git a/tests/lib/MVC/Symfony/SiteAccess/RouterURIElementTest.php b/tests/lib/MVC/Symfony/SiteAccess/RouterURIElementTest.php index 5e80dcadec..692117719a 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/RouterURIElementTest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/RouterURIElementTest.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; @@ -69,7 +70,7 @@ public function matchProvider(): array public function testGetName() { $matcher = new URIElementMatcher([]); - $this->assertSame('uri:element', $matcher->getName()); + self::assertSame('uri:element', $matcher->getName()); } /** @@ -84,7 +85,7 @@ public function testAnalyseURI($uri, $expectedFixedUpURI) $matcher->setRequest( new SimplifiedRequest(['pathinfo' => $uri]) ); - $this->assertSame($expectedFixedUpURI, $matcher->analyseURI($uri)); + self::assertSame($expectedFixedUpURI, $matcher->analyseURI($uri)); } /** @@ -99,7 +100,7 @@ public function testAnalyseLink($fullUri, $linkUri) $matcher->setRequest( new SimplifiedRequest(['pathinfo' => $fullUri]) ); - $this->assertSame($fullUri, $matcher->analyseLink($linkUri)); + self::assertSame($fullUri, $matcher->analyseLink($linkUri)); } public function analyseProvider() @@ -118,10 +119,10 @@ public function testReverseMatch($siteAccessName, $originalPathinfo) $matcher = new URIElementMatcher([1]); $matcher->setRequest(new SimplifiedRequest(['pathinfo' => $originalPathinfo])); $result = $matcher->reverseMatch($siteAccessName); - $this->assertInstanceOf(URIElement::class, $result); - $this->assertSame("/{$siteAccessName}{$originalPathinfo}", $result->getRequest()->pathinfo); - $this->assertSame("/$siteAccessName/some/linked/uri", $result->analyseLink('/some/linked/uri')); - $this->assertSame('/foo/bar/baz', $result->analyseURI("/$siteAccessName/foo/bar/baz")); + self::assertInstanceOf(URIElement::class, $result); + self::assertSame("/{$siteAccessName}{$originalPathinfo}", $result->getRequest()->pathinfo); + self::assertSame("/$siteAccessName/some/linked/uri", $result->analyseLink('/some/linked/uri')); + self::assertSame('/foo/bar/baz', $result->analyseURI("/$siteAccessName/foo/bar/baz")); } public function reverseMatchProvider() @@ -145,7 +146,7 @@ public function testSerialize() $matcher->setRequest(new SimplifiedRequest(['pathinfo' => '/foo/bar/baz'])); $serializedSA2 = serialize($sa); - $this->assertSame($serializedSA1, $serializedSA2); + self::assertSame($serializedSA1, $serializedSA2); } protected function createRouter(): Router diff --git a/tests/lib/MVC/Symfony/SiteAccess/RouterURIRegexTest.php b/tests/lib/MVC/Symfony/SiteAccess/RouterURIRegexTest.php index e4f3f3ca8b..e20ce44a49 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/RouterURIRegexTest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/RouterURIRegexTest.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; @@ -75,7 +76,7 @@ public function matchProvider(): array public function testGetName() { $matcher = new RegexMatcher([], []); - $this->assertSame('uri:regexp', $matcher->getName()); + self::assertSame('uri:regexp', $matcher->getName()); } public function testSerialize() @@ -93,7 +94,7 @@ public function testSerialize() $matcher->setRequest(new SimplifiedRequest(['pathinfo' => '/foo/bar/baz'])); $serializedSA2 = serialize($sa); - $this->assertSame($serializedSA1, $serializedSA2); + self::assertSame($serializedSA1, $serializedSA2); } protected function createRouter(): Router diff --git a/tests/lib/MVC/Symfony/SiteAccess/RouterURITextTest.php b/tests/lib/MVC/Symfony/SiteAccess/RouterURITextTest.php index aeac59795f..eebe52612d 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/RouterURITextTest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/RouterURITextTest.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\Core\MVC\Symfony\SiteAccess; use Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest; @@ -75,7 +76,7 @@ public function matchProvider(): array public function testGetName() { $matcher = new URITextMatcher([], []); - $this->assertSame('uri:text', $matcher->getName()); + self::assertSame('uri:text', $matcher->getName()); } public function testAnalyseURI() @@ -90,7 +91,7 @@ public function testAnalyseURI() ); $matcher->setRequest(SimplifiedRequest::fromUrl('http://phoenix-rises.fm/footestbar/blabla')); - $this->assertSame($semanticURI, $matcher->analyseURI($siteAccessURI . $semanticURI)); + self::assertSame($semanticURI, $matcher->analyseURI($siteAccessURI . $semanticURI)); } public function testAnalyseLink() @@ -105,7 +106,7 @@ public function testAnalyseLink() ); $matcher->setRequest(SimplifiedRequest::fromUrl('http://phoenix-rises.fm/footestbar/blabla')); - $this->assertSame($siteAccessURI . $semanticURI, $matcher->analyseLink($semanticURI)); + self::assertSame($siteAccessURI . $semanticURI, $matcher->analyseLink($semanticURI)); } public function testReverseMatch() @@ -120,10 +121,10 @@ public function testReverseMatch() $matcher->setRequest(new SimplifiedRequest(['pathinfo' => $semanticURI])); $result = $matcher->reverseMatch('something'); - $this->assertInstanceOf(URIText::class, $result); + self::assertInstanceOf(URIText::class, $result); $request = $result->getRequest(); - $this->assertInstanceOf(SimplifiedRequest::class, $request); - $this->assertSame("/foosomethingbar{$semanticURI}", $request->pathinfo); + self::assertInstanceOf(SimplifiedRequest::class, $request); + self::assertSame("/foosomethingbar{$semanticURI}", $request->pathinfo); } protected function createRouter(): Router diff --git a/tests/lib/MVC/Symfony/SiteAccess/SiteAccessServiceTest.php b/tests/lib/MVC/Symfony/SiteAccess/SiteAccessServiceTest.php index 6ba29301eb..23f9f45ceb 100644 --- a/tests/lib/MVC/Symfony/SiteAccess/SiteAccessServiceTest.php +++ b/tests/lib/MVC/Symfony/SiteAccess/SiteAccessServiceTest.php @@ -107,7 +107,7 @@ public function testGetCurrentSiteAccessesRelation(): void ->method('getSiteAccesses') ->willReturn($this->availableSiteAccesses); - $this->assertSame(['current', 'first_sa'], $this->getSiteAccessService()->getSiteAccessesRelation()); + self::assertSame(['current', 'first_sa'], $this->getSiteAccessService()->getSiteAccessesRelation()); } public function testGetFirstSiteAccessesRelation(): void @@ -120,7 +120,7 @@ public function testGetFirstSiteAccessesRelation(): void ->method('getSiteAccesses') ->willReturn($this->availableSiteAccesses); - $this->assertSame( + self::assertSame( ['current', 'first_sa'], $this->getSiteAccessService()->getSiteAccessesRelation(new SiteAccess('first_sa')) ); diff --git a/tests/lib/MVC/Symfony/Templating/GlobalHelperTest.php b/tests/lib/MVC/Symfony/Templating/GlobalHelperTest.php index 1f989ed964..b3166c34c4 100644 --- a/tests/lib/MVC/Symfony/Templating/GlobalHelperTest.php +++ b/tests/lib/MVC/Symfony/Templating/GlobalHelperTest.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\Core\MVC\Symfony\Templating; use Ibexa\Contracts\Core\Repository\LocationService; @@ -60,7 +61,7 @@ public function testGetSiteaccess() $request->attributes->set('siteaccess', $siteAccess); $this->helper->setRequestStack($requestStack); - $this->assertSame($siteAccess, $this->helper->getSiteaccess()); + self::assertSame($siteAccess, $this->helper->getSiteaccess()); } public function testGetViewParameters() @@ -76,7 +77,7 @@ public function testGetViewParameters() $requestStack->push($request); $this->helper->setRequestStack($requestStack); - $this->assertSame($viewParameters, $this->helper->getViewParameters()); + self::assertSame($viewParameters, $this->helper->getViewParameters()); } public function testGetViewParametersString() @@ -88,7 +89,7 @@ public function testGetViewParametersString() $requestStack->push($request); $this->helper->setRequestStack($requestStack); - $this->assertSame($viewParametersString, $this->helper->getViewParametersString()); + self::assertSame($viewParametersString, $this->helper->getViewParametersString()); } public function testGetRequestedUriString() @@ -100,7 +101,7 @@ public function testGetRequestedUriString() $requestStack->push($request); $this->helper->setRequestStack($requestStack); - $this->assertSame($semanticPathinfo, $this->helper->getRequestedUriString()); + self::assertSame($semanticPathinfo, $this->helper->getRequestedUriString()); } public function testGetSystemUriStringNoUrlAlias() @@ -112,7 +113,7 @@ public function testGetSystemUriStringNoUrlAlias() $requestStack = new RequestStack(); $requestStack->push($request); $this->helper->setRequestStack($requestStack); - $this->assertSame($semanticPathinfo, $this->helper->getSystemUriString()); + self::assertSame($semanticPathinfo, $this->helper->getSystemUriString()); } public function testGetSystemUriString() @@ -130,33 +131,33 @@ public function testGetSystemUriString() $requestStack->push($request); $this->router - ->expects($this->once()) + ->expects(self::once()) ->method('generate') ->with('ibexa.content.view', [ 'contentId' => $contentId, 'locationId' => $locationId, 'viewType' => $viewType, ]) - ->will($this->returnValue($expectedSystemUriString)); + ->will(self::returnValue($expectedSystemUriString)); $this->helper->setRequestStack($requestStack); - $this->assertSame($expectedSystemUriString, $this->helper->getSystemUriString()); + self::assertSame($expectedSystemUriString, $this->helper->getSystemUriString()); } public function testGetConfigResolver() { - $this->assertSame($this->configResolver, $this->helper->getConfigResolver()); + self::assertSame($this->configResolver, $this->helper->getConfigResolver()); } public function testGetRootLocation() { $rootLocationId = 2; $this->configResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getParameter') ->with('content.tree_root.location_id') - ->will($this->returnValue($rootLocationId)); + ->will(self::returnValue($rootLocationId)); $rootLocation = $this ->getMockBuilder(Location::class) @@ -164,12 +165,12 @@ public function testGetRootLocation() ->getMock(); $this->locationService - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') ->with($rootLocationId) - ->will($this->returnValue($rootLocation)); + ->will(self::returnValue($rootLocation)); - $this->assertSame($rootLocation, $this->helper->getRootLocation()); + self::assertSame($rootLocation, $this->helper->getRootLocation()); } public function testGetTranslationSiteAccess() @@ -177,23 +178,23 @@ public function testGetTranslationSiteAccess() $language = 'fre-FR'; $siteaccess = 'fre'; $this->translationHelper - ->expects($this->once()) + ->expects(self::once()) ->method('getTranslationSiteAccess') ->with($language) - ->will($this->returnValue($siteaccess)); + ->will(self::returnValue($siteaccess)); - $this->assertSame($siteaccess, $this->helper->getTranslationSiteAccess($language)); + self::assertSame($siteaccess, $this->helper->getTranslationSiteAccess($language)); } public function testGetAvailableLanguages() { $languages = ['fre-FR', 'eng-GB', 'esl-ES']; $this->translationHelper - ->expects($this->once()) + ->expects(self::once()) ->method('getAvailableLanguages') - ->will($this->returnValue($languages)); + ->will(self::returnValue($languages)); - $this->assertSame($languages, $this->helper->getAvailableLanguages()); + self::assertSame($languages, $this->helper->getAvailableLanguages()); } } diff --git a/tests/lib/MVC/Symfony/Templating/RenderContentStrategyTest.php b/tests/lib/MVC/Symfony/Templating/RenderContentStrategyTest.php index 0d3cc48c2b..7699307291 100644 --- a/tests/lib/MVC/Symfony/Templating/RenderContentStrategyTest.php +++ b/tests/lib/MVC/Symfony/Templating/RenderContentStrategyTest.php @@ -32,7 +32,7 @@ public function testUnsupportedValueObject(): void $valueObject = new class() extends ValueObject { }; - $this->assertFalse($renderContentStrategy->supports($valueObject)); + self::assertFalse($renderContentStrategy->supports($valueObject)); $this->expectException(InvalidArgumentException::class); $renderContentStrategy->render($valueObject, new RenderOptions()); @@ -49,9 +49,9 @@ public function testDefaultFragmentRenderer(): void ); $contentMock = $this->createMock(Content::class); - $this->assertTrue($renderContentStrategy->supports($contentMock)); + self::assertTrue($renderContentStrategy->supports($contentMock)); - $this->assertSame( + self::assertSame( 'inline_rendered', $renderContentStrategy->render($contentMock, new RenderOptions()) ); @@ -65,7 +65,7 @@ public function testUnknownFragmentRenderer(): void ); $contentMock = $this->createMock(Content::class); - $this->assertTrue($renderContentStrategy->supports($contentMock)); + self::assertTrue($renderContentStrategy->supports($contentMock)); $this->expectException(InvalidArgumentException::class); $renderContentStrategy->render($contentMock, new RenderOptions()); @@ -83,9 +83,9 @@ public function testMultipleFragmentRenderers(): void ); $contentMock = $this->createMock(Content::class); - $this->assertTrue($renderContentStrategy->supports($contentMock)); + self::assertTrue($renderContentStrategy->supports($contentMock)); - $this->assertSame( + self::assertSame( 'method_b_rendered', $renderContentStrategy->render($contentMock, new RenderOptions([ 'method' => 'method_b', @@ -106,7 +106,7 @@ public function testExpectedMethodRenderArgumentsFormat(): void ->method('getName') ->willReturn('method_b'); - $controllerReferenceCallback = $this->callback(function (ControllerReference $controllerReference) { + $controllerReferenceCallback = self::callback(function (ControllerReference $controllerReference) { $this->assertInstanceOf(ControllerReference::class, $controllerReference); $this->assertEquals('ibexa_content::viewAction', $controllerReference->controller); $this->assertSame([ @@ -117,14 +117,14 @@ public function testExpectedMethodRenderArgumentsFormat(): void return true; }); - $requestCallback = $this->callback(function (Request $request) use ($siteAccess, $content): bool { + $requestCallback = self::callback(function (Request $request) use ($siteAccess, $content): bool { $this->assertSame('TEST/1.0', $request->headers->get('Surrogate-Capability')); return true; }); $fragmentRendererMock - ->expects($this->once()) + ->expects(self::once()) ->method('render') ->with($controllerReferenceCallback, $requestCallback) ->willReturn(new Response('some_rendered_content')); @@ -141,7 +141,7 @@ public function testExpectedMethodRenderArgumentsFormat(): void $request ); - $this->assertSame('some_rendered_content', $renderContentStrategy->render( + self::assertSame('some_rendered_content', $renderContentStrategy->render( $content, new RenderOptions([ 'method' => 'method_b', diff --git a/tests/lib/MVC/Symfony/Templating/RenderLocationStrategyTest.php b/tests/lib/MVC/Symfony/Templating/RenderLocationStrategyTest.php index 94e28a4f64..8905fdd7b6 100644 --- a/tests/lib/MVC/Symfony/Templating/RenderLocationStrategyTest.php +++ b/tests/lib/MVC/Symfony/Templating/RenderLocationStrategyTest.php @@ -32,7 +32,7 @@ public function testUnsupportedValueObject(): void $valueObject = new class() extends ValueObject { }; - $this->assertFalse($renderLocationStrategy->supports($valueObject)); + self::assertFalse($renderLocationStrategy->supports($valueObject)); $this->expectException(InvalidArgumentException::class); $renderLocationStrategy->render($valueObject, new RenderOptions()); @@ -49,9 +49,9 @@ public function testDefaultFragmentRenderer(): void ); $locationMock = $this->createMock(Location::class); - $this->assertTrue($renderLocationStrategy->supports($locationMock)); + self::assertTrue($renderLocationStrategy->supports($locationMock)); - $this->assertSame( + self::assertSame( 'inline_rendered', $renderLocationStrategy->render($locationMock, new RenderOptions()) ); @@ -65,7 +65,7 @@ public function testUnknownFragmentRenderer(): void ); $locationMock = $this->createMock(Location::class); - $this->assertTrue($renderLocationStrategy->supports($locationMock)); + self::assertTrue($renderLocationStrategy->supports($locationMock)); $this->expectException(InvalidArgumentException::class); $renderLocationStrategy->render($locationMock, new RenderOptions()); @@ -83,9 +83,9 @@ public function testMultipleFragmentRenderers(): void ); $locationMock = $this->createMock(Location::class); - $this->assertTrue($renderLocationStrategy->supports($locationMock)); + self::assertTrue($renderLocationStrategy->supports($locationMock)); - $this->assertSame( + self::assertSame( 'method_b_rendered', $renderLocationStrategy->render($locationMock, new RenderOptions([ 'method' => 'method_b', @@ -107,7 +107,7 @@ public function testExpectedMethodRenderRequestFormat(): void ->method('getName') ->willReturn('method_b'); - $controllerReferenceCallback = $this->callback(function (ControllerReference $controllerReference) { + $controllerReferenceCallback = self::callback(function (ControllerReference $controllerReference) { $this->assertInstanceOf(ControllerReference::class, $controllerReference); $this->assertEquals('ibexa_content::viewAction', $controllerReference->controller); $this->assertSame([ @@ -119,14 +119,14 @@ public function testExpectedMethodRenderRequestFormat(): void return true; }); - $requestCallback = $this->callback(function (Request $request) use ($siteAccess, $content): bool { + $requestCallback = self::callback(function (Request $request) use ($siteAccess, $content): bool { $this->assertSame('TEST/1.0', $request->headers->get('Surrogate-Capability')); return true; }); $fragmentRendererMock - ->expects($this->once()) + ->expects(self::once()) ->method('render') ->with($controllerReferenceCallback, $requestCallback) ->willReturn(new Response('some_rendered_content')); @@ -143,7 +143,7 @@ public function testExpectedMethodRenderRequestFormat(): void $request ); - $this->assertSame('some_rendered_content', $renderLocationStrategy->render( + self::assertSame('some_rendered_content', $renderLocationStrategy->render( $location, new RenderOptions([ 'method' => 'method_b', diff --git a/tests/lib/MVC/Symfony/Templating/RenderOptionsTest.php b/tests/lib/MVC/Symfony/Templating/RenderOptionsTest.php index 089538c0a4..544ffc560a 100644 --- a/tests/lib/MVC/Symfony/Templating/RenderOptionsTest.php +++ b/tests/lib/MVC/Symfony/Templating/RenderOptionsTest.php @@ -20,10 +20,10 @@ public function testInitialOptions(): void 'b' => null, ]); - $this->assertTrue($renderOptions->has('a')); - $this->assertSame('value_a', $renderOptions->get('a')); - $this->assertFalse($renderOptions->has('b')); - $this->assertSame([ + self::assertTrue($renderOptions->has('a')); + self::assertSame('value_a', $renderOptions->get('a')); + self::assertFalse($renderOptions->has('b')); + self::assertSame([ 'a' => 'value_a', 'b' => null, ], $renderOptions->all()); @@ -34,16 +34,16 @@ public function testSettingOptions(): void $renderOptions = new RenderOptions(); $renderOptions->set('a', 'value_a'); - $this->assertTrue($renderOptions->has('a')); - $this->assertSame('value_a', $renderOptions->get('a')); + self::assertTrue($renderOptions->has('a')); + self::assertSame('value_a', $renderOptions->get('a')); - $this->assertTrue($renderOptions->has('a')); + self::assertTrue($renderOptions->has('a')); $renderOptions->set('a', 'different_value_a'); - $this->assertSame('different_value_a', $renderOptions->get('a')); + self::assertSame('different_value_a', $renderOptions->get('a')); - $this->assertFalse($renderOptions->has('b')); + self::assertFalse($renderOptions->has('b')); $renderOptions->set('b', null); - $this->assertFalse($renderOptions->has('b')); + self::assertFalse($renderOptions->has('b')); } public function testGettingDefaultOptions(): void @@ -53,14 +53,14 @@ public function testGettingDefaultOptions(): void 'b' => 'default_value_b', ]); - $this->assertFalse($renderOptions->has('a')); - $this->assertSame('some_default_value', $renderOptions->get('a', 'some_default_value')); + self::assertFalse($renderOptions->has('a')); + self::assertSame('some_default_value', $renderOptions->get('a', 'some_default_value')); - $this->assertTrue($renderOptions->has('b')); - $this->assertSame('default_value_b', $renderOptions->get('b', 'other_default_value')); + self::assertTrue($renderOptions->has('b')); + self::assertSame('default_value_b', $renderOptions->get('b', 'other_default_value')); - $this->assertFalse($renderOptions->has('c')); - $this->assertSame('default_value_c', $renderOptions->get('c', 'default_value_c')); + self::assertFalse($renderOptions->has('c')); + self::assertSame('default_value_c', $renderOptions->get('c', 'default_value_c')); } public function testUnsettingOptions(): void @@ -72,12 +72,12 @@ public function testUnsettingOptions(): void ]); $renderOptions->set('a', null); - $this->assertFalse($renderOptions->has('a')); + self::assertFalse($renderOptions->has('a')); $renderOptions->remove('b'); - $this->assertFalse($renderOptions->has('b')); + self::assertFalse($renderOptions->has('b')); - $this->assertTrue($renderOptions->has('c')); + self::assertTrue($renderOptions->has('c')); } } diff --git a/tests/lib/MVC/Symfony/Templating/RenderStrategyTest.php b/tests/lib/MVC/Symfony/Templating/RenderStrategyTest.php index 47533b5174..ac90936cc2 100644 --- a/tests/lib/MVC/Symfony/Templating/RenderStrategyTest.php +++ b/tests/lib/MVC/Symfony/Templating/RenderStrategyTest.php @@ -52,7 +52,7 @@ public function testNoStrategies(): void $valueObject = new class() extends ValueObject { }; - $this->assertFalse($renderStrategy->supports($valueObject)); + self::assertFalse($renderStrategy->supports($valueObject)); $this->expectException(InvalidArgumentException::class); $renderStrategy->render($valueObject, new RenderOptions()); @@ -67,7 +67,7 @@ public function testNoSupportedStrategy(): void $valueObject = new class() extends ValueObject { }; - $this->assertFalse($renderStrategy->supports($valueObject)); + self::assertFalse($renderStrategy->supports($valueObject)); $this->expectException(InvalidArgumentException::class); $renderStrategy->render($valueObject, new RenderOptions()); @@ -81,8 +81,8 @@ public function testSupportStrategy(): void $valueObject = new class() extends ValueObject { }; - $this->assertTrue($renderStrategy->supports($valueObject)); - $this->assertSame('some_rendered_content', $renderStrategy->render($valueObject, new RenderOptions())); + self::assertTrue($renderStrategy->supports($valueObject)); + self::assertSame('some_rendered_content', $renderStrategy->render($valueObject, new RenderOptions())); } public function testMultipleStrategiesSameValueObjectType(): void @@ -96,8 +96,8 @@ public function testMultipleStrategiesSameValueObjectType(): void $this->createRenderStrategy('other_rendered_content', $valueObjectClass), ]); - $this->assertTrue($renderStrategy->supports($valueObject)); - $this->assertSame('some_rendered_content', $renderStrategy->render($valueObject, new RenderOptions())); + self::assertTrue($renderStrategy->supports($valueObject)); + self::assertSame('some_rendered_content', $renderStrategy->render($valueObject, new RenderOptions())); } public function testMultipleStrategies(): void @@ -111,8 +111,8 @@ public function testMultipleStrategies(): void $this->createRenderStrategy('other_rendered_content', $valueObjectClass), ]); - $this->assertTrue($renderStrategy->supports($valueObject)); - $this->assertSame('other_rendered_content', $renderStrategy->render($valueObject, new RenderOptions())); + self::assertTrue($renderStrategy->supports($valueObject)); + self::assertSame('other_rendered_content', $renderStrategy->render($valueObject, new RenderOptions())); } } diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtensionTest.php b/tests/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtensionTest.php index 7696b0ab8d..2df527967c 100644 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtensionTest.php +++ b/tests/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtensionTest.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\Core\MVC\Symfony\Templating\Twig\Extension; use Ibexa\Contracts\Core\Repository\ContentService; @@ -130,10 +131,10 @@ private function getConfigResolverMock() { $mock = $this->createMock(ConfigResolverInterface::class); // Signature: ConfigResolverInterface->getParameter( $paramName, $namespace = null, $scope = null ) - $mock->expects($this->any()) + $mock->expects(self::any()) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ [ 'languages', @@ -163,9 +164,9 @@ protected function getField($isEmpty) $field = new Field(['fieldDefIdentifier' => 'testfield', 'value' => null]); $this->fieldHelperMock - ->expects($this->once()) + ->expects(self::once()) ->method('isFieldEmpty') - ->will($this->returnValue($isEmpty)); + ->will(self::returnValue($isEmpty)); return $field; } @@ -177,9 +178,9 @@ protected function getRepositoryMock() { $mock = $this->createMock(Repository::class); - $mock->expects($this->any()) + $mock->expects(self::any()) ->method('getContentTypeService') - ->will($this->returnValue($this->getContentTypeServiceMock())); + ->will(self::returnValue($this->getContentTypeServiceMock())); return $mock; } @@ -191,10 +192,10 @@ protected function getContentTypeServiceMock() { $mock = $this->createMock(ContentTypeService::class); - $mock->expects($this->any()) + $mock->expects(self::any()) ->method('loadContentType') ->will( - $this->returnCallback( + self::returnCallback( function ($contentTypeId) { return new ContentType( [ diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtensionIntegrationTest.php b/tests/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtensionIntegrationTest.php index 96646006f7..a903909131 100644 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtensionIntegrationTest.php +++ b/tests/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtensionIntegrationTest.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\Core\MVC\Symfony\Templating\Twig\Extension; use Ibexa\Contracts\Core\Repository\ContentService; @@ -140,10 +141,10 @@ private function getConfigResolverMock() { $mock = $this->createMock(ConfigResolverInterface::class); // Signature: ConfigResolverInterface->getParameter( $paramName, $namespace = null, $scope = null ) - $mock->expects($this->any()) + $mock->expects(self::any()) ->method('getParameter') ->will( - $this->returnValueMap( + self::returnValueMap( [ [ 'languages', diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtensionTest.php b/tests/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtensionTest.php index b526e49d6f..7555d68f14 100644 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtensionTest.php +++ b/tests/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtensionTest.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\Core\MVC\Symfony\Templating\Twig\Extension; use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface; @@ -84,10 +85,10 @@ protected function getFixturesDir() protected function getConfigResolverInterfaceMock() { $configResolverInterfaceMock = $this->createMock(ConfigResolverInterface::class); - $configResolverInterfaceMock->expects($this->any()) + $configResolverInterfaceMock->expects(self::any()) ->method('getParameter') ->with('languages') - ->will($this->returnValue($this->getLocale())); + ->will(self::returnValue($this->getLocale())); return $configResolverInterfaceMock; } @@ -98,10 +99,10 @@ protected function getConfigResolverInterfaceMock() protected function getLocaleConverterInterfaceMock() { $this->localeConverterInterfaceMock = $this->createMock(LocaleConverterInterface::class); - $this->localeConverterInterfaceMock->expects($this->any()) + $this->localeConverterInterfaceMock->expects(self::any()) ->method('convertToPOSIX') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['fre-FR', 'fr-FR'], ['eng-GB', 'en-GB'], @@ -120,8 +121,8 @@ protected function getTranslatorInterfaceMock() $that = $this; $this->translatorMock = $this->createMock(TranslatorInterface::class); $this->translatorMock - ->expects($this->any())->method('trans')->will( - $this->returnCallback( + ->expects(self::any())->method('trans')->will( + self::returnCallback( static function ($suffixes) use ($that) { foreach ($that->getLocale() as $value) { if ($value === 'fre-FR') { diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/FileSystemTwigIntegrationTestCase.php b/tests/lib/MVC/Symfony/Templating/Twig/Extension/FileSystemTwigIntegrationTestCase.php index cca6652886..bfb7fe50d2 100644 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/FileSystemTwigIntegrationTestCase.php +++ b/tests/lib/MVC/Symfony/Templating/Twig/Extension/FileSystemTwigIntegrationTestCase.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\Core\MVC\Symfony\Templating\Twig\Extension; use Exception; @@ -32,7 +33,7 @@ protected function doIntegrationTest($file, $message, $condition, $templates, $e if ($condition) { eval('$ret = ' . $condition . ';'); if (!$ret) { - $this->markTestSkipped($condition); + self::markTestSkipped($condition); } } @@ -63,7 +64,7 @@ protected function doIntegrationTest($file, $message, $condition, $templates, $e $template = $twig->loadTemplate($twig->getTemplateClass('index.twig'), 'index.twig'); } catch (Exception $e) { if (false !== $exception) { - $this->assertEquals( + self::assertEquals( trim($exception), trim( sprintf('%s: %s', get_class($e), $e->getMessage()) @@ -86,7 +87,7 @@ protected function doIntegrationTest($file, $message, $condition, $templates, $e $output = trim($template->render(eval($match[1] . ';')), "\n "); } catch (Exception $e) { if (false !== $exception) { - $this->assertStringContainsString( + self::assertStringContainsString( trim($exception), trim( sprintf('%s: %s', get_class($e), $e->getMessage()) @@ -109,7 +110,7 @@ protected function doIntegrationTest($file, $message, $condition, $templates, $e if (false !== $exception) { list($class) = explode(':', $exception); - $this->assertThat( + self::assertThat( null, new PHPUnitException($class) ); @@ -128,7 +129,7 @@ protected function doIntegrationTest($file, $message, $condition, $templates, $e ); } } - $this->assertEquals($expected, $output, $message . ' (in ' . $file . ')'); + self::assertEquals($expected, $output, $message . ' (in ' . $file . ')'); } } } diff --git a/tests/lib/MVC/Symfony/Templating/Twig/ResourceProviderTest.php b/tests/lib/MVC/Symfony/Templating/Twig/ResourceProviderTest.php index ef0b521e09..dd9b9f3ecb 100644 --- a/tests/lib/MVC/Symfony/Templating/Twig/ResourceProviderTest.php +++ b/tests/lib/MVC/Symfony/Templating/Twig/ResourceProviderTest.php @@ -34,13 +34,13 @@ public function testGetFieldViewResources(): void $templates = array_column($resources, 'template'); $priorities = array_column($resources, 'priority'); - $this->assertEquals('templates/fields_override1.html.twig', array_shift($templates)); - $this->assertEquals('templates/fields_override2.html.twig', array_shift($templates)); - $this->assertEquals('templates/fields_default.html.twig', array_shift($templates)); + self::assertEquals('templates/fields_override1.html.twig', array_shift($templates)); + self::assertEquals('templates/fields_override2.html.twig', array_shift($templates)); + self::assertEquals('templates/fields_default.html.twig', array_shift($templates)); - $this->assertEquals(10, array_shift($priorities)); - $this->assertEquals(20, array_shift($priorities)); - $this->assertEquals(0, array_shift($priorities)); + self::assertEquals(10, array_shift($priorities)); + self::assertEquals(20, array_shift($priorities)); + self::assertEquals(0, array_shift($priorities)); } public function testGetFieldEditResources(): void @@ -49,13 +49,13 @@ public function testGetFieldEditResources(): void $templates = array_column($resources, 'template'); $priorities = array_column($resources, 'priority'); - $this->assertEquals('templates/fields_override1.html.twig', array_shift($templates)); - $this->assertEquals('templates/fields_override2.html.twig', array_shift($templates)); - $this->assertEquals('templates/fields_default.html.twig', array_shift($templates)); + self::assertEquals('templates/fields_override1.html.twig', array_shift($templates)); + self::assertEquals('templates/fields_override2.html.twig', array_shift($templates)); + self::assertEquals('templates/fields_default.html.twig', array_shift($templates)); - $this->assertEquals(10, array_shift($priorities)); - $this->assertEquals(20, array_shift($priorities)); - $this->assertEquals(0, array_shift($priorities)); + self::assertEquals(10, array_shift($priorities)); + self::assertEquals(20, array_shift($priorities)); + self::assertEquals(0, array_shift($priorities)); } public function testGetFieldDefinitionViewResources(): void @@ -64,13 +64,13 @@ public function testGetFieldDefinitionViewResources(): void $templates = array_column($resources, 'template'); $priorities = array_column($resources, 'priority'); - $this->assertEquals('templates/settings_override1.html.twig', array_shift($templates)); - $this->assertEquals('templates/settings_override2.html.twig', array_shift($templates)); - $this->assertEquals('templates/settings_default.html.twig', array_shift($templates)); + self::assertEquals('templates/settings_override1.html.twig', array_shift($templates)); + self::assertEquals('templates/settings_override2.html.twig', array_shift($templates)); + self::assertEquals('templates/settings_default.html.twig', array_shift($templates)); - $this->assertEquals(10, array_shift($priorities)); - $this->assertEquals(20, array_shift($priorities)); - $this->assertEquals(0, array_shift($priorities)); + self::assertEquals(10, array_shift($priorities)); + self::assertEquals(20, array_shift($priorities)); + self::assertEquals(0, array_shift($priorities)); } public function testGetFieldDefinitionEditResources(): void @@ -79,13 +79,13 @@ public function testGetFieldDefinitionEditResources(): void $templates = array_column($resources, 'template'); $priorities = array_column($resources, 'priority'); - $this->assertEquals('templates/settings_override1.html.twig', array_shift($templates)); - $this->assertEquals('templates/settings_override2.html.twig', array_shift($templates)); - $this->assertEquals('templates/settings_default.html.twig', array_shift($templates)); + self::assertEquals('templates/settings_override1.html.twig', array_shift($templates)); + self::assertEquals('templates/settings_override2.html.twig', array_shift($templates)); + self::assertEquals('templates/settings_default.html.twig', array_shift($templates)); - $this->assertEquals(10, array_shift($priorities)); - $this->assertEquals(20, array_shift($priorities)); - $this->assertEquals(0, array_shift($priorities)); + self::assertEquals(10, array_shift($priorities)); + self::assertEquals(20, array_shift($priorities)); + self::assertEquals(0, array_shift($priorities)); } /** diff --git a/tests/lib/MVC/Symfony/Translation/ExceptionMessageTemplateFileVisitorTest.php b/tests/lib/MVC/Symfony/Translation/ExceptionMessageTemplateFileVisitorTest.php index b151a1915d..9dd7874e92 100644 --- a/tests/lib/MVC/Symfony/Translation/ExceptionMessageTemplateFileVisitorTest.php +++ b/tests/lib/MVC/Symfony/Translation/ExceptionMessageTemplateFileVisitorTest.php @@ -89,7 +89,7 @@ public function testWrongTranslationId(): void $logger = $this->createMock(LoggerInterface::class); $logger - ->expects($this->once()) + ->expects(self::once()) ->method('error'); $this->exceptionMessageTemplateFileVisitor->setLogger($logger); diff --git a/tests/lib/MVC/Symfony/View/AbstractViewTest.php b/tests/lib/MVC/Symfony/View/AbstractViewTest.php index 3ba7a50f34..bf97210d12 100644 --- a/tests/lib/MVC/Symfony/View/AbstractViewTest.php +++ b/tests/lib/MVC/Symfony/View/AbstractViewTest.php @@ -51,15 +51,15 @@ public function testAddParameters(): void $additionalParams = ['truc' => 'muche', 'laurel' => 'hardy']; $view->addParameters($additionalParams); - $this->assertSame($this->getAlwaysAvailableParams() + $params + $additionalParams, $view->getParameters()); + self::assertSame($this->getAlwaysAvailableParams() + $params + $additionalParams, $view->getParameters()); } public function testHasParameter(): View { $view = $this->createViewUnderTest(__METHOD__, ['foo' => 'bar']); - $this->assertTrue($view->hasParameter('foo')); - $this->assertFalse($view->hasParameter('nonExistent')); + self::assertTrue($view->hasParameter('foo')); + self::assertFalse($view->hasParameter('nonExistent')); return $view; } @@ -69,7 +69,7 @@ public function testHasParameter(): View */ public function testGetParameter(View $view): View { - $this->assertSame('bar', $view->getParameter('foo')); + self::assertSame('bar', $view->getParameter('foo')); return $view; } @@ -94,7 +94,7 @@ public function testSetTemplateIdentifier($templateIdentifier): void $contentView = $this->createViewUnderTest(); $contentView->setTemplateIdentifier($templateIdentifier); - $this->assertSame($templateIdentifier, $contentView->getTemplateIdentifier()); + self::assertSame($templateIdentifier, $contentView->getTemplateIdentifier()); } public function goodTemplateIdentifierProvider(): array diff --git a/tests/lib/MVC/Symfony/View/Builder/ContentViewBuilderTest.php b/tests/lib/MVC/Symfony/View/Builder/ContentViewBuilderTest.php index 6d0b34572a..bbe88464c6 100644 --- a/tests/lib/MVC/Symfony/View/Builder/ContentViewBuilderTest.php +++ b/tests/lib/MVC/Symfony/View/Builder/ContentViewBuilderTest.php @@ -75,7 +75,7 @@ protected function setUp(): void $this->permissionResolver = $this->getMockBuilder(PermissionResolver::class)->getMock(); $this->requestStack = $this->getMockBuilder(RequestStack::class)->getMock(); $this->repository - ->expects($this->any()) + ->expects(self::any()) ->method('getPermissionResolver') ->willReturn($this->permissionResolver); @@ -90,8 +90,8 @@ protected function setUp(): void public function testMatches(): void { - $this->assertTrue($this->contentViewBuilder->matches('ibexa_content:55')); - $this->assertFalse($this->contentViewBuilder->matches('dummy_value')); + self::assertTrue($this->contentViewBuilder->matches('ibexa_content:55')); + self::assertFalse($this->contentViewBuilder->matches('dummy_value')); } public function testBuildViewWithoutLocationIdAndContentId(): void @@ -115,7 +115,7 @@ public function testBuildViewWithInvalidLocationId(): void ]; $this->repository - ->expects($this->once()) + ->expects(self::once()) ->method('sudo') ->willThrowException(new NotFoundException('location', 865)); @@ -135,7 +135,7 @@ public function testBuildViewWithHiddenLocation(): void $location = new Location(['invisible' => true]); $this->repository - ->expects($this->once()) + ->expects(self::once()) ->method('sudo') ->willReturn($location); @@ -165,12 +165,12 @@ public function testBuildViewWithoutContentReadPermission(): void // It's call for LocationService::loadLocation() $this->repository - ->expects($this->once()) + ->expects(self::once()) ->method('sudo') ->willReturn($location); $this->permissionResolver - ->expects($this->any()) + ->expects(self::any()) ->method('canUser') ->willReturn(false); @@ -205,17 +205,17 @@ public function testBuildEmbedViewWithoutContentViewEmbedPermission(): void // It's call for LocationService::loadLocation() $this->repository - ->expects($this->once()) + ->expects(self::once()) ->method('sudo') ->willReturn($location); $this->permissionResolver - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('canUser') ->willReturn(false); $this->permissionResolver - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('canUser') ->willReturn(false); @@ -332,12 +332,12 @@ public function testBuildViewWithContentWhichDoesNotBelongToLocation(): void // It's call for LocationService::loadLocation() $this->repository - ->expects($this->once()) + ->expects(self::once()) ->method('sudo') ->willReturn($location); $this->permissionResolver - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('canUser') ->willReturn(true); @@ -374,7 +374,7 @@ public function testBuildViewWithTranslatedContentWithoutLocation(): void // No call for LocationService::loadLocation() $this->repository - ->expects($this->never()) + ->expects(self::never()) ->method('sudo'); $this->repository @@ -384,7 +384,7 @@ public function testBuildViewWithTranslatedContentWithoutLocation(): void $expectedView = new ContentView(null, [], 'full'); $expectedView->setContent($content); - $this->assertEquals($expectedView, $this->contentViewBuilder->buildView($parameters)); + self::assertEquals($expectedView, $this->contentViewBuilder->buildView($parameters)); } public function testBuildView(): void @@ -414,16 +414,16 @@ public function testBuildView(): void ]; $this->repository - ->expects($this->once()) + ->expects(self::once()) ->method('sudo') ->willReturn($location); $this->permissionResolver - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('canUser') ->willReturn(true); - $this->assertEquals($expectedView, $this->contentViewBuilder->buildView($parameters)); + self::assertEquals($expectedView, $this->contentViewBuilder->buildView($parameters)); } /** @@ -446,7 +446,7 @@ public function testBuildViewInsertsDoNotGenerateEmbedUrlParameter(): void $parameters = ['viewType' => 'embed', 'contentId' => 120, '_controller' => null]; $this->repository - ->expects($this->once()) + ->expects(self::once()) ->method('sudo') ->willReturn($content); @@ -465,7 +465,7 @@ public function testBuildViewInsertsDoNotGenerateEmbedUrlParameter(): void ->parametersInjector ->method('injectViewParameters') ->with( - $this->isInstanceOf(ContentView::class), + self::isInstanceOf(ContentView::class), array_merge( $parameters, // invocation expectation: diff --git a/tests/lib/MVC/Symfony/View/LoginFormViewTest.php b/tests/lib/MVC/Symfony/View/LoginFormViewTest.php index 7f60891914..5ea750bcf9 100644 --- a/tests/lib/MVC/Symfony/View/LoginFormViewTest.php +++ b/tests/lib/MVC/Symfony/View/LoginFormViewTest.php @@ -23,7 +23,7 @@ public function testSetLastUsername(): void $view = $this->createViewUnderTest(); $view->setLastUsername('johndoe'); - $this->assertEquals('johndoe', $view->getLastUsername()); + self::assertEquals('johndoe', $view->getLastUsername()); } public function testSetLastAuthenticationError(): void @@ -34,7 +34,7 @@ public function testSetLastAuthenticationError(): void $view = $this->createViewUnderTest(); $view->setLastAuthenticationError($exception); - $this->assertEquals($exception, $view->getLastAuthenticationException()); + self::assertEquals($exception, $view->getLastAuthenticationException()); } protected function createViewUnderTest($template = null, array $parameters = [], $viewType = 'full'): View diff --git a/tests/lib/MVC/Symfony/View/Renderer/TemplateRendererTest.php b/tests/lib/MVC/Symfony/View/Renderer/TemplateRendererTest.php index b24bfa5da4..4ba75aac17 100644 --- a/tests/lib/MVC/Symfony/View/Renderer/TemplateRendererTest.php +++ b/tests/lib/MVC/Symfony/View/Renderer/TemplateRendererTest.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\Core\MVC\Symfony\View\Renderer; use Ibexa\Core\MVC\Exception\NoViewTemplateException; @@ -42,15 +43,15 @@ public function testRender() $view->setTemplateIdentifier('path/to/template.html.twig'); $this->eventDispatcherMock - ->expects($this->once()) + ->expects(self::once()) ->method('dispatch') ->with( - $this->isInstanceOf(PreContentViewEvent::class), + self::isInstanceOf(PreContentViewEvent::class), MVCEvents::PRE_CONTENT_VIEW ); $this->templateEngineMock - ->expects($this->once()) + ->expects(self::once()) ->method('render') ->with( 'path/to/template.html.twig', diff --git a/tests/lib/MVC/Symfony/View/VariableProviderRegistryTest.php b/tests/lib/MVC/Symfony/View/VariableProviderRegistryTest.php index 629c184d4f..5e28067f13 100644 --- a/tests/lib/MVC/Symfony/View/VariableProviderRegistryTest.php +++ b/tests/lib/MVC/Symfony/View/VariableProviderRegistryTest.php @@ -58,8 +58,8 @@ public function testParameterProviderGetter(): void $providerA = $registry->getTwigVariableProvider('provider_a'); $providerB = $registry->getTwigVariableProvider('provider_b'); - $this->assertEquals($providerA->getIdentifier(), 'provider_a'); - $this->assertEquals($providerB->getIdentifier(), 'provider_b'); + self::assertEquals($providerA->getIdentifier(), 'provider_a'); + self::assertEquals($providerB->getIdentifier(), 'provider_b'); } public function testParameterNotFoundProviderGetter(): void @@ -83,12 +83,12 @@ public function testParameterProviderSetter(): void $hasProviderC = $registry->hasTwigVariableProvider('provider_c'); - $this->assertFalse($hasProviderC); + self::assertFalse($hasProviderC); $registry->setTwigVariableProvider($this->getProvider('provider_c')); $providerC = $registry->getTwigVariableProvider('provider_c'); - $this->assertEquals($providerC->getIdentifier(), 'provider_c'); + self::assertEquals($providerC->getIdentifier(), 'provider_c'); } public function testParameterProviderChecker(): void @@ -98,9 +98,9 @@ public function testParameterProviderChecker(): void $this->getProvider('provider_b'), ]); - $this->assertTrue($registry->hasTwigVariableProvider('provider_a')); - $this->assertTrue($registry->hasTwigVariableProvider('provider_b')); - $this->assertFalse($registry->hasTwigVariableProvider('provider_c')); + self::assertTrue($registry->hasTwigVariableProvider('provider_a')); + self::assertTrue($registry->hasTwigVariableProvider('provider_b')); + self::assertFalse($registry->hasTwigVariableProvider('provider_c')); } } diff --git a/tests/lib/MVC/Symfony/View/ViewManagerTest.php b/tests/lib/MVC/Symfony/View/ViewManagerTest.php index 8f18d913a5..2162ffd56e 100644 --- a/tests/lib/MVC/Symfony/View/ViewManagerTest.php +++ b/tests/lib/MVC/Symfony/View/ViewManagerTest.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\Core\MVC\Symfony\View; use Ibexa\Contracts\Core\Repository\ContentService as APIContentService; @@ -114,10 +115,10 @@ public function testRenderContent() $params = ['foo' => 'bar']; $templateIdentifier = 'foo:bar:baz'; $this->viewConfigurator - ->expects($this->once()) + ->expects(self::once()) ->method('configure') ->will( - $this->returnCallback( + self::returnCallback( static function (View $view) use ($templateIdentifier) { $view->setTemplateIdentifier($templateIdentifier); } @@ -127,13 +128,13 @@ static function (View $view) use ($templateIdentifier) { // Configuring template engine behaviour $expectedTemplateResult = 'This is content rendering'; $this->templateEngineMock - ->expects($this->once()) + ->expects(self::once()) ->method('render') ->with( $templateIdentifier, $params + ['content' => $content, 'view_base_layout' => $this->viewBaseLayout] ) - ->will($this->returnValue($expectedTemplateResult)); + ->will(self::returnValue($expectedTemplateResult)); self::assertSame($expectedTemplateResult, $this->viewManager->renderContent($content, 'customViewType', $params)); } @@ -150,10 +151,10 @@ public function testRenderContentWithClosure() }; $params = ['foo' => 'bar']; $this->viewConfigurator - ->expects($this->once()) + ->expects(self::once()) ->method('configure') ->will( - $this->returnCallback( + self::returnCallback( static function (View $view) use ($closure) { $view->setTemplateIdentifier($closure); } @@ -164,7 +165,7 @@ static function (View $view) use ($closure) { $params += ['content' => $content, 'view_base_layout' => $this->viewBaseLayout]; $expectedTemplateResult = array_keys($params); $this->templateEngineMock - ->expects($this->never()) + ->expects(self::never()) ->method('render'); $templateResult = unserialize($this->viewManager->renderContent($content, 'full', $params)); @@ -181,10 +182,10 @@ public function testRenderLocation() $templateIdentifier = 'foo:bar:baz'; $params = ['foo' => 'bar']; $this->viewConfigurator - ->expects($this->once()) + ->expects(self::once()) ->method('configure') ->will( - $this->returnCallback( + self::returnCallback( static function (View $view) use ($templateIdentifier) { $view->setTemplateIdentifier($templateIdentifier); } @@ -193,30 +194,30 @@ static function (View $view) use ($templateIdentifier) { $languages = ['eng-GB']; $this->configResolverMock - ->expects($this->any()) + ->expects(self::any()) ->method('getParameter') ->with('languages') - ->will($this->returnValue($languages)); + ->will(self::returnValue($languages)); $contentService = $this->createMock(APIContentService::class); - $contentService->expects($this->any()) + $contentService->expects(self::any()) ->method('loadContentByContentInfo') ->with($location->contentInfo, $languages) - ->will($this->returnValue($content)); + ->will(self::returnValue($content)); $this->repositoryMock - ->expects($this->any()) + ->expects(self::any()) ->method('getContentService') - ->will($this->returnValue($contentService)); + ->will(self::returnValue($contentService)); // Configuring template engine behaviour $expectedTemplateResult = 'This is location rendering'; $this->templateEngineMock - ->expects($this->once()) + ->expects(self::once()) ->method('render') ->with($templateIdentifier, $params + ['location' => $location, 'content' => $content, 'view_base_layout' => $this->viewBaseLayout]) - ->will($this->returnValue($expectedTemplateResult)); + ->will(self::returnValue($expectedTemplateResult)); self::assertSame($expectedTemplateResult, $this->viewManager->renderLocation($location, 'customViewType', $params)); } @@ -230,10 +231,10 @@ public function testRenderLocationWithContentPassed() $templateIdentifier = 'foo:bar:baz'; $params = ['foo' => 'bar', 'content' => $content]; $this->viewConfigurator - ->expects($this->once()) + ->expects(self::once()) ->method('configure') ->will( - $this->returnCallback( + self::returnCallback( static function (View $view) use ($templateIdentifier) { $view->setTemplateIdentifier($templateIdentifier); } @@ -242,18 +243,18 @@ static function (View $view) use ($templateIdentifier) { $contentService = $this->createMock(ContentService::class); - $contentService->expects($this->any()) + $contentService->expects(self::any()) ->method('loadContentByContentInfo') ->with($content->contentInfo) ->will( - $this->returnValue($content) + self::returnValue($content) ); $this->repositoryMock - ->expects($this->any()) + ->expects(self::any()) ->method('getContentService') ->will( - $this->returnValue( + self::returnValue( $contentService ) ); @@ -261,13 +262,13 @@ static function (View $view) use ($templateIdentifier) { // Configuring template engine behaviour $expectedTemplateResult = 'This is location rendering'; $this->templateEngineMock - ->expects($this->once()) + ->expects(self::once()) ->method('render') ->with( $templateIdentifier, $params + ['location' => $location, 'content' => $content, 'view_base_layout' => $this->viewBaseLayout] ) - ->will($this->returnValue($expectedTemplateResult)); + ->will(self::returnValue($expectedTemplateResult)); self::assertSame($expectedTemplateResult, $this->viewManager->renderLocation($location, 'customViewType', $params)); } @@ -283,10 +284,10 @@ public function testRenderLocationWithClosure() }; $params = ['foo' => 'bar']; $this->viewConfigurator - ->expects($this->once()) + ->expects(self::once()) ->method('configure') ->will( - $this->returnCallback( + self::returnCallback( static function (View $view) use ($closure) { $view->setTemplateIdentifier($closure); } @@ -295,18 +296,18 @@ static function (View $view) use ($closure) { $contentService = $this->createMock(ContentService::class); - $contentService->expects($this->any()) + $contentService->expects(self::any()) ->method('loadContentByContentInfo') ->with($content->contentInfo) ->will( - $this->returnValue($content) + self::returnValue($content) ); $this->repositoryMock - ->expects($this->any()) + ->expects(self::any()) ->method('getContentService') ->will( - $this->returnValue( + self::returnValue( $contentService ) ); @@ -314,7 +315,7 @@ static function (View $view) use ($closure) { // Configuring template engine behaviour $params += ['location' => $location, 'content' => $content, 'view_base_layout' => $this->viewBaseLayout]; $this->templateEngineMock - ->expects($this->never()) + ->expects(self::never()) ->method('render'); $expectedTemplateResult = array_keys($params); diff --git a/tests/lib/Pagination/AdapterFactory/SearchHitAdapterFactoryTest.php b/tests/lib/Pagination/AdapterFactory/SearchHitAdapterFactoryTest.php index cca74ca853..bab86a7ac3 100644 --- a/tests/lib/Pagination/AdapterFactory/SearchHitAdapterFactoryTest.php +++ b/tests/lib/Pagination/AdapterFactory/SearchHitAdapterFactoryTest.php @@ -41,7 +41,7 @@ public function testCreateAdapterForContentQuery(): void { $query = new Query(); - $this->assertEquals( + self::assertEquals( new ContentSearchHitAdapter( $query, $this->searchService, @@ -55,7 +55,7 @@ public function testCreateAdapterForLocationQuery(): void { $query = new LocationQuery(); - $this->assertEquals( + self::assertEquals( new LocationSearchHitAdapter( $query, $this->searchService, @@ -82,12 +82,12 @@ public function testCreateFixedAdapter(Query $query, string $expectedSearchMetho ]); $this->searchService - ->expects($this->once()) + ->expects(self::once()) ->method($expectedSearchMethod) ->with($query, self::EXAMPLE_LANGUAGE_FILTER) ->willReturn($searchResult); - $this->assertEquals( + self::assertEquals( new FixedSearchResultHitAdapter($searchResult), $this->searchHitAdapterFactory->createFixedAdapter($query, self::EXAMPLE_LANGUAGE_FILTER) ); diff --git a/tests/lib/Pagination/ContentFilteringAdapterTest.php b/tests/lib/Pagination/ContentFilteringAdapterTest.php index 94164893bf..8874ec45a3 100644 --- a/tests/lib/Pagination/ContentFilteringAdapterTest.php +++ b/tests/lib/Pagination/ContentFilteringAdapterTest.php @@ -80,7 +80,7 @@ public function testGetSlice(): void self::EXAMPLE_LANGUAGE_FILTER ); - $this->assertEquals( + self::assertEquals( $expectedContentList, $adapter->getSlice(10, 20) ); diff --git a/tests/lib/Pagination/ContentSearchAdapterTest.php b/tests/lib/Pagination/ContentSearchAdapterTest.php index 1edec52e9a..7fcf32cd32 100644 --- a/tests/lib/Pagination/ContentSearchAdapterTest.php +++ b/tests/lib/Pagination/ContentSearchAdapterTest.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\Core\Pagination; use Ibexa\Contracts\Core\Repository\SearchService; diff --git a/tests/lib/Pagination/ContentSearchHitAdapterTest.php b/tests/lib/Pagination/ContentSearchHitAdapterTest.php index 08d887faa5..683117142a 100644 --- a/tests/lib/Pagination/ContentSearchHitAdapterTest.php +++ b/tests/lib/Pagination/ContentSearchHitAdapterTest.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\Core\Pagination; use Ibexa\Contracts\Core\Repository\SearchService; @@ -66,16 +67,16 @@ public function testGetNbResults() $searchResult = new SearchResult(['totalCount' => $nbResults]); $this->searchService - ->expects($this->once()) + ->expects(self::once()) ->method('findContent') ->with($countQuery, self::EXAMPLE_LANGUAGE_FILTER) ->willReturn($searchResult); $adapter = $this->getAdapter($query, $this->searchService, self::EXAMPLE_LANGUAGE_FILTER); - $this->assertSame($nbResults, $adapter->getNbResults()); + self::assertSame($nbResults, $adapter->getNbResults()); // Running a 2nd time to ensure SearchService::findContent() is called only once. - $this->assertSame($nbResults, $adapter->getNbResults()); + self::assertSame($nbResults, $adapter->getNbResults()); } public function testGetSlice() @@ -110,22 +111,22 @@ public function testGetSlice() $this ->searchService - ->expects($this->once()) + ->expects(self::once()) ->method('findContent') ->with($searchQuery, self::EXAMPLE_LANGUAGE_FILTER) ->willReturn($searchResult); $adapter = $this->getAdapter($query, $this->searchService, self::EXAMPLE_LANGUAGE_FILTER); - $this->assertSame( + self::assertSame( $this->getExpectedFinalResultFromHits($hits), $adapter->getSlice(self::EXAMPLE_OFFSET, self::EXAMPLE_LIMIT) ); - $this->assertSame($nbResults, $adapter->getNbResults()); - $this->assertSame($aggregationsResults, $adapter->getAggregations()); - $this->assertSame(self::EXAMPLE_RESULT_MAX_SCORE, $adapter->getMaxScore()); - $this->assertTrue($adapter->getTimedOut()); - $this->assertSame(self::EXAMPLE_RESULT_TIME, $adapter->getTime()); + self::assertSame($nbResults, $adapter->getNbResults()); + self::assertSame($aggregationsResults, $adapter->getAggregations()); + self::assertSame(self::EXAMPLE_RESULT_MAX_SCORE, $adapter->getMaxScore()); + self::assertTrue($adapter->getTimedOut()); + self::assertSame(self::EXAMPLE_RESULT_TIME, $adapter->getTime()); } public function testGetAggregations(): void @@ -148,16 +149,16 @@ public function testGetAggregations(): void $this ->searchService - ->expects($this->once()) + ->expects(self::once()) ->method('findContent') ->with($aggregationQuery, self::EXAMPLE_LANGUAGE_FILTER) ->willReturn($searchResult); $adapter = $this->getAdapter($query, $this->searchService, self::EXAMPLE_LANGUAGE_FILTER); - $this->assertSame($exceptedAggregationsResults, $adapter->getAggregations()); + self::assertSame($exceptedAggregationsResults, $adapter->getAggregations()); // Running a 2nd time to ensure SearchService::findContent() is called only once. - $this->assertSame($exceptedAggregationsResults, $adapter->getAggregations()); + self::assertSame($exceptedAggregationsResults, $adapter->getAggregations()); } /** diff --git a/tests/lib/Pagination/FixedSearchResultHitAdapterTest.php b/tests/lib/Pagination/FixedSearchResultHitAdapterTest.php index 370b5c046a..24ef97db56 100644 --- a/tests/lib/Pagination/FixedSearchResultHitAdapterTest.php +++ b/tests/lib/Pagination/FixedSearchResultHitAdapterTest.php @@ -21,12 +21,12 @@ public function testFixedSearchResultHitAdapter(): void $adapter = new FixedSearchResultHitAdapter($searchResult); - $this->assertEquals($searchResult->totalCount, $adapter->getNbResults()); - $this->assertEquals($searchResult->searchHits, $adapter->getSlice(0, 10)); - $this->assertSame($searchResult->getAggregations(), $adapter->getAggregations()); - $this->assertEquals($searchResult->maxScore, $adapter->getMaxScore()); - $this->assertEquals($searchResult->time, $adapter->getTime()); - $this->assertEquals($searchResult->timedOut, $adapter->getTimedOut()); + self::assertEquals($searchResult->totalCount, $adapter->getNbResults()); + self::assertEquals($searchResult->searchHits, $adapter->getSlice(0, 10)); + self::assertSame($searchResult->getAggregations(), $adapter->getAggregations()); + self::assertEquals($searchResult->maxScore, $adapter->getMaxScore()); + self::assertEquals($searchResult->time, $adapter->getTime()); + self::assertEquals($searchResult->timedOut, $adapter->getTimedOut()); } private function createExampleSearchResult(): SearchResult diff --git a/tests/lib/Pagination/LocationFilteringAdapterTest.php b/tests/lib/Pagination/LocationFilteringAdapterTest.php index 50acd16af9..36ce5f31a7 100644 --- a/tests/lib/Pagination/LocationFilteringAdapterTest.php +++ b/tests/lib/Pagination/LocationFilteringAdapterTest.php @@ -80,7 +80,7 @@ public function testGetSlice(): void self::EXAMPLE_LANGUAGE_FILTER ); - $this->assertEquals( + self::assertEquals( $expectedContentList, $adapter->getSlice(10, 20) ); diff --git a/tests/lib/Pagination/LocationSearchAdapterTest.php b/tests/lib/Pagination/LocationSearchAdapterTest.php index e9c282c6db..4f62777f46 100644 --- a/tests/lib/Pagination/LocationSearchAdapterTest.php +++ b/tests/lib/Pagination/LocationSearchAdapterTest.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\Core\Pagination; use Ibexa\Contracts\Core\Repository\SearchService; diff --git a/tests/lib/Pagination/LocationSearchHitAdapterTest.php b/tests/lib/Pagination/LocationSearchHitAdapterTest.php index 9a6a8381f7..a9889abbe9 100644 --- a/tests/lib/Pagination/LocationSearchHitAdapterTest.php +++ b/tests/lib/Pagination/LocationSearchHitAdapterTest.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\Core\Pagination; use Ibexa\Contracts\Core\Repository\SearchService; @@ -69,16 +70,16 @@ public function testGetNbResults() ]); $this->searchService - ->expects($this->once()) + ->expects(self::once()) ->method('findLocations') ->with($countQuery, self::EXAMPLE_LANGUAGE_FILTER) ->willReturn($searchResult); $adapter = $this->getAdapter($query, $this->searchService, self::EXAMPLE_LANGUAGE_FILTER); - $this->assertSame($nbResults, $adapter->getNbResults()); + self::assertSame($nbResults, $adapter->getNbResults()); // Running a 2nd time to ensure SearchService::findContent() is called only once. - $this->assertSame($nbResults, $adapter->getNbResults()); + self::assertSame($nbResults, $adapter->getNbResults()); } public function testGetSlice() @@ -113,23 +114,23 @@ public function testGetSlice() $this ->searchService - ->expects($this->once()) + ->expects(self::once()) ->method('findLocations') ->with($searchQuery, self::EXAMPLE_LANGUAGE_FILTER) ->willReturn($searchResult); $adapter = $this->getAdapter($query, $this->searchService, self::EXAMPLE_LANGUAGE_FILTER); - $this->assertSame( + self::assertSame( $this->getExpectedFinalResultFromHits($hits), $adapter->getSlice(self::EXAMPLE_OFFSET, self::EXAMPLE_LIMIT) ); - $this->assertSame($nbResults, $adapter->getNbResults()); - $this->assertSame($aggregationsResults, $adapter->getAggregations()); - $this->assertSame(self::EXAMPLE_RESULT_MAX_SCORE, $adapter->getMaxScore()); - $this->assertTrue($adapter->getTimedOut()); - $this->assertSame(self::EXAMPLE_RESULT_TIME, $adapter->getTime()); + self::assertSame($nbResults, $adapter->getNbResults()); + self::assertSame($aggregationsResults, $adapter->getAggregations()); + self::assertSame(self::EXAMPLE_RESULT_MAX_SCORE, $adapter->getMaxScore()); + self::assertTrue($adapter->getTimedOut()); + self::assertSame(self::EXAMPLE_RESULT_TIME, $adapter->getTime()); } public function testGetAggregations(): void @@ -152,16 +153,16 @@ public function testGetAggregations(): void $this ->searchService - ->expects($this->once()) + ->expects(self::once()) ->method('findLocations') ->with($aggregationQuery, self::EXAMPLE_LANGUAGE_FILTER) ->willReturn($searchResult); $adapter = $this->getAdapter($query, $this->searchService, self::EXAMPLE_LANGUAGE_FILTER); - $this->assertSame($exceptedAggregationsResults, $adapter->getAggregations()); + self::assertSame($exceptedAggregationsResults, $adapter->getAggregations()); // Running a 2nd time to ensure SearchService::findContent() is called only once. - $this->assertSame($exceptedAggregationsResults, $adapter->getAggregations()); + self::assertSame($exceptedAggregationsResults, $adapter->getAggregations()); } /** diff --git a/tests/lib/Pagination/PagerfantaTest.php b/tests/lib/Pagination/PagerfantaTest.php index f990370b76..8c77e8ad29 100644 --- a/tests/lib/Pagination/PagerfantaTest.php +++ b/tests/lib/Pagination/PagerfantaTest.php @@ -36,7 +36,7 @@ public function testGetAggregations(): void $this->adapter->method('getAggregations')->willReturn($aggregations); - $this->assertEquals( + self::assertEquals( $aggregations, $this->pagerfanta->getAggregations() ); @@ -46,7 +46,7 @@ public function testGetTime(): void { $this->adapter->method('getTime')->willReturn(self::EXAMPLE_TIME_RESULT); - $this->assertEquals( + self::assertEquals( self::EXAMPLE_TIME_RESULT, $this->pagerfanta->getTime() ); @@ -56,7 +56,7 @@ public function testGetTimedOut(): void { $this->adapter->method('getTimedOut')->willReturn(true); - $this->assertTrue( + self::assertTrue( $this->pagerfanta->getTimedOut() ); } @@ -65,7 +65,7 @@ public function testGetMaxScore(): void { $this->adapter->method('getMaxScore')->willReturn(self::EXAMPLE_MAX_SCORE_RESULT); - $this->assertEquals( + self::assertEquals( self::EXAMPLE_MAX_SCORE_RESULT, $this->pagerfanta->getMaxScore() ); diff --git a/tests/lib/Persistence/Cache/AbstractBaseHandlerTest.php b/tests/lib/Persistence/Cache/AbstractBaseHandlerTest.php index 8577ef7117..4495f26423 100644 --- a/tests/lib/Persistence/Cache/AbstractBaseHandlerTest.php +++ b/tests/lib/Persistence/Cache/AbstractBaseHandlerTest.php @@ -117,7 +117,7 @@ static function ($key, $value, $isHit, $defaultLifetime = 0) { $item->key = $key; $item->value = $value; $item->isHit = $isHit; - $item->defaultLifetime = $defaultLifetime; + $item->expiresAfter($defaultLifetime); $item->isTaggable = true; return $item; diff --git a/tests/lib/Persistence/Cache/AbstractCacheHandlerTest.php b/tests/lib/Persistence/Cache/AbstractCacheHandlerTest.php index bab472ebc1..18248861f7 100644 --- a/tests/lib/Persistence/Cache/AbstractCacheHandlerTest.php +++ b/tests/lib/Persistence/Cache/AbstractCacheHandlerTest.php @@ -41,18 +41,18 @@ final public function testUnCachedMethods( ) { $handlerMethodName = $this->getHandlerMethodName(); - $this->loggerMock->expects($this->once())->method('logCall'); - $this->loggerMock->expects($this->never())->method('logCacheHit'); - $this->loggerMock->expects($this->never())->method('logCacheMiss'); + $this->loggerMock->expects(self::once())->method('logCall'); + $this->loggerMock->expects(self::never())->method('logCacheHit'); + $this->loggerMock->expects(self::never())->method('logCacheMiss'); $innerHandler = $this->createMock($this->getHandlerClassName()); $this->persistenceHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method($handlerMethodName) ->willReturn($innerHandler); $invocationMocker = $innerHandler - ->expects($this->once()) + ->expects(self::once()) ->method($method) ->with(...$arguments); // workaround for mocking void-returning methods, null in this case denotes that, not null value @@ -63,7 +63,7 @@ final public function testUnCachedMethods( if ($tags || $key) { if ($tagGeneratingArguments) { $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(count($tagGeneratingArguments))) + ->expects(self::exactly(count($tagGeneratingArguments))) ->method('generateTag') ->withConsecutive(...$tagGeneratingArguments) ->willReturnOnConsecutiveCalls(...$tags); @@ -74,13 +74,13 @@ final public function testUnCachedMethods( if (is_array($key)) { $this->cacheIdentifierGeneratorMock - ->expects($this->exactly($callsCount)) + ->expects(self::exactly($callsCount)) ->method('generateKey') ->withConsecutive(...$keyGeneratingArguments) ->willReturnOnConsecutiveCalls(...$key); } else { $this->cacheIdentifierGeneratorMock - ->expects($this->exactly($callsCount)) + ->expects(self::exactly($callsCount)) ->method('generateKey') ->with($keyGeneratingArguments[0][0]) ->willReturn($key); @@ -88,17 +88,17 @@ final public function testUnCachedMethods( } $this->cacheMock - ->expects(!empty($tags) ? $this->once() : $this->never()) + ->expects(!empty($tags) ? self::once() : self::never()) ->method('invalidateTags') ->with($tags); $this->cacheMock - ->expects(!empty($key) && is_string($key) ? $this->once() : $this->never()) + ->expects(!empty($key) && is_string($key) ? self::once() : self::never()) ->method('deleteItem') ->with($key); $this->cacheMock - ->expects(!empty($key) && is_array($key) ? $this->once() : $this->never()) + ->expects(!empty($key) && is_array($key) ? self::once() : self::never()) ->method('deleteItems') ->with($key); } @@ -106,7 +106,7 @@ final public function testUnCachedMethods( $handler = $this->persistenceCacheHandler->$handlerMethodName(); $actualReturnValue = call_user_func_array([$handler, $method], $arguments); - $this->assertEquals($returnValue, $actualReturnValue); + self::assertEquals($returnValue, $actualReturnValue); } abstract public function providerForCachedLoadMethodsHit(): array; @@ -140,11 +140,11 @@ final public function testLoadMethodsCacheHit( $cacheItem = $this->getCacheItem($key, $multi ? reset($data) : $data); $handlerMethodName = $this->getHandlerMethodName(); - $this->loggerMock->expects($this->never())->method('logCall'); + $this->loggerMock->expects(self::never())->method('logCall'); if ($tagGeneratingArguments) { $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(count($tagGeneratingArguments))) + ->expects(self::exactly(count($tagGeneratingArguments))) ->method('generateTag') ->withConsecutive(...$tagGeneratingArguments) ->willReturnOnConsecutiveCalls(...$tagGeneratingResults); @@ -152,7 +152,7 @@ final public function testLoadMethodsCacheHit( if ($keyGeneratingArguments) { $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(count($keyGeneratingArguments))) + ->expects(self::exactly(count($keyGeneratingArguments))) ->method('generateKey') ->withConsecutive(...$keyGeneratingArguments) ->willReturnOnConsecutiveCalls(...$keyGeneratingResults); @@ -160,32 +160,32 @@ final public function testLoadMethodsCacheHit( if ($multi) { $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('getItems') ->with([$cacheItem->getKey()]) ->willReturn([$key => $cacheItem]); } else { $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('getItem') ->with($cacheItem->getKey()) ->willReturn($cacheItem); } $this->persistenceHandlerMock - ->expects($this->never()) + ->expects(self::never()) ->method($handlerMethodName); foreach ($additionalCalls as $additionalCall) { $this->persistenceHandlerMock - ->expects($this->never()) + ->expects(self::never()) ->method($additionalCall[0]); } $handler = $this->persistenceCacheHandler->$handlerMethodName(); $return = call_user_func_array([$handler, $method], $arguments); - $this->assertEquals($data, $return); + self::assertEquals($data, $return); } abstract public function providerForCachedLoadMethodsMiss(): array; @@ -219,11 +219,11 @@ final public function testLoadMethodsCacheMiss( $cacheItem = $this->getCacheItem($key, null); $handlerMethodName = $this->getHandlerMethodName(); - $this->loggerMock->expects($this->once())->method('logCall'); + $this->loggerMock->expects(self::once())->method('logCall'); if ($tagGeneratingArguments) { $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(count($tagGeneratingArguments))) + ->expects(self::exactly(count($tagGeneratingArguments))) ->method('generateTag') ->withConsecutive(...$tagGeneratingArguments) ->willReturnOnConsecutiveCalls(...$tagGeneratingResults); @@ -231,7 +231,7 @@ final public function testLoadMethodsCacheMiss( if ($keyGeneratingArguments) { $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(count($keyGeneratingArguments))) + ->expects(self::exactly(count($keyGeneratingArguments))) ->method('generateKey') ->withConsecutive(...$keyGeneratingArguments) ->willReturnOnConsecutiveCalls(...$keyGeneratingResults); @@ -239,13 +239,13 @@ final public function testLoadMethodsCacheMiss( if ($multi) { $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('getItems') ->with([$cacheItem->getKey()]) ->willReturn([$key => $cacheItem]); } else { $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('getItem') ->with($cacheItem->getKey()) ->willReturn($cacheItem); @@ -253,12 +253,12 @@ final public function testLoadMethodsCacheMiss( $innerHandlerMock = $this->createMock($this->getHandlerClassName()); $this->persistenceHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method($handlerMethodName) ->willReturn($innerHandlerMock); $innerHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method($method) ->with(...$arguments) ->willReturn($data); @@ -266,25 +266,25 @@ final public function testLoadMethodsCacheMiss( foreach ($additionalCalls as $additionalCall) { $innerHandlerMock = $this->createMock($additionalCall[1]); $this->persistenceHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method($additionalCall[0]) ->willReturn($innerHandlerMock); $innerHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method($additionalCall[2]) ->willReturn($additionalCall[3]); } $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('save') ->with($cacheItem); $handler = $this->persistenceCacheHandler->$handlerMethodName(); $return = call_user_func_array([$handler, $method], $arguments); - $this->assertEquals($data, $return); + self::assertEquals($data, $return); // Assert use of tags would probably need custom logic as internal property is [$tag => $tag] value and we don't want to know that. //$this->assertAttributeEquals([], 'tags', $cacheItem); diff --git a/tests/lib/Persistence/Cache/AbstractInMemoryCacheHandlerTest.php b/tests/lib/Persistence/Cache/AbstractInMemoryCacheHandlerTest.php index 87083bf4ec..96055ac11c 100644 --- a/tests/lib/Persistence/Cache/AbstractInMemoryCacheHandlerTest.php +++ b/tests/lib/Persistence/Cache/AbstractInMemoryCacheHandlerTest.php @@ -42,18 +42,18 @@ final public function testUnCachedMethods( ) { $handlerMethodName = $this->getHandlerMethodName(); - $this->loggerMock->expects($this->once())->method('logCall'); - $this->loggerMock->expects($this->never())->method('logCacheHit'); - $this->loggerMock->expects($this->never())->method('logCacheMiss'); + $this->loggerMock->expects(self::once())->method('logCall'); + $this->loggerMock->expects(self::never())->method('logCacheHit'); + $this->loggerMock->expects(self::never())->method('logCacheMiss'); $innerHandler = $this->createMock($this->getHandlerClassName()); $this->persistenceHandlerMock - ->expects($callInnerHandler ? $this->once() : $this->never()) + ->expects($callInnerHandler ? self::once() : self::never()) ->method($handlerMethodName) ->willReturn($innerHandler); $invocationMocker = $innerHandler - ->expects($callInnerHandler ? $this->once() : $this->never()) + ->expects($callInnerHandler ? self::once() : self::never()) ->method($method) ->with(...$arguments); // workaround for mocking void-returning methods, null in this case denotes that, not null value @@ -64,7 +64,7 @@ final public function testUnCachedMethods( if ($tags || $key) { if ($tagGeneratingArguments) { $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(count($tagGeneratingArguments))) + ->expects(self::exactly(count($tagGeneratingArguments))) ->method('generateTag') ->withConsecutive(...$tagGeneratingArguments) ->willReturnOnConsecutiveCalls(...$tags); @@ -75,13 +75,13 @@ final public function testUnCachedMethods( if (is_array($key)) { $this->cacheIdentifierGeneratorMock - ->expects($this->exactly($callsCount)) + ->expects(self::exactly($callsCount)) ->method('generateKey') ->withConsecutive(...$keyGeneratingArguments) ->willReturnOnConsecutiveCalls(...$key); } else { $this->cacheIdentifierGeneratorMock - ->expects($this->exactly($callsCount)) + ->expects(self::exactly($callsCount)) ->method('generateKey') ->with($keyGeneratingArguments[0][0]) ->willReturn($key); @@ -89,24 +89,24 @@ final public function testUnCachedMethods( } $this->cacheMock - ->expects(!empty($tags) ? $this->once() : $this->never()) + ->expects(!empty($tags) ? self::once() : self::never()) ->method('invalidateTags') ->with($tags); $this->cacheMock - ->expects(!empty($key) ? $this->once() : $this->never()) + ->expects(!empty($key) ? self::once() : self::never()) ->method('deleteItems') ->with($key); } else { $this->cacheMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); } $handler = $this->persistenceCacheHandler->$handlerMethodName(); $actualReturnValue = call_user_func_array([$handler, $method], $arguments); - $this->assertEquals($returnValue, $actualReturnValue); + self::assertEquals($returnValue, $actualReturnValue); } abstract public function providerForCachedLoadMethodsHit(): array; @@ -140,13 +140,13 @@ final public function testLoadMethodsCacheHit( $cacheItem = $this->getCacheItem($key, $multi ? reset($data) : $data); $handlerMethodName = $this->getHandlerMethodName(); - $this->loggerMock->expects($this->once())->method('logCacheHit'); - $this->loggerMock->expects($this->never())->method('logCall'); - $this->loggerMock->expects($this->never())->method('logCacheMiss'); + $this->loggerMock->expects(self::once())->method('logCacheHit'); + $this->loggerMock->expects(self::never())->method('logCall'); + $this->loggerMock->expects(self::never())->method('logCacheMiss'); if ($tagGeneratingArguments) { $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(count($tagGeneratingArguments))) + ->expects(self::exactly(count($tagGeneratingArguments))) ->method('generateTag') ->withConsecutive(...$tagGeneratingArguments) ->willReturnOnConsecutiveCalls(...$tagGeneratingResults); @@ -154,7 +154,7 @@ final public function testLoadMethodsCacheHit( if ($keyGeneratingArguments) { $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(count($keyGeneratingArguments))) + ->expects(self::exactly(count($keyGeneratingArguments))) ->method('generateKey') ->withConsecutive(...$keyGeneratingArguments) ->willReturnOnConsecutiveCalls(...$keyGeneratingResults); @@ -162,32 +162,32 @@ final public function testLoadMethodsCacheHit( if ($multi) { $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('getItems') ->with([$cacheItem->getKey()]) ->willReturn([$key => $cacheItem]); } else { $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('getItem') ->with($cacheItem->getKey()) ->willReturn($cacheItem); } $this->persistenceHandlerMock - ->expects($this->never()) + ->expects(self::never()) ->method($handlerMethodName); foreach ($additionalCalls as $additionalCall) { $this->persistenceHandlerMock - ->expects($this->never()) + ->expects(self::never()) ->method($additionalCall[0]); } $handler = $this->persistenceCacheHandler->$handlerMethodName(); $return = call_user_func_array([$handler, $method], $arguments); - $this->assertEquals($data, $return); + self::assertEquals($data, $return); } abstract public function providerForCachedLoadMethodsMiss(): array; @@ -221,13 +221,13 @@ final public function testLoadMethodsCacheMiss( $cacheItem = $this->getCacheItem($key, null); $handlerMethodName = $this->getHandlerMethodName(); - $this->loggerMock->expects($this->once())->method('logCacheMiss'); - $this->loggerMock->expects($this->never())->method('logCall'); - $this->loggerMock->expects($this->never())->method('logCacheHit'); + $this->loggerMock->expects(self::once())->method('logCacheMiss'); + $this->loggerMock->expects(self::never())->method('logCall'); + $this->loggerMock->expects(self::never())->method('logCacheHit'); if ($tagGeneratingArguments) { $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(count($tagGeneratingArguments))) + ->expects(self::exactly(count($tagGeneratingArguments))) ->method('generateTag') ->withConsecutive(...$tagGeneratingArguments) ->willReturnOnConsecutiveCalls(...$tagGeneratingResults); @@ -235,7 +235,7 @@ final public function testLoadMethodsCacheMiss( if ($keyGeneratingArguments) { $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(count($keyGeneratingArguments))) + ->expects(self::exactly(count($keyGeneratingArguments))) ->method('generateKey') ->withConsecutive(...$keyGeneratingArguments) ->willReturnOnConsecutiveCalls(...$keyGeneratingResults); @@ -243,13 +243,13 @@ final public function testLoadMethodsCacheMiss( if ($multi) { $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('getItems') ->with([$cacheItem->getKey()]) ->willReturn([$key => $cacheItem]); } else { $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('getItem') ->with($cacheItem->getKey()) ->willReturn($cacheItem); @@ -257,12 +257,12 @@ final public function testLoadMethodsCacheMiss( $innerHandlerMock = $this->createMock($this->getHandlerClassName()); $this->persistenceHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method($handlerMethodName) ->willReturn($innerHandlerMock); $innerHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method($method) ->with(...$arguments) ->willReturn($data); @@ -270,25 +270,25 @@ final public function testLoadMethodsCacheMiss( foreach ($additionalCalls as $additionalCall) { $innerHandlerMock = $this->createMock($additionalCall[1]); $this->persistenceHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method($additionalCall[0]) ->willReturn($innerHandlerMock); $innerHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method($additionalCall[2]) ->willReturn($additionalCall[3]); } $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('save') ->with($cacheItem); $handler = $this->persistenceCacheHandler->$handlerMethodName(); $return = call_user_func_array([$handler, $method], $arguments); - $this->assertEquals($data, $return); + self::assertEquals($data, $return); // Assert use of tags would probably need custom logic as internal property is [$tag => $tag] value, and we don't want to know that. //$this->assertAttributeEquals([], 'tags', $cacheItem); diff --git a/tests/lib/Persistence/Cache/Adapter/InMemoryClearingProxyAdapterTest.php b/tests/lib/Persistence/Cache/Adapter/InMemoryClearingProxyAdapterTest.php index 9fe7ef6d52..7340251524 100644 --- a/tests/lib/Persistence/Cache/Adapter/InMemoryClearingProxyAdapterTest.php +++ b/tests/lib/Persistence/Cache/Adapter/InMemoryClearingProxyAdapterTest.php @@ -49,11 +49,12 @@ protected function setUp(): void $this->cacheItemsClosure = \Closure::bind( static function ($key, $value, $isHit, $defaultLifetime = 0, $tags = []) { $item = new CacheItem(); + $item->isTaggable = true; $item->key = $key; $item->value = $value; $item->isHit = $isHit; - $item->prevTags = $tags; - $item->defaultLifetime = $defaultLifetime; + $item->tag($tags); + $item->expiresAfter($defaultLifetime); return $item; }, @@ -79,15 +80,15 @@ public function testGetItem() $item = $this->createCacheItem('first'); $this->innerPool - ->expects($this->once()) + ->expects(self::once()) ->method('getItem') ->with('first') ->willReturn($item); - $this->inMemory->expects($this->never())->method($this->anything()); + $this->inMemory->expects(self::never())->method(self::anything()); $returnedItem = $this->cache->getItem('first'); - $this->assertSame($item, $returnedItem); + self::assertSame($item, $returnedItem); } public function testGetItems() @@ -98,15 +99,15 @@ public function testGetItems() ]; $this->innerPool - ->expects($this->once()) + ->expects(self::once()) ->method('getItems') ->with(['first', 'second']) ->willReturn($items); - $this->inMemory->expects($this->never())->method($this->anything()); + $this->inMemory->expects(self::never())->method(self::anything()); $returnedItems = $this->cache->getItems(['first', 'second']); - $this->assertSame($items, $returnedItems); + self::assertSame($items, $returnedItems); } /** @@ -120,28 +121,28 @@ public function testGetItemsWithGenerator() ]; $this->innerPool - ->expects($this->once()) + ->expects(self::once()) ->method('getItems') ->with(['first', 'second']) ->willReturn($this->arrayAsGenerator($items)); - $this->inMemory->expects($this->never())->method($this->anything()); + $this->inMemory->expects(self::never())->method(self::anything()); $returnedItems = iterator_to_array($this->cache->getItems(['first', 'second'])); - $this->assertSame($items, $returnedItems); + self::assertSame($items, $returnedItems); } public function testHasItem() { $this->innerPool - ->expects($this->once()) + ->expects(self::once()) ->method('hasItem') ->with('first') ->willReturn(true); - $this->inMemory->expects($this->never())->method($this->anything()); + $this->inMemory->expects(self::never())->method(self::anything()); - $this->assertTrue($this->cache->hasItem('first')); + self::assertTrue($this->cache->hasItem('first')); } /** @@ -150,18 +151,18 @@ public function testHasItem() public function testDelete(string $method, $argument) { $this->innerPool - ->expects($this->once()) + ->expects(self::once()) ->method($method) ->with($argument) ->willReturn(true); $this->inMemory - ->expects($this->once()) + ->expects(self::once()) ->method('deleteMulti') ->with(is_array($argument) ? $argument : [$argument]); // invalidate it - $this->assertTrue($this->cache->$method($argument)); + self::assertTrue($this->cache->$method($argument)); } public function providerForDelete(): array @@ -182,23 +183,23 @@ public function testClearAndInvalidation(string $method, $argument) { if ($argument) { $this->innerPool - ->expects($this->once()) + ->expects(self::once()) ->method($method) ->with($argument) ->willReturn(true); } else { $this->innerPool - ->expects($this->once()) + ->expects(self::once()) ->method($method) ->willReturn(true); } $this->inMemory - ->expects($this->once()) + ->expects(self::once()) ->method('clear'); // invalidate it - $this->assertTrue($this->cache->$method($argument)); + self::assertTrue($this->cache->$method($argument)); } public function providerForClearAndInvalidation(): array diff --git a/tests/lib/Persistence/Cache/ContentHandlerTest.php b/tests/lib/Persistence/Cache/ContentHandlerTest.php index c7c43308fa..9a354a8a9c 100644 --- a/tests/lib/Persistence/Cache/ContentHandlerTest.php +++ b/tests/lib/Persistence/Cache/ContentHandlerTest.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content; @@ -424,16 +425,16 @@ public function providerForCachedLoadMethodsMiss(): array public function testDeleteContent() { - $this->loggerMock->expects($this->once())->method('logCall'); + $this->loggerMock->expects(self::once())->method('logCall'); $innerHandlerMock = $this->createMock(SPIContentHandler::class); $this->persistenceHandlerMock - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('contentHandler') ->willReturn($innerHandlerMock); $innerHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadReverseRelations') ->with(2, APIRelation::FIELD | APIRelation::ASSET) ->willReturn( @@ -443,17 +444,17 @@ public function testDeleteContent() ); $innerHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('deleteContent') ->with(2) ->willReturn(true); $this->cacheMock - ->expects($this->never()) + ->expects(self::never()) ->method('deleteItem'); $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('generateTag') ->withConsecutive( ['content', [42], false], @@ -462,7 +463,7 @@ public function testDeleteContent() ->willReturnOnConsecutiveCalls('c-42', 'c-2'); $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('invalidateTags') ->with(['c-42', 'c-2']); diff --git a/tests/lib/Persistence/Cache/ContentLanguageHandlerTest.php b/tests/lib/Persistence/Cache/ContentLanguageHandlerTest.php index c618f6d6ed..cc1c124562 100644 --- a/tests/lib/Persistence/Cache/ContentLanguageHandlerTest.php +++ b/tests/lib/Persistence/Cache/ContentLanguageHandlerTest.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\Language as SPILanguage; diff --git a/tests/lib/Persistence/Cache/ContentTypeHandlerTest.php b/tests/lib/Persistence/Cache/ContentTypeHandlerTest.php index 6b113e3fb8..139da18a06 100644 --- a/tests/lib/Persistence/Cache/ContentTypeHandlerTest.php +++ b/tests/lib/Persistence/Cache/ContentTypeHandlerTest.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\Type as SPIType; @@ -411,22 +412,22 @@ public function testPublish() $handlerMethodName = $this->getHandlerMethodName(); - $this->loggerMock->expects($this->once())->method('logCall'); + $this->loggerMock->expects(self::once())->method('logCall'); $innerHandler = $this->createMock($this->getHandlerClassName()); $this->persistenceHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method($handlerMethodName) ->willReturn($innerHandler); $innerHandler - ->expects($this->once()) + ->expects(self::once()) ->method($method) ->with(...$arguments) ->willReturn(null); $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(3)) + ->expects(self::exactly(3)) ->method('generateTag') ->withConsecutive( ['type', [5], false], @@ -440,7 +441,7 @@ public function testPublish() ); $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(3)) + ->expects(self::exactly(3)) ->method('generateKey') ->withConsecutive( ['content_type', [], true], @@ -454,18 +455,18 @@ public function testPublish() ); $this->cacheMock - ->expects(!empty($tags) ? $this->once() : $this->never()) + ->expects(!empty($tags) ? self::once() : self::never()) ->method('invalidateTags') ->with($tags); $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('getItem') ->with($cacheItem->getKey()) ->willReturn($cacheItem); $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('deleteItems') ->with(['ibx-ctlbg-3', 'ibx-ctlbg-4']) ->willReturn(true); diff --git a/tests/lib/Persistence/Cache/Identifier/CacheIdentifierGeneratorTest.php b/tests/lib/Persistence/Cache/Identifier/CacheIdentifierGeneratorTest.php index 895a7c9cc8..dcc7eb690d 100644 --- a/tests/lib/Persistence/Cache/Identifier/CacheIdentifierGeneratorTest.php +++ b/tests/lib/Persistence/Cache/Identifier/CacheIdentifierGeneratorTest.php @@ -76,7 +76,7 @@ public function providerForTestGenerateKeyThrowsInvalidArgumentException(): arra */ public function testGenerateTag(array $arguments, string $resultKey): void { - $this->assertEquals( + self::assertEquals( $resultKey, $this->cacheIdentifierGenerator->generateTag(...$arguments) ); @@ -89,7 +89,7 @@ public function testGenerateTagThrowsInvalidArgumentException(array $arguments, { $this->expectException(InvalidArgumentException::class); - $this->assertEquals( + self::assertEquals( $resultKey, $this->cacheIdentifierGenerator->generateTag(...$arguments) ); @@ -100,7 +100,7 @@ public function testGenerateTagThrowsInvalidArgumentException(array $arguments, */ public function testGenerateKey(array $arguments, string $resultKey): void { - $this->assertEquals( + self::assertEquals( $resultKey, $this->cacheIdentifierGenerator->generateKey(...$arguments) ); @@ -113,7 +113,7 @@ public function testGenerateKeyThrowsInvalidArgumentException(array $arguments, { $this->expectException(InvalidArgumentException::class); - $this->assertEquals( + self::assertEquals( $resultKey, $this->cacheIdentifierGenerator->generateKey(...$arguments) ); diff --git a/tests/lib/Persistence/Cache/InMemory/InMemoryCacheTest.php b/tests/lib/Persistence/Cache/InMemory/InMemoryCacheTest.php index 2f9d26e936..60a88d0481 100644 --- a/tests/lib/Persistence/Cache/InMemory/InMemoryCacheTest.php +++ b/tests/lib/Persistence/Cache/InMemory/InMemoryCacheTest.php @@ -46,50 +46,50 @@ protected function tearDown(): void public function testGetByKey(): void { - $this->assertNull($this->cache->get('first')); + self::assertNull($this->cache->get('first')); $obj = new \stdClass(); $this->cache->setMulti([$obj], static function ($o) { return ['first']; }); - $this->assertSame($obj, $this->cache->get('first')); + self::assertSame($obj, $this->cache->get('first')); // Test TTL $GLOBALS['override_time'] = \microtime(true) + 4; - $this->assertNull($this->cache->get('first')); + self::assertNull($this->cache->get('first')); } public function testGetBySecondaryIndex(): void { - $this->assertNull($this->cache->get('first')); - $this->assertNull($this->cache->get('secondary')); + self::assertNull($this->cache->get('first')); + self::assertNull($this->cache->get('secondary')); $obj = new \stdClass(); $this->cache->setMulti([$obj], static function ($o) { return ['first', 'secondary']; }); - $this->assertSame($obj, $this->cache->get('first')); - $this->assertSame($obj, $this->cache->get('secondary')); + self::assertSame($obj, $this->cache->get('first')); + self::assertSame($obj, $this->cache->get('secondary')); // Test TTL $GLOBALS['override_time'] = \microtime(true) + 4; - $this->assertNull($this->cache->get('first')); - $this->assertNull($this->cache->get('secondary')); + self::assertNull($this->cache->get('first')); + self::assertNull($this->cache->get('secondary')); } public function testGetByList(): void { - $this->assertNull($this->cache->get('first')); - $this->assertNull($this->cache->get('list')); + self::assertNull($this->cache->get('first')); + self::assertNull($this->cache->get('list')); $obj = new \stdClass(); $this->cache->setMulti([$obj], static function ($o) { return ['first']; }, 'list'); - $this->assertSame($obj, $this->cache->get('first')); - $this->assertSame([$obj], $this->cache->get('list')); + self::assertSame($obj, $this->cache->get('first')); + self::assertSame([$obj], $this->cache->get('list')); // Test TTL $GLOBALS['override_time'] = \microtime(true) + 4; - $this->assertNull($this->cache->get('first')); - $this->assertNull($this->cache->get('list')); + self::assertNull($this->cache->get('first')); + self::assertNull($this->cache->get('list')); } public function testDeleted(): void @@ -97,21 +97,21 @@ public function testDeleted(): void $obj = new \stdClass(); $this->cache->setMulti([$obj], static function ($o) { return ['first', 'second']; }, 'list'); - $this->assertSame($obj, $this->cache->get('first')); - $this->assertSame($obj, $this->cache->get('second')); - $this->assertSame([$obj], $this->cache->get('list')); + self::assertSame($obj, $this->cache->get('first')); + self::assertSame($obj, $this->cache->get('second')); + self::assertSame([$obj], $this->cache->get('list')); // Delete primary, her we expect secondary index to also start returning null $this->cache->deleteMulti(['first']); - $this->assertNull($this->cache->get('first')); - $this->assertNull($this->cache->get('second')); - $this->assertSame([$obj], $this->cache->get('list')); + self::assertNull($this->cache->get('first')); + self::assertNull($this->cache->get('second')); + self::assertSame([$obj], $this->cache->get('list')); // Delete list $this->cache->deleteMulti(['list']); - $this->assertNull($this->cache->get('list')); + self::assertNull($this->cache->get('list')); } public function testClear(): void @@ -119,16 +119,16 @@ public function testClear(): void $obj = new \stdClass(); $this->cache->setMulti([$obj], static function ($o) { return ['first', 'second']; }, 'list'); - $this->assertSame($obj, $this->cache->get('first')); - $this->assertSame($obj, $this->cache->get('second')); - $this->assertSame([$obj], $this->cache->get('list')); + self::assertSame($obj, $this->cache->get('first')); + self::assertSame($obj, $this->cache->get('second')); + self::assertSame([$obj], $this->cache->get('list')); // Clear all cache $this->cache->clear(); - $this->assertNull($this->cache->get('first')); - $this->assertNull($this->cache->get('second')); - $this->assertNull($this->cache->get('list')); + self::assertNull($this->cache->get('first')); + self::assertNull($this->cache->get('second')); + self::assertNull($this->cache->get('list')); } public function testSetWhenReachingSetLimit(): void @@ -136,9 +136,9 @@ public function testSetWhenReachingSetLimit(): void $obj = new \stdClass(); $this->cache->setMulti([$obj, $obj], static function ($o) { return ['first', 'second']; }, 'list'); - $this->assertNull($this->cache->get('first')); - $this->assertNull($this->cache->get('second')); - $this->assertNull($this->cache->get('list')); + self::assertNull($this->cache->get('first')); + self::assertNull($this->cache->get('second')); + self::assertNull($this->cache->get('list')); } public function testSetWhenReachingTotalLimit(): void @@ -153,14 +153,14 @@ public function testSetWhenReachingTotalLimit(): void $this->cache->setMulti([$obj], static function ($o) { return ['seventh']; }); $this->cache->setMulti([$obj], static function ($o) { return ['eight']; }); - $this->assertNull($this->cache->get('first')); - $this->assertNull($this->cache->get('second')); - $this->assertSame($obj, $this->cache->get('third')); - $this->assertSame($obj, $this->cache->get('fourth')); - $this->assertSame($obj, $this->cache->get('fifth')); - $this->assertSame($obj, $this->cache->get('sixth')); - $this->assertSame($obj, $this->cache->get('seventh')); - $this->assertSame($obj, $this->cache->get('eight')); + self::assertNull($this->cache->get('first')); + self::assertNull($this->cache->get('second')); + self::assertSame($obj, $this->cache->get('third')); + self::assertSame($obj, $this->cache->get('fourth')); + self::assertSame($obj, $this->cache->get('fifth')); + self::assertSame($obj, $this->cache->get('sixth')); + self::assertSame($obj, $this->cache->get('seventh')); + self::assertSame($obj, $this->cache->get('eight')); } /** @@ -183,14 +183,14 @@ public function testAccessCountsWhenReachingTotalLimit(): void $this->cache->setMulti([$obj], static function ($o) { return ['seventh']; }); $this->cache->setMulti([$obj], static function ($o) { return ['eight']; }); - $this->assertSame($obj, $this->cache->get('first')); - $this->assertNull($this->cache->get('second')); - $this->assertSame($obj, $this->cache->get('third')); - $this->assertNull($this->cache->get('fourth')); - $this->assertSame($obj, $this->cache->get('fifth')); - $this->assertSame($obj, $this->cache->get('sixth')); - $this->assertSame($obj, $this->cache->get('seventh')); - $this->assertSame($obj, $this->cache->get('eight')); + self::assertSame($obj, $this->cache->get('first')); + self::assertNull($this->cache->get('second')); + self::assertSame($obj, $this->cache->get('third')); + self::assertNull($this->cache->get('fourth')); + self::assertSame($obj, $this->cache->get('fifth')); + self::assertSame($obj, $this->cache->get('sixth')); + self::assertSame($obj, $this->cache->get('seventh')); + self::assertSame($obj, $this->cache->get('eight')); } } class_alias(InMemoryCacheTest::class, 'eZ\Publish\Core\Persistence\Cache\InMemory\InMemoryCacheTest'); diff --git a/tests/lib/Persistence/Cache/LocationHandlerTest.php b/tests/lib/Persistence/Cache/LocationHandlerTest.php index ed498aa495..d9d4e0a0e8 100644 --- a/tests/lib/Persistence/Cache/LocationHandlerTest.php +++ b/tests/lib/Persistence/Cache/LocationHandlerTest.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\Location; diff --git a/tests/lib/Persistence/Cache/ObjectStateHandlerTest.php b/tests/lib/Persistence/Cache/ObjectStateHandlerTest.php index dbbf5034b5..145e873c82 100644 --- a/tests/lib/Persistence/Cache/ObjectStateHandlerTest.php +++ b/tests/lib/Persistence/Cache/ObjectStateHandlerTest.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\ObjectState as SPIObjectState; diff --git a/tests/lib/Persistence/Cache/PersistenceHandlerTest.php b/tests/lib/Persistence/Cache/PersistenceHandlerTest.php index 8b379dd5bd..1a32f68695 100644 --- a/tests/lib/Persistence/Cache/PersistenceHandlerTest.php +++ b/tests/lib/Persistence/Cache/PersistenceHandlerTest.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence as SPIPersistence; @@ -18,96 +19,96 @@ class PersistenceHandlerTest extends AbstractBaseHandlerTest { public function testHandler() { - $this->assertInstanceOf(SPIPersistence\Handler::class, $this->persistenceCacheHandler); - $this->assertInstanceOf(Cache\Handler::class, $this->persistenceCacheHandler); + self::assertInstanceOf(SPIPersistence\Handler::class, $this->persistenceCacheHandler); + self::assertInstanceOf(Cache\Handler::class, $this->persistenceCacheHandler); } public function testContentHandler() { - $this->loggerMock->expects($this->never())->method($this->anything()); + $this->loggerMock->expects(self::never())->method(self::anything()); $handler = $this->persistenceCacheHandler->contentHandler(); - $this->assertInstanceOf(SPIPersistence\Content\Handler::class, $handler); - $this->assertInstanceOf(Cache\ContentHandler::class, $handler); + self::assertInstanceOf(SPIPersistence\Content\Handler::class, $handler); + self::assertInstanceOf(Cache\ContentHandler::class, $handler); } public function testLanguageHandler() { - $this->loggerMock->expects($this->never())->method($this->anything()); + $this->loggerMock->expects(self::never())->method(self::anything()); $handler = $this->persistenceCacheHandler->contentLanguageHandler(); - $this->assertInstanceOf(SPIPersistence\Content\Language\Handler::class, $handler); - $this->assertInstanceOf(Cache\ContentLanguageHandler::class, $handler); + self::assertInstanceOf(SPIPersistence\Content\Language\Handler::class, $handler); + self::assertInstanceOf(Cache\ContentLanguageHandler::class, $handler); } public function testContentTypeHandler() { - $this->loggerMock->expects($this->never())->method($this->anything()); + $this->loggerMock->expects(self::never())->method(self::anything()); $handler = $this->persistenceCacheHandler->contentTypeHandler(); - $this->assertInstanceOf(SPIPersistence\Content\Type\Handler::class, $handler); - $this->assertInstanceOf(Cache\ContentTypeHandler::class, $handler); + self::assertInstanceOf(SPIPersistence\Content\Type\Handler::class, $handler); + self::assertInstanceOf(Cache\ContentTypeHandler::class, $handler); } public function testContentLocationHandler() { - $this->loggerMock->expects($this->never())->method($this->anything()); + $this->loggerMock->expects(self::never())->method(self::anything()); $handler = $this->persistenceCacheHandler->locationHandler(); - $this->assertInstanceOf(SPIPersistence\Content\Location\Handler::class, $handler); - $this->assertInstanceOf(Cache\LocationHandler::class, $handler); + self::assertInstanceOf(SPIPersistence\Content\Location\Handler::class, $handler); + self::assertInstanceOf(Cache\LocationHandler::class, $handler); } public function testTrashHandler() { - $this->loggerMock->expects($this->never())->method($this->anything()); + $this->loggerMock->expects(self::never())->method(self::anything()); $handler = $this->persistenceCacheHandler->trashHandler(); - $this->assertInstanceOf(SPIPersistence\Content\Location\Trash\Handler::class, $handler); - $this->assertInstanceOf(Cache\TrashHandler::class, $handler); + self::assertInstanceOf(SPIPersistence\Content\Location\Trash\Handler::class, $handler); + self::assertInstanceOf(Cache\TrashHandler::class, $handler); } public function testObjectStateHandler() { - $this->loggerMock->expects($this->never())->method($this->anything()); + $this->loggerMock->expects(self::never())->method(self::anything()); $handler = $this->persistenceCacheHandler->objectStateHandler(); - $this->assertInstanceOf(SPIPersistence\Content\ObjectState\Handler::class, $handler); - $this->assertInstanceOf(Cache\ObjectStateHandler::class, $handler); + self::assertInstanceOf(SPIPersistence\Content\ObjectState\Handler::class, $handler); + self::assertInstanceOf(Cache\ObjectStateHandler::class, $handler); } public function testSectionHandler() { - $this->loggerMock->expects($this->never())->method($this->anything()); + $this->loggerMock->expects(self::never())->method(self::anything()); $handler = $this->persistenceCacheHandler->sectionHandler(); - $this->assertInstanceOf(SPIPersistence\Content\Section\Handler::class, $handler); - $this->assertInstanceOf(Cache\SectionHandler::class, $handler); + self::assertInstanceOf(SPIPersistence\Content\Section\Handler::class, $handler); + self::assertInstanceOf(Cache\SectionHandler::class, $handler); } public function testUserHandler() { - $this->loggerMock->expects($this->never())->method($this->anything()); + $this->loggerMock->expects(self::never())->method(self::anything()); $handler = $this->persistenceCacheHandler->userHandler(); - $this->assertInstanceOf(SPIPersistence\User\Handler::class, $handler); - $this->assertInstanceOf(Cache\UserHandler::class, $handler); + self::assertInstanceOf(SPIPersistence\User\Handler::class, $handler); + self::assertInstanceOf(Cache\UserHandler::class, $handler); } public function testUrlAliasHandler() { - $this->loggerMock->expects($this->never())->method($this->anything()); + $this->loggerMock->expects(self::never())->method(self::anything()); $handler = $this->persistenceCacheHandler->urlAliasHandler(); - $this->assertInstanceOf(SPIPersistence\Content\UrlAlias\Handler::class, $handler); - $this->assertInstanceOf(Cache\UrlAliasHandler::class, $handler); + self::assertInstanceOf(SPIPersistence\Content\UrlAlias\Handler::class, $handler); + self::assertInstanceOf(Cache\UrlAliasHandler::class, $handler); } public function testUrlWildcardHandler() { - $this->loggerMock->expects($this->never())->method($this->anything()); + $this->loggerMock->expects(self::never())->method(self::anything()); $handler = $this->persistenceCacheHandler->urlWildcardHandler(); - $this->assertInstanceOf(SPIPersistence\Content\UrlWildcard\Handler::class, $handler); - $this->assertInstanceOf(Cache\UrlWildcardHandler::class, $handler); + self::assertInstanceOf(SPIPersistence\Content\UrlWildcard\Handler::class, $handler); + self::assertInstanceOf(Cache\UrlWildcardHandler::class, $handler); } public function testTransactionHandler() { - $this->loggerMock->expects($this->never())->method($this->anything()); + $this->loggerMock->expects(self::never())->method(self::anything()); $handler = $this->persistenceCacheHandler->transactionHandler(); - $this->assertInstanceOf(SPIPersistence\TransactionHandler::class, $handler); - $this->assertInstanceOf(Cache\TransactionHandler::class, $handler); + self::assertInstanceOf(SPIPersistence\TransactionHandler::class, $handler); + self::assertInstanceOf(Cache\TransactionHandler::class, $handler); } } diff --git a/tests/lib/Persistence/Cache/PersistenceLoggerTest.php b/tests/lib/Persistence/Cache/PersistenceLoggerTest.php index 23eda2909d..b1e5a77371 100644 --- a/tests/lib/Persistence/Cache/PersistenceLoggerTest.php +++ b/tests/lib/Persistence/Cache/PersistenceLoggerTest.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\Core\Persistence\Cache; use Ibexa\Core\Persistence\Cache\PersistenceLogger; @@ -37,22 +38,22 @@ protected function tearDown(): void public function testGetName() { - $this->assertEquals(PersistenceLogger::NAME, $this->logger->getName()); + self::assertEquals(PersistenceLogger::NAME, $this->logger->getName()); } public function testGetCount() { - $this->assertEquals(0, $this->logger->getCount()); + self::assertEquals(0, $this->logger->getCount()); } public function testGetCalls() { - $this->assertEquals([], $this->logger->getCalls()); + self::assertEquals([], $this->logger->getCalls()); } public function testLogCall() { - $this->assertNull($this->logger->logCall(__METHOD__)); + self::assertNull($this->logger->logCall(__METHOD__)); $this->logger->logCall(__METHOD__); $this->logger->logCall(__METHOD__); $this->logger->logCall(__METHOD__, [33]); @@ -67,7 +68,7 @@ public function testLogCall() */ public function testGetCountValues($logger) { - $this->assertEquals(4, $logger->getCount()); + self::assertEquals(4, $logger->getCount()); return $logger; } @@ -85,15 +86,15 @@ public function testGetCallValues($logger) $method = __CLASS__ . '::testLogCall'; - $this->assertEquals($method, $calls[0]['method']); - $this->assertEquals([], $calls[0]['arguments']); - $this->assertCount(1, $calls[0]['traces']); - $this->assertEquals(['uncached' => 3, 'miss' => 0, 'hit' => 0, 'memory' => 0], $calls[0]['stats']); + self::assertEquals($method, $calls[0]['method']); + self::assertEquals([], $calls[0]['arguments']); + self::assertCount(1, $calls[0]['traces']); + self::assertEquals(['uncached' => 3, 'miss' => 0, 'hit' => 0, 'memory' => 0], $calls[0]['stats']); - $this->assertEquals($method, $calls[1]['method']); - $this->assertEquals([33], $calls[1]['arguments']); - $this->assertCount(1, $calls[1]['traces']); - $this->assertEquals(['uncached' => 1, 'miss' => 0, 'hit' => 0, 'memory' => 0], $calls[1]['stats']); + self::assertEquals($method, $calls[1]['method']); + self::assertEquals([33], $calls[1]['arguments']); + self::assertCount(1, $calls[1]['traces']); + self::assertEquals(['uncached' => 1, 'miss' => 0, 'hit' => 0, 'memory' => 0], $calls[1]['stats']); } } diff --git a/tests/lib/Persistence/Cache/SectionHandlerTest.php b/tests/lib/Persistence/Cache/SectionHandlerTest.php index 012af0783e..502f9365ff 100644 --- a/tests/lib/Persistence/Cache/SectionHandlerTest.php +++ b/tests/lib/Persistence/Cache/SectionHandlerTest.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\Section as SPISection; diff --git a/tests/lib/Persistence/Cache/SettingHandlerTest.php b/tests/lib/Persistence/Cache/SettingHandlerTest.php index 96b05914b2..057093566c 100644 --- a/tests/lib/Persistence/Cache/SettingHandlerTest.php +++ b/tests/lib/Persistence/Cache/SettingHandlerTest.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Setting\Handler as SettingHandler; diff --git a/tests/lib/Persistence/Cache/TransactionHandlerTest.php b/tests/lib/Persistence/Cache/TransactionHandlerTest.php index 65eb580861..3c0b18e842 100644 --- a/tests/lib/Persistence/Cache/TransactionHandlerTest.php +++ b/tests/lib/Persistence/Cache/TransactionHandlerTest.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\TransactionHandler; @@ -49,25 +50,25 @@ public function providerForCachedLoadMethodsMiss(): array public function testRollback() { $this->loggerMock - ->expects($this->once()) + ->expects(self::once()) ->method('logCall'); $this->cacheMock - ->expects($this->never()) + ->expects(self::never()) ->method('clear'); $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('rollbackTransaction'); $innerHandlerMock = $this->createMock(TransactionHandler::class); $this->persistenceHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('transactionHandler') ->willReturn($innerHandlerMock); $innerHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('rollback'); $handler = $this->persistenceCacheHandler->transactionHandler(); @@ -77,21 +78,21 @@ public function testRollback() public function testCommitStopsCacheTransaction() { $this->loggerMock - ->expects($this->once()) + ->expects(self::once()) ->method('logCall'); $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('commitTransaction'); $innerHandlerMock = $this->createMock(TransactionHandler::class); $this->persistenceHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('transactionHandler') ->willReturn($innerHandlerMock); $innerHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('commit'); $handler = $this->persistenceCacheHandler->transactionHandler(); @@ -101,21 +102,21 @@ public function testCommitStopsCacheTransaction() public function testBeginTransactionStartsCacheTransaction() { $this->loggerMock - ->expects($this->once()) + ->expects(self::once()) ->method('logCall'); $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('beginTransaction'); $innerHandlerMock = $this->createMock(TransactionHandler::class); $this->persistenceHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('transactionHandler') ->willReturn($innerHandlerMock); $innerHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('beginTransaction'); $handler = $this->persistenceCacheHandler->transactionHandler(); diff --git a/tests/lib/Persistence/Cache/TrashHandlerTest.php b/tests/lib/Persistence/Cache/TrashHandlerTest.php index dcfc8712bd..22b5aa5be9 100644 --- a/tests/lib/Persistence/Cache/TrashHandlerTest.php +++ b/tests/lib/Persistence/Cache/TrashHandlerTest.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\Location; @@ -64,7 +65,7 @@ public function testRecover() $handlerMethodName = $this->getHandlerMethodName(); - $this->loggerMock->expects($this->once())->method('logCall'); + $this->loggerMock->expects(self::once())->method('logCall'); $innerHandler = $this->createMock($this->getHandlerClassName()); $contentHandlerMock = $this->createMock(ContentHandler::class); @@ -83,18 +84,18 @@ public function testRecover() ->willReturn($locationHandlerMock); $this->persistenceHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method($handlerMethodName) ->willReturn($innerHandler); $innerHandler - ->expects($this->once()) + ->expects(self::once()) ->method('recover') ->with($originalLocationId, $targetLocationId) ->willReturn(null); $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('generateTag') ->withConsecutive( ['content', [$contentId], false], @@ -106,7 +107,7 @@ public function testRecover() ); $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('invalidateTags') ->with($tags); @@ -126,7 +127,7 @@ public function testTrashSubtree() $handlerMethodName = $this->getHandlerMethodName(); - $this->loggerMock->expects($this->once())->method('logCall'); + $this->loggerMock->expects(self::once())->method('logCall'); $innerHandler = $this->createMock($this->getHandlerClassName()); $contentHandlerMock = $this->createMock(ContentHandler::class); @@ -145,18 +146,18 @@ public function testTrashSubtree() ->willReturn($locationHandlerMock); $this->persistenceHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method($handlerMethodName) ->willReturn($innerHandler); $innerHandler - ->expects($this->once()) + ->expects(self::once()) ->method('trashSubtree') ->with($locationId) ->willReturn(null); $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('generateTag') ->withConsecutive( ['content', [$contentId], false], @@ -165,7 +166,7 @@ public function testTrashSubtree() ->willReturnOnConsecutiveCalls(...$tags); $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('invalidateTags') ->with($tags); @@ -185,13 +186,13 @@ public function testDeleteTrashItem() $trashed = new Trashed(['id' => $trashedId, 'contentId' => $contentId]); $innerHandler - ->expects($this->once()) + ->expects(self::once()) ->method('deleteTrashItem') ->with($trashedId) ->willReturn(new TrashItemDeleteResult(['trashItemId' => $trashedId, 'contentId' => $contentId])); $innerHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadTrashItem') ->with($trashedId) ->willReturn($trashed); @@ -203,7 +204,7 @@ public function testDeleteTrashItem() $contentHandlerMock = $this->createMock(ContentHandler::class); $contentHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadReverseRelations') ->with($contentId) ->willReturn([new Relation(['sourceContentId' => $relationSourceContentId])]); @@ -219,7 +220,7 @@ public function testDeleteTrashItem() ]; $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(3)) + ->expects(self::exactly(3)) ->method('generateTag') ->withConsecutive( ['content', [$relationSourceContentId], false], @@ -233,7 +234,7 @@ public function testDeleteTrashItem() ); $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('invalidateTags') ->with($tags); @@ -253,7 +254,7 @@ public function testEmptyTrash() $innerHandler = $this->createMock($this->getHandlerClassName()); $innerHandler - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('findTrashItems') ->willReturn(new Location\Trash\TrashResult([ 'items' => [new Trashed(['id' => $trashedId, 'contentId' => $contentId])], @@ -268,7 +269,7 @@ public function testEmptyTrash() $contentHandlerMock = $this->createMock(ContentHandler::class); $contentHandlerMock - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('loadReverseRelations') ->with($contentId) ->willReturn([new Relation(['sourceContentId' => $relationSourceContentId])]); @@ -291,13 +292,13 @@ public function testEmptyTrash() //one set of arguments and tags for each relation $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(6)) + ->expects(self::exactly(6)) ->method('generateTag') ->withConsecutive(...array_merge($cacheIdentifierGeneratorArguments, $cacheIdentifierGeneratorArguments)) ->willReturnOnConsecutiveCalls(...array_merge($tags, $tags)); $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('invalidateTags') ->with($tags); diff --git a/tests/lib/Persistence/Cache/URLHandlerTest.php b/tests/lib/Persistence/Cache/URLHandlerTest.php index 34cee6878d..ad367e67bc 100644 --- a/tests/lib/Persistence/Cache/URLHandlerTest.php +++ b/tests/lib/Persistence/Cache/URLHandlerTest.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\URL\Handler as SpiURLHandler; @@ -72,7 +73,7 @@ public function testUpdateUrlWhenAddressIsUpdated(): void $updateStruct = new URLUpdateStruct(); $updateStruct->url = 'http://ibexa.co'; - $this->loggerMock->expects($this->once())->method('logCall'); + $this->loggerMock->expects(self::once())->method('logCall'); $innerHandlerMock = $this->createMock(SpiURLHandler::class); $this->persistenceHandlerMock @@ -80,19 +81,19 @@ public function testUpdateUrlWhenAddressIsUpdated(): void ->willReturn($innerHandlerMock); $innerHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('findUsages') ->with($urlId) ->willReturn([2, 3, 5]); $innerHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('updateUrl') ->with($urlId, $updateStruct) ->willReturn(true); $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(4)) + ->expects(self::exactly(4)) ->method('generateTag') ->withConsecutive( ['url', [1], false], @@ -108,12 +109,12 @@ public function testUpdateUrlWhenAddressIsUpdated(): void ); $this->cacheMock - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('invalidateTags') ->with(['url-1']); $this->cacheMock - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('invalidateTags') ->with(['c-2', 'c-3', 'c-5']); @@ -126,7 +127,7 @@ public function testUpdateUrlStatusIsUpdated() $urlId = 1; $updateStruct = new URLUpdateStruct(); - $this->loggerMock->expects($this->once())->method('logCall'); + $this->loggerMock->expects(self::once())->method('logCall'); $innerHandlerMock = $this->createMock(SpiURLHandler::class); $this->persistenceHandlerMock @@ -134,19 +135,19 @@ public function testUpdateUrlStatusIsUpdated() ->willReturn($innerHandlerMock); $innerHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('updateUrl') ->with($urlId, $updateStruct) ->willReturn(true); $this->cacheIdentifierGeneratorMock - ->expects($this->once()) + ->expects(self::once()) ->method('generateTag') ->with('url', [1], false) ->willReturn('url-1'); $this->cacheMock - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('invalidateTags') ->with(['url-1']); diff --git a/tests/lib/Persistence/Cache/UrlAliasHandlerTest.php b/tests/lib/Persistence/Cache/UrlAliasHandlerTest.php index f6af94e240..b3f011a197 100644 --- a/tests/lib/Persistence/Cache/UrlAliasHandlerTest.php +++ b/tests/lib/Persistence/Cache/UrlAliasHandlerTest.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\UrlAlias; diff --git a/tests/lib/Persistence/Cache/UrlWildcardHandlerTest.php b/tests/lib/Persistence/Cache/UrlWildcardHandlerTest.php index c62be9b139..b5606ba88c 100644 --- a/tests/lib/Persistence/Cache/UrlWildcardHandlerTest.php +++ b/tests/lib/Persistence/Cache/UrlWildcardHandlerTest.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\UrlWildcard; diff --git a/tests/lib/Persistence/Cache/UserHandlerTest.php b/tests/lib/Persistence/Cache/UserHandlerTest.php index 108f91494c..044c449ae6 100644 --- a/tests/lib/Persistence/Cache/UserHandlerTest.php +++ b/tests/lib/Persistence/Cache/UserHandlerTest.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\Core\Persistence\Cache; use Ibexa\Contracts\Core\Persistence\Content\Location; @@ -469,11 +470,11 @@ public function providerForCachedLoadMethodsMiss(): array public function testPublishRoleDraftFromExistingRole() { - $this->loggerMock->expects($this->once())->method('logCall'); + $this->loggerMock->expects(self::once())->method('logCall'); $innerHandlerMock = $this->createMock(SPIUserHandler::class); $this->persistenceHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('userHandler') ->willReturn($innerHandlerMock); @@ -481,31 +482,31 @@ public function testPublishRoleDraftFromExistingRole() $originalRoleId = 30; $innerHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadRole') ->with($roleDraftId, Role::STATUS_DRAFT) ->willReturn(new Role(['originalId' => $originalRoleId])); $innerHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('publishRoleDraft') ->with($roleDraftId); $roleTag = 'r-' . $originalRoleId; $this->cacheIdentifierGeneratorMock - ->expects($this->once()) + ->expects(self::once()) ->method('generateTag') ->with('role', [$originalRoleId], false) ->willReturn($roleTag); $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('invalidateTags') ->with([$roleTag]); $this->cacheMock - ->expects($this->never()) + ->expects(self::never()) ->method('deleteItem'); $handler = $this->persistenceCacheHandler->userHandler(); @@ -514,25 +515,25 @@ public function testPublishRoleDraftFromExistingRole() public function testPublishNewRoleDraft() { - $this->loggerMock->expects($this->once())->method('logCall'); + $this->loggerMock->expects(self::once())->method('logCall'); $innerHandlerMock = $this->createMock(SPIUserHandler::class); $this->persistenceHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('userHandler') ->willReturn($innerHandlerMock); $roleDraftId = 33; $innerHandlerMock - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('loadRole') ->with($roleDraftId, Role::STATUS_DRAFT) ->willReturn(new Role(['originalId' => -1])); $innerHandlerMock - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('publishRoleDraft') ->with($roleDraftId); $this->cacheMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $handler = $this->persistenceCacheHandler->userHandler(); $handler->publishRoleDraft($roleDraftId); } @@ -545,26 +546,26 @@ public function testAssignRole() $contentId = 14; $roleId = 9; - $this->loggerMock->expects($this->once())->method('logCall'); + $this->loggerMock->expects(self::once())->method('logCall'); $this->persistenceHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('userHandler') ->willReturn($innerUserHandlerMock); $innerUserHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('assignRole') ->with($contentId, $roleId) ->willReturn(null); $this->persistenceHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('locationHandler') ->willReturn($innerLocationHandlerMock); $innerLocationHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocationsByContent') ->with($contentId) ->willReturn([new Location(['id' => '43'])]); @@ -572,7 +573,7 @@ public function testAssignRole() $tags = ['ragl-14', 'rarl-9', 'lp-43']; $this->cacheIdentifierGeneratorMock - ->expects($this->exactly(3)) + ->expects(self::exactly(3)) ->method('generateTag') ->withConsecutive( ['role_assignment_group_list', [14], false], @@ -582,12 +583,12 @@ public function testAssignRole() ->willReturnOnConsecutiveCalls(...$tags); $this->cacheMock - ->expects($this->once()) + ->expects(self::once()) ->method('invalidateTags') ->with($tags); $this->cacheMock - ->expects($this->never()) + ->expects(self::never()) ->method('deleteItem'); $handler = $this->persistenceCacheHandler->userHandler(); diff --git a/tests/lib/Persistence/FieldTypeRegistryTest.php b/tests/lib/Persistence/FieldTypeRegistryTest.php index 9b9b616444..da394a66bc 100644 --- a/tests/lib/Persistence/FieldTypeRegistryTest.php +++ b/tests/lib/Persistence/FieldTypeRegistryTest.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\Core\Persistence; use Ibexa\Contracts\Core\FieldType\FieldType as SPIFieldType; @@ -24,7 +25,7 @@ public function testConstructor(): void $fieldType = $this->getFieldTypeMock(); $registry = new FieldTypeRegistry([self::FIELD_TYPE_IDENTIFIER => $fieldType]); - $this->assertInstanceOf( + self::assertInstanceOf( SPIPersistenceFieldType::class, $registry->getFieldType(self::FIELD_TYPE_IDENTIFIER) ); @@ -37,7 +38,7 @@ public function testGetFieldTypeInstance() $result = $registry->getFieldType(self::FIELD_TYPE_IDENTIFIER); - $this->assertInstanceOf(SPIPersistenceFieldType::class, $result); + self::assertInstanceOf(SPIPersistenceFieldType::class, $result); } /** @@ -76,7 +77,7 @@ public function testRegister() $registry = new FieldTypeRegistry([]); $registry->register(self::FIELD_TYPE_IDENTIFIER, $fieldType); - $this->assertInstanceOf( + self::assertInstanceOf( SPIPersistenceFieldType::class, $registry->getFieldType(self::FIELD_TYPE_IDENTIFIER) ); diff --git a/tests/lib/Persistence/Legacy/Bookmark/Gateway/DoctrineDatabaseTest.php b/tests/lib/Persistence/Legacy/Bookmark/Gateway/DoctrineDatabaseTest.php index f73e1f96cc..52fd8076c3 100644 --- a/tests/lib/Persistence/Legacy/Bookmark/Gateway/DoctrineDatabaseTest.php +++ b/tests/lib/Persistence/Legacy/Bookmark/Gateway/DoctrineDatabaseTest.php @@ -44,7 +44,7 @@ public function testInsertBookmark() $data = $this->loadBookmark($id); - $this->assertEquals([ + self::assertEquals([ 'id' => $id, 'name' => 'Lorem ipsum dolor...', 'node_id' => '54', @@ -56,12 +56,12 @@ public function testDeleteBookmark() { $this->getGateway()->deleteBookmark(self::EXISTING_BOOKMARK_ID); - $this->assertEmpty($this->loadBookmark(self::EXISTING_BOOKMARK_ID)); + self::assertEmpty($this->loadBookmark(self::EXISTING_BOOKMARK_ID)); } public function testLoadBookmarkDataById() { - $this->assertEquals( + self::assertEquals( [self::EXISTING_BOOKMARK_DATA], $this->getGateway()->loadBookmarkDataById(self::EXISTING_BOOKMARK_ID) ); @@ -74,7 +74,7 @@ public function testLoadBookmarkDataByUserIdAndLocationId() [(int) self::EXISTING_BOOKMARK_DATA['node_id']] ); - $this->assertEquals([self::EXISTING_BOOKMARK_DATA], $data); + self::assertEquals([self::EXISTING_BOOKMARK_DATA], $data); } /** @@ -82,7 +82,7 @@ public function testLoadBookmarkDataByUserIdAndLocationId() */ public function testLoadUserBookmarks(int $userId, int $offset, int $limit, array $expected) { - $this->assertEquals($expected, $this->getGateway()->loadUserBookmarks($userId, $offset, $limit)); + self::assertEquals($expected, $this->getGateway()->loadUserBookmarks($userId, $offset, $limit)); } /** @@ -90,7 +90,7 @@ public function testLoadUserBookmarks(int $userId, int $offset, int $limit, arra */ public function testCountUserBookmarks(int $userId, int $offset, int $limit, array $expected) { - $this->assertEquals(count($expected), $this->getGateway()->countUserBookmarks($userId)); + self::assertEquals(count($expected), $this->getGateway()->countUserBookmarks($userId)); } public function dataProviderForLoadUserBookmarks(): array @@ -134,8 +134,8 @@ public function testLocationSwapped() $bookmark1AfterSwap = $this->loadBookmark($bookmark1Id); $bookmark2AfterSwap = $this->loadBookmark($bookmark2Id); - $this->assertEquals($bookmark1BeforeSwap['node_id'], $bookmark2AfterSwap['node_id']); - $this->assertEquals($bookmark2BeforeSwap['node_id'], $bookmark1AfterSwap['node_id']); + self::assertEquals($bookmark1BeforeSwap['node_id'], $bookmark2AfterSwap['node_id']); + self::assertEquals($bookmark2BeforeSwap['node_id'], $bookmark1AfterSwap['node_id']); } /** diff --git a/tests/lib/Persistence/Legacy/Bookmark/HandlerTest.php b/tests/lib/Persistence/Legacy/Bookmark/HandlerTest.php index 65f96a6203..08ee473599 100644 --- a/tests/lib/Persistence/Legacy/Bookmark/HandlerTest.php +++ b/tests/lib/Persistence/Legacy/Bookmark/HandlerTest.php @@ -50,26 +50,26 @@ public function testCreate() ]); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('createBookmarkFromCreateStruct') ->with($createStruct) ->willReturn($bookmark); $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('insertBookmark') ->with($bookmark) ->willReturn(self::BOOKMARK_ID); $this->handler->create($createStruct); - $this->assertEquals($bookmark->id, self::BOOKMARK_ID); + self::assertEquals($bookmark->id, self::BOOKMARK_ID); } public function testDelete() { $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('deleteBookmark') ->with(self::BOOKMARK_ID); @@ -96,18 +96,18 @@ public function testLoadByUserIdAndLocationIdExistingBookmark() ]); $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('loadBookmarkDataByUserIdAndLocationId') ->with($userId, [$locationId]) ->willReturn($rows); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('extractBookmarksFromRows') ->with($rows) ->willReturn([$object]); - $this->assertEquals([$locationId => $object], $this->handler->loadByUserIdAndLocationId($userId, [$locationId])); + self::assertEquals([$locationId => $object], $this->handler->loadByUserIdAndLocationId($userId, [$locationId])); } public function testLoadByUserIdAndLocationIdNonExistingBookmark() @@ -116,18 +116,18 @@ public function testLoadByUserIdAndLocationIdNonExistingBookmark() $locationId = 54; $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('loadBookmarkDataByUserIdAndLocationId') ->with($userId, [$locationId]) ->willReturn([]); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('extractBookmarksFromRows') ->with([]) ->willReturn([]); - $this->assertEmpty($this->handler->loadByUserIdAndLocationId($userId, [$locationId])); + self::assertEmpty($this->handler->loadByUserIdAndLocationId($userId, [$locationId])); } public function testLoadUserBookmarks() @@ -167,18 +167,18 @@ public function testLoadUserBookmarks() ]; $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('loadUserBookmarks') ->with($userId, $offset, $limit) ->willReturn($rows); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('extractBookmarksFromRows') ->with($rows) ->willReturn($objects); - $this->assertEquals($objects, $this->handler->loadUserBookmarks($userId, $offset, $limit)); + self::assertEquals($objects, $this->handler->loadUserBookmarks($userId, $offset, $limit)); } public function testLocationSwapped() @@ -187,7 +187,7 @@ public function testLocationSwapped() $location2Id = 2; $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('locationSwapped') ->with($location1Id, $location2Id); diff --git a/tests/lib/Persistence/Legacy/Bookmark/MapperTest.php b/tests/lib/Persistence/Legacy/Bookmark/MapperTest.php index 5806326a42..474dc64192 100644 --- a/tests/lib/Persistence/Legacy/Bookmark/MapperTest.php +++ b/tests/lib/Persistence/Legacy/Bookmark/MapperTest.php @@ -34,7 +34,7 @@ public function testCreateBookmarkFromCreateStruct() 'userId' => 87, ]); - $this->assertEquals(new Bookmark([ + self::assertEquals(new Bookmark([ 'name' => 'Contact', 'locationId' => 54, 'userId' => 87, @@ -73,7 +73,7 @@ public function testExtractBookmarksFromRows() ]), ]; - $this->assertEquals($objects, $this->mapper->extractBookmarksFromRows($rows)); + self::assertEquals($objects, $this->mapper->extractBookmarksFromRows($rows)); } } diff --git a/tests/lib/Persistence/Legacy/Content/ContentHandlerTest.php b/tests/lib/Persistence/Legacy/Content/ContentHandlerTest.php index 1e68bbbbe0..04d0de7499 100644 --- a/tests/lib/Persistence/Legacy/Content/ContentHandlerTest.php +++ b/tests/lib/Persistence/Legacy/Content/ContentHandlerTest.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\Core\Persistence\Legacy\Content; use Ibexa\Contracts\Core\Persistence\Content; @@ -125,19 +126,19 @@ public function testCreate() $contentTypeMock = $this->createMock(Type::class); $createStruct = $this->getCreateStructFixture(); - $contentTypeHandlerMock->expects($this->once()) + $contentTypeHandlerMock->expects(self::once()) ->method('load') ->with($createStruct->typeId) - ->will($this->returnValue($contentTypeMock)); + ->will(self::returnValue($contentTypeMock)); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createVersionInfoFromCreateStruct') ->with( - $this->isInstanceOf( + self::isInstanceOf( CreateStruct::class ) )->will( - $this->returnValue( + self::returnValue( new VersionInfo( [ 'names' => [], @@ -147,61 +148,61 @@ public function testCreate() ) ); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('insertContentObject') ->with( - $this->isInstanceOf(CreateStruct::class) - )->will($this->returnValue(23)); + self::isInstanceOf(CreateStruct::class) + )->will(self::returnValue(23)); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('insertVersion') ->with( - $this->isInstanceOf(VersionInfo::class), - $this->isType('array') - )->will($this->returnValue(1)); + self::isInstanceOf(VersionInfo::class), + self::isType('array') + )->will(self::returnValue(1)); - $fieldHandlerMock->expects($this->once()) + $fieldHandlerMock->expects(self::once()) ->method('createNewFields') ->with( - $this->isInstanceOf(Content::class), - $this->isInstanceOf(Type::class) + self::isInstanceOf(Content::class), + self::isInstanceOf(Type::class) ); - $locationMock->expects($this->once()) + $locationMock->expects(self::once()) ->method('createNodeAssignment') ->with( - $this->isInstanceOf( + self::isInstanceOf( LocationCreateStruct::class ), - $this->equalTo(42), - $this->equalTo(3) // Location\Gateway::NODE_ASSIGNMENT_OP_CODE_CREATE + self::equalTo(42), + self::equalTo(3) // Location\Gateway::NODE_ASSIGNMENT_OP_CODE_CREATE ); $res = $handler->create($createStruct); // @todo Make subsequent tests - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $res, 'Content not created' ); - $this->assertEquals( + self::assertEquals( 23, $res->versionInfo->contentInfo->id, 'Content ID not set correctly' ); - $this->assertInstanceOf( + self::assertInstanceOf( VersionInfo::class, $res->versionInfo, 'Version infos not created' ); - $this->assertEquals( + self::assertEquals( 1, $res->versionInfo->id, 'Version ID not set correctly' ); - $this->assertCount( + self::assertCount( 2, $res->fields, 'Fields not set correctly in version' @@ -218,11 +219,11 @@ public function testPublishFirstVersion() $fieldHandlerMock = $this->getFieldHandlerMock(); $metadataUpdateStruct = new MetadataUpdateStruct(); - $handler->expects($this->at(0)) + $handler->expects(self::at(0)) ->method('loadVersionInfo') ->with(23, 1) ->will( - $this->returnValue( + self::returnValue( new VersionInfo([ 'contentInfo' => new ContentInfo([ 'currentVersionNo' => 1, @@ -237,48 +238,48 @@ public function testPublishFirstVersion() $contentRows = [['ezcontentobject_version_version' => 1]]; - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('load') ->with( - $this->equalTo(23), - $this->equalTo(1), - $this->equalTo(null) + self::equalTo(23), + self::equalTo(1), + self::equalTo(null) )->willReturn($contentRows); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadVersionedNameData') ->with( - $this->equalTo([['id' => 23, 'version' => 1]]) + self::equalTo([['id' => 23, 'version' => 1]]) )->will( - $this->returnValue([22]) + self::returnValue([22]) ); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractContentFromRows') - ->with($this->equalTo($contentRows), $this->equalTo([22])) - ->will($this->returnValue([$this->getContentFixtureForDraft()])); + ->with(self::equalTo($contentRows), self::equalTo([22])) + ->will(self::returnValue([$this->getContentFixtureForDraft()])); - $fieldHandlerMock->expects($this->once()) + $fieldHandlerMock->expects(self::once()) ->method('loadExternalFieldData') - ->with($this->isInstanceOf(Content::class)); + ->with(self::isInstanceOf(Content::class)); $gatewayMock - ->expects($this->once()) + ->expects(self::once()) ->method('updateContent') ->with(23, $metadataUpdateStruct); $locationMock - ->expects($this->once()) + ->expects(self::once()) ->method('createLocationsFromNodeAssignments') ->with(23, 1); $locationMock - ->expects($this->once()) + ->expects(self::once()) ->method('updateLocationsContentVersionNo') ->with(23, 1); $gatewayMock - ->expects($this->once()) + ->expects(self::once()) ->method('setPublishedStatus') ->with(23, 1); @@ -295,11 +296,11 @@ public function testPublish() $fieldHandlerMock = $this->getFieldHandlerMock(); $metadataUpdateStruct = new MetadataUpdateStruct(); - $handler->expects($this->at(0)) + $handler->expects(self::at(0)) ->method('loadVersionInfo') ->with(23, 2) ->will( - $this->returnValue( + self::returnValue( new VersionInfo([ 'contentInfo' => new ContentInfo([ 'currentVersionNo' => 1, @@ -313,55 +314,55 @@ public function testPublish() ); $handler - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('setStatus') ->with(23, VersionInfo::STATUS_ARCHIVED, 1); $contentRows = [['ezcontentobject_version_version' => 2]]; - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('load') ->with( - $this->equalTo(23), - $this->equalTo(2), - $this->equalTo(null) + self::equalTo(23), + self::equalTo(2), + self::equalTo(null) ) ->willReturn($contentRows); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadVersionedNameData') ->with( - $this->equalTo([['id' => 23, 'version' => 2]]) + self::equalTo([['id' => 23, 'version' => 2]]) )->will( - $this->returnValue([22]) + self::returnValue([22]) ); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractContentFromRows') - ->with($this->equalTo($contentRows), $this->equalTo([22])) - ->will($this->returnValue([$this->getContentFixtureForDraft()])); + ->with(self::equalTo($contentRows), self::equalTo([22])) + ->will(self::returnValue([$this->getContentFixtureForDraft()])); - $fieldHandlerMock->expects($this->once()) + $fieldHandlerMock->expects(self::once()) ->method('loadExternalFieldData') - ->with($this->isInstanceOf(Content::class)); + ->with(self::isInstanceOf(Content::class)); $gatewayMock - ->expects($this->once()) + ->expects(self::once()) ->method('updateContent') - ->with(23, $metadataUpdateStruct, $this->isInstanceOf(VersionInfo::class)); + ->with(23, $metadataUpdateStruct, self::isInstanceOf(VersionInfo::class)); $locationMock - ->expects($this->once()) + ->expects(self::once()) ->method('createLocationsFromNodeAssignments') ->with(23, 2); $locationMock - ->expects($this->once()) + ->expects(self::once()) ->method('updateLocationsContentVersionNo') ->with(23, 2); $gatewayMock - ->expects($this->once()) + ->expects(self::once()) ->method('setPublishedStatus') ->with(23, 2); @@ -376,19 +377,19 @@ public function testCreateDraftFromVersion() $gatewayMock = $this->getGatewayMock(); $fieldHandlerMock = $this->getFieldHandlerMock(); - $handler->expects($this->once()) + $handler->expects(self::once()) ->method('load') ->with(23, 2) - ->will($this->returnValue($this->getContentFixtureForDraft())); + ->will(self::returnValue($this->getContentFixtureForDraft())); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createVersionInfoForContent') ->with( - $this->isInstanceOf(Content::class), - $this->equalTo(3), - $this->equalTo(14) + self::isInstanceOf(Content::class), + self::equalTo(3), + self::equalTo(14) )->will( - $this->returnValue( + self::returnValue( new VersionInfo( [ 'names' => [], @@ -398,21 +399,21 @@ public function testCreateDraftFromVersion() ) ); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('insertVersion') ->with( - $this->isInstanceOf(VersionInfo::class), + self::isInstanceOf(VersionInfo::class), $this->getContentFixtureForDraft()->fields - )->will($this->returnValue(42)); + )->will(self::returnValue(42)); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('getLastVersionNumber') - ->with($this->equalTo(23)) - ->will($this->returnValue(2)); + ->with(self::equalTo(23)) + ->will(self::returnValue(2)); - $fieldHandlerMock->expects($this->once()) + $fieldHandlerMock->expects(self::once()) ->method('createExistingFieldsInNewVersion') - ->with($this->isInstanceOf(Content::class)); + ->with(self::isInstanceOf(Content::class)); $relationData = [ [ @@ -422,13 +423,13 @@ public function testCreateDraftFromVersion() ], ]; - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadRelations') ->with( - $this->equalTo(23), - $this->equalTo(2) + self::equalTo(23), + self::equalTo(2) ) - ->will($this->returnValue($relationData)); + ->will(self::returnValue($relationData)); $relationStruct = new RelationCreateStruct( [ @@ -440,17 +441,17 @@ public function testCreateDraftFromVersion() ] ); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('insertRelation') - ->with($this->equalTo($relationStruct)); + ->with(self::equalTo($relationStruct)); $result = $handler->createDraftFromVersion(23, 2, 14); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $result ); - $this->assertEquals( + self::assertEquals( 42, $result->versionInfo->id ); @@ -466,36 +467,36 @@ public function testLoad() $contentRows = [['ezcontentobject_version_version' => 2]]; - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('load') ->with( - $this->equalTo(23), - $this->equalTo(2), - $this->equalTo(['eng-GB']) + self::equalTo(23), + self::equalTo(2), + self::equalTo(['eng-GB']) )->will( - $this->returnValue($contentRows) + self::returnValue($contentRows) ); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadVersionedNameData') ->with( - $this->equalTo([['id' => 23, 'version' => 2]]) + self::equalTo([['id' => 23, 'version' => 2]]) )->will( - $this->returnValue([22]) + self::returnValue([22]) ); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractContentFromRows') - ->with($this->equalTo($contentRows), $this->equalTo([22])) - ->will($this->returnValue([$this->getContentFixtureForDraft()])); + ->with(self::equalTo($contentRows), self::equalTo([22])) + ->will(self::returnValue([$this->getContentFixtureForDraft()])); - $fieldHandlerMock->expects($this->once()) + $fieldHandlerMock->expects(self::once()) ->method('loadExternalFieldData') - ->with($this->isInstanceOf(Content::class)); + ->with(self::isInstanceOf(Content::class)); $result = $handler->load(23, 2, ['eng-GB']); - $this->assertEquals( + self::assertEquals( $result, $this->getContentFixtureForDraft() ); @@ -512,7 +513,7 @@ public function testLoadContentList() ['ezcontentobject_id' => 2, 'ezcontentobject_version_version' => 2], ['ezcontentobject_id' => 3, 'ezcontentobject_version_version' => 1], ]; - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadContentList') ->with([2, 3], ['eng-GB', 'eng-US']) ->willReturn($contentRows); @@ -522,32 +523,32 @@ public function testLoadContentList() ['ezcontentobject_name_contentobject_id' => 3, 'ezcontentobject_name_content_version' => 1], ]; - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadVersionedNameData') - ->with($this->equalTo([['id' => 2, 'version' => 2], ['id' => 3, 'version' => 1]])) + ->with(self::equalTo([['id' => 2, 'version' => 2], ['id' => 3, 'version' => 1]])) ->willReturn($nameDataRows); $expected = [ 2 => $this->getContentFixtureForDraft(2, 2), 3 => $this->getContentFixtureForDraft(3, 1), ]; - $mapperMock->expects($this->at(0)) + $mapperMock->expects(self::at(0)) ->method('extractContentFromRows') - ->with($this->equalTo([$contentRows[0]]), $this->equalTo([$nameDataRows[0]])) + ->with(self::equalTo([$contentRows[0]]), self::equalTo([$nameDataRows[0]])) ->willReturn([$expected[2]]); - $mapperMock->expects($this->at(1)) + $mapperMock->expects(self::at(1)) ->method('extractContentFromRows') - ->with($this->equalTo([$contentRows[1]]), $this->equalTo([$nameDataRows[1]])) + ->with(self::equalTo([$contentRows[1]]), self::equalTo([$nameDataRows[1]])) ->willReturn([$expected[3]]); - $fieldHandlerMock->expects($this->exactly(2)) + $fieldHandlerMock->expects(self::exactly(2)) ->method('loadExternalFieldData') - ->with($this->isInstanceOf(Content::class)); + ->with(self::isInstanceOf(Content::class)); $result = $handler->loadContentList([2, 3], ['eng-GB', 'eng-US']); - $this->assertEquals( + self::assertEquals( $expected, $result ); @@ -556,20 +557,20 @@ public function testLoadContentList() public function testLoadContentInfoByRemoteId() { $contentInfoData = [new ContentInfo()]; - $this->getGatewayMock()->expects($this->once()) + $this->getGatewayMock()->expects(self::once()) ->method('loadContentInfoByRemoteId') ->with( - $this->equalTo('15b256dbea2ae72418ff5facc999e8f9') + self::equalTo('15b256dbea2ae72418ff5facc999e8f9') )->will( - $this->returnValue([42]) + self::returnValue([42]) ); - $this->getMapperMock()->expects($this->once()) + $this->getMapperMock()->expects(self::once()) ->method('extractContentInfoFromRow') - ->with($this->equalTo([42])) - ->will($this->returnValue($contentInfoData)); + ->with(self::equalTo([42])) + ->will(self::returnValue($contentInfoData)); - $this->assertSame( + self::assertSame( $contentInfoData, $this->getContentHandler()->loadContentInfoByRemoteId('15b256dbea2ae72418ff5facc999e8f9') ); @@ -583,10 +584,10 @@ public function testLoadErrorNotFound() $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('load') ->will( - $this->returnValue([]) + self::returnValue([]) ); $result = $handler->load(23, 2, ['eng-GB']); @@ -638,36 +639,36 @@ public function testUpdateContent() ] ); - $contentTypeHandlerMock->expects($this->once()) + $contentTypeHandlerMock->expects(self::once()) ->method('load') ->with($contentStub->versionInfo->contentInfo->contentTypeId) - ->will($this->returnValue($contentTypeMock)); + ->will(self::returnValue($contentTypeMock)); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('updateContent') - ->with(14, $this->isInstanceOf(MetadataUpdateStruct::class)); - $gatewayMock->expects($this->once()) + ->with(14, self::isInstanceOf(MetadataUpdateStruct::class)); + $gatewayMock->expects(self::once()) ->method('updateVersion') - ->with(14, 4, $this->isInstanceOf(UpdateStruct::class)); + ->with(14, 4, self::isInstanceOf(UpdateStruct::class)); - $fieldHandlerMock->expects($this->once()) + $fieldHandlerMock->expects(self::once()) ->method('updateFields') ->with( - $this->isInstanceOf(Content::class), - $this->isInstanceOf(UpdateStruct::class), - $this->isInstanceOf(Type::class) + self::isInstanceOf(Content::class), + self::isInstanceOf(UpdateStruct::class), + self::isInstanceOf(Type::class) ); - $handler->expects($this->at(0)) + $handler->expects(self::at(0)) ->method('load') ->with(14, 4) - ->will($this->returnValue($contentStub)); + ->will(self::returnValue($contentStub)); - $handler->expects($this->at(1)) + $handler->expects(self::at(1)) ->method('load') ->with(14, 4); - $handler->expects($this->at(2)) + $handler->expects(self::at(2)) ->method('loadContentInfo') ->with(14); @@ -729,15 +730,15 @@ public function testUpdateMetadata() ] ); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('updateContent') ->with(14, $updateStruct); - $handler->expects($this->once()) + $handler->expects(self::once()) ->method('loadContentInfo') ->with(14) ->will( - $this->returnValue( + self::returnValue( $this->createMock(ContentInfo::class) ) ); @@ -758,15 +759,15 @@ public function testUpdateMetadataUpdatesPathIdentificationString() $gatewayMock = $this->getGatewayMock(); $updateStruct = new MetadataUpdateStruct(['mainLanguageId' => 2]); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('updateContent') ->with(14, $updateStruct); - $locationGatewayMock->expects($this->once()) + $locationGatewayMock->expects(self::once()) ->method('loadLocationDataByContent') ->with(14) ->will( - $this->returnValue( + self::returnValue( [ [ 'node_id' => 100, @@ -776,11 +777,11 @@ public function testUpdateMetadataUpdatesPathIdentificationString() ) ); - $urlAliasGatewayMock->expects($this->once()) + $urlAliasGatewayMock->expects(self::once()) ->method('loadLocationEntries') ->with(100, false, 2) ->will( - $this->returnValue( + self::returnValue( [ [ 'text' => 'slug', @@ -789,20 +790,20 @@ public function testUpdateMetadataUpdatesPathIdentificationString() ) ); - $slugConverterMock->expects($this->once()) + $slugConverterMock->expects(self::once()) ->method('convert') ->with('slug', 'node_100', 'urlalias_compat') - ->will($this->returnValue('transformed_slug')); + ->will(self::returnValue('transformed_slug')); - $locationGatewayMock->expects($this->once()) + $locationGatewayMock->expects(self::once()) ->method('updatePathIdentificationString') ->with(100, 200, 'transformed_slug'); - $handler->expects($this->once()) + $handler->expects(self::once()) ->method('loadContentInfo') ->with(14) ->will( - $this->returnValue( + self::returnValue( $this->createMock(ContentInfo::class) ) ); @@ -838,7 +839,7 @@ public function testLoadRelation(): void $result = $handler->loadRelation(self::RELATION_ID); - $this->assertEquals( + self::assertEquals( $result, $relationFixture ); @@ -851,24 +852,24 @@ public function testLoadRelations() $gatewayMock = $this->getGatewayMock(); $mapperMock = $this->getMapperMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadRelations') ->with( - $this->equalTo(23), - $this->equalTo(null), - $this->equalTo(null) + self::equalTo(23), + self::equalTo(null), + self::equalTo(null) )->will( - $this->returnValue([42]) + self::returnValue([42]) ); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractRelationsFromRows') - ->with($this->equalTo([42])) - ->will($this->returnValue($this->getRelationFixture())); + ->with(self::equalTo([42])) + ->will(self::returnValue($this->getRelationFixture())); $result = $handler->loadRelations(23); - $this->assertEquals( + self::assertEquals( $result, $this->getRelationFixture() ); @@ -881,23 +882,23 @@ public function testLoadReverseRelations() $gatewayMock = $this->getGatewayMock(); $mapperMock = $this->getMapperMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadReverseRelations') ->with( - $this->equalTo(23), - $this->equalTo(null) + self::equalTo(23), + self::equalTo(null) )->will( - $this->returnValue([42]) + self::returnValue([42]) ); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractRelationsFromRows') - ->with($this->equalTo([42])) - ->will($this->returnValue($this->getRelationFixture())); + ->with(self::equalTo([42])) + ->will(self::returnValue($this->getRelationFixture())); $result = $handler->loadReverseRelations(23); - $this->assertEquals( + self::assertEquals( $result, $this->getRelationFixture() ); @@ -925,23 +926,23 @@ public function testAddRelation() $gatewayMock = $this->getGatewayMock(); $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createRelationFromCreateStruct') // @todo Connected with the todo above - ->with($this->equalTo($relationCreateStruct)) - ->will($this->returnValue($expectedRelationObject)); + ->with(self::equalTo($relationCreateStruct)) + ->will(self::returnValue($expectedRelationObject)); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('insertRelation') - ->with($this->equalTo($relationCreateStruct)) + ->with(self::equalTo($relationCreateStruct)) ->will( // @todo Should this return a row as if it was selected from the database, the id... ? Check with other, similar create methods - $this->returnValue(42) + self::returnValue(42) ); $result = $handler->addRelation($relationCreateStruct); - $this->assertEquals( + self::assertEquals( $result, $expectedRelationObject ); @@ -951,9 +952,12 @@ public function testRemoveRelation() { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('deleteRelation') - ->with($this->equalTo(1, RelationValue::COMMON)); + ->with( + self::equalTo(1), + self::equalTo(RelationValue::COMMON), + ); $this->getContentHandler()->removeRelation(1, RelationValue::COMMON); } @@ -1011,24 +1015,24 @@ public function testLoadDraftsForUser() $gatewayMock = $this->getGatewayMock(); $mapperMock = $this->getMapperMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('listVersionsForUser') - ->with($this->equalTo(23)) - ->will($this->returnValue($rows)); + ->with(self::equalTo(23)) + ->will(self::returnValue($rows)); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadVersionedNameData') - ->with($this->equalTo([['id' => 42, 'version' => 2]])) - ->will($this->returnValue([])); + ->with(self::equalTo([['id' => 42, 'version' => 2]])) + ->will(self::returnValue([])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractVersionInfoListFromRows') - ->with($this->equalTo($rows), $this->equalTo([])) - ->will($this->returnValue([new VersionInfo()])); + ->with(self::equalTo($rows), self::equalTo([])) + ->will(self::returnValue([new VersionInfo()])); $res = $handler->loadDraftsForUser(23); - $this->assertEquals( + self::assertEquals( [new VersionInfo()], $res ); @@ -1041,14 +1045,14 @@ public function testListVersions() $treeHandlerMock = $this->getTreeHandlerMock(); $treeHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('listVersions') ->with(23) - ->will($this->returnValue([new VersionInfo()])); + ->will(self::returnValue([new VersionInfo()])); $versions = $handler->listVersions(23); - $this->assertEquals( + self::assertEquals( [new VersionInfo()], $versions ); @@ -1060,7 +1064,7 @@ public function testRemoveRawContent() $treeHandlerMock = $this->getTreeHandlerMock(); $treeHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('removeRawContent') ->with(23); @@ -1076,16 +1080,16 @@ public function testDeleteContentWithLocations() $gatewayMock = $this->getGatewayMock(); $treeHandlerMock = $this->getTreeHandlerMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('getAllLocationIds') - ->with($this->equalTo(23)) - ->will($this->returnValue([42, 24])); - $treeHandlerMock->expects($this->exactly(2)) + ->with(self::equalTo(23)) + ->will(self::returnValue([42, 24])); + $treeHandlerMock->expects(self::exactly(2)) ->method('removeSubtree') ->with( - $this->logicalOr( - $this->equalTo(42), - $this->equalTo(24) + self::logicalOr( + self::equalTo(42), + self::equalTo(24) ) ); @@ -1100,13 +1104,13 @@ public function testDeleteContentWithoutLocations() $handlerMock = $this->getPartlyMockedHandler(['removeRawContent']); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('getAllLocationIds') - ->with($this->equalTo(23)) - ->will($this->returnValue([])); - $handlerMock->expects($this->once()) + ->with(self::equalTo(23)) + ->will(self::returnValue([])); + $handlerMock->expects(self::once()) ->method('removeRawContent') - ->with($this->equalTo(23)); + ->with(self::equalTo(23)); $handlerMock->deleteContent(23); } @@ -1123,51 +1127,51 @@ public function testDeleteVersion() $rows = [['ezcontentobject_version_version' => 2]]; // Load VersionInfo to delete fields - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadVersionInfo') - ->with($this->equalTo(225), $this->equalTo(2)) + ->with(self::equalTo(225), self::equalTo(2)) ->willReturn($rows); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadVersionedNameData') - ->with($this->equalTo([['id' => 225, 'version' => 2]])) - ->will($this->returnValue([22])); + ->with(self::equalTo([['id' => 225, 'version' => 2]])) + ->will(self::returnValue([22])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractVersionInfoListFromRows') - ->with($this->equalTo($rows), $this->equalTo([22])) - ->will($this->returnValue([new VersionInfo()])); + ->with(self::equalTo($rows), self::equalTo([22])) + ->will(self::returnValue([new VersionInfo()])); - $locationHandlerMock->expects($this->once()) + $locationHandlerMock->expects(self::once()) ->method('deleteNodeAssignment') ->with( - $this->equalTo(225), - $this->equalTo(2) + self::equalTo(225), + self::equalTo(2) ); - $fieldHandlerMock->expects($this->once()) + $fieldHandlerMock->expects(self::once()) ->method('deleteFields') ->with( - $this->equalTo(225), - $this->isInstanceOf(VersionInfo::class) + self::equalTo(225), + self::isInstanceOf(VersionInfo::class) ); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('deleteRelations') ->with( - $this->equalTo(225), - $this->equalTo(2) + self::equalTo(225), + self::equalTo(2) ); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('deleteVersions') ->with( - $this->equalTo(225), - $this->equalTo(2) + self::equalTo(225), + self::equalTo(2) ); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('deleteNames') ->with( - $this->equalTo(225), - $this->equalTo(2) + self::equalTo(225), + self::equalTo(2) ); $handler->deleteVersion(225, 2); @@ -1180,35 +1184,35 @@ public function testCopySingleVersion() $mapperMock = $this->getMapperMock(); $handler->expects( - $this->once() + self::once() )->method( 'load' )->with( - $this->equalTo(23), - $this->equalTo(32) + self::equalTo(23), + self::equalTo(32) )->will( - $this->returnValue(new Content()) + self::returnValue(new Content()) ); $mapperMock->expects( - $this->once() + self::once() )->method( 'createCreateStructFromContent' )->with( - $this->isInstanceOf(Content::class) + self::isInstanceOf(Content::class) )->will( - $this->returnValue(new CreateStruct()) + self::returnValue(new CreateStruct()) ); $handler->expects( - $this->once() + self::once() )->method( 'internalCreate' )->with( - $this->isInstanceOf(CreateStruct::class), - $this->equalTo(32) + self::isInstanceOf(CreateStruct::class), + self::equalTo(32) )->will( - $this->returnValue( + self::returnValue( new Content( [ 'versionInfo' => new VersionInfo(['contentInfo' => new ContentInfo(['id' => 24])]), @@ -1217,18 +1221,18 @@ public function testCopySingleVersion() ) ); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('copyRelations') ->with( - $this->equalTo(23), - $this->equalTo(24), - $this->equalTo(32) + self::equalTo(23), + self::equalTo(24), + self::equalTo(32) ) - ->will($this->returnValue(null)); + ->will(self::returnValue(null)); $result = $handler->copy(23, 32); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $result ); @@ -1257,35 +1261,35 @@ public function testCopyAllVersions() ] ); - $contentTypeHandlerMock->expects($this->once()) + $contentTypeHandlerMock->expects(self::once()) ->method('load') ->with($createStructStub->typeId) - ->will($this->returnValue($contentTypeMock)); + ->will(self::returnValue($contentTypeMock)); - $handler->expects($this->once()) + $handler->expects(self::once()) ->method('loadContentInfo') - ->with($this->equalTo(23)) - ->will($this->returnValue(new ContentInfo(['currentVersionNo' => 2]))); + ->with(self::equalTo(23)) + ->will(self::returnValue(new ContentInfo(['currentVersionNo' => 2]))); - $handler->expects($this->at(1)) + $handler->expects(self::at(1)) ->method('load') - ->with($this->equalTo(23), $this->equalTo(2)) - ->will($this->returnValue(new Content())); + ->with(self::equalTo(23), self::equalTo(2)) + ->will(self::returnValue(new Content())); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createCreateStructFromContent') - ->with($this->isInstanceOf(Content::class)) + ->with(self::isInstanceOf(Content::class)) ->will( - $this->returnValue($createStructStub) + self::returnValue($createStructStub) ); - $handler->expects($this->once()) + $handler->expects(self::once()) ->method('internalCreate') ->with( - $this->isInstanceOf(CreateStruct::class), - $this->equalTo(2) + self::isInstanceOf(CreateStruct::class), + self::equalTo(2) )->will( - $this->returnValue( + self::returnValue( new Content( [ 'versionInfo' => new VersionInfo( @@ -1298,11 +1302,11 @@ public function testCopyAllVersions() ) ); - $handler->expects($this->once()) + $handler->expects(self::once()) ->method('listVersions') - ->with($this->equalTo(23)) + ->with(self::equalTo(23)) ->will( - $this->returnValue( + self::returnValue( [ new VersionInfo(['versionNo' => 1]), new VersionInfo(['versionNo' => 2]), @@ -1321,11 +1325,11 @@ public function testCopyAllVersions() ), ] ); - $handler->expects($this->at(4)) + $handler->expects(self::at(4)) ->method('load') - ->with($this->equalTo(23), $this->equalTo(1)) + ->with(self::equalTo(23), self::equalTo(1)) ->will( - $this->returnValue( + self::returnValue( new Content( [ 'versionInfo' => $versionInfo, @@ -1337,19 +1341,19 @@ public function testCopyAllVersions() $versionInfo->creationDate = $time; $versionInfo->modificationDate = $time; - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('insertVersion') ->with( - $this->equalTo($versionInfo), - $this->isType('array') - )->will($this->returnValue(42)); + self::equalTo($versionInfo), + self::isType('array') + )->will(self::returnValue(42)); $versionInfo = clone $versionInfo; $versionInfo->id = 42; - $fieldHandlerMock->expects($this->once()) + $fieldHandlerMock->expects(self::once()) ->method('createNewFields') ->with( - $this->equalTo( + self::equalTo( new Content( [ 'versionInfo' => $versionInfo, @@ -1357,30 +1361,30 @@ public function testCopyAllVersions() ] ) ), - $this->isInstanceOf(Type::class) + self::isInstanceOf(Type::class) ); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('setName') ->with( - $this->equalTo(24), - $this->equalTo(1), - $this->equalTo('Test'), - $this->equalTo('eng-US') + self::equalTo(24), + self::equalTo(1), + self::equalTo('Test'), + self::equalTo('eng-US') ); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('copyRelations') ->with( - $this->equalTo(23), - $this->equalTo(24), - $this->equalTo(null) + self::equalTo(23), + self::equalTo(24), + self::equalTo(null) ) - ->will($this->returnValue(null)); + ->will(self::returnValue(null)); $result = $handler->copy(23); - $this->assertInstanceOf( + self::assertInstanceOf( Content::class, $result ); @@ -1394,11 +1398,11 @@ public function testCopyThrowsNotFoundExceptionContentNotFound() $treeHandlerMock = $this->getTreeHandlerMock(); $treeHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadContentInfo') - ->with($this->equalTo(23)) + ->with(self::equalTo(23)) ->will( - $this->throwException(new NotFoundException('ContentInfo', 23)) + self::throwException(new NotFoundException('ContentInfo', 23)) ); $handler->copy(23); @@ -1411,10 +1415,13 @@ public function testCopyThrowsNotFoundExceptionVersionNotFound() $handler = $this->getContentHandler(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('load') - ->with($this->equalTo(23, 32)) - ->will($this->returnValue([])); + ->with( + self::equalTo(23), + self::equalTo(32), + ) + ->will(self::returnValue([])); $result = $handler->copy(23, 32); } @@ -1426,12 +1433,12 @@ public function testSetStatus() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('setStatus') ->with(23, 5, 2) - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); - $this->assertTrue( + self::assertTrue( $handler->setStatus(23, 2, 5) ); } diff --git a/tests/lib/Persistence/Legacy/Content/FieldHandlerTest.php b/tests/lib/Persistence/Legacy/Content/FieldHandlerTest.php index a9214ebe59..1ed83e6afb 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldHandlerTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldHandlerTest.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\Core\Persistence\Legacy\Content; use Ibexa\Contracts\Core\Persistence\Content; @@ -71,17 +72,17 @@ protected function assertCreateNewFields($storageHandlerUpdatesFields = false) $fieldTypeMock = $this->getFieldTypeMock(); $storageHandlerMock = $this->getStorageHandlerMock(); - $fieldTypeMock->expects($this->exactly(3)) + $fieldTypeMock->expects(self::exactly(3)) ->method('getEmptyValue') - ->will($this->returnValue(new FieldValue())); + ->will(self::returnValue(new FieldValue())); - $contentGatewayMock->expects($this->exactly(6)) + $contentGatewayMock->expects(self::exactly(6)) ->method('insertNewField') ->with( - $this->isInstanceOf(Content::class), - $this->isInstanceOf(Field::class), - $this->isInstanceOf(StorageFieldValue::class) - )->will($this->returnValue(42)); + self::isInstanceOf(Content::class), + self::isInstanceOf(Field::class), + self::isInstanceOf(StorageFieldValue::class) + )->will(self::returnValue(42)); $callNo = 0; $fieldValue = new FieldValue(); @@ -104,24 +105,24 @@ protected function assertCreateNewFields($storageHandlerUpdatesFields = false) $originalField->languageCode = 'eng-GB'; continue; } - $storageHandlerMock->expects($this->at($callNo++)) + $storageHandlerMock->expects(self::at($callNo++)) ->method('storeFieldData') ->with( - $this->isInstanceOf(VersionInfo::class), - $this->equalTo($field) - )->will($this->returnValue($storageHandlerUpdatesFields)); + self::isInstanceOf(VersionInfo::class), + self::equalTo($field) + )->will(self::returnValue($storageHandlerUpdatesFields)); } } /* @var $copyField */ /* @var $originalField */ - $storageHandlerMock->expects($this->at($callNo)) + $storageHandlerMock->expects(self::at($callNo)) ->method('copyFieldData') ->with( - $this->isInstanceOf(VersionInfo::class), - $this->equalTo($copyField), - $this->equalTo($originalField) - )->will($this->returnValue($storageHandlerUpdatesFields)); + self::isInstanceOf(VersionInfo::class), + self::equalTo($copyField), + self::equalTo($originalField) + )->will(self::returnValue($storageHandlerUpdatesFields)); } public function testCreateNewFields() @@ -131,10 +132,10 @@ public function testCreateNewFields() $this->assertCreateNewFields(false); - $mapperMock->expects($this->exactly(6)) + $mapperMock->expects(self::exactly(6)) ->method('convertToStorageValue') - ->with($this->isInstanceOf(Field::class)) - ->will($this->returnValue(new StorageFieldValue())); + ->with(self::isInstanceOf(Field::class)) + ->will(self::returnValue(new StorageFieldValue())); $fieldHandler->createNewFields( $this->getContentPartialFieldsFixture(), @@ -150,16 +151,16 @@ public function testCreateNewFieldsUpdatingStorageHandler() $this->assertCreateNewFields(true); - $mapperMock->expects($this->exactly(12)) + $mapperMock->expects(self::exactly(12)) ->method('convertToStorageValue') - ->with($this->isInstanceOf(Field::class)) - ->will($this->returnValue(new StorageFieldValue())); + ->with(self::isInstanceOf(Field::class)) + ->will(self::returnValue(new StorageFieldValue())); - $contentGatewayMock->expects($this->exactly(6)) + $contentGatewayMock->expects(self::exactly(6)) ->method('updateField') ->with( - $this->isInstanceOf(Field::class), - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(Field::class), + self::isInstanceOf(StorageFieldValue::class) ); $fieldHandler->createNewFields( @@ -177,17 +178,17 @@ protected function assertCreateNewFieldsForMainLanguage($storageHandlerUpdatesFi $fieldTypeMock = $this->getFieldTypeMock(); $storageHandlerMock = $this->getStorageHandlerMock(); - $fieldTypeMock->expects($this->exactly(3)) + $fieldTypeMock->expects(self::exactly(3)) ->method('getEmptyValue') - ->will($this->returnValue(new FieldValue())); + ->will(self::returnValue(new FieldValue())); - $contentGatewayMock->expects($this->exactly(3)) + $contentGatewayMock->expects(self::exactly(3)) ->method('insertNewField') ->with( - $this->isInstanceOf(Content::class), - $this->isInstanceOf(Field::class), - $this->isInstanceOf(StorageFieldValue::class) - )->will($this->returnValue(42)); + self::isInstanceOf(Content::class), + self::isInstanceOf(Field::class), + self::isInstanceOf(StorageFieldValue::class) + )->will(self::returnValue(42)); $callNo = 0; $fieldValue = new FieldValue(); @@ -202,12 +203,12 @@ protected function assertCreateNewFieldsForMainLanguage($storageHandlerUpdatesFi 'languageCode' => 'eng-GB', ] ); - $storageHandlerMock->expects($this->at($callNo++)) + $storageHandlerMock->expects(self::at($callNo++)) ->method('storeFieldData') ->with( - $this->isInstanceOf(VersionInfo::class), - $this->equalTo($field) - )->will($this->returnValue($storageHandlerUpdatesFields)); + self::isInstanceOf(VersionInfo::class), + self::equalTo($field) + )->will(self::returnValue($storageHandlerUpdatesFields)); } } @@ -218,10 +219,10 @@ public function testCreateNewFieldsForMainLanguage() $this->assertCreateNewFieldsForMainLanguage(false); - $mapperMock->expects($this->exactly(3)) + $mapperMock->expects(self::exactly(3)) ->method('convertToStorageValue') - ->with($this->isInstanceOf(Field::class)) - ->will($this->returnValue(new StorageFieldValue())); + ->with(self::isInstanceOf(Field::class)) + ->will(self::returnValue(new StorageFieldValue())); $fieldHandler->createNewFields( $this->getContentNoFieldsFixture(), @@ -237,16 +238,16 @@ public function testCreateNewFieldsForMainLanguageUpdatingStorageHandler() $this->assertCreateNewFieldsForMainLanguage(true); - $mapperMock->expects($this->exactly(6)) + $mapperMock->expects(self::exactly(6)) ->method('convertToStorageValue') - ->with($this->isInstanceOf(Field::class)) - ->will($this->returnValue(new StorageFieldValue())); + ->with(self::isInstanceOf(Field::class)) + ->will(self::returnValue(new StorageFieldValue())); - $contentGatewayMock->expects($this->exactly(3)) + $contentGatewayMock->expects(self::exactly(3)) ->method('updateField') ->with( - $this->isInstanceOf(Field::class), - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(Field::class), + self::isInstanceOf(StorageFieldValue::class) ); $fieldHandler->createNewFields( @@ -263,13 +264,13 @@ protected function assertCreateExistingFieldsInNewVersion($storageHandlerUpdates $contentGatewayMock = $this->getContentGatewayMock(); $storageHandlerMock = $this->getStorageHandlerMock(); - $contentGatewayMock->expects($this->exactly(6)) + $contentGatewayMock->expects(self::exactly(6)) ->method('insertExistingField') ->with( - $this->isInstanceOf(Content::class), - $this->isInstanceOf(Field::class), - $this->isInstanceOf(StorageFieldValue::class) - )->will($this->returnValue(42)); + self::isInstanceOf(Content::class), + self::isInstanceOf(Field::class), + self::isInstanceOf(StorageFieldValue::class) + )->will(self::returnValue(42)); $callNo = 0; $fieldValue = new FieldValue(); @@ -286,13 +287,13 @@ protected function assertCreateExistingFieldsInNewVersion($storageHandlerUpdates ); $originalField = clone $field; $field->versionNo = 1; - $storageHandlerMock->expects($this->at($callNo++)) + $storageHandlerMock->expects(self::at($callNo++)) ->method('copyFieldData') ->with( - $this->isInstanceOf(VersionInfo::class), - $this->equalTo($field), - $this->equalTo($originalField) - )->will($this->returnValue($storageHandlerUpdatesFields)); + self::isInstanceOf(VersionInfo::class), + self::equalTo($field), + self::equalTo($originalField) + )->will(self::returnValue($storageHandlerUpdatesFields)); } } } @@ -304,10 +305,10 @@ public function testCreateExistingFieldsInNewVersion() $this->assertCreateExistingFieldsInNewVersion(false); - $mapperMock->expects($this->exactly(6)) + $mapperMock->expects(self::exactly(6)) ->method('convertToStorageValue') - ->with($this->isInstanceOf(Field::class)) - ->will($this->returnValue(new StorageFieldValue())); + ->with(self::isInstanceOf(Field::class)) + ->will(self::returnValue(new StorageFieldValue())); $fieldHandler->createExistingFieldsInNewVersion($this->getContentFixture()); } @@ -320,16 +321,16 @@ public function testCreateExistingFieldsInNewVersionUpdatingStorageHandler() $this->assertCreateExistingFieldsInNewVersion(true); - $mapperMock->expects($this->exactly(12)) + $mapperMock->expects(self::exactly(12)) ->method('convertToStorageValue') - ->with($this->isInstanceOf(Field::class)) - ->will($this->returnValue(new StorageFieldValue())); + ->with(self::isInstanceOf(Field::class)) + ->will(self::returnValue(new StorageFieldValue())); - $contentGatewayMock->expects($this->exactly(6)) + $contentGatewayMock->expects(self::exactly(6)) ->method('updateField') ->with( - $this->isInstanceOf(Field::class), - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(Field::class), + self::isInstanceOf(StorageFieldValue::class) ); $fieldHandler->createExistingFieldsInNewVersion($this->getContentFixture()); @@ -341,11 +342,11 @@ public function testLoadExternalFieldData() $storageHandlerMock = $this->getStorageHandlerMock(); - $storageHandlerMock->expects($this->exactly(6)) + $storageHandlerMock->expects(self::exactly(6)) ->method('getFieldData') ->with( - $this->isInstanceOf(VersionInfo::class), - $this->isInstanceOf(Field::class) + self::isInstanceOf(VersionInfo::class), + self::isInstanceOf(Field::class) ); $fieldHandler->loadExternalFieldData($this->getContentFixture()); @@ -360,16 +361,16 @@ public function assertUpdateFieldsWithNewLanguage($storageHandlerUpdatesFields = $fieldTypeMock = $this->getFieldTypeMock(); $storageHandlerMock = $this->getStorageHandlerMock(); - $fieldTypeMock->expects($this->exactly(1)) + $fieldTypeMock->expects(self::exactly(1)) ->method('getEmptyValue') - ->will($this->returnValue(new FieldValue())); + ->will(self::returnValue(new FieldValue())); - $contentGatewayMock->expects($this->exactly(3)) + $contentGatewayMock->expects(self::exactly(3)) ->method('insertNewField') ->with( - $this->isInstanceOf(Content::class), - $this->isInstanceOf(Field::class), - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(Content::class), + self::isInstanceOf(Field::class), + self::isInstanceOf(StorageFieldValue::class) ); $callNo = 0; @@ -392,23 +393,23 @@ public function assertUpdateFieldsWithNewLanguage($storageHandlerUpdatesFields = $originalField->languageCode = 'eng-GB'; continue; } - $storageHandlerMock->expects($this->at($callNo++)) + $storageHandlerMock->expects(self::at($callNo++)) ->method('storeFieldData') ->with( - $this->isInstanceOf(VersionInfo::class), - $this->equalTo($field) - )->will($this->returnValue($storageHandlerUpdatesFields)); + self::isInstanceOf(VersionInfo::class), + self::equalTo($field) + )->will(self::returnValue($storageHandlerUpdatesFields)); } /* @var $copyField */ /* @var $originalField */ - $storageHandlerMock->expects($this->at($callNo)) + $storageHandlerMock->expects(self::at($callNo)) ->method('copyFieldData') ->with( - $this->isInstanceOf(VersionInfo::class), - $this->equalTo($copyField), - $this->equalTo($originalField) - )->will($this->returnValue($storageHandlerUpdatesFields)); + self::isInstanceOf(VersionInfo::class), + self::equalTo($copyField), + self::equalTo($originalField) + )->will(self::returnValue($storageHandlerUpdatesFields)); } public function testUpdateFieldsWithNewLanguage() @@ -418,10 +419,10 @@ public function testUpdateFieldsWithNewLanguage() $this->assertUpdateFieldsWithNewLanguage(false); - $mapperMock->expects($this->exactly(3)) + $mapperMock->expects(self::exactly(3)) ->method('convertToStorageValue') - ->with($this->isInstanceOf(Field::class)) - ->will($this->returnValue(new StorageFieldValue())); + ->with(self::isInstanceOf(Field::class)) + ->will(self::returnValue(new StorageFieldValue())); $field = new Field( [ @@ -451,16 +452,16 @@ public function testUpdateFieldsWithNewLanguageUpdatingStorageHandler() $this->assertUpdateFieldsWithNewLanguage(true); - $mapperMock->expects($this->exactly(6)) + $mapperMock->expects(self::exactly(6)) ->method('convertToStorageValue') - ->with($this->isInstanceOf(Field::class)) - ->will($this->returnValue(new StorageFieldValue())); + ->with(self::isInstanceOf(Field::class)) + ->will(self::returnValue(new StorageFieldValue())); - $contentGatewayMock->expects($this->exactly(3)) + $contentGatewayMock->expects(self::exactly(3)) ->method('updateField') ->with( - $this->isInstanceOf(Field::class), - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(Field::class), + self::isInstanceOf(StorageFieldValue::class) ); $field = new Field( @@ -515,24 +516,24 @@ public function assertUpdateFieldsExistingLanguages($storageHandlerUpdatesFields 'original' => $originalField, ]; } else { - $storageHandlerMock->expects($this->at($callNo++)) + $storageHandlerMock->expects(self::at($callNo++)) ->method('storeFieldData') ->with( - $this->isInstanceOf(VersionInfo::class), - $this->equalTo($field) - )->will($this->returnValue($storageHandlerUpdatesFields)); + self::isInstanceOf(VersionInfo::class), + self::equalTo($field) + )->will(self::returnValue($storageHandlerUpdatesFields)); } } } foreach ($fieldsToCopy as $fieldToCopy) { - $storageHandlerMock->expects($this->at($callNo++)) + $storageHandlerMock->expects(self::at($callNo++)) ->method('copyFieldData') ->with( - $this->isInstanceOf(VersionInfo::class), - $this->equalTo($fieldToCopy['copy']), - $this->equalTo($fieldToCopy['original']) - )->will($this->returnValue($storageHandlerUpdatesFields)); + self::isInstanceOf(VersionInfo::class), + self::equalTo($fieldToCopy['copy']), + self::equalTo($fieldToCopy['original']) + )->will(self::returnValue($storageHandlerUpdatesFields)); } } @@ -544,16 +545,16 @@ public function testUpdateFieldsExistingLanguages() $this->assertUpdateFieldsExistingLanguages(false); - $mapperMock->expects($this->exactly(6)) + $mapperMock->expects(self::exactly(6)) ->method('convertToStorageValue') - ->with($this->isInstanceOf(Field::class)) - ->will($this->returnValue(new StorageFieldValue())); + ->with(self::isInstanceOf(Field::class)) + ->will(self::returnValue(new StorageFieldValue())); - $contentGatewayMock->expects($this->exactly(6)) + $contentGatewayMock->expects(self::exactly(6)) ->method('updateField') ->with( - $this->isInstanceOf(Field::class), - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(Field::class), + self::isInstanceOf(StorageFieldValue::class) ); $fieldHandler->updateFields( @@ -571,16 +572,16 @@ public function testUpdateFieldsExistingLanguagesUpdatingStorageHandler() $this->assertUpdateFieldsExistingLanguages(true); - $mapperMock->expects($this->exactly(12)) + $mapperMock->expects(self::exactly(12)) ->method('convertToStorageValue') - ->with($this->isInstanceOf(Field::class)) - ->will($this->returnValue(new StorageFieldValue())); + ->with(self::isInstanceOf(Field::class)) + ->will(self::returnValue(new StorageFieldValue())); - $contentGatewayMock->expects($this->exactly(12)) + $contentGatewayMock->expects(self::exactly(12)) ->method('updateField') ->with( - $this->isInstanceOf(Field::class), - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(Field::class), + self::isInstanceOf(StorageFieldValue::class) ); $fieldHandler->updateFields( @@ -622,22 +623,22 @@ public function assertUpdateFieldsForInitialLanguage($storageHandlerUpdatesField } // This field is inserted as empty $field->value = null; - $storageHandlerMock->expects($this->at($callNo++)) + $storageHandlerMock->expects(self::at($callNo++)) ->method('storeFieldData') ->with( - $this->isInstanceOf(VersionInfo::class), - $this->equalTo($field) - )->will($this->returnValue($storageHandlerUpdatesFields)); + self::isInstanceOf(VersionInfo::class), + self::equalTo($field) + )->will(self::returnValue($storageHandlerUpdatesFields)); } foreach ($fieldsToCopy as $fieldToCopy) { - $storageHandlerMock->expects($this->at($callNo++)) + $storageHandlerMock->expects(self::at($callNo++)) ->method('copyFieldData') ->with( - $this->isInstanceOf(VersionInfo::class), - $this->equalTo($fieldToCopy['copy']), - $this->equalTo($fieldToCopy['original']) - )->will($this->returnValue($storageHandlerUpdatesFields)); + self::isInstanceOf(VersionInfo::class), + self::equalTo($fieldToCopy['copy']), + self::equalTo($fieldToCopy['original']) + )->will(self::returnValue($storageHandlerUpdatesFields)); } } @@ -648,10 +649,10 @@ public function testUpdateFieldsForInitialLanguage() $this->assertUpdateFieldsForInitialLanguage(false); - $mapperMock->expects($this->exactly(3)) + $mapperMock->expects(self::exactly(3)) ->method('convertToStorageValue') - ->with($this->isInstanceOf(Field::class)) - ->will($this->returnValue(new StorageFieldValue())); + ->with(self::isInstanceOf(Field::class)) + ->will(self::returnValue(new StorageFieldValue())); $struct = new UpdateStruct(); // Language with id=2 is eng-US @@ -671,16 +672,16 @@ public function testUpdateFieldsForInitialLanguageUpdatingStorageHandler() $this->assertUpdateFieldsForInitialLanguage(true); - $mapperMock->expects($this->exactly(6)) + $mapperMock->expects(self::exactly(6)) ->method('convertToStorageValue') - ->with($this->isInstanceOf(Field::class)) - ->will($this->returnValue(new StorageFieldValue())); + ->with(self::isInstanceOf(Field::class)) + ->will(self::returnValue(new StorageFieldValue())); - $contentGatewayMock->expects($this->exactly(3)) + $contentGatewayMock->expects(self::exactly(3)) ->method('updateField') ->with( - $this->isInstanceOf(Field::class), - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(Field::class), + self::isInstanceOf(StorageFieldValue::class) ); $struct = new UpdateStruct(); @@ -698,27 +699,27 @@ public function testDeleteFields() $fieldHandler = $this->getFieldHandler(); $contentGatewayMock = $this->getContentGatewayMock(); - $contentGatewayMock->expects($this->once()) + $contentGatewayMock->expects(self::once()) ->method('getFieldIdsByType') ->with( - $this->equalTo(42), - $this->equalTo(2) - )->will($this->returnValue(['some-type' => [2, 3]])); + self::equalTo(42), + self::equalTo(2) + )->will(self::returnValue(['some-type' => [2, 3]])); $storageHandlerMock = $this->getStorageHandlerMock(); - $storageHandlerMock->expects($this->once()) + $storageHandlerMock->expects(self::once()) ->method('deleteFieldData') ->with( - $this->equalTo('some-type'), - $this->isInstanceOf(VersionInfo::class), - $this->equalTo([2, 3]) + self::equalTo('some-type'), + self::isInstanceOf(VersionInfo::class), + self::equalTo([2, 3]) ); - $contentGatewayMock->expects($this->once()) + $contentGatewayMock->expects(self::once()) ->method('deleteFields') ->with( - $this->equalTo(42), - $this->equalTo(2) + self::equalTo(42), + self::equalTo(2) ); $fieldHandler->deleteFields(42, new VersionInfo(['versionNo' => 2])); @@ -998,13 +999,13 @@ protected function getFieldTypeRegistryMock() $this->fieldTypeRegistryMock = $this->createMock(FieldTypeRegistry::class); $this->fieldTypeRegistryMock->expects( - $this->any() + self::any() )->method( 'getFieldType' )->with( - $this->isType('string') + self::isType('string') )->will( - $this->returnValue($this->getFieldTypeMock()) + self::returnValue($this->getFieldTypeMock()) ); } diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/AuthorTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/AuthorTest.php index 96e18e03fe..0171769c2c 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/AuthorTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/AuthorTest.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use DOMDocument; diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/CheckboxTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/CheckboxTest.php index 5d0dc8e2a6..78c30d6e1c 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/CheckboxTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/CheckboxTest.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryTest.php index e65b6300be..5b6394960d 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/CountryTest.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldTypeConstraints; @@ -40,6 +41,7 @@ public function providerForTestToStorageValue() /** * @group fieldType * @group country + * * @dataProvider providerForTestToStorageValue */ public function testToStorageValue($data, $sortKey, $dataText, $sortKeyString) @@ -65,6 +67,7 @@ public function providerForTestToFieldValue() /** * @group fieldType * @group country + * * @dataProvider providerForTestToFieldValue */ public function testToFieldValue($dataText, $sortKeyString, $data) diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/DateAndTimeTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/DateAndTimeTest.php index 0ab500db69..9a1afa260e 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/DateAndTimeTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/DateAndTimeTest.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use DateInterval; diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/DateTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/DateTest.php index f2e32c8cfa..0eb70ab5f4 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/DateTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/DateTest.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use DateTime; diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/ISBNTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/ISBNTest.php index f0a03deeef..bb7260d001 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/ISBNTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/ISBNTest.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\Type\FieldDefinition as PersistenceFieldDefinition; diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/KeywordTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/KeywordTest.php index fcdad63838..47f35372f5 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/KeywordTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/KeywordTest.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; @@ -39,11 +40,11 @@ public function testToStorageValue() $storageFieldValue = new StorageFieldValue(); $this->converter->toStorageValue($value, $storageFieldValue); - $this->assertNull($storageFieldValue->dataText); - $this->assertNull($storageFieldValue->dataInt); - $this->assertNull($storageFieldValue->dataFloat); - $this->assertEquals(0, $storageFieldValue->sortKeyInt); - $this->assertEquals('', $storageFieldValue->sortKeyString); + self::assertNull($storageFieldValue->dataText); + self::assertNull($storageFieldValue->dataInt); + self::assertNull($storageFieldValue->dataFloat); + self::assertEquals(0, $storageFieldValue->sortKeyInt); + self::assertEquals('', $storageFieldValue->sortKeyString); } /** @@ -56,8 +57,8 @@ public function testToFieldValue() $fieldValue = new FieldValue(); $this->converter->toFieldValue($storageFieldValue, $fieldValue); - $this->assertSame([], $fieldValue->data); - $this->assertEquals('', $fieldValue->sortKey); + self::assertSame([], $fieldValue->data); + self::assertEquals('', $fieldValue->sortKey); } /** diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/MediaTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/MediaTest.php index 296e05bef1..3b4b79aacf 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/MediaTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/MediaTest.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldTypeConstraints; diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationListTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationListTest.php index 7cb5158b5c..1a4681dfc5 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationListTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationListTest.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldTypeConstraints; @@ -54,11 +55,11 @@ public function testToStorageValue() $actualStorageFieldValue = new StorageFieldValue(); $this->converter - ->expects($this->once()) + ->expects(self::once()) ->method('getRelationXmlHashFromDB') ->with($destinationContentIds) ->will( - $this->returnValue( + self::returnValue( [ '1' => [ [ @@ -96,7 +97,7 @@ public function testToStorageValue() $this->converter->toStorageValue($fieldValue, $actualStorageFieldValue); - $this->assertEquals( + self::assertEquals( $expectedStorageFieldValue, $actualStorageFieldValue ); @@ -123,14 +124,14 @@ public function testToStorageValueEmpty() $actualStorageFieldValue = new StorageFieldValue(); $this->converter - ->expects($this->once()) + ->expects(self::once()) ->method('getRelationXmlHashFromDB') ->with($destinationContentIds) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->converter->toStorageValue($fieldValue, $actualStorageFieldValue); - $this->assertEquals( + self::assertEquals( $expectedStorageFieldValue, $actualStorageFieldValue ); @@ -157,7 +158,7 @@ public function testToFieldValue() $this->converter->toFieldValue($storageFieldValue, $actualFieldValue); - $this->assertEquals( + self::assertEquals( $expectedFieldValue, $actualFieldValue ); @@ -184,7 +185,7 @@ public function testToFieldValueEmpty() $this->converter->toFieldValue($storageFieldValue, $actualFieldValue); - $this->assertEquals( + self::assertEquals( $expectedFieldValue, $actualFieldValue ); @@ -227,7 +228,7 @@ public function testToStorageFieldDefinition() $this->converter->toStorageFieldDefinition($fieldDefinition, $actualStorageFieldDefinition); - $this->assertEquals( + self::assertEquals( $expectedStorageFieldDefinition, $actualStorageFieldDefinition ); @@ -285,7 +286,7 @@ public function testToFieldDefinitionMultiple() $this->converter->toFieldDefinition($storageFieldDefinition, $actualFieldDefinition); - $this->assertEquals( + self::assertEquals( $expectedFieldDefinition, $actualFieldDefinition ); diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationTest.php index b360c5f9f4..aeb653170c 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/RelationTest.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldTypeConstraints; @@ -62,7 +63,7 @@ public function testToStorageFieldDefinition() $this->converter->toStorageFieldDefinition($fieldDefinition, $actualStorageFieldDefinition); - $this->assertEquals( + self::assertEquals( $expectedStorageFieldDefinition, $actualStorageFieldDefinition ); diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/SelectionTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/SelectionTest.php index 24aab067b1..e741d20a18 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/SelectionTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/SelectionTest.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldTypeConstraints; @@ -48,7 +49,7 @@ public function testToStorageValue() $this->converter->toStorageValue($fieldValue, $actualStorageFieldValue); - $this->assertEquals( + self::assertEquals( $expectedStorageFieldValue, $actualStorageFieldValue ); @@ -72,7 +73,7 @@ public function testToStorageValueEmpty() $this->converter->toStorageValue($fieldValue, $actualStorageFieldValue); - $this->assertEquals( + self::assertEquals( $expectedStorageFieldValue, $actualStorageFieldValue ); @@ -96,7 +97,7 @@ public function testToFieldValue() $this->converter->toFieldValue($storageFieldValue, $actualFieldValue); - $this->assertEquals( + self::assertEquals( $expectedFieldValue, $actualFieldValue ); @@ -120,7 +121,7 @@ public function testToFieldValueEmpty() $this->converter->toFieldValue($storageFieldValue, $actualFieldValue); - $this->assertEquals( + self::assertEquals( $expectedFieldValue, $actualFieldValue ); @@ -163,7 +164,7 @@ public function testToStorageFieldDefinitionMultiple() $this->converter->toStorageFieldDefinition($fieldDefinition, $actualStorageFieldDefinition); - $this->assertEquals($expectedStorageFieldDefinition, $actualStorageFieldDefinition); + self::assertEquals($expectedStorageFieldDefinition, $actualStorageFieldDefinition); } /** @@ -201,7 +202,7 @@ public function testToStorageFieldDefinitionSingle() $this->converter->toStorageFieldDefinition($fieldDefinition, $actualStorageFieldDefinition); - $this->assertEquals($expectedStorageFieldDefinition, $actualStorageFieldDefinition); + self::assertEquals($expectedStorageFieldDefinition, $actualStorageFieldDefinition); } /** @@ -270,7 +271,7 @@ public function testToFieldDefinitionMultiple() $this->converter->toFieldDefinition($storageFieldDefinition, $actualFieldDefinition); - $this->assertEquals($expectedFieldDefinition, $actualFieldDefinition); + self::assertEquals($expectedFieldDefinition, $actualFieldDefinition); } /** @@ -323,7 +324,7 @@ public function testToFieldDefinitionSingleEmpty() $this->converter->toFieldDefinition($storageFieldDefinition, $actualFieldDefinition); - $this->assertEquals($expectedFieldDefinition, $actualFieldDefinition); + self::assertEquals($expectedFieldDefinition, $actualFieldDefinition); } } diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/SerializableConverterTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/SerializableConverterTest.php index 14afbf217d..28744c243d 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/SerializableConverterTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/SerializableConverterTest.php @@ -51,7 +51,7 @@ public function testToStorageValue(): void $fieldValue->sortKey = 'key'; $this->serializer - ->expects($this->once()) + ->expects(self::once()) ->method('encode') ->with($fieldValue->data) ->willReturn(self::EXAMPLE_JSON); @@ -60,21 +60,21 @@ public function testToStorageValue(): void $this->converter->toStorageValue($fieldValue, $storageValue); - $this->assertEquals(self::EXAMPLE_JSON, $storageValue->dataText); - $this->assertEquals('key', $storageValue->sortKeyString); + self::assertEquals(self::EXAMPLE_JSON, $storageValue->dataText); + self::assertEquals('key', $storageValue->sortKeyString); } public function testEmptyToStorageValue(): void { $this->serializer - ->expects($this->never()) + ->expects(self::never()) ->method('encode'); $storageValue = new StorageFieldValue(); $this->converter->toStorageValue(new FieldValue(), $storageValue); - $this->assertNull($storageValue->dataText); + self::assertNull($storageValue->dataText); } public function testToFieldValue(): void @@ -84,7 +84,7 @@ public function testToFieldValue(): void $storageValue->dataText = self::EXAMPLE_JSON; $this->serializer - ->expects($this->once()) + ->expects(self::once()) ->method('decode') ->with(self::EXAMPLE_JSON) ->willReturn(self::EXAMPLE_DATA); @@ -93,22 +93,22 @@ public function testToFieldValue(): void $this->converter->toFieldValue($storageValue, $fieldValue); - $this->assertEquals('key', $fieldValue->sortKey); - $this->assertEquals(self::EXAMPLE_DATA, $fieldValue->data); - $this->assertNull($fieldValue->externalData); + self::assertEquals('key', $fieldValue->sortKey); + self::assertEquals(self::EXAMPLE_DATA, $fieldValue->data); + self::assertNull($fieldValue->externalData); } public function testEmptyToFieldValue(): void { $this->serializer - ->expects($this->never()) + ->expects(self::never()) ->method('decode'); $fieldValue = new FieldValue(); $this->converter->toFieldValue(new StorageFieldValue(), $fieldValue); - $this->assertNull($fieldValue->data); + self::assertNull($fieldValue->data); } public function testToStorageFieldDefinition(): void @@ -121,7 +121,7 @@ public function testToStorageFieldDefinition(): void ]); $this->serializer - ->expects($this->once()) + ->expects(self::once()) ->method('encode') ->with(self::EXAMPLE_DATA) ->willReturn(self::EXAMPLE_JSON); @@ -130,20 +130,20 @@ public function testToStorageFieldDefinition(): void $this->converter->toStorageFieldDefinition($fieldDefinition, $storageFieldDefinition); - $this->assertEquals(self::EXAMPLE_JSON, $storageFieldDefinition->dataText5); + self::assertEquals(self::EXAMPLE_JSON, $storageFieldDefinition->dataText5); } public function testEmptyToStorageFieldDefinition(): void { $this->serializer - ->expects($this->never()) + ->expects(self::never()) ->method('encode'); $storageFieldDefinition = new StorageFieldDefinition(); $this->converter->toStorageFieldDefinition(new FieldDefinition(), $storageFieldDefinition); - $this->assertNull($storageFieldDefinition->dataText5); + self::assertNull($storageFieldDefinition->dataText5); } public function testToFieldDefinition(): void @@ -152,7 +152,7 @@ public function testToFieldDefinition(): void $storageFieldDefinition->dataText5 = self::EXAMPLE_JSON; $this->serializer - ->expects($this->once()) + ->expects(self::once()) ->method('decode') ->with(self::EXAMPLE_JSON) ->willReturn(self::EXAMPLE_DATA); @@ -161,7 +161,7 @@ public function testToFieldDefinition(): void $this->converter->toFieldDefinition($storageFieldDefinition, $fieldDefinition); - $this->assertEquals( + self::assertEquals( new FieldSettings(self::EXAMPLE_DATA), $fieldDefinition->fieldTypeConstraints->fieldSettings ); @@ -170,14 +170,14 @@ public function testToFieldDefinition(): void public function testEmptyToFieldDefinition(): void { $this->serializer - ->expects($this->never()) + ->expects(self::never()) ->method('decode'); $fieldDefinition = new FieldDefinition(); $this->converter->toFieldDefinition(new StorageFieldDefinition(), $fieldDefinition); - $this->assertNull($fieldDefinition->fieldTypeConstraints->fieldSettings); + self::assertNull($fieldDefinition->fieldTypeConstraints->fieldSettings); } } diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/TextBlockTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/TextBlockTest.php index ef8bc2010d..0551272a58 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/TextBlockTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/TextBlockTest.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldTypeConstraints; diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/TextLineTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/TextLineTest.php index 48595753c7..50516d69ad 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/TextLineTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/TextLineTest.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldTypeConstraints; diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/TimeTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/TimeTest.php index 530362c1e0..0c9d7cd8f9 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/TimeTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/TimeTest.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use DateTime; diff --git a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/UrlTest.php b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/UrlTest.php index 67c2ee65c4..ea858a37ab 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/UrlTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValue/Converter/UrlTest.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\Core\Persistence\Legacy\Content\FieldValue\Converter; use Ibexa\Contracts\Core\Persistence\Content\FieldValue; diff --git a/tests/lib/Persistence/Legacy/Content/FieldValueConverterRegistryTest.php b/tests/lib/Persistence/Legacy/Content/FieldValueConverterRegistryTest.php index 08ccabe4a8..d4a48a6b5b 100644 --- a/tests/lib/Persistence/Legacy/Content/FieldValueConverterRegistryTest.php +++ b/tests/lib/Persistence/Legacy/Content/FieldValueConverterRegistryTest.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\Core\Persistence\Legacy\Content; use Ibexa\Core\Persistence\Legacy\Content\FieldValue\Converter; @@ -22,7 +23,7 @@ public function testRegister() $converter = $this->getFieldValueConverterMock(); $registry = new Registry([self::TYPE_NAME => $converter]); - $this->assertSame($converter, $registry->getConverter(self::TYPE_NAME)); + self::assertSame($converter, $registry->getConverter(self::TYPE_NAME)); } public function testGetStorage() @@ -32,7 +33,7 @@ public function testGetStorage() $res = $registry->getConverter(self::TYPE_NAME); - $this->assertSame( + self::assertSame( $converter, $res ); diff --git a/tests/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabaseTest.php b/tests/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabaseTest.php index 8d8a004560..f226431428 100644 --- a/tests/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabaseTest.php +++ b/tests/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabaseTest.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\Core\Persistence\Legacy\Content\Gateway; use Doctrine\DBAL\ParameterType; @@ -217,7 +218,7 @@ public function testSetStatus() $version->contentInfo->id = $contentId; $gateway->insertVersion($version, []); - $this->assertTrue( + self::assertTrue( $gateway->setStatus($version->contentInfo->id, $version->versionNo, VersionInfo::STATUS_PENDING) ); @@ -252,7 +253,7 @@ public function testSetStatusPublished() $version->contentInfo->id = $contentId; $gateway->insertVersion($version, []); - $this->assertTrue( + self::assertTrue( $gateway->setStatus($version->contentInfo->id, $version->versionNo, VersionInfo::STATUS_PUBLISHED) ); @@ -278,7 +279,7 @@ public function testSetStatusUnknownVersion() { $gateway = $this->getDatabaseGateway(); - $this->assertFalse( + self::assertFalse( $gateway->setStatus(23, 42, 2) ); } @@ -601,23 +602,23 @@ public function testListVersions(): void $gateway = $this->getDatabaseGateway(); $res = $gateway->listVersions(226); - $this->assertCount( + self::assertCount( 2, $res ); foreach ($res as $row) { - $this->assertCount( + self::assertCount( 23, $row ); } - $this->assertEquals( + self::assertEquals( 675, $res[0]['ezcontentobject_version_id'] ); - $this->assertEquals( + self::assertEquals( 676, $res[1]['ezcontentobject_version_id'] ); @@ -632,7 +633,7 @@ public function testListVersionNumbers() $gateway = $this->getDatabaseGateway(); $res = $gateway->listVersionNumbers(226); - $this->assertEquals([1, 2], $res); + self::assertEquals([1, 2], $res); } public function testListVersionsForUser() @@ -644,31 +645,31 @@ public function testListVersionsForUser() $gateway = $this->getDatabaseGateway(); $res = $gateway->listVersionsForUser(14); - $this->assertCount( + self::assertCount( 2, $res ); foreach ($res as $row) { - $this->assertCount( + self::assertCount( 23, $row ); } - $this->assertEquals( + self::assertEquals( 677, $res[0]['ezcontentobject_version_id'] ); - $this->assertEquals( + self::assertEquals( 0, $res[0]['ezcontentobject_version_status'] ); - $this->assertEquals( + self::assertEquals( 678, $res[1]['ezcontentobject_version_id'] ); - $this->assertEquals( + self::assertEquals( 0, $res[1]['ezcontentobject_version_status'] ); @@ -716,7 +717,7 @@ public function testCreateFixtureForMapperExtractContentFromRowsMultipleVersions $res );*/ - $this->assertEquals($orig, $res, 'Fixtures differ between what was previously stored(expected) and what it now generates(actual), this hints either some mistake in impl or that the fixture (../_fixtures/extract_content_from_rows_multiple_versions.php) and tests needs to be adapted.'); + self::assertEquals($orig, $res, 'Fixtures differ between what was previously stored(expected) and what it now generates(actual), this hints either some mistake in impl or that the fixture (../_fixtures/extract_content_from_rows_multiple_versions.php) and tests needs to be adapted.'); } public function testCreateFixtureForMapperExtractContentFromRows() @@ -736,7 +737,7 @@ public function testCreateFixtureForMapperExtractContentFromRows() $res );*/ - $this->assertEquals($orig, $res, 'Fixtures differ between what was previously stored(expected) and what it now generates(actual), this hints either some mistake in impl or that the fixture (../_fixtures/extract_content_from_rows.php) and tests needs to be adapted.'); + self::assertEquals($orig, $res, 'Fixtures differ between what was previously stored(expected) and what it now generates(actual), this hints either some mistake in impl or that the fixture (../_fixtures/extract_content_from_rows.php) and tests needs to be adapted.'); } public function testLoadWithSingleTranslation() @@ -758,7 +759,7 @@ public function testLoadWithSingleTranslation() ['4'], $res ); - $this->assertCount( + self::assertCount( 1, $res ); @@ -773,7 +774,7 @@ public function testLoadNonExistentTranslation() $gateway = $this->getDatabaseGateway(); $res = $gateway->load(226, 2, ['de-DE']); - $this->assertCount( + self::assertCount( 0, $res ); @@ -801,7 +802,7 @@ protected function assertValuesInRows($columnKey, array $expectedValues, array $ } } - $this->assertEquals( + self::assertEquals( $expectedValues, $containedValues ); @@ -815,7 +816,7 @@ public function testGetAllLocationIds() $gateway = $this->getDatabaseGateway(); - $this->assertEquals( + self::assertEquals( [228], $gateway->getAllLocationIds(226) ); @@ -829,7 +830,7 @@ public function testGetFieldIdsByType() $gateway = $this->getDatabaseGateway(); - $this->assertEquals( + self::assertEquals( [ 'ezstring' => [841], 'ezimage' => [843], @@ -847,7 +848,7 @@ public function testGetFieldIdsByTypeWithSecondArgument() $gateway = $this->getDatabaseGateway(); - $this->assertEquals( + self::assertEquals( [ 'ezstring' => [4001, 4002], ], @@ -870,7 +871,7 @@ public function testDeleteRelationsTo() $gateway = $this->getDatabaseGateway(); $gateway->deleteRelations(149); - $this->assertEquals( + self::assertEquals( // yes, relates to itself! [ 'all' => $beforeCount['all'] - 2, @@ -900,7 +901,7 @@ public function testDeleteRelationsFrom() $gateway = $this->getDatabaseGateway(); $gateway->deleteRelations(75); - $this->assertEquals( + self::assertEquals( [ 'all' => $beforeCount['all'] - 6, 'from' => $beforeCount['from'] - 6, @@ -929,7 +930,7 @@ public function testDeleteRelationsWithSecondArgument() $gateway = $this->getDatabaseGateway(); $gateway->deleteRelations(225, 2); - $this->assertEquals( + self::assertEquals( [ 'all' => $beforeCount['all'] - 1, 'from' => $beforeCount['from'] - 1, @@ -957,7 +958,7 @@ public function testDeleteField(): void $gateway = $this->getDatabaseGateway(); $gateway->deleteField(22); - $this->assertEquals( + self::assertEquals( $beforeCount - 2, $this->countContentFields() ); @@ -985,7 +986,7 @@ public function testDeleteFields() $gateway = $this->getDatabaseGateway(); $gateway->deleteFields(4); - $this->assertEquals( + self::assertEquals( [ 'all' => $beforeCount['all'] - 2, 'this' => 0, @@ -1011,7 +1012,7 @@ public function testDeleteFieldsWithSecondArgument() $gateway = $this->getDatabaseGateway(); $gateway->deleteFields(225, 2); - $this->assertEquals( + self::assertEquals( [ 'all' => $beforeCount['all'] - 2, 'this' => $beforeCount['this'] - 2, @@ -1037,7 +1038,7 @@ public function testDeleteVersions() $gateway = $this->getDatabaseGateway(); $gateway->deleteVersions(14); - $this->assertEquals( + self::assertEquals( [ 'all' => $beforeCount['all'] - 2, 'this' => 0, @@ -1063,7 +1064,7 @@ public function testDeleteVersionsWithSecondArgument() $gateway = $this->getDatabaseGateway(); $gateway->deleteVersions(225, 2); - $this->assertEquals( + self::assertEquals( [ 'all' => $beforeCount['all'] - 1, 'this' => $beforeCount['this'] - 1, @@ -1126,7 +1127,7 @@ public function testDeleteNames() $gateway = $this->getDatabaseGateway(); $gateway->deleteNames(14); - $this->assertEquals( + self::assertEquals( [ 'all' => $beforeCount['all'] - 2, 'this' => 0, @@ -1152,7 +1153,7 @@ public function testDeleteNamesWithSecondArgument() $gateway = $this->getDatabaseGateway(); $gateway->deleteNames(225, 2); - $this->assertEquals( + self::assertEquals( [ 'all' => $beforeCount['all'] - 1, 'this' => $beforeCount['this'] - 1, @@ -1175,7 +1176,7 @@ public function testDeleteContent() $gateway = $this->getDatabaseGateway(); $gateway->deleteContent(14); - $this->assertEquals( + self::assertEquals( [ 'all' => $beforeCount - 1, 'this' => 0, @@ -1224,7 +1225,7 @@ public function testLoadRelations(): void $relations = $gateway->loadRelations(57); - $this->assertCount(3, $relations); + self::assertCount(3, $relations); $this->assertValuesInRows( 'ezcontentobject_link_to_contentobject_id', @@ -1252,7 +1253,7 @@ public function testLoadRelationsByType() $relations = $gateway->loadRelations(57, null, RelationValue::COMMON); - $this->assertCount(1, $relations, 'Expecting one relation to be loaded'); + self::assertCount(1, $relations, 'Expecting one relation to be loaded'); $this->assertValuesInRows( 'ezcontentobject_link_relation_type', @@ -1275,7 +1276,7 @@ public function testLoadRelationsByVersion() $relations = $gateway->loadRelations(57, 1); - $this->assertCount(1, $relations, 'Expecting one relation to be loaded'); + self::assertCount(1, $relations, 'Expecting one relation to be loaded'); $this->assertValuesInRows( 'ezcontentobject_link_to_contentobject_id', @@ -1292,7 +1293,7 @@ public function testLoadRelationsNoResult() $relations = $gateway->loadRelations(57, 1, RelationValue::EMBED); - $this->assertCount(0, $relations, 'Expecting no relation to be loaded'); + self::assertCount(0, $relations, 'Expecting no relation to be loaded'); } public function testLoadReverseRelations() @@ -1353,7 +1354,7 @@ public function testGetLastVersionNumber() $gateway = $this->getDatabaseGateway(); - $this->assertEquals( + self::assertEquals( 1, $gateway->getLastVersionNumber(4) ); @@ -1680,7 +1681,7 @@ public function testLoadVersionInfo(): void $orig = include __DIR__ . '/../_fixtures/extract_version_info_from_rows_multiple_versions.php'; - $this->assertEquals($orig, $res, 'Fixtures differ between what was previously stored(expected) and what it now generates(actual), this hints either some mistake in impl or that the fixture (../_fixtures/extract_content_from_rows_multiple_versions.php) and tests needs to be adapted.'); + self::assertEquals($orig, $res, 'Fixtures differ between what was previously stored(expected) and what it now generates(actual), this hints either some mistake in impl or that the fixture (../_fixtures/extract_content_from_rows_multiple_versions.php) and tests needs to be adapted.'); } /** diff --git a/tests/lib/Persistence/Legacy/Content/Gateway/RandomSortClauseHandlerFactoryTest.php b/tests/lib/Persistence/Legacy/Content/Gateway/RandomSortClauseHandlerFactoryTest.php index 627062083b..bd36c4e4da 100644 --- a/tests/lib/Persistence/Legacy/Content/Gateway/RandomSortClauseHandlerFactoryTest.php +++ b/tests/lib/Persistence/Legacy/Content/Gateway/RandomSortClauseHandlerFactoryTest.php @@ -40,7 +40,7 @@ public function testGetGateway(array $gateways) ->willReturn($platform); $handlerFactory = new RandomSortClauseHandlerFactory($connection, $gateways); - $this->assertEquals( + self::assertEquals( 'testStorage', $handlerFactory->getGateway()->getDriverName() ); diff --git a/tests/lib/Persistence/Legacy/Content/Language/CachingLanguageHandlerTest.php b/tests/lib/Persistence/Legacy/Content/Language/CachingLanguageHandlerTest.php index 6bae3ef379..0f8a458344 100644 --- a/tests/lib/Persistence/Legacy/Content/Language/CachingLanguageHandlerTest.php +++ b/tests/lib/Persistence/Legacy/Content/Language/CachingLanguageHandlerTest.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\Core\Persistence\Legacy\Content\Language; use Ibexa\Contracts\Core\Persistence\Content\Language; @@ -53,23 +54,23 @@ public function testCreate() $languageFixture = $this->getLanguageFixture(); - $innerHandlerMock->expects($this->once()) + $innerHandlerMock->expects(self::once()) ->method('create') ->with( - $this->isInstanceOf( + self::isInstanceOf( SPILanguageCreateStruct::class ) )->willReturn($languageFixture); - $cacheMock->expects($this->once()) + $cacheMock->expects(self::once()) ->method('setMulti') - ->with($this->equalTo([$languageFixture])); + ->with(self::equalTo([$languageFixture])); $createStruct = $this->getCreateStructFixture(); $result = $handler->create($createStruct); - $this->assertEquals( + self::assertEquals( $languageFixture, $result ); @@ -106,14 +107,14 @@ public function testUpdate() $innerHandlerMock = $this->getInnerLanguageHandlerMock(); $cacheMock = $this->getLanguageCacheMock(); - $innerHandlerMock->expects($this->once()) + $innerHandlerMock->expects(self::once()) ->method('update') ->with($this->getLanguageFixture()); $languageFixture = $this->getLanguageFixture(); - $cacheMock->expects($this->once()) + $cacheMock->expects(self::once()) ->method('setMulti') - ->with($this->equalTo([$languageFixture])); + ->with(self::equalTo([$languageFixture])); $handler->update($languageFixture); } @@ -124,19 +125,19 @@ public function testLoad() $cacheMock = $this->getLanguageCacheMock(); $cacheIdentifierGeneratorMock = $this->getCacheIdentifierGeneratorMock(); - $cacheIdentifierGeneratorMock->expects($this->once()) + $cacheIdentifierGeneratorMock->expects(self::once()) ->method('generateKey') ->with('language', [2], true) ->willReturn('ibx-la-2'); - $cacheMock->expects($this->once()) + $cacheMock->expects(self::once()) ->method('get') - ->with($this->equalTo('ibx-la-2')) + ->with(self::equalTo('ibx-la-2')) ->willReturn($this->getLanguageFixture()); $result = $handler->load(2); - $this->assertEquals( + self::assertEquals( $this->getLanguageFixture(), $result ); @@ -149,21 +150,21 @@ public function testLoadFailure() $innerHandlerMock = $this->getInnerLanguageHandlerMock(); $cacheIdentifierGeneratorMock = $this->getCacheIdentifierGeneratorMock(); - $cacheIdentifierGeneratorMock->expects($this->once()) + $cacheIdentifierGeneratorMock->expects(self::once()) ->method('generateKey') ->with('language', [2], true) ->willReturn('ibx-la-2'); - $cacheMock->expects($this->once()) + $cacheMock->expects(self::once()) ->method('get') - ->with($this->equalTo('ibx-la-2')) + ->with(self::equalTo('ibx-la-2')) ->willReturn(null); - $innerHandlerMock->expects($this->once()) + $innerHandlerMock->expects(self::once()) ->method('load') - ->with($this->equalTo(2)) + ->with(self::equalTo(2)) ->will( - $this->throwException( + self::throwException( new NotFoundException('Language', 2) ) ); @@ -178,19 +179,19 @@ public function testLoadByLanguageCode() $cacheMock = $this->getLanguageCacheMock(); $cacheIdentifierGeneratorMock = $this->getCacheIdentifierGeneratorMock(); - $cacheIdentifierGeneratorMock->expects($this->once()) + $cacheIdentifierGeneratorMock->expects(self::once()) ->method('generateKey') ->with('language_code', ['eng-US'], true) ->willReturn('ibx-lac-eng-US'); - $cacheMock->expects($this->once()) + $cacheMock->expects(self::once()) ->method('get') - ->with($this->equalTo('ibx-lac-eng-US')) + ->with(self::equalTo('ibx-lac-eng-US')) ->willReturn($this->getLanguageFixture()); $result = $handler->loadByLanguageCode('eng-US'); - $this->assertEquals( + self::assertEquals( $this->getLanguageFixture(), $result ); @@ -203,21 +204,21 @@ public function testLoadByLanguageCodeFailure() $innerHandlerMock = $this->getInnerLanguageHandlerMock(); $cacheIdentifierGeneratorMock = $this->getCacheIdentifierGeneratorMock(); - $cacheIdentifierGeneratorMock->expects($this->once()) + $cacheIdentifierGeneratorMock->expects(self::once()) ->method('generateKey') ->with('language_code', ['eng-US'], true) ->willReturn('ibx-lac-eng-US'); - $cacheMock->expects($this->once()) + $cacheMock->expects(self::once()) ->method('get') - ->with($this->equalTo('ibx-lac-eng-US')) + ->with(self::equalTo('ibx-lac-eng-US')) ->willReturn(null); - $innerHandlerMock->expects($this->once()) + $innerHandlerMock->expects(self::once()) ->method('loadByLanguageCode') - ->with($this->equalTo('eng-US')) + ->with(self::equalTo('eng-US')) ->will( - $this->throwException( + self::throwException( new NotFoundException('Language', 2) ) ); @@ -232,19 +233,19 @@ public function testLoadAll() $cacheMock = $this->getLanguageCacheMock(); $cacheIdentifierGeneratorMock = $this->getCacheIdentifierGeneratorMock(); - $cacheIdentifierGeneratorMock->expects($this->once()) + $cacheIdentifierGeneratorMock->expects(self::once()) ->method('generateKey') ->with('language_list', [], true) ->willReturn('ibx-lal'); - $cacheMock->expects($this->once()) + $cacheMock->expects(self::once()) ->method('get') - ->with($this->equalTo('ibx-lal')) + ->with(self::equalTo('ibx-lal')) ->willReturn([]); $result = $handler->loadAll(); - $this->assertIsArray($result); + self::assertIsArray($result); } public function testDelete() @@ -254,7 +255,7 @@ public function testDelete() $innerHandlerMock = $this->getInnerLanguageHandlerMock(); $cacheIdentifierGeneratorMock = $this->getCacheIdentifierGeneratorMock(); - $cacheIdentifierGeneratorMock->expects($this->exactly(2)) + $cacheIdentifierGeneratorMock->expects(self::exactly(2)) ->method('generateKey') ->withConsecutive( ['language', [2], true], @@ -265,13 +266,13 @@ public function testDelete() 'ibx-lal' ); - $innerHandlerMock->expects($this->once()) + $innerHandlerMock->expects(self::once()) ->method('delete') - ->with($this->equalTo(2)); + ->with(self::equalTo(2)); - $cacheMock->expects($this->once()) + $cacheMock->expects(self::once()) ->method('deleteMulti') - ->with($this->equalTo(['ibx-la-2', 'ibx-lal'])); + ->with(self::equalTo(['ibx-la-2', 'ibx-lal'])); $handler->delete(2); } diff --git a/tests/lib/Persistence/Legacy/Content/Language/Gateway/DoctrineDatabaseTest.php b/tests/lib/Persistence/Legacy/Content/Language/Gateway/DoctrineDatabaseTest.php index 37f9fdfa68..18a0745318 100644 --- a/tests/lib/Persistence/Legacy/Content/Language/Gateway/DoctrineDatabaseTest.php +++ b/tests/lib/Persistence/Legacy/Content/Language/Gateway/DoctrineDatabaseTest.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\Core\Persistence\Legacy\Content\Language\Gateway; use Ibexa\Contracts\Core\Persistence\Content\Language; @@ -103,7 +104,7 @@ public function testLoadLanguageListData() $result = $gateway->loadLanguageListData([2]); - $this->assertEquals( + self::assertEquals( [ [ 'id' => '2', @@ -122,7 +123,7 @@ public function testLoadAllLanguagesData() $result = $gateway->loadAllLanguagesData(); - $this->assertEquals( + self::assertEquals( [ [ 'id' => '2', diff --git a/tests/lib/Persistence/Legacy/Content/Language/LanguageHandlerTest.php b/tests/lib/Persistence/Legacy/Content/Language/LanguageHandlerTest.php index 764f54b114..e2a268bf32 100644 --- a/tests/lib/Persistence/Legacy/Content/Language/LanguageHandlerTest.php +++ b/tests/lib/Persistence/Legacy/Content/Language/LanguageHandlerTest.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\Core\Persistence\Legacy\Content\Language; use Ibexa\Contracts\Core\Persistence\Content\Language; @@ -45,32 +46,32 @@ public function testCreate() $handler = $this->getLanguageHandler(); $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createLanguageFromCreateStruct') ->with( - $this->isInstanceOf( + self::isInstanceOf( SPILanguageCreateStruct::class ) - )->will($this->returnValue(new Language())); + )->will(self::returnValue(new Language())); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('insertLanguage') ->with( - $this->isInstanceOf( + self::isInstanceOf( Language::class ) - )->will($this->returnValue(2)); + )->will(self::returnValue(2)); $createStruct = $this->getCreateStructFixture(); $result = $handler->create($createStruct); - $this->assertInstanceOf( + self::assertInstanceOf( Language::class, $result ); - $this->assertEquals( + self::assertEquals( 2, $result->id ); @@ -91,9 +92,9 @@ public function testUpdate() $handler = $this->getLanguageHandler(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('updateLanguage') - ->with($this->isInstanceOf(Language::class)); + ->with(self::isInstanceOf(Language::class)); $handler->update($this->getLanguageFixture()); } @@ -114,19 +115,19 @@ public function testLoad() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadLanguageListData') - ->with($this->equalTo([2])) - ->will($this->returnValue([])); + ->with(self::equalTo([2])) + ->will(self::returnValue([])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractLanguagesFromRows') - ->with($this->equalTo([])) - ->will($this->returnValue([new Language()])); + ->with(self::equalTo([])) + ->will(self::returnValue([new Language()])); $result = $handler->load(2); - $this->assertInstanceOf( + self::assertInstanceOf( Language::class, $result ); @@ -140,16 +141,16 @@ public function testLoadFailure() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadLanguageListData') - ->with($this->equalTo([2])) - ->will($this->returnValue([])); + ->with(self::equalTo([2])) + ->will(self::returnValue([])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractLanguagesFromRows') - ->with($this->equalTo([])) + ->with(self::equalTo([])) // No language extracted - ->will($this->returnValue([])); + ->will(self::returnValue([])); $result = $handler->load(2); } @@ -160,19 +161,19 @@ public function testLoadByLanguageCode() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadLanguageListDataByLanguageCode') - ->with($this->equalTo(['eng-US'])) - ->will($this->returnValue([])); + ->with(self::equalTo(['eng-US'])) + ->will(self::returnValue([])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractLanguagesFromRows') - ->with($this->equalTo([])) - ->will($this->returnValue([new Language()])); + ->with(self::equalTo([])) + ->will(self::returnValue([new Language()])); $result = $handler->loadByLanguageCode('eng-US'); - $this->assertInstanceOf( + self::assertInstanceOf( Language::class, $result ); @@ -186,16 +187,16 @@ public function testLoadByLanguageCodeFailure() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadLanguageListDataByLanguageCode') - ->with($this->equalTo(['eng-US'])) - ->will($this->returnValue([])); + ->with(self::equalTo(['eng-US'])) + ->will(self::returnValue([])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractLanguagesFromRows') - ->with($this->equalTo([])) + ->with(self::equalTo([])) // No language extracted - ->will($this->returnValue([])); + ->will(self::returnValue([])); $result = $handler->loadByLanguageCode('eng-US'); } @@ -206,18 +207,18 @@ public function testLoadAll() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadAllLanguagesData') - ->will($this->returnValue([])); + ->will(self::returnValue([])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractLanguagesFromRows') - ->with($this->equalTo([])) - ->will($this->returnValue([new Language()])); + ->with(self::equalTo([])) + ->will(self::returnValue([new Language()])); $result = $handler->loadAll(); - $this->assertIsArray( + self::assertIsArray( $result ); } @@ -227,13 +228,13 @@ public function testDeleteSuccess() $handler = $this->getLanguageHandler(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('canDeleteLanguage') - ->with($this->equalTo(2)) - ->will($this->returnValue(true)); - $gatewayMock->expects($this->once()) + ->with(self::equalTo(2)) + ->will(self::returnValue(true)); + $gatewayMock->expects(self::once()) ->method('deleteLanguage') - ->with($this->equalTo(2)); + ->with(self::equalTo(2)); $result = $handler->delete(2); } @@ -245,11 +246,11 @@ public function testDeleteFail() $handler = $this->getLanguageHandler(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('canDeleteLanguage') - ->with($this->equalTo(2)) - ->will($this->returnValue(false)); - $gatewayMock->expects($this->never()) + ->with(self::equalTo(2)) + ->will(self::returnValue(false)); + $gatewayMock->expects(self::never()) ->method('deleteLanguage'); $result = $handler->delete(2); diff --git a/tests/lib/Persistence/Legacy/Content/Language/MapperTest.php b/tests/lib/Persistence/Legacy/Content/Language/MapperTest.php index f9724dd435..6f235492d8 100644 --- a/tests/lib/Persistence/Legacy/Content/Language/MapperTest.php +++ b/tests/lib/Persistence/Legacy/Content/Language/MapperTest.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\Core\Persistence\Legacy\Content\Language; use Ibexa\Contracts\Core\Persistence\Content\Language; @@ -39,7 +40,7 @@ public function testExtractLanguagesFromRows() $result = $mapper->extractLanguagesFromRows($rows); - $this->assertEquals( + self::assertEquals( $this->getExtractReference(), $result ); diff --git a/tests/lib/Persistence/Legacy/Content/Language/MaskGeneratorTest.php b/tests/lib/Persistence/Legacy/Content/Language/MaskGeneratorTest.php index 5f94935f24..b6c78d1404 100644 --- a/tests/lib/Persistence/Legacy/Content/Language/MaskGeneratorTest.php +++ b/tests/lib/Persistence/Legacy/Content/Language/MaskGeneratorTest.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\Core\Persistence\Legacy\Content\Language; use Ibexa\Contracts\Core\Persistence\Content\Language; @@ -23,7 +24,7 @@ public function testGenerateLanguageMask(array $languages, $expectedMask) { $generator = $this->getMaskGenerator(); - $this->assertSame( + self::assertSame( $expectedMask, $generator->generateLanguageMask($languages) ); @@ -33,7 +34,6 @@ public function testGenerateLanguageMask(array $languages, $expectedMask) * @param array $languages * @param int $expectedMask * - * * @dataProvider getLanguageMaskData */ public function testGenerateLanguageMaskFromLanguagesCodes(array $languages, $expectedMask) @@ -47,7 +47,7 @@ public function testGenerateLanguageMaskFromLanguagesCodes(array $languages, $ex $isAlwaysAvailable = false; } - $this->assertSame( + self::assertSame( $expectedMask, $generator->generateLanguageMaskFromLanguageCodes(array_keys($languages), $isAlwaysAvailable) ); @@ -98,7 +98,7 @@ public function testGenerateLanguageIndicator( ) { $generator = $this->getMaskGenerator(); - $this->assertSame( + self::assertSame( $expectedIndicator, $generator->generateLanguageIndicator($languageCode, $alwaysAvailable) ); @@ -129,7 +129,7 @@ public function testIsLanguageAlwaysAvailable() { $generator = $this->getMaskGenerator(); - $this->assertTrue( + self::assertTrue( $generator->isLanguageAlwaysAvailable( 'eng-GB', [ @@ -144,7 +144,7 @@ public function testIsLanguageAlwaysAvailableOtherLanguage() { $generator = $this->getMaskGenerator(); - $this->assertFalse( + self::assertFalse( $generator->isLanguageAlwaysAvailable( 'eng-GB', [ @@ -159,7 +159,7 @@ public function testIsLanguageAlwaysAvailableNoDefault() { $generator = $this->getMaskGenerator(); - $this->assertFalse( + self::assertFalse( $generator->isLanguageAlwaysAvailable( 'eng-GB', [ @@ -275,10 +275,10 @@ protected function getLanguageHandler() { if (!isset($this->languageHandler)) { $this->languageHandler = $this->createMock(LanguageHandler::class); - $this->languageHandler->expects($this->any()) - ->method($this->anything())// loadByLanguageCode && loadListByLanguageCodes + $this->languageHandler->expects(self::any()) + ->method(self::anything())// loadByLanguageCode && loadListByLanguageCodes ->will( - $this->returnCallback( + self::returnCallback( static function ($languageCodes) { if (is_string($languageCodes)) { $language = $languageCodes; diff --git a/tests/lib/Persistence/Legacy/Content/LanguageAwareTestCase.php b/tests/lib/Persistence/Legacy/Content/LanguageAwareTestCase.php index 02d95b6425..5c40b767b8 100644 --- a/tests/lib/Persistence/Legacy/Content/LanguageAwareTestCase.php +++ b/tests/lib/Persistence/Legacy/Content/LanguageAwareTestCase.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\Core\Persistence\Legacy\Content; use Ibexa\Core\Persistence; diff --git a/tests/lib/Persistence/Legacy/Content/LanguageHandlerMock.php b/tests/lib/Persistence/Legacy/Content/LanguageHandlerMock.php index 5b37fbec5e..dd876c8c49 100644 --- a/tests/lib/Persistence/Legacy/Content/LanguageHandlerMock.php +++ b/tests/lib/Persistence/Legacy/Content/LanguageHandlerMock.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\Core\Persistence\Legacy\Content; use Ibexa\Contracts\Core\Persistence\Content\Language; diff --git a/tests/lib/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabaseTest.php b/tests/lib/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabaseTest.php index 789530d83d..6f88ba8adc 100644 --- a/tests/lib/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabaseTest.php +++ b/tests/lib/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabaseTest.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\Core\Persistence\Legacy\Content\Location\Gateway; use Doctrine\DBAL\FetchMode; @@ -126,7 +127,7 @@ public function testLoadParentLocationDataForDraftContentAll() $locationsData = $gateway->loadParentLocationsDataForDraftContent(226); - $this->assertCount(1, $locationsData); + self::assertCount(1, $locationsData); $locationRow = reset($locationsData); @@ -141,7 +142,7 @@ public function testLoadLocationDataByContentLimitSubtree() $locationsData = $gateway->loadLocationDataByContent(75, 3); - $this->assertCount(0, $locationsData); + self::assertCount(0, $locationsData); } public function testMoveSubtreePathUpdate() @@ -613,12 +614,13 @@ public static function getCreateLocationValues() /** * @depends testCreateLocation + * * @dataProvider getCreateLocationValues */ public function testCreateLocationValues($field, $value) { if ($value === null) { - $this->markTestIncomplete('Proper value setting yet unknown.'); + self::markTestIncomplete('Proper value setting yet unknown.'); } $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); @@ -672,12 +674,13 @@ public static function getCreateLocationReturnValues() /** * @depends testCreateLocation + * * @dataProvider getCreateLocationReturnValues */ public function testCreateLocationReturnValues($field, $value) { if ($value === null) { - $this->markTestIncomplete('Proper value setting yet unknown.'); + self::markTestIncomplete('Proper value setting yet unknown.'); } $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); @@ -701,8 +704,8 @@ public function testCreateLocationReturnValues($field, $value) ] ); - $this->assertTrue($location instanceof Location); - $this->assertEquals($value, $location->$field); + self::assertTrue($location instanceof Location); + self::assertEquals($value, $location->$field); } public static function getUpdateLocationData() @@ -821,6 +824,7 @@ private function buildContentTreeSelectContentWithParentQuery( /** * @depends testCreateLocation + * * @dataProvider getNodeAssignmentValues * * @param string $field @@ -994,6 +998,7 @@ public static function getConvertNodeAssignmentsLocationValues() /** * @depends testCreateLocationNodeAssignmentCreation + * * @dataProvider getConvertNodeAssignmentsLocationValues */ public function testConvertNodeAssignments($field, $value) @@ -1044,7 +1049,7 @@ public function testConvertNodeAssignments($field, $value) if ($field === 'modified_subnode') { $statement = $query->execute(); $result = $statement->fetch(FetchMode::ASSOCIATIVE); - $this->assertGreaterThanOrEqual($value, $result); + self::assertGreaterThanOrEqual($value, $result); } else { $this->assertQueryResult( [[$value]], @@ -1369,11 +1374,11 @@ public function testGetChildren() $gateway = $this->getLocationGateway(); $childrenRows = $gateway->getChildren(213); - $this->assertCount(2, $childrenRows); - $this->assertCount(16, $childrenRows[0]); - $this->assertEquals(214, $childrenRows[0]['node_id']); - $this->assertCount(16, $childrenRows[1]); - $this->assertEquals(215, $childrenRows[1]['node_id']); + self::assertCount(2, $childrenRows); + self::assertCount(16, $childrenRows[0]); + self::assertEquals(214, $childrenRows[0]['node_id']); + self::assertCount(16, $childrenRows[1]); + self::assertEquals(215, $childrenRows[1]['node_id']); } /** @@ -1418,9 +1423,9 @@ public function testGetFallbackMainNodeData(): void $gateway = $this->getLocationGateway(); $data = $gateway->getFallbackMainNodeData(12, 13); - $this->assertEquals(228, $data['node_id']); - $this->assertEquals(1, $data['contentobject_version']); - $this->assertEquals(227, $data['parent_node_id']); + self::assertEquals(228, $data['node_id']); + self::assertEquals(1, $data['contentobject_version']); + self::assertEquals(227, $data['parent_node_id']); } /** @@ -1435,7 +1440,7 @@ public function testRemoveLocation() try { $gateway->getBasicNodeData(13); - $this->fail('Location was not deleted!'); + self::fail('Location was not deleted!'); } catch (NotFoundException $e) { // Do nothing } diff --git a/tests/lib/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabaseTrashTest.php b/tests/lib/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabaseTrashTest.php index 322dfacd79..2bfa74636f 100644 --- a/tests/lib/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabaseTrashTest.php +++ b/tests/lib/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabaseTrashTest.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\Core\Persistence\Legacy\Content\Location\Gateway; use Doctrine\DBAL\ParameterType; @@ -193,7 +194,7 @@ public function testLoadTrashByLocationId($field, $value) $data = $handler->loadTrashByLocation(71); - $this->assertEquals( + self::assertEquals( $value, $data[$field], "Value in property $field not as expected." @@ -205,14 +206,14 @@ public function testCountTrashed() $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); $handler = $this->getLocationGateway(); - $this->assertEquals( + self::assertEquals( 0, $handler->countTrashed() ); $this->trashSubtree(); - $this->assertEquals( + self::assertEquals( 8, $handler->countTrashed() ); @@ -223,7 +224,7 @@ public function testListEmptyTrash() $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php'); $handler = $this->getLocationGateway(); - $this->assertEquals( + self::assertEquals( [], $handler->listTrashed(0, null, []) ); @@ -248,7 +249,7 @@ public function testListFullTrash() $handler = $this->getLocationGateway(); $this->trashSubtree(); - $this->assertCount( + self::assertCount( 8, $handler->listTrashed(0, null, []) ); @@ -260,7 +261,7 @@ public function testListTrashLimited() $handler = $this->getLocationGateway(); $this->trashSubtree(); - $this->assertCount( + self::assertCount( 5, $handler->listTrashed(0, 5, []) ); @@ -297,7 +298,7 @@ public function testListTrashItem($key, $value) $this->trashSubtree(); $trashList = $handler->listTrashed(0, 1, []); - $this->assertEquals($value, $trashList[0][$key]); + self::assertEquals($value, $trashList[0][$key]); } public function testListTrashSortedPathStringDesc() @@ -306,7 +307,7 @@ public function testListTrashSortedPathStringDesc() $handler = $this->getLocationGateway(); $this->trashSubtree(); - $this->assertEquals( + self::assertEquals( [ '/1/2/69/76/', '/1/2/69/72/75/', @@ -338,7 +339,7 @@ public function testListTrashSortedDepth() $handler = $this->getLocationGateway(); $this->trashSubtree(); - $this->assertEquals( + self::assertEquals( [ '/1/2/69/', '/1/2/69/76/', diff --git a/tests/lib/Persistence/Legacy/Content/Location/MapperTest.php b/tests/lib/Persistence/Legacy/Content/Location/MapperTest.php index e242ed5619..8327cab05a 100644 --- a/tests/lib/Persistence/Legacy/Content/Location/MapperTest.php +++ b/tests/lib/Persistence/Legacy/Content/Location/MapperTest.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\Core\Persistence\Legacy\Content\Location; use Ibexa\Contracts\Core\Persistence\Content\Location as SPILocation; @@ -103,9 +104,9 @@ public function testCreateLocationsFromRows() $locations = $mapper->createLocationsFromRows($inputRows); - $this->assertCount(3, $locations); + self::assertCount(3, $locations); foreach ($locations as $location) { - $this->assertInstanceOf( + self::assertInstanceOf( SPILocation::class, $location ); @@ -122,7 +123,7 @@ public function testCreateTrashedFromRow() new Trashed() ); - $this->assertTrue($location instanceof Trashed); + self::assertTrue($location instanceof Trashed); $this->assertPropertiesCorrect( $this->locationValues, $location @@ -156,7 +157,7 @@ public function testGetLocationCreateStruct() $this->locationRow ); - $this->assertNotEquals($this->locationRow['remote_id'], $createStruct->remoteId); + self::assertNotEquals($this->locationRow['remote_id'], $createStruct->remoteId); $this->assertPropertiesCorrect( $this->locationCreateStructValues, $createStruct diff --git a/tests/lib/Persistence/Legacy/Content/Location/TrashHandlerTest.php b/tests/lib/Persistence/Legacy/Content/Location/TrashHandlerTest.php index 1dd78d7b72..a50140801d 100644 --- a/tests/lib/Persistence/Legacy/Content/Location/TrashHandlerTest.php +++ b/tests/lib/Persistence/Legacy/Content/Location/TrashHandlerTest.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\Core\Persistence\Legacy\Content\Location; use Ibexa\Contracts\Core\Persistence\Content\Location\Trash\TrashResult; @@ -62,11 +63,11 @@ public function testTrashSubtree() $handler = $this->getTrashHandler(); $this->locationGateway - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('getSubtreeContent') ->with(20) ->will( - $this->returnValue( + self::returnValue( [ [ 'contentobject_id' => 10, @@ -85,43 +86,43 @@ public function testTrashSubtree() ); $this->locationGateway - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('countLocationsByContentId') ->with(10) - ->will($this->returnValue(1)); + ->will(self::returnValue(1)); $this->locationGateway - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('trashLocation') ->with(20); $this->locationGateway - ->expects($this->at(3)) + ->expects(self::at(3)) ->method('countLocationsByContentId') ->with(11) - ->will($this->returnValue(2)); + ->will(self::returnValue(2)); $this->locationGateway - ->expects($this->at(4)) + ->expects(self::at(4)) ->method('removeLocation') ->with(21); $this->locationHandler - ->expects($this->once()) + ->expects(self::once()) ->method('markSubtreeModified') ->with(40); $this->locationGateway - ->expects($this->at(5)) + ->expects(self::at(5)) ->method('loadTrashByLocation') ->with(20) - ->will($this->returnValue($array = ['data…'])); + ->will(self::returnValue($array = ['data…'])); $this->locationMapper - ->expects($this->once()) + ->expects(self::once()) ->method('createLocationFromRow') ->with($array, null, new Trashed()) - ->will($this->returnValue(new Trashed(['id' => 20]))); + ->will(self::returnValue(new Trashed(['id' => 20]))); $trashedObject = $handler->trashSubtree(20); self::assertInstanceOf(Trashed::class, $trashedObject); @@ -133,11 +134,11 @@ public function testTrashSubtreeReturnsNull() $handler = $this->getTrashHandler(); $this->locationGateway - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('getSubtreeContent') ->with(20) ->will( - $this->returnValue( + self::returnValue( [ [ 'contentobject_id' => 10, @@ -156,29 +157,29 @@ public function testTrashSubtreeReturnsNull() ); $this->locationGateway - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('countLocationsByContentId') ->with(10) - ->will($this->returnValue(2)); + ->will(self::returnValue(2)); $this->locationGateway - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('removeLocation') ->with(20); $this->locationGateway - ->expects($this->at(3)) + ->expects(self::at(3)) ->method('countLocationsByContentId') ->with(11) - ->will($this->returnValue(1)); + ->will(self::returnValue(1)); $this->locationGateway - ->expects($this->at(4)) + ->expects(self::at(4)) ->method('trashLocation') ->with(21); $this->locationHandler - ->expects($this->once()) + ->expects(self::once()) ->method('markSubtreeModified') ->with(40); @@ -191,11 +192,11 @@ public function testTrashSubtreeUpdatesMainLocation() $handler = $this->getTrashHandler(); $this->locationGateway - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('getSubtreeContent') ->with(20) ->will( - $this->returnValue( + self::returnValue( [ [ 'contentobject_id' => 10, @@ -214,33 +215,33 @@ public function testTrashSubtreeUpdatesMainLocation() ); $this->locationGateway - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('countLocationsByContentId') ->with(10) - ->will($this->returnValue(1)); + ->will(self::returnValue(1)); $this->locationGateway - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('trashLocation') ->with(20); $this->locationGateway - ->expects($this->at(3)) + ->expects(self::at(3)) ->method('countLocationsByContentId') ->with(11) - ->will($this->returnValue(2)); + ->will(self::returnValue(2)); $this->locationGateway - ->expects($this->at(4)) + ->expects(self::at(4)) ->method('removeLocation') ->with(21); $this->locationGateway - ->expects($this->at(5)) + ->expects(self::at(5)) ->method('getFallbackMainNodeData') ->with(11, 21) ->will( - $this->returnValue( + self::returnValue( [ 'node_id' => 100, 'contentobject_version' => 101, @@ -250,26 +251,26 @@ public function testTrashSubtreeUpdatesMainLocation() ); $this->locationHandler - ->expects($this->once()) + ->expects(self::once()) ->method('changeMainLocation') ->with(11, 100, 101, 102); $this->locationHandler - ->expects($this->once()) + ->expects(self::once()) ->method('markSubtreeModified') ->with(40); $this->locationGateway - ->expects($this->at(6)) + ->expects(self::at(6)) ->method('loadTrashByLocation') ->with(20) - ->will($this->returnValue($array = ['data…'])); + ->will(self::returnValue($array = ['data…'])); $this->locationMapper - ->expects($this->once()) + ->expects(self::once()) ->method('createLocationFromRow') ->with($array, null, new Trashed()) - ->will($this->returnValue(new Trashed(['id' => 20]))); + ->will(self::returnValue(new Trashed(['id' => 20]))); $trashedObject = $handler->trashSubtree(20); self::assertInstanceOf(Trashed::class, $trashedObject); @@ -281,11 +282,11 @@ public function testRecover() $handler = $this->getTrashHandler(); $this->locationGateway - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('untrashLocation') ->with(69, 23) ->will( - $this->returnValue( + self::returnValue( new Trashed(['id' => 70]) ) ); @@ -298,13 +299,13 @@ public function testLoadTrashItem() $handler = $this->getTrashHandler(); $this->locationGateway - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('loadTrashByLocation') ->with(69) - ->will($this->returnValue($array = ['data…'])); + ->will(self::returnValue($array = ['data…'])); $this->locationMapper - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('createLocationFromRow') ->with($array, null, new Trashed()); @@ -467,11 +468,11 @@ public function testDeleteTrashItemStillHaveLocations() $trashItemId = 69; $contentId = 67; $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('loadTrashByLocation') ->with($trashItemId) ->will( - $this->returnValue( + self::returnValue( [ 'node_id' => $trashItemId, 'contentobject_id' => $contentId, @@ -481,10 +482,10 @@ public function testDeleteTrashItemStillHaveLocations() ); $this->locationMapper - ->expects($this->once()) + ->expects(self::once()) ->method('createLocationFromRow') ->will( - $this->returnValue( + self::returnValue( new Trashed( [ 'id' => $trashItemId, @@ -496,26 +497,26 @@ public function testDeleteTrashItemStillHaveLocations() ); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('removeElementFromTrash') ->with($trashItemId); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('countLocationsByContentId') ->with($contentId) - ->will($this->returnValue(1)); + ->will(self::returnValue(1)); $this->contentHandler - ->expects($this->never()) + ->expects(self::never()) ->method('deleteContent'); $trashItemDeleteResult = $handler->deleteTrashItem($trashItemId); - $this->assertInstanceOf(TrashItemDeleteResult::class, $trashItemDeleteResult); - $this->assertEquals($trashItemId, $trashItemDeleteResult->trashItemId); - $this->assertEquals($contentId, $trashItemDeleteResult->contentId); - $this->assertFalse($trashItemDeleteResult->contentRemoved); + self::assertInstanceOf(TrashItemDeleteResult::class, $trashItemDeleteResult); + self::assertEquals($trashItemId, $trashItemDeleteResult->trashItemId); + self::assertEquals($contentId, $trashItemDeleteResult->contentId); + self::assertFalse($trashItemDeleteResult->contentRemoved); } public function testFindTrashItemsWhenEmpty() @@ -523,26 +524,26 @@ public function testFindTrashItemsWhenEmpty() $handler = $this->getTrashHandler(); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('countTrashed') ->willReturn(0); $this->locationGateway - ->expects($this->never()) + ->expects(self::never()) ->method('listTrashed'); $this->locationMapper - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $trashResult = $handler->findTrashItems(); - $this->assertInstanceOf(TrashResult::class, $trashResult); - $this->assertEquals(0, $trashResult->totalCount); - $this->assertIsArray($trashResult->items); - $this->assertEmpty($trashResult->items); - $this->assertIsIterable($trashResult); - $this->assertCount(0, $trashResult);// Can't assert as empty, however we can count it. + self::assertInstanceOf(TrashResult::class, $trashResult); + self::assertEquals(0, $trashResult->totalCount); + self::assertIsArray($trashResult->items); + self::assertEmpty($trashResult->items); + self::assertIsIterable($trashResult); + self::assertCount(0, $trashResult);// Can't assert as empty, however we can count it. } public function testFindTrashItemsWithLimits() @@ -550,30 +551,30 @@ public function testFindTrashItemsWithLimits() $handler = $this->getTrashHandler(); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('countTrashed') ->willReturn(2); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('listTrashed') ->with(1, 1, null) ->willReturn([['fake data']]); $this->locationMapper - ->expects($this->once()) + ->expects(self::once()) ->method('createLocationFromRow') ->with(['fake data']) ->willReturn(new \stdClass()); $trashResult = $handler->findTrashItems(null, 1, 1); - $this->assertInstanceOf(TrashResult::class, $trashResult); - $this->assertEquals(2, $trashResult->totalCount); - $this->assertIsArray($trashResult->items); - $this->assertCount(1, $trashResult->items); - $this->assertIsIterable($trashResult); - $this->assertCount(1, $trashResult); + self::assertInstanceOf(TrashResult::class, $trashResult); + self::assertEquals(2, $trashResult->totalCount); + self::assertIsArray($trashResult->items); + self::assertCount(1, $trashResult->items); + self::assertIsIterable($trashResult); + self::assertCount(1, $trashResult); } } diff --git a/tests/lib/Persistence/Legacy/Content/LocationHandlerTest.php b/tests/lib/Persistence/Legacy/Content/LocationHandlerTest.php index 6b971543cc..acadd29f66 100644 --- a/tests/lib/Persistence/Legacy/Content/LocationHandlerTest.php +++ b/tests/lib/Persistence/Legacy/Content/LocationHandlerTest.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\Core\Persistence\Legacy\Content; use Ibexa\Contracts\Core\Persistence\Content; @@ -89,7 +90,7 @@ public function testLoadLocation() $handler = $this->getLocationHandler(); $this->treeHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') ->with(77) ->willReturn(new Location()); @@ -102,11 +103,11 @@ public function testLoadLocation() public function testLoadLocationSubtree() { $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('getSubtreeContent') ->with(77, true) ->will( - $this->returnValue( + self::returnValue( [ [77 => 100], [78 => 101], @@ -114,7 +115,7 @@ public function testLoadLocationSubtree() ) ); - $this->assertCount(2, $this->getLocationHandler()->loadSubtreeIds(77)); + self::assertCount(2, $this->getLocationHandler()->loadSubtreeIds(77)); } public function testLoadLocationByRemoteId() @@ -122,7 +123,7 @@ public function testLoadLocationByRemoteId() $handler = $this->getLocationHandler(); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('getBasicNodeDataByRemoteId') ->with('abc123') ->willReturn( @@ -132,7 +133,7 @@ public function testLoadLocationByRemoteId() ); $this->locationMapper - ->expects($this->once()) + ->expects(self::once()) ->method('createLocationFromRow') ->with(['node_id' => 77]) ->willReturn(new Location()); @@ -147,24 +148,24 @@ public function testLoadLocationsByContent() $handler = $this->getLocationHandler(); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocationDataByContent') ->with(23, 42) ->will( - $this->returnValue( + self::returnValue( [] ) ); $this->locationMapper - ->expects($this->once()) + ->expects(self::once()) ->method('createLocationsFromRows') ->with([]) - ->will($this->returnValue(['a', 'b'])); + ->will(self::returnValue(['a', 'b'])); $locations = $handler->loadLocationsByContent(23, 42); - $this->assertIsArray($locations); + self::assertIsArray($locations); } public function loadParentLocationsForDraftContent() @@ -172,24 +173,24 @@ public function loadParentLocationsForDraftContent() $handler = $this->getLocationHandler(); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('loadParentLocationsDataForDraftContent') ->with(23) ->will( - $this->returnValue( + self::returnValue( [] ) ); $this->locationMapper - ->expects($this->once()) + ->expects(self::once()) ->method('createLocationsFromRows') ->with([]) - ->will($this->returnValue(['a', 'b'])); + ->will(self::returnValue(['a', 'b'])); $locations = $handler->loadParentLocationsForDraftContent(23); - $this->assertIsArray($locations); + self::assertIsArray($locations); } public function testMoveSubtree() @@ -203,10 +204,10 @@ public function testMoveSubtree() 'contentobject_id' => 67, ]; $this->locationGateway - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('getBasicNodeData') ->with(69) - ->will($this->returnValue($sourceData)); + ->will(self::returnValue($sourceData)); $destinationData = [ 'node_id' => 77, @@ -214,26 +215,26 @@ public function testMoveSubtree() 'contentobject_id' => 68, ]; $this->locationGateway - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('getBasicNodeData') ->with(77) - ->will($this->returnValue($destinationData)); + ->will(self::returnValue($destinationData)); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('moveSubtreeNodes') ->with($sourceData, $destinationData); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('updateNodeAssignment') ->with(67, 2, 77, 5); $this->treeHandler - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('loadLocation') ->with($sourceData['node_id']) - ->will($this->returnValue( + ->will(self::returnValue( new Location( [ 'id' => $sourceData['node_id'], @@ -243,25 +244,25 @@ public function testMoveSubtree() )); $this->treeHandler - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('loadLocation') ->with($destinationData['node_id']) - ->will($this->returnValue(new Location(['contentId' => $destinationData['contentobject_id']]))); + ->will(self::returnValue(new Location(['contentId' => $destinationData['contentobject_id']]))); $this->contentHandler - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('loadContentInfo') ->with($destinationData['contentobject_id']) - ->will($this->returnValue(new ContentInfo(['sectionId' => 12345]))); + ->will(self::returnValue(new ContentInfo(['sectionId' => 12345]))); $this->contentHandler - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('loadContentInfo') ->with($sourceData['contentobject_id']) - ->will($this->returnValue(new ContentInfo(['mainLocationId' => 69]))); + ->will(self::returnValue(new ContentInfo(['mainLocationId' => 69]))); $this->treeHandler - ->expects($this->once()) + ->expects(self::once()) ->method('setSectionForSubtree') ->with(69, 12345); @@ -273,11 +274,11 @@ public function testHideUpdateHidden() $handler = $this->getLocationHandler(); $this->locationGateway - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('getBasicNodeData') ->with(69) ->will( - $this->returnValue( + self::returnValue( [ 'node_id' => 69, 'path_string' => '/1/2/69/', @@ -287,7 +288,7 @@ public function testHideUpdateHidden() ); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('hideSubtree') ->with('/1/2/69/'); @@ -302,11 +303,11 @@ public function testHideUnhideUpdateHidden() $handler = $this->getLocationHandler(); $this->locationGateway - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('getBasicNodeData') ->with(69) ->will( - $this->returnValue( + self::returnValue( [ 'node_id' => 69, 'path_string' => '/1/2/69/', @@ -316,7 +317,7 @@ public function testHideUnhideUpdateHidden() ); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('unhideSubtree') ->with('/1/2/69/'); @@ -328,7 +329,7 @@ public function testSwapLocations() $handler = $this->getLocationHandler(); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('swap') ->with(70, 78); @@ -347,11 +348,11 @@ public function testCreateLocation() $spiLocation->pathString = '/1/2/77/78/'; $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('getBasicNodeData') ->with(77) ->will( - $this->returnValue( + self::returnValue( $parentInfo = [ 'node_id' => 77, 'path_string' => '/1/2/77/', @@ -360,13 +361,13 @@ public function testCreateLocation() ); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('create') ->with($createStruct, $parentInfo) - ->will($this->returnValue($spiLocation)); + ->will(self::returnValue($spiLocation)); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('createNodeAssignment') ->with($createStruct, 77, 2); @@ -381,7 +382,7 @@ public function testUpdateLocation() $updateStruct->priority = 77; $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('update') ->with($updateStruct, 23); @@ -393,7 +394,7 @@ public function testSetSectionForSubtree() $handler = $this->getLocationHandler(); $this->treeHandler - ->expects($this->once()) + ->expects(self::once()) ->method('setSectionForSubtree') ->with(69, 3); @@ -405,11 +406,11 @@ public function testMarkSubtreeModified() $handler = $this->getLocationHandler(); $this->locationGateway - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('getBasicNodeData') ->with(69) ->will( - $this->returnValue( + self::returnValue( [ 'node_id' => 69, 'path_string' => '/1/2/69/', @@ -419,7 +420,7 @@ public function testMarkSubtreeModified() ); $this->locationGateway - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('updateSubtreeModificationTime') ->with('/1/2/69/'); @@ -431,7 +432,7 @@ public function testChangeMainLocation() $handler = $this->getLocationHandler(); $this->treeHandler - ->expects($this->once()) + ->expects(self::once()) ->method('changeMainLocation') ->with(12, 34); @@ -446,7 +447,7 @@ public function testRemoveSubtree() $handler = $this->getLocationHandler(); $this->treeHandler - ->expects($this->once()) + ->expects(self::once()) ->method('removeSubtree') ->with(42); @@ -481,43 +482,43 @@ public function testCopySubtree() $offset = 1000; $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('getSubtreeContent') ->with($subtreeContentRows[0]['node_id']) - ->will($this->returnValue($subtreeContentRows)); + ->will(self::returnValue($subtreeContentRows)); $this->locationGateway - ->expects($this->once()) + ->expects(self::once()) ->method('getBasicNodeData') ->with($destinationData['node_id']) - ->will($this->returnValue($destinationData)); + ->will(self::returnValue($destinationData)); $objectStateHandlerCall = 0; - $this->objectStateHandler->expects($this->at($objectStateHandlerCall++)) + $this->objectStateHandler->expects(self::at($objectStateHandlerCall++)) ->method('loadAllGroups') ->will( - $this->returnValue( + self::returnValue( [ new ObjectStateGroup(['id' => 10]), new ObjectStateGroup(['id' => 20]), ] ) ); - $this->objectStateHandler->expects($this->at($objectStateHandlerCall++)) + $this->objectStateHandler->expects(self::at($objectStateHandlerCall++)) ->method('loadObjectStates') - ->with($this->equalTo(10)) + ->with(self::equalTo(10)) ->will( - $this->returnValue( + self::returnValue( [ new ObjectState(['id' => 11, 'groupId' => 10]), new ObjectState(['id' => 12, 'groupId' => 10]), ] ) ); - $this->objectStateHandler->expects($this->at($objectStateHandlerCall++)) + $this->objectStateHandler->expects(self::at($objectStateHandlerCall++)) ->method('loadObjectStates') - ->with($this->equalTo(20)) + ->with(self::equalTo(20)) ->will( - $this->returnValue( + self::returnValue( [ new ObjectState(['id' => 21, 'groupId' => 20]), new ObjectState(['id' => 22, 'groupId' => 20]), @@ -536,11 +537,11 @@ public function testCopySubtree() ); foreach ($contentIds as $index => $contentId) { $this->contentHandler - ->expects($this->at($index * 2)) + ->expects(self::at($index * 2)) ->method('copy') ->with($contentId, 1) ->will( - $this->returnValue( + self::returnValue( new Content( [ 'versionInfo' => new VersionInfo( @@ -559,7 +560,7 @@ public function testCopySubtree() ); foreach ($defaultObjectStates as $objectState) { - $this->objectStateHandler->expects($this->at($objectStateHandlerCall++)) + $this->objectStateHandler->expects(self::at($objectStateHandlerCall++)) ->method('setContentState') ->with( $contentId + $offset, @@ -569,15 +570,15 @@ public function testCopySubtree() } $this->contentHandler - ->expects($this->at($index * 2 + 1)) + ->expects(self::at($index * 2 + 1)) ->method('publish') ->with( $contentId + $offset, 1, - $this->isInstanceOf(Content\MetadataUpdateStruct::class) + self::isInstanceOf(Content\MetadataUpdateStruct::class) ) ->will( - $this->returnValue( + self::returnValue( new Content( [ 'versionInfo' => new VersionInfo( @@ -601,10 +602,10 @@ public function testCopySubtree() $mapper = new Mapper(); $createStruct = $mapper->getLocationCreateStruct($row); $this->locationMapper - ->expects($this->at($index)) + ->expects(self::at($index)) ->method('getLocationCreateStruct') ->with($row) - ->will($this->returnValue($createStruct)); + ->will(self::returnValue($createStruct)); $createStruct = clone $createStruct; $createStruct->contentId = $createStruct->contentId + $offset; @@ -614,11 +615,11 @@ public function testCopySubtree() $createStruct->pathIdentificationString = $pathStrings[$createStruct->parentId] . '/' . $row['path_identification_string']; $pathStrings[$row['node_id'] + $offset] = $createStruct->pathIdentificationString; $handler - ->expects($this->at($index)) + ->expects(self::at($index)) ->method('create') ->with($createStruct) ->will( - $this->returnValue( + self::returnValue( new Location( [ 'id' => $row['node_id'] + $offset, @@ -634,31 +635,31 @@ public function testCopySubtree() foreach ($updateMainLocationsMap as $contentId => $locationId) { $handler - ->expects($this->any()) + ->expects(self::any()) ->method('changeMainLocation') ->with($contentId, $locationId); } $handler - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with($destinationData['node_id']) - ->will($this->returnValue(new Location(['contentId' => $destinationData['contentobject_id']]))); + ->will(self::returnValue(new Location(['contentId' => $destinationData['contentobject_id']]))); $this->contentHandler - ->expects($this->at($lastContentHandlerIndex + 1)) + ->expects(self::at($lastContentHandlerIndex + 1)) ->method('loadContentInfo') ->with($destinationData['contentobject_id']) - ->will($this->returnValue(new ContentInfo(['sectionId' => 12345]))); + ->will(self::returnValue(new ContentInfo(['sectionId' => 12345]))); $this->contentHandler - ->expects($this->at($lastContentHandlerIndex + 2)) + ->expects(self::at($lastContentHandlerIndex + 2)) ->method('loadContentInfo') ->with(21) - ->will($this->returnValue(new ContentInfo(['mainLocationId' => 1010]))); + ->will(self::returnValue(new ContentInfo(['mainLocationId' => 1010]))); $handler - ->expects($this->once()) + ->expects(self::once()) ->method('setSectionForSubtree') ->with($subtreeContentRows[0]['node_id'] + $offset, 12345); diff --git a/tests/lib/Persistence/Legacy/Content/MapperTest.php b/tests/lib/Persistence/Legacy/Content/MapperTest.php index 806767f9e4..a8927a98c4 100644 --- a/tests/lib/Persistence/Legacy/Content/MapperTest.php +++ b/tests/lib/Persistence/Legacy/Content/MapperTest.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\Core\Persistence\Legacy\Content; use function count; @@ -87,8 +88,8 @@ public function testCreateVersionInfoForContent() ], $versionInfo ); - $this->assertGreaterThanOrEqual($time, $versionInfo->creationDate); - $this->assertGreaterThanOrEqual($time, $versionInfo->modificationDate); + self::assertGreaterThanOrEqual($time, $versionInfo->creationDate); + self::assertGreaterThanOrEqual($time, $versionInfo->modificationDate); } /** @@ -123,16 +124,16 @@ protected function getFullContentFixture() public function testConvertToStorageValue() { $convMock = $this->createMock(Converter::class); - $convMock->expects($this->once()) + $convMock->expects(self::once()) ->method('toStorageValue') ->with( - $this->isInstanceOf( + self::isInstanceOf( FieldValue::class ), - $this->isInstanceOf( + self::isInstanceOf( StorageFieldValue::class ) - )->will($this->returnValue(new StorageFieldValue())); + )->will(self::returnValue(new StorageFieldValue())); $reg = new Registry(['some-type' => $convMock]); @@ -143,7 +144,7 @@ public function testConvertToStorageValue() $mapper = new Mapper($reg, $this->getLanguageHandler()); $res = $mapper->convertToStorageValue($field); - $this->assertInstanceOf( + self::assertInstanceOf( StorageFieldValue::class, $res ); @@ -155,14 +156,14 @@ public function testExtractContentFromRows() $nameRowsFixture = $this->getNamesExtractFixture(); $convMock = $this->createMock(Converter::class); - $convMock->expects($this->exactly(count($rowsFixture))) + $convMock->expects(self::exactly(count($rowsFixture))) ->method('toFieldValue') ->with( - $this->isInstanceOf( + self::isInstanceOf( StorageFieldValue::class ) )->will( - $this->returnValue( + self::returnValue( new FieldValue() ) ); @@ -181,7 +182,7 @@ public function testExtractContentFromRows() $mapper = new Mapper($reg, $this->getLanguageHandler()); $result = $mapper->extractContentFromRows($rowsFixture, $nameRowsFixture); - $this->assertEquals( + self::assertEquals( [ $this->getContentExtractReference(), ], @@ -192,9 +193,9 @@ public function testExtractContentFromRows() public function testExtractContentFromRowsMultipleVersions() { $convMock = $this->createMock(Converter::class); - $convMock->expects($this->any()) + $convMock->expects(self::any()) ->method('toFieldValue') - ->will($this->returnValue(new FieldValue())); + ->will(self::returnValue(new FieldValue())); $reg = new Registry( [ @@ -209,25 +210,25 @@ public function testExtractContentFromRowsMultipleVersions() $mapper = new Mapper($reg, $this->getLanguageHandler()); $result = $mapper->extractContentFromRows($rowsFixture, $nameRowsFixture); - $this->assertCount( + self::assertCount( 2, $result ); - $this->assertEquals( + self::assertEquals( 11, $result[0]->versionInfo->contentInfo->id ); - $this->assertEquals( + self::assertEquals( 11, $result[1]->versionInfo->contentInfo->id ); - $this->assertEquals( + self::assertEquals( 1, $result[0]->versionInfo->versionNo ); - $this->assertEquals( + self::assertEquals( 2, $result[1]->versionInfo->versionNo ); @@ -242,7 +243,7 @@ public function testCreateCreateStructFromContent() $struct = $mapper->createCreateStructFromContent($content); - $this->assertInstanceOf(CreateStruct::class, $struct); + self::assertInstanceOf(CreateStruct::class, $struct); return [ 'original' => $content, @@ -279,7 +280,7 @@ public function testCreateCreateStructFromContentBasicProperties($data) */ public function testCreateCreateStructFromContentParentLocationsEmpty($data) { - $this->assertEquals( + self::assertEquals( [], $data['result']->locations ); @@ -290,7 +291,7 @@ public function testCreateCreateStructFromContentParentLocationsEmpty($data) */ public function testCreateCreateStructFromContentFieldCount($data) { - $this->assertEquals( + self::assertEquals( count($data['original']->fields), count($data['result']->fields) ); @@ -302,7 +303,7 @@ public function testCreateCreateStructFromContentFieldCount($data) public function testCreateCreateStructFromContentFieldsNoId($data) { foreach ($data['result']->fields as $field) { - $this->assertNull($field->id); + self::assertNull($field->id); } } @@ -314,7 +315,7 @@ public function testExtractRelationsFromRows() $res = $mapper->extractRelationsFromRows($rows); - $this->assertEquals( + self::assertEquals( $this->getRelationExtractReference(), $res ); @@ -330,7 +331,7 @@ public function testCreateCreateStructFromContentWithPreserveOriginalLanguage() $struct = $mapper->createCreateStructFromContent($content, true); - $this->assertInstanceOf(CreateStruct::class, $struct); + self::assertInstanceOf(CreateStruct::class, $struct); $this->assertStructsEqual($content->versionInfo->contentInfo, $struct, ['sectionId', 'ownerId']); self::assertNotEquals($content->versionInfo->contentInfo->remoteId, $struct->remoteId); self::assertSame($content->versionInfo->contentInfo->contentTypeId, $struct->typeId); @@ -570,10 +571,10 @@ protected function getLanguageHandler() if (!isset($this->languageHandler)) { $this->languageHandler = $this->createMock(Language\Handler::class); - $this->languageHandler->expects($this->any()) + $this->languageHandler->expects(self::any()) ->method('load') ->will( - $this->returnCallback( + self::returnCallback( static function ($id) use ($languages) { foreach ($languages as $language) { if ($language->id == $id) { @@ -583,10 +584,10 @@ static function ($id) use ($languages) { } ) ); - $this->languageHandler->expects($this->any()) + $this->languageHandler->expects(self::any()) ->method('loadByLanguageCode') ->will( - $this->returnCallback( + self::returnCallback( static function ($languageCode) use ($languages) { foreach ($languages as $language) { if ($language->languageCode == $languageCode) { @@ -596,7 +597,7 @@ static function ($languageCode) use ($languages) { } ) ); - $this->languageHandler->expects($this->any()) + $this->languageHandler->expects(self::any()) ->method('loadAll') ->willReturn($languages); } diff --git a/tests/lib/Persistence/Legacy/Content/ObjectState/Gateway/DoctrineDatabaseTest.php b/tests/lib/Persistence/Legacy/Content/ObjectState/Gateway/DoctrineDatabaseTest.php index 1105684cad..bb54908de3 100644 --- a/tests/lib/Persistence/Legacy/Content/ObjectState/Gateway/DoctrineDatabaseTest.php +++ b/tests/lib/Persistence/Legacy/Content/ObjectState/Gateway/DoctrineDatabaseTest.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\Core\Persistence\Legacy\Content\ObjectState\Gateway; use Ibexa\Contracts\Core\Persistence\Content\ObjectState; @@ -52,7 +53,7 @@ public function testLoadObjectStateData() $result = $gateway->loadObjectStateData(1); - $this->assertEquals( + self::assertEquals( [ [ 'ezcobj_state_default_language_id' => 2, @@ -76,7 +77,7 @@ public function testLoadObjectStateDataByIdentifier() $result = $gateway->loadObjectStateDataByIdentifier('not_locked', 2); - $this->assertEquals( + self::assertEquals( [ [ 'ezcobj_state_default_language_id' => 2, @@ -100,7 +101,7 @@ public function testLoadObjectStateListData() $result = $gateway->loadObjectStateListData(2); - $this->assertEquals( + self::assertEquals( [ [ [ @@ -139,7 +140,7 @@ public function testLoadObjectStateGroupData() $result = $gateway->loadObjectStateGroupData(2); - $this->assertEquals( + self::assertEquals( [ [ 'ezcobj_state_group_default_language_id' => 2, @@ -162,7 +163,7 @@ public function testLoadObjectStateGroupDataByIdentifier() $result = $gateway->loadObjectStateGroupDataByIdentifier('ez_lock'); - $this->assertEquals( + self::assertEquals( [ [ 'ezcobj_state_group_default_language_id' => 2, @@ -185,7 +186,7 @@ public function testLoadObjectStateGroupListData() $result = $gateway->loadObjectStateGroupListData(0, -1); - $this->assertEquals( + self::assertEquals( [ [ [ @@ -210,7 +211,7 @@ public function testInsertObjectState() $gateway->insertObjectState($this->getObjectStateFixture(), 2); - $this->assertEquals( + self::assertEquals( [ [ 'ezcobj_state_default_language_id' => 4, @@ -238,7 +239,7 @@ public function testInsertObjectStateInEmptyGroup() $gateway->insertObjectStateGroup($this->getObjectStateGroupFixture()); $gateway->insertObjectState($this->getObjectStateFixture(), 3); - $this->assertEquals( + self::assertEquals( [ [ 'ezcobj_state_default_language_id' => 4, @@ -259,7 +260,7 @@ public function testInsertObjectStateInEmptyGroup() $this->getDatabaseGateway()->loadObjectStateData(3) ); - $this->assertEquals( + self::assertEquals( // 185 is the number of objects in the fixture 185, $gateway->getContentCount(3) @@ -275,7 +276,7 @@ public function testUpdateObjectState() $gateway->updateObjectState($objectStateFixture); - $this->assertEquals( + self::assertEquals( [ [ 'ezcobj_state_default_language_id' => 4, @@ -299,7 +300,7 @@ public function testDeleteObjectState() $gateway->deleteObjectState(1); - $this->assertEquals( + self::assertEquals( [], $this->getDatabaseGateway()->loadObjectStateData(1) ); @@ -330,7 +331,7 @@ public function testInsertObjectStateGroup() $gateway->insertObjectStateGroup($this->getObjectStateGroupFixture()); - $this->assertEquals( + self::assertEquals( [ [ 'ezcobj_state_group_default_language_id' => 4, @@ -358,7 +359,7 @@ public function testUpdateObjectStateGroup() $gateway->updateObjectStateGroup($groupFixture); - $this->assertEquals( + self::assertEquals( [ [ 'ezcobj_state_group_default_language_id' => 4, @@ -381,7 +382,7 @@ public function testDeleteObjectStateGroup() $gateway->deleteObjectStateGroup(2); - $this->assertEquals( + self::assertEquals( [], $this->getDatabaseGateway()->loadObjectStateGroupData(2) ); @@ -413,7 +414,7 @@ public function testLoadObjectStateDataForContent() $result = $gateway->loadObjectStateDataForContent(42, 2); - $this->assertEquals( + self::assertEquals( [ [ 'ezcobj_state_default_language_id' => 2, @@ -438,7 +439,7 @@ public function testGetContentCount() $result = $gateway->getContentCount(1); // 185 is the number of objects in the fixture - $this->assertEquals(185, $result); + self::assertEquals(185, $result); } public function testUpdateObjectStatePriority() @@ -449,7 +450,7 @@ public function testUpdateObjectStatePriority() $objectStateData = $gateway->loadObjectStateData(1); - $this->assertEquals( + self::assertEquals( [ [ 'ezcobj_state_default_language_id' => 2, diff --git a/tests/lib/Persistence/Legacy/Content/ObjectState/MapperTest.php b/tests/lib/Persistence/Legacy/Content/ObjectState/MapperTest.php index 0ed86adc50..1426d2ac4b 100644 --- a/tests/lib/Persistence/Legacy/Content/ObjectState/MapperTest.php +++ b/tests/lib/Persistence/Legacy/Content/ObjectState/MapperTest.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\Core\Persistence\Legacy\Content\ObjectState; use Ibexa\Contracts\Core\Persistence\Content\ObjectState; diff --git a/tests/lib/Persistence/Legacy/Content/ObjectState/ObjectStateHandlerTest.php b/tests/lib/Persistence/Legacy/Content/ObjectState/ObjectStateHandlerTest.php index 075e4b50b6..7839ed657b 100644 --- a/tests/lib/Persistence/Legacy/Content/ObjectState/ObjectStateHandlerTest.php +++ b/tests/lib/Persistence/Legacy/Content/ObjectState/ObjectStateHandlerTest.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\Core\Persistence\Legacy\Content\ObjectState; use Ibexa\Contracts\Core\Persistence\Content\ObjectState; @@ -48,19 +49,19 @@ public function testCreateGroup() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateGroupFromInputStruct') - ->with($this->equalTo($this->getInputStructFixture())) - ->will($this->returnValue($this->getObjectStateGroupFixture())); + ->with(self::equalTo($this->getInputStructFixture())) + ->will(self::returnValue($this->getObjectStateGroupFixture())); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('insertObjectStateGroup') - ->with($this->equalTo($this->getObjectStateGroupFixture())) - ->will($this->returnValue($this->getObjectStateGroupFixture())); + ->with(self::equalTo($this->getObjectStateGroupFixture())) + ->will(self::returnValue($this->getObjectStateGroupFixture())); $result = $handler->createGroup($this->getInputStructFixture()); - $this->assertInstanceOf( + self::assertInstanceOf( Group::class, $result ); @@ -72,19 +73,19 @@ public function testLoadGroup() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateGroupData') - ->with($this->equalTo(2)) - ->will($this->returnValue([[]])); + ->with(self::equalTo(2)) + ->will(self::returnValue([[]])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateGroupFromData') - ->with($this->equalTo([[]])) - ->will($this->returnValue($this->getObjectStateGroupFixture())); + ->with(self::equalTo([[]])) + ->will(self::returnValue($this->getObjectStateGroupFixture())); $result = $handler->loadGroup(2); - $this->assertInstanceOf( + self::assertInstanceOf( Group::class, $result ); @@ -97,10 +98,10 @@ public function testLoadGroupThrowsNotFoundException() $handler = $this->getObjectStateHandler(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateGroupData') - ->with($this->equalTo(APIBaseTest::DB_INT_MAX)) - ->will($this->returnValue([])); + ->with(self::equalTo(APIBaseTest::DB_INT_MAX)) + ->will(self::returnValue([])); $handler->loadGroup(APIBaseTest::DB_INT_MAX); } @@ -111,19 +112,19 @@ public function testLoadGroupByIdentifier() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateGroupDataByIdentifier') - ->with($this->equalTo('ez_lock')) - ->will($this->returnValue([[]])); + ->with(self::equalTo('ez_lock')) + ->will(self::returnValue([[]])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateGroupFromData') - ->with($this->equalTo([[]])) - ->will($this->returnValue($this->getObjectStateGroupFixture())); + ->with(self::equalTo([[]])) + ->will(self::returnValue($this->getObjectStateGroupFixture())); $result = $handler->loadGroupByIdentifier('ez_lock'); - $this->assertInstanceOf( + self::assertInstanceOf( Group::class, $result ); @@ -136,10 +137,10 @@ public function testLoadGroupByIdentifierThrowsNotFoundException() $handler = $this->getObjectStateHandler(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateGroupDataByIdentifier') - ->with($this->equalTo('unknown')) - ->will($this->returnValue([])); + ->with(self::equalTo('unknown')) + ->will(self::returnValue([])); $handler->loadGroupByIdentifier('unknown'); } @@ -150,20 +151,20 @@ public function testLoadAllGroups() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateGroupListData') - ->with($this->equalTo(0), $this->equalTo(-1)) - ->will($this->returnValue([[]])); + ->with(self::equalTo(0), self::equalTo(-1)) + ->will(self::returnValue([[]])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateGroupListFromData') - ->with($this->equalTo([[]])) - ->will($this->returnValue([$this->getObjectStateGroupFixture()])); + ->with(self::equalTo([[]])) + ->will(self::returnValue([$this->getObjectStateGroupFixture()])); $result = $handler->loadAllGroups(); foreach ($result as $resultItem) { - $this->assertInstanceOf( + self::assertInstanceOf( Group::class, $resultItem ); @@ -176,20 +177,20 @@ public function testLoadObjectStates() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateListData') - ->with($this->equalTo(2)) - ->will($this->returnValue([[]])); + ->with(self::equalTo(2)) + ->will(self::returnValue([[]])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateListFromData') - ->with($this->equalTo([[]])) - ->will($this->returnValue([$this->getObjectStateFixture(), $this->getObjectStateFixture()])); + ->with(self::equalTo([[]])) + ->will(self::returnValue([$this->getObjectStateFixture(), $this->getObjectStateFixture()])); $result = $handler->loadObjectStates(2); foreach ($result as $resultItem) { - $this->assertInstanceOf( + self::assertInstanceOf( ObjectState::class, $resultItem ); @@ -202,28 +203,28 @@ public function testUpdateGroup() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateGroupFromInputStruct') - ->with($this->equalTo($this->getInputStructFixture())) - ->will($this->returnValue($this->getObjectStateGroupFixture())); + ->with(self::equalTo($this->getInputStructFixture())) + ->will(self::returnValue($this->getObjectStateGroupFixture())); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('updateObjectStateGroup') - ->with($this->equalTo(new Group(['id' => 2]))); + ->with(self::equalTo(new Group(['id' => 2]))); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateGroupData') - ->with($this->equalTo(2)) - ->will($this->returnValue([[]])); + ->with(self::equalTo(2)) + ->will(self::returnValue([[]])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateGroupFromData') - ->with($this->equalTo([[]])) - ->will($this->returnValue($this->getObjectStateGroupFixture())); + ->with(self::equalTo([[]])) + ->will(self::returnValue($this->getObjectStateGroupFixture())); $result = $handler->updateGroup(2, $this->getInputStructFixture()); - $this->assertInstanceOf( + self::assertInstanceOf( Group::class, $result ); @@ -235,16 +236,16 @@ public function testDeleteGroup() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateListData') - ->with($this->equalTo(2)) - ->will($this->returnValue([[]])); + ->with(self::equalTo(2)) + ->will(self::returnValue([[]])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateListFromData') - ->with($this->equalTo([[]])) + ->with(self::equalTo([[]])) ->will( - $this->returnValue( + self::returnValue( [ new ObjectState(['id' => 1]), new ObjectState(['id' => 2]), @@ -252,31 +253,31 @@ public function testDeleteGroup() ) ); - $gatewayMock->expects($this->exactly(2)) + $gatewayMock->expects(self::exactly(2)) ->method('deleteObjectStateLinks'); - $gatewayMock->expects($this->exactly(2)) + $gatewayMock->expects(self::exactly(2)) ->method('deleteObjectState'); - $gatewayMock->expects($this->at(1)) + $gatewayMock->expects(self::at(1)) ->method('deleteObjectStateLinks') - ->with($this->equalTo(1)); + ->with(self::equalTo(1)); - $gatewayMock->expects($this->at(2)) + $gatewayMock->expects(self::at(2)) ->method('deleteObjectState') - ->with($this->equalTo(1)); + ->with(self::equalTo(1)); - $gatewayMock->expects($this->at(3)) + $gatewayMock->expects(self::at(3)) ->method('deleteObjectStateLinks') - ->with($this->equalTo(2)); + ->with(self::equalTo(2)); - $gatewayMock->expects($this->at(4)) + $gatewayMock->expects(self::at(4)) ->method('deleteObjectState') - ->with($this->equalTo(2)); + ->with(self::equalTo(2)); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('deleteObjectStateGroup') - ->with($this->equalTo(2)); + ->with(self::equalTo(2)); $handler->deleteGroup(2); } @@ -287,19 +288,19 @@ public function testCreate() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateFromInputStruct') - ->with($this->equalTo($this->getInputStructFixture())) - ->will($this->returnValue($this->getObjectStateFixture())); + ->with(self::equalTo($this->getInputStructFixture())) + ->will(self::returnValue($this->getObjectStateFixture())); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('insertObjectState') - ->with($this->equalTo($this->getObjectStateFixture()), $this->equalTo(2)) - ->will($this->returnValue($this->getObjectStateFixture())); + ->with(self::equalTo($this->getObjectStateFixture()), self::equalTo(2)) + ->will(self::returnValue($this->getObjectStateFixture())); $result = $handler->create(2, $this->getInputStructFixture()); - $this->assertInstanceOf( + self::assertInstanceOf( ObjectState::class, $result ); @@ -311,19 +312,19 @@ public function testLoad() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateData') - ->with($this->equalTo(1)) - ->will($this->returnValue([[]])); + ->with(self::equalTo(1)) + ->will(self::returnValue([[]])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateFromData') - ->with($this->equalTo([[]])) - ->will($this->returnValue($this->getObjectStateFixture())); + ->with(self::equalTo([[]])) + ->will(self::returnValue($this->getObjectStateFixture())); $result = $handler->load(1); - $this->assertInstanceOf( + self::assertInstanceOf( ObjectState::class, $result ); @@ -336,10 +337,10 @@ public function testLoadThrowsNotFoundException() $handler = $this->getObjectStateHandler(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateData') - ->with($this->equalTo(APIBaseTest::DB_INT_MAX)) - ->will($this->returnValue([])); + ->with(self::equalTo(APIBaseTest::DB_INT_MAX)) + ->will(self::returnValue([])); $handler->load(APIBaseTest::DB_INT_MAX); } @@ -350,19 +351,19 @@ public function testLoadByIdentifier() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateDataByIdentifier') - ->with($this->equalTo('not_locked'), $this->equalTo(2)) - ->will($this->returnValue([[]])); + ->with(self::equalTo('not_locked'), self::equalTo(2)) + ->will(self::returnValue([[]])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateFromData') - ->with($this->equalTo([[]])) - ->will($this->returnValue($this->getObjectStateFixture())); + ->with(self::equalTo([[]])) + ->will(self::returnValue($this->getObjectStateFixture())); $result = $handler->loadByIdentifier('not_locked', 2); - $this->assertInstanceOf( + self::assertInstanceOf( ObjectState::class, $result ); @@ -375,10 +376,10 @@ public function testLoadByIdentifierThrowsNotFoundException() $handler = $this->getObjectStateHandler(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateDataByIdentifier') - ->with($this->equalTo('unknown'), $this->equalTo(2)) - ->will($this->returnValue([])); + ->with(self::equalTo('unknown'), self::equalTo(2)) + ->will(self::returnValue([])); $handler->loadByIdentifier('unknown', 2); } @@ -389,28 +390,28 @@ public function testUpdate() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateFromInputStruct') - ->with($this->equalTo($this->getInputStructFixture())) - ->will($this->returnValue($this->getObjectStateFixture())); + ->with(self::equalTo($this->getInputStructFixture())) + ->will(self::returnValue($this->getObjectStateFixture())); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('updateObjectState') - ->with($this->equalTo(new ObjectState(['id' => 1]))); + ->with(self::equalTo(new ObjectState(['id' => 1]))); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateData') - ->with($this->equalTo(1)) - ->will($this->returnValue([[]])); + ->with(self::equalTo(1)) + ->will(self::returnValue([[]])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateFromData') - ->with($this->equalTo([[]])) - ->will($this->returnValue($this->getObjectStateFixture())); + ->with(self::equalTo([[]])) + ->will(self::returnValue($this->getObjectStateFixture())); $result = $handler->update(1, $this->getInputStructFixture()); - $this->assertInstanceOf( + self::assertInstanceOf( ObjectState::class, $result ); @@ -422,26 +423,26 @@ public function testSetPriority() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateData') - ->with($this->equalTo(2)) - ->will($this->returnValue([[]])); + ->with(self::equalTo(2)) + ->will(self::returnValue([[]])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateFromData') - ->with($this->equalTo([[]])) - ->will($this->returnValue(new ObjectState(['id' => 2, 'groupId' => 2]))); + ->with(self::equalTo([[]])) + ->will(self::returnValue(new ObjectState(['id' => 2, 'groupId' => 2]))); - $gatewayMock->expects($this->any()) + $gatewayMock->expects(self::any()) ->method('loadObjectStateListData') - ->with($this->equalTo(2)) - ->will($this->returnValue([[]])); + ->with(self::equalTo(2)) + ->will(self::returnValue([[]])); - $mapperMock->expects($this->any()) + $mapperMock->expects(self::any()) ->method('createObjectStateListFromData') - ->with($this->equalTo([[]])) + ->with(self::equalTo([[]])) ->will( - $this->returnValue( + self::returnValue( [ new ObjectState(['id' => 1, 'groupId' => 2]), new ObjectState(['id' => 2, 'groupId' => 2]), @@ -450,20 +451,20 @@ public function testSetPriority() ) ); - $gatewayMock->expects($this->exactly(3)) + $gatewayMock->expects(self::exactly(3)) ->method('updateObjectStatePriority'); - $gatewayMock->expects($this->at(2)) + $gatewayMock->expects(self::at(2)) ->method('updateObjectStatePriority') - ->with($this->equalTo(2), $this->equalTo(0)); + ->with(self::equalTo(2), self::equalTo(0)); - $gatewayMock->expects($this->at(3)) + $gatewayMock->expects(self::at(3)) ->method('updateObjectStatePriority') - ->with($this->equalTo(1), $this->equalTo(1)); + ->with(self::equalTo(1), self::equalTo(1)); - $gatewayMock->expects($this->at(4)) + $gatewayMock->expects(self::at(4)) ->method('updateObjectStatePriority') - ->with($this->equalTo(3), $this->equalTo(2)); + ->with(self::equalTo(3), self::equalTo(2)); $handler->setPriority(2, 0); } @@ -474,37 +475,37 @@ public function testDelete() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateData') - ->with($this->equalTo(1)) - ->will($this->returnValue([[]])); + ->with(self::equalTo(1)) + ->will(self::returnValue([[]])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateFromData') - ->with($this->equalTo([[]])) - ->will($this->returnValue(new ObjectState(['id' => 1, 'groupId' => 2]))); + ->with(self::equalTo([[]])) + ->will(self::returnValue(new ObjectState(['id' => 1, 'groupId' => 2]))); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('deleteObjectState') - ->with($this->equalTo(1)); + ->with(self::equalTo(1)); - $gatewayMock->expects($this->any()) + $gatewayMock->expects(self::any()) ->method('loadObjectStateListData') - ->with($this->equalTo(2)) - ->will($this->returnValue([[]])); + ->with(self::equalTo(2)) + ->will(self::returnValue([[]])); - $mapperMock->expects($this->any()) + $mapperMock->expects(self::any()) ->method('createObjectStateListFromData') - ->with($this->equalTo([[]])) - ->will($this->returnValue([new ObjectState(['id' => 2, 'groupId' => 2])])); + ->with(self::equalTo([[]])) + ->will(self::returnValue([new ObjectState(['id' => 2, 'groupId' => 2])])); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('updateObjectStatePriority') - ->with($this->equalTo(2), $this->equalTo(0)); + ->with(self::equalTo(2), self::equalTo(0)); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('updateObjectStateLinks') - ->with($this->equalTo(1), $this->equalTo(2)); + ->with(self::equalTo(1), self::equalTo(2)); $handler->delete(1); } @@ -516,10 +517,10 @@ public function testDeleteThrowsNotFoundException() $handler = $this->getObjectStateHandler(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateData') - ->with($this->equalTo(APIBaseTest::DB_INT_MAX)) - ->will($this->returnValue([])); + ->with(self::equalTo(APIBaseTest::DB_INT_MAX)) + ->will(self::returnValue([])); $handler->delete(APIBaseTest::DB_INT_MAX); } @@ -529,13 +530,13 @@ public function testSetContentState() $handler = $this->getObjectStateHandler(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('setContentState') - ->with($this->equalTo(42), $this->equalTo(2), $this->equalTo(2)); + ->with(self::equalTo(42), self::equalTo(2), self::equalTo(2)); $result = $handler->setContentState(42, 2, 2); - $this->assertTrue($result); + self::assertTrue($result); } public function testGetContentState() @@ -544,19 +545,19 @@ public function testGetContentState() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadObjectStateDataForContent') - ->with($this->equalTo(42), $this->equalTo(2)) - ->will($this->returnValue([[]])); + ->with(self::equalTo(42), self::equalTo(2)) + ->will(self::returnValue([[]])); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createObjectStateFromData') - ->with($this->equalTo([[]])) - ->will($this->returnValue($this->getObjectStateFixture())); + ->with(self::equalTo([[]])) + ->will(self::returnValue($this->getObjectStateFixture())); $result = $handler->getContentState(42, 2); - $this->assertInstanceOf( + self::assertInstanceOf( ObjectState::class, $result ); @@ -567,14 +568,14 @@ public function testGetContentCount() $handler = $this->getObjectStateHandler(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('getContentCount') - ->with($this->equalTo(1)) - ->will($this->returnValue(185)); + ->with(self::equalTo(1)) + ->will(self::returnValue(185)); $result = $handler->getContentCount(1); - $this->assertEquals(185, $result); + self::assertEquals(185, $result); } /** diff --git a/tests/lib/Persistence/Legacy/Content/Section/Gateway/DoctrineDatabaseTest.php b/tests/lib/Persistence/Legacy/Content/Section/Gateway/DoctrineDatabaseTest.php index 48f2a680b8..a3e324e74f 100644 --- a/tests/lib/Persistence/Legacy/Content/Section/Gateway/DoctrineDatabaseTest.php +++ b/tests/lib/Persistence/Legacy/Content/Section/Gateway/DoctrineDatabaseTest.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\Core\Persistence\Legacy\Content\Section\Gateway; use Ibexa\Core\Persistence\Legacy\Content\Section\Gateway; @@ -90,7 +91,7 @@ public function testLoadSectionData() $result = $gateway->loadSectionData(2); - $this->assertEquals( + self::assertEquals( [ [ 'id' => '2', @@ -145,7 +146,7 @@ public function testLoadAllSectionData() 'name' => 'Restricted', ], ]; - $this->assertEquals( + self::assertEquals( $expected, $result ); @@ -157,7 +158,7 @@ public function testLoadSectionDataByIdentifier() $result = $gateway->loadSectionDataByIdentifier('users'); - $this->assertEquals( + self::assertEquals( [ [ 'id' => '2', @@ -179,7 +180,7 @@ public function testCountContentObjectsInSection() $result = $gateway->countContentObjectsInSection(2); - $this->assertSame( + self::assertSame( 7, $result ); @@ -195,7 +196,7 @@ public function testCountRoleAssignmentsUsingSection() $result = $gateway->countRoleAssignmentsUsingSection(2); - $this->assertSame( + self::assertSame( 1, $result ); @@ -246,7 +247,7 @@ public function testAssignSectionToContent() $result = $gateway->assignSectionToContent(4, 10); - $this->assertSame( + self::assertSame( $beforeCount + 1, $gateway->countContentObjectsInSection(4) ); diff --git a/tests/lib/Persistence/Legacy/Content/Section/SectionHandlerTest.php b/tests/lib/Persistence/Legacy/Content/Section/SectionHandlerTest.php index e9357cdeba..ab2d71839d 100644 --- a/tests/lib/Persistence/Legacy/Content/Section/SectionHandlerTest.php +++ b/tests/lib/Persistence/Legacy/Content/Section/SectionHandlerTest.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\Core\Persistence\Legacy\Content\Section; use Ibexa\Contracts\Core\Persistence\Content\Section; @@ -36,12 +37,12 @@ public function testCreate() $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('insertSection') ->with( - $this->equalTo('New Section'), - $this->equalTo('new_section') - )->will($this->returnValue(23)); + self::equalTo('New Section'), + self::equalTo('new_section') + )->will(self::returnValue(23)); $sectionRef = new Section(); $sectionRef->id = 23; @@ -50,7 +51,7 @@ public function testCreate() $result = $handler->create('New Section', 'new_section'); - $this->assertEquals( + self::assertEquals( $sectionRef, $result ); @@ -62,12 +63,12 @@ public function testUpdate() $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('updateSection') ->with( - $this->equalTo(23), - $this->equalTo('New Section'), - $this->equalTo('new_section') + self::equalTo(23), + self::equalTo('New Section'), + self::equalTo('new_section') ); $sectionRef = new Section(); @@ -77,7 +78,7 @@ public function testUpdate() $result = $handler->update(23, 'New Section', 'new_section'); - $this->assertEquals( + self::assertEquals( $sectionRef, $result ); @@ -89,12 +90,12 @@ public function testLoad() $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadSectionData') ->with( - $this->equalTo(23) + self::equalTo(23) )->will( - $this->returnValue( + self::returnValue( [ [ 'id' => '23', @@ -112,7 +113,7 @@ public function testLoad() $result = $handler->load(23); - $this->assertEquals( + self::assertEquals( $sectionRef, $result ); @@ -124,10 +125,10 @@ public function testLoadAll() $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadAllSectionData') ->will( - $this->returnValue( + self::returnValue( [ [ 'id' => '23', @@ -155,7 +156,7 @@ public function testLoadAll() $result = $handler->loadAll(); - $this->assertEquals( + self::assertEquals( [$sectionRef, $sectionRef2], $result ); @@ -167,12 +168,12 @@ public function testLoadByIdentifier() $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadSectionDataByIdentifier') ->with( - $this->equalTo('new_section') + self::equalTo('new_section') )->will( - $this->returnValue( + self::returnValue( [ [ 'id' => '23', @@ -190,7 +191,7 @@ public function testLoadByIdentifier() $result = $handler->loadByIdentifier('new_section'); - $this->assertEquals( + self::assertEquals( $sectionRef, $result ); @@ -202,15 +203,15 @@ public function testDelete() $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('countContentObjectsInSection') - ->with($this->equalTo(23)) - ->will($this->returnValue(0)); + ->with(self::equalTo(23)) + ->will(self::returnValue(0)); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('deleteSection') ->with( - $this->equalTo(23) + self::equalTo(23) ); $result = $handler->delete(23); @@ -224,12 +225,12 @@ public function testDeleteFailure() $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('countContentObjectsInSection') - ->with($this->equalTo(23)) - ->will($this->returnValue(2)); + ->with(self::equalTo(23)) + ->will(self::returnValue(2)); - $gatewayMock->expects($this->never()) + $gatewayMock->expects(self::never()) ->method('deleteSection'); $result = $handler->delete(23); @@ -241,11 +242,11 @@ public function testAssign() $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('assignSectionToContent') ->with( - $this->equalTo(23), - $this->equalTo(42) + self::equalTo(23), + self::equalTo(42) ); $result = $handler->assign(23, 42); @@ -257,13 +258,13 @@ public function testPoliciesCount() $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('countPoliciesUsingSection') ->with( - $this->equalTo(1) + self::equalTo(1) ) ->will( - $this->returnValue(7) + self::returnValue(7) ); $result = $handler->policiesCount(1); @@ -275,13 +276,13 @@ public function testCountRoleAssignmentsUsingSection() $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('countRoleAssignmentsUsingSection') ->with( - $this->equalTo(1) + self::equalTo(1) ) ->will( - $this->returnValue(0) + self::returnValue(0) ); $handler->countRoleAssignmentsUsingSection(1); diff --git a/tests/lib/Persistence/Legacy/Content/StorageHandlerTest.php b/tests/lib/Persistence/Legacy/Content/StorageHandlerTest.php index 3ea01062bc..2369a780b7 100644 --- a/tests/lib/Persistence/Legacy/Content/StorageHandlerTest.php +++ b/tests/lib/Persistence/Legacy/Content/StorageHandlerTest.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\Core\Persistence\Legacy\Content; use Ibexa\Contracts\Core\FieldType\FieldStorage; @@ -52,18 +53,18 @@ public function testStoreFieldData() $storageMock = $this->getStorageMock(); $storageRegistryMock = $this->getStorageRegistryMock(); - $storageMock->expects($this->once()) + $storageMock->expects(self::once()) ->method('storeFieldData') ->with( - $this->isInstanceOf(VersionInfo::class), - $this->isInstanceOf(Field::class), - $this->equalTo($this->getContextMock()) + self::isInstanceOf(VersionInfo::class), + self::isInstanceOf(Field::class), + self::equalTo($this->getContextMock()) ); - $storageRegistryMock->expects($this->once()) + $storageRegistryMock->expects(self::once()) ->method('getStorage') - ->with($this->equalTo('foobar')) - ->will($this->returnValue($storageMock)); + ->with(self::equalTo('foobar')) + ->will(self::returnValue($storageMock)); $field = new Field(); $field->type = 'foobar'; @@ -78,21 +79,21 @@ public function testGetFieldDataAvailable() $storageMock = $this->getStorageMock(); $storageRegistryMock = $this->getStorageRegistryMock(); - $storageMock->expects($this->once()) + $storageMock->expects(self::once()) ->method('hasFieldData') - ->will($this->returnValue(true)); - $storageMock->expects($this->once()) + ->will(self::returnValue(true)); + $storageMock->expects(self::once()) ->method('getFieldData') ->with( - $this->isInstanceOf(VersionInfo::class), - $this->isInstanceOf(Field::class), - $this->equalTo($this->getContextMock()) + self::isInstanceOf(VersionInfo::class), + self::isInstanceOf(Field::class), + self::equalTo($this->getContextMock()) ); - $storageRegistryMock->expects($this->once()) + $storageRegistryMock->expects(self::once()) ->method('getStorage') - ->with($this->equalTo('foobar')) - ->will($this->returnValue($storageMock)); + ->with(self::equalTo('foobar')) + ->will(self::returnValue($storageMock)); $field = new Field(); $field->type = 'foobar'; @@ -107,16 +108,16 @@ public function testGetFieldDataNotAvailable() $storageMock = $this->getStorageMock(); $storageRegistryMock = $this->getStorageRegistryMock(); - $storageMock->expects($this->once()) + $storageMock->expects(self::once()) ->method('hasFieldData') - ->will($this->returnValue(false)); - $storageMock->expects($this->never()) + ->will(self::returnValue(false)); + $storageMock->expects(self::never()) ->method('getFieldData'); - $storageRegistryMock->expects($this->once()) + $storageRegistryMock->expects(self::once()) ->method('getStorage') - ->with($this->equalTo('foobar')) - ->will($this->returnValue($storageMock)); + ->with(self::equalTo('foobar')) + ->will(self::returnValue($storageMock)); $field = new Field(); $field->type = 'foobar'; @@ -131,18 +132,18 @@ public function testDeleteFieldData() $storageMock = $this->getStorageMock(); $storageRegistryMock = $this->getStorageRegistryMock(); - $storageMock->expects($this->once()) + $storageMock->expects(self::once()) ->method('deleteFieldData') ->with( - $this->isInstanceOf(VersionInfo::class), - $this->equalTo([1, 2, 3]), - $this->equalTo($this->getContextMock()) + self::isInstanceOf(VersionInfo::class), + self::equalTo([1, 2, 3]), + self::equalTo($this->getContextMock()) ); - $storageRegistryMock->expects($this->once()) + $storageRegistryMock->expects(self::once()) ->method('getStorage') - ->with($this->equalTo('foobar')) - ->will($this->returnValue($storageMock)); + ->with(self::equalTo('foobar')) + ->will(self::returnValue($storageMock)); $handler = $this->getStorageHandler(); $handler->deleteFieldData('foobar', new VersionInfo(), [1, 2, 3]); diff --git a/tests/lib/Persistence/Legacy/Content/StorageRegistryTest.php b/tests/lib/Persistence/Legacy/Content/StorageRegistryTest.php index 06e605b411..f4ab1cc54d 100644 --- a/tests/lib/Persistence/Legacy/Content/StorageRegistryTest.php +++ b/tests/lib/Persistence/Legacy/Content/StorageRegistryTest.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\Core\Persistence\Legacy\Content; use Ibexa\Contracts\Core\FieldType\FieldStorage; @@ -23,7 +24,7 @@ public function testRegister(): void $storage = $this->getStorageMock(); $registry = new StorageRegistry([self::TYPE_NAME => $storage]); - $this->assertSame($storage, $registry->getStorage(self::TYPE_NAME)); + self::assertSame($storage, $registry->getStorage(self::TYPE_NAME)); } public function testGetStorage() @@ -33,7 +34,7 @@ public function testGetStorage() $res = $registry->getStorage(self::TYPE_NAME); - $this->assertSame( + self::assertSame( $storage, $res ); diff --git a/tests/lib/Persistence/Legacy/Content/TreeHandlerTest.php b/tests/lib/Persistence/Legacy/Content/TreeHandlerTest.php index a3403d8fb8..78a219941b 100644 --- a/tests/lib/Persistence/Legacy/Content/TreeHandlerTest.php +++ b/tests/lib/Persistence/Legacy/Content/TreeHandlerTest.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\Core\Persistence\Legacy\Content; use Ibexa\Contracts\Core\Persistence\Content\ContentInfo; @@ -27,18 +28,18 @@ public function testLoadContentInfoByRemoteId() $contentInfoData = [new ContentInfo()]; $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('loadContentInfo') ->with(42) - ->will($this->returnValue([42])); + ->will(self::returnValue([42])); $this->getContentMapperMock() - ->expects($this->once()) + ->expects(self::once()) ->method('extractContentInfoFromRow') - ->with($this->equalTo([42])) - ->will($this->returnValue($contentInfoData)); + ->with(self::equalTo([42])) + ->will(self::returnValue($contentInfoData)); - $this->assertSame( + self::assertSame( $contentInfoData, $this->getTreeHandler()->loadContentInfo(42) ); @@ -47,26 +48,26 @@ public function testLoadContentInfoByRemoteId() public function testListVersions() { $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('listVersions') - ->with($this->equalTo(23)) - ->will($this->returnValue([['ezcontentobject_version_version' => 2]])); + ->with(self::equalTo(23)) + ->will(self::returnValue([['ezcontentobject_version_version' => 2]])); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('loadVersionedNameData') - ->with($this->equalTo([['id' => 23, 'version' => 2]])) - ->will($this->returnValue([])); + ->with(self::equalTo([['id' => 23, 'version' => 2]])) + ->will(self::returnValue([])); $this->getContentMapperMock() - ->expects($this->once()) + ->expects(self::once()) ->method('extractVersionInfoListFromRows') - ->with($this->equalTo([['ezcontentobject_version_version' => 2]]), []) - ->will($this->returnValue([new VersionInfo()])); + ->with(self::equalTo([['ezcontentobject_version_version' => 2]]), []) + ->will(self::returnValue([new VersionInfo()])); $versions = $this->getTreeHandler()->listVersions(23); - $this->assertEquals( + self::assertEquals( [new VersionInfo()], $versions ); @@ -82,44 +83,44 @@ public function testRemoveRawContent() ); $treeHandler - ->expects($this->once()) + ->expects(self::once()) ->method('listVersions') - ->will($this->returnValue([new VersionInfo(), new VersionInfo()])); + ->will(self::returnValue([new VersionInfo(), new VersionInfo()])); $treeHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadContentInfo') ->with(23) - ->will($this->returnValue(new ContentInfo(['mainLocationId' => 42]))); + ->will(self::returnValue(new ContentInfo(['mainLocationId' => 42]))); $this->getFieldHandlerMock() - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('deleteFields') ->with( - $this->equalTo(23), - $this->isInstanceOf(VersionInfo::class) + self::equalTo(23), + self::isInstanceOf(VersionInfo::class) ); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('deleteRelations') - ->with($this->equalTo(23)); + ->with(self::equalTo(23)); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('deleteVersions') - ->with($this->equalTo(23)); + ->with(self::equalTo(23)); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('deleteNames') - ->with($this->equalTo(23)); + ->with(self::equalTo(23)); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('deleteContent') - ->with($this->equalTo(23)); + ->with(self::equalTo(23)); $this->getLocationGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('removeElementFromTrash') - ->with($this->equalTo(42)); + ->with(self::equalTo(42)); $treeHandler->removeRawContent(23); } @@ -135,11 +136,11 @@ public function testRemoveSubtree() // Original call $this->getLocationGatewayMock() - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('getBasicNodeData') ->with(42) ->will( - $this->returnValue( + self::returnValue( [ 'contentobject_id' => 100, 'main_node_id' => 200, @@ -147,11 +148,11 @@ public function testRemoveSubtree() ) ); $this->getLocationGatewayMock() - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('getChildren') ->with(42) ->will( - $this->returnValue( + self::returnValue( [ ['node_id' => 201], ['node_id' => 202], @@ -161,11 +162,11 @@ public function testRemoveSubtree() // First recursive call $this->getLocationGatewayMock() - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('getBasicNodeData') ->with(201) ->will( - $this->returnValue( + self::returnValue( [ 'contentobject_id' => 101, 'main_node_id' => 201, @@ -173,35 +174,35 @@ public function testRemoveSubtree() ) ); $this->getLocationGatewayMock() - ->expects($this->at(3)) + ->expects(self::at(3)) ->method('getChildren') ->with(201) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->getLocationGatewayMock() - ->expects($this->at(4)) + ->expects(self::at(4)) ->method('countLocationsByContentId') ->with(101) - ->will($this->returnValue(1)); + ->will(self::returnValue(1)); $treeHandler - ->expects($this->once()) + ->expects(self::once()) ->method('removeRawContent') ->with(101); $this->getLocationGatewayMock() - ->expects($this->at(5)) + ->expects(self::at(5)) ->method('removeLocation') ->with(201); $this->getLocationGatewayMock() - ->expects($this->at(6)) + ->expects(self::at(6)) ->method('deleteNodeAssignment') ->with(101); // Second recursive call $this->getLocationGatewayMock() - ->expects($this->at(7)) + ->expects(self::at(7)) ->method('getBasicNodeData') ->with(202) ->will( - $this->returnValue( + self::returnValue( [ 'contentobject_id' => 102, 'main_node_id' => 202, @@ -209,21 +210,21 @@ public function testRemoveSubtree() ) ); $this->getLocationGatewayMock() - ->expects($this->at(8)) + ->expects(self::at(8)) ->method('getChildren') ->with(202) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->getLocationGatewayMock() - ->expects($this->at(9)) + ->expects(self::at(9)) ->method('countLocationsByContentId') ->with(102) - ->will($this->returnValue(2)); + ->will(self::returnValue(2)); $this->getLocationGatewayMock() - ->expects($this->at(10)) + ->expects(self::at(10)) ->method('getFallbackMainNodeData') ->with(102, 202) ->will( - $this->returnValue( + self::returnValue( [ 'node_id' => 203, 'contentobject_version' => 1, @@ -232,25 +233,25 @@ public function testRemoveSubtree() ) ); $treeHandler - ->expects($this->once()) + ->expects(self::once()) ->method('changeMainLocation') ->with(102, 203); $this->getLocationGatewayMock() - ->expects($this->at(11)) + ->expects(self::at(11)) ->method('removeLocation') ->with(202); $this->getLocationGatewayMock() - ->expects($this->at(12)) + ->expects(self::at(12)) ->method('deleteNodeAssignment') ->with(102); // Continuation of the original call $this->getLocationGatewayMock() - ->expects($this->at(13)) + ->expects(self::at(13)) ->method('removeLocation') ->with(42); $this->getLocationGatewayMock() - ->expects($this->at(14)) + ->expects(self::at(14)) ->method('deleteNodeAssignment') ->with(100); @@ -263,11 +264,11 @@ public function testSetSectionForSubtree() $treeHandler = $this->getTreeHandler(); $this->getLocationGatewayMock() - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('getBasicNodeData') ->with(69) ->will( - $this->returnValue( + self::returnValue( [ 'node_id' => 69, 'path_string' => '/1/2/69/', @@ -277,7 +278,7 @@ public function testSetSectionForSubtree() ); $this->getLocationGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('setSectionForSubtree') ->with('/1/2/69/', 3); @@ -295,36 +296,36 @@ public function testChangeMainLocation() ); $treeHandler - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('loadLocation') ->with(34) - ->will($this->returnValue(new Location(['parentId' => 42]))); + ->will(self::returnValue(new Location(['parentId' => 42]))); $treeHandler - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('loadContentInfo') ->with('12') - ->will($this->returnValue(new ContentInfo(['currentVersionNo' => 1]))); + ->will(self::returnValue(new ContentInfo(['currentVersionNo' => 1]))); $treeHandler - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('loadLocation') ->with(42) - ->will($this->returnValue(new Location(['contentId' => 84]))); + ->will(self::returnValue(new Location(['contentId' => 84]))); $treeHandler - ->expects($this->at(3)) + ->expects(self::at(3)) ->method('loadContentInfo') ->with('84') - ->will($this->returnValue(new ContentInfo(['sectionId' => 4]))); + ->will(self::returnValue(new ContentInfo(['sectionId' => 4]))); $this->getLocationGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('changeMainLocation') ->with(12, 34, 1, 42); $treeHandler - ->expects($this->once()) + ->expects(self::once()) ->method('setSectionForSubtree') ->with(34, 4); @@ -342,31 +343,31 @@ public function testChangeMainLocationToLocationWithoutContentInfo() ); $treeHandler - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('loadLocation') ->with(34) - ->will($this->returnValue(new Location(['parentId' => 1]))); + ->will(self::returnValue(new Location(['parentId' => 1]))); $treeHandler - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('loadContentInfo') ->with('12') - ->will($this->returnValue(new ContentInfo(['currentVersionNo' => 1]))); + ->will(self::returnValue(new ContentInfo(['currentVersionNo' => 1]))); $treeHandler - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('loadLocation') ->with(1) - ->will($this->returnValue(new Location(['contentId' => 84]))); + ->will(self::returnValue(new Location(['contentId' => 84]))); $treeHandler - ->expects($this->at(3)) + ->expects(self::at(3)) ->method('loadContentInfo') ->with('84') - ->will($this->returnValue(new ContentInfo(['sectionId' => 4]))); + ->will(self::returnValue(new ContentInfo(['sectionId' => 4]))); $this->getLocationGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('changeMainLocation') ->with(12, 34, 1, 1); @@ -378,11 +379,11 @@ public function testLoadLocation() $treeHandler = $this->getTreeHandler(); $this->getLocationGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('getBasicNodeData') ->with(77) ->will( - $this->returnValue( + self::returnValue( [ 'node_id' => 77, ] @@ -390,14 +391,14 @@ public function testLoadLocation() ); $this->getLocationMapperMock() - ->expects($this->once()) + ->expects(self::once()) ->method('createLocationFromRow') ->with(['node_id' => 77]) - ->will($this->returnValue(new Location())); + ->will(self::returnValue(new Location())); $location = $treeHandler->loadLocation(77); - $this->assertTrue($location instanceof Location); + self::assertTrue($location instanceof Location); } /** @var \PHPUnit\Framework\MockObject\MockObject|\Ibexa\Core\Persistence\Legacy\Content\Location\Gateway */ diff --git a/tests/lib/Persistence/Legacy/Content/Type/ContentTypeHandlerTest.php b/tests/lib/Persistence/Legacy/Content/Type/ContentTypeHandlerTest.php index 2226bc1508..c8cff9eaa3 100644 --- a/tests/lib/Persistence/Legacy/Content/Type/ContentTypeHandlerTest.php +++ b/tests/lib/Persistence/Legacy/Content/Type/ContentTypeHandlerTest.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\Core\Persistence\Legacy\Content\Type; use Ibexa\Contracts\Core\Persistence\Content\Type; @@ -57,37 +58,37 @@ public function testCreateGroup() $createStruct = new GroupCreateStruct(); $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createGroupFromCreateStruct') ->with( - $this->isInstanceOf( + self::isInstanceOf( GroupCreateStruct::class ) ) ->will( - $this->returnValue(new Group()) + self::returnValue(new Group()) ); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('insertGroup') ->with( - $this->isInstanceOf( + self::isInstanceOf( Group::class ) ) - ->will($this->returnValue(23)); + ->will(self::returnValue(23)); $handler = $this->getHandler(); $group = $handler->createGroup( new GroupCreateStruct() ); - $this->assertInstanceOf( + self::assertInstanceOf( Group::class, $group ); - $this->assertEquals( + self::assertEquals( 23, $group->id ); @@ -101,10 +102,10 @@ public function testUpdateGroup() $mapperMock = $this->getMapperMock(); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('updateGroup') ->with( - $this->isInstanceOf( + self::isInstanceOf( GroupUpdateStruct::class ) ); @@ -119,19 +120,19 @@ public function testUpdateGroup() ]) ->getMock(); - $handlerMock->expects($this->once()) + $handlerMock->expects(self::once()) ->method('loadGroup') ->with( - $this->equalTo(23) + self::equalTo(23) )->will( - $this->returnValue(new Group()) + self::returnValue(new Group()) ); $res = $handlerMock->updateGroup( $updateStruct ); - $this->assertInstanceOf( + self::assertInstanceOf( Group::class, $res ); @@ -140,13 +141,13 @@ public function testUpdateGroup() public function testDeleteGroupSuccess() { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('countTypesInGroup') - ->with($this->equalTo(23)) - ->will($this->returnValue(0)); - $gatewayMock->expects($this->once()) + ->with(self::equalTo(23)) + ->will(self::returnValue(0)); + $gatewayMock->expects(self::once()) ->method('deleteGroup') - ->with($this->equalTo(23)); + ->with(self::equalTo(23)); $handler = $this->getHandler(); $handler->deleteGroup(23); @@ -158,11 +159,11 @@ public function testDeleteGroupFailure() $this->expectExceptionMessage('Group with ID "23" is not empty.'); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('countTypesInGroup') - ->with($this->equalTo(23)) - ->will($this->returnValue(42)); - $gatewayMock->expects($this->never()) + ->with(self::equalTo(23)) + ->will(self::returnValue(42)); + $gatewayMock->expects(self::never()) ->method('deleteGroup'); $handler = $this->getHandler(); @@ -172,21 +173,21 @@ public function testDeleteGroupFailure() public function testLoadGroup() { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadGroupData') - ->with($this->equalTo([23])) - ->will($this->returnValue([])); + ->with(self::equalTo([23])) + ->will(self::returnValue([])); $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractGroupsFromRows') - ->with($this->equalTo([])) - ->will($this->returnValue([new Group()])); + ->with(self::equalTo([])) + ->will(self::returnValue([new Group()])); $handler = $this->getHandler(); $res = $handler->loadGroup(23); - $this->assertEquals( + self::assertEquals( new Group(), $res ); @@ -195,21 +196,21 @@ public function testLoadGroup() public function testLoadGroupByIdentifier() { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadGroupDataByIdentifier') - ->with($this->equalTo('content')) - ->will($this->returnValue([])); + ->with(self::equalTo('content')) + ->will(self::returnValue([])); $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractGroupsFromRows') - ->with($this->equalTo([])) - ->will($this->returnValue([new Group()])); + ->with(self::equalTo([])) + ->will(self::returnValue([new Group()])); $handler = $this->getHandler(); $res = $handler->loadGroupByIdentifier('content'); - $this->assertEquals( + self::assertEquals( new Group(), $res ); @@ -218,20 +219,20 @@ public function testLoadGroupByIdentifier() public function testLoadAllGroups() { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadAllGroupsData') - ->will($this->returnValue([])); + ->will(self::returnValue([])); $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractGroupsFromRows') - ->with($this->equalTo([])) - ->will($this->returnValue([new Group()])); + ->with(self::equalTo([])) + ->will(self::returnValue([new Group()])); $handler = $this->getHandler(); $res = $handler->loadAllGroups(); - $this->assertEquals( + self::assertEquals( [new Group()], $res ); @@ -240,21 +241,21 @@ public function testLoadAllGroups() public function testLoadContentTypes() { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadTypesDataForGroup') - ->with($this->equalTo(23), $this->equalTo(0)) - ->will($this->returnValue([])); + ->with(self::equalTo(23), self::equalTo(0)) + ->will(self::returnValue([])); $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractTypesFromRows') - ->with($this->equalTo([])) - ->will($this->returnValue([new Type()])); + ->with(self::equalTo([])) + ->will(self::returnValue([new Type()])); $handler = $this->getHandler(); $res = $handler->loadContentTypes(23, 0); - $this->assertEquals( + self::assertEquals( [new Type()], $res ); @@ -263,21 +264,21 @@ public function testLoadContentTypes() public function testLoadContentTypeList(): void { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadTypesListData') - ->with($this->equalTo([23, 24])) + ->with(self::equalTo([23, 24])) ->willReturn([]); $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractTypesFromRows') - ->with($this->equalTo([])) + ->with(self::equalTo([])) ->willReturn([23 => new Type()]); $handler = $this->getHandler(); $types = $handler->loadContentTypeList([23, 24]); - $this->assertEquals( + self::assertEquals( [23 => new Type()], $types, 'Types not loaded correctly' @@ -287,7 +288,7 @@ public function testLoadContentTypeList(): void public function testLoadContentTypesByFieldDefinitionIdentifier(): void { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadTypesDataByFieldDefinitionIdentifier') ->with('ezstring') ->willReturn([]); @@ -311,20 +312,20 @@ public function testLoadContentTypesByFieldDefinitionIdentifier(): void public function testLoad() { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadTypeData') ->with( - $this->equalTo(23), - $this->equalTo(1) + self::equalTo(23), + self::equalTo(1) ) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractTypesFromRows') - ->with($this->equalTo([])) + ->with(self::equalTo([])) ->will( - $this->returnValue( + self::returnValue( [new Type()] ) ); @@ -332,7 +333,7 @@ public function testLoad() $handler = $this->getHandler(); $type = $handler->load(23, 1); - $this->assertEquals( + self::assertEquals( new Type(), $type, 'Type not loaded correctly' @@ -344,20 +345,20 @@ public function testLoadNotFound() $this->expectException(Exception\TypeNotFound::class); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadTypeData') ->with( - $this->equalTo(23), - $this->equalTo(1) + self::equalTo(23), + self::equalTo(1) ) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractTypesFromRows') - ->with($this->equalTo([])) + ->with(self::equalTo([])) ->will( - $this->returnValue( + self::returnValue( [] ) ); @@ -369,19 +370,19 @@ public function testLoadNotFound() public function testLoadDefaultVersion() { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadTypeData') ->with( - $this->equalTo(23), - $this->equalTo(0) + self::equalTo(23), + self::equalTo(0) ) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractTypesFromRows') ->will( - $this->returnValue( + self::returnValue( [new Type()] ) ); @@ -389,7 +390,7 @@ public function testLoadDefaultVersion() $handler = $this->getHandler(); $type = $handler->load(23); - $this->assertEquals( + self::assertEquals( new Type(), $type, 'Type not loaded correctly' @@ -399,19 +400,19 @@ public function testLoadDefaultVersion() public function testLoadByIdentifier() { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadTypeDataByIdentifier') ->with( - $this->equalTo('blogentry'), - $this->equalTo(0) + self::equalTo('blogentry'), + self::equalTo(0) ) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractTypesFromRows') ->will( - $this->returnValue( + self::returnValue( [new Type()] ) ); @@ -419,7 +420,7 @@ public function testLoadByIdentifier() $handler = $this->getHandler(); $type = $handler->loadByIdentifier('blogentry'); - $this->assertEquals( + self::assertEquals( new Type(), $type, 'Type not loaded correctly' @@ -429,19 +430,19 @@ public function testLoadByIdentifier() public function testLoadByRemoteId() { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadTypeDataByRemoteId') ->with( - $this->equalTo('someLongHash'), - $this->equalTo(0) + self::equalTo('someLongHash'), + self::equalTo(0) ) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractTypesFromRows') ->will( - $this->returnValue( + self::returnValue( [new Type()] ) ); @@ -449,7 +450,7 @@ public function testLoadByRemoteId() $handler = $this->getHandler(); $type = $handler->loadByRemoteId('someLongHash'); - $this->assertEquals( + self::assertEquals( new Type(), $type, 'Type not loaded correctly' @@ -469,64 +470,64 @@ public function testCreate() $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('insertType') ->with( - $this->isInstanceOf( + self::isInstanceOf( Type::class ) ) - ->will($this->returnValue(23)); - $gatewayMock->expects($this->once()) + ->will(self::returnValue(23)); + $gatewayMock->expects(self::once()) ->method('insertGroupAssignment') ->with( - $this->equalTo(42), - $this->equalTo(23), - $this->equalTo(1) + self::equalTo(42), + self::equalTo(23), + self::equalTo(1) ); - $gatewayMock->expects($this->exactly(2)) + $gatewayMock->expects(self::exactly(2)) ->method('insertFieldDefinition') ->with( - $this->equalTo(23), - $this->equalTo(1), - $this->isInstanceOf(FieldDefinition::class), - $this->isInstanceOf(StorageFieldDefinition::class) + self::equalTo(23), + self::equalTo(1), + self::isInstanceOf(FieldDefinition::class), + self::isInstanceOf(StorageFieldDefinition::class) ) - ->will($this->returnValue(42)); + ->will(self::returnValue(42)); - $mapperMock->expects($this->exactly(2)) + $mapperMock->expects(self::exactly(2)) ->method('toStorageFieldDefinition') ->with( - $this->isInstanceOf(FieldDefinition::class), - $this->isInstanceOf(StorageFieldDefinition::class) + self::isInstanceOf(FieldDefinition::class), + self::isInstanceOf(StorageFieldDefinition::class) ); $handler = $this->getHandler(); $type = $handler->create($createStructFix); - $this->assertInstanceOf( + self::assertInstanceOf( Type::class, $type, 'Incorrect type returned from create()' ); - $this->assertEquals( + self::assertEquals( 23, $type->id, 'Incorrect ID for Type.' ); - $this->assertEquals( + self::assertEquals( 42, $type->fieldDefinitions[0]->id, 'Field definition ID not set correctly' ); - $this->assertEquals( + self::assertEquals( 42, $type->fieldDefinitions[1]->id, 'Field definition ID not set correctly' ); - $this->assertEquals( + self::assertEquals( $createStructClone, $createStructFix, 'Create struct manipulated' @@ -536,12 +537,12 @@ public function testCreate() public function testUpdate() { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('updateType') ->with( - $this->equalTo(23), - $this->equalTo(1), - $this->isInstanceOf( + self::equalTo(23), + self::equalTo(1), + self::isInstanceOf( Type::class ) ); @@ -556,17 +557,17 @@ public function testUpdate() ]) ->getMock(); - $handlerMock->expects($this->once()) + $handlerMock->expects(self::once()) ->method('load') ->with( - $this->equalTo(23), - $this->equalTo(1) + self::equalTo(23), + self::equalTo(1) ) - ->will($this->returnValue(new Type())); + ->will(self::returnValue(new Type())); $res = $handlerMock->update(23, 1, new UpdateStruct()); - $this->assertInstanceOf( + self::assertInstanceOf( Type::class, $res ); @@ -577,33 +578,33 @@ public function testDeleteSuccess() $gatewayMock = $this->getGatewayMock(); $gatewayMock->expects( - $this->once() + self::once() )->method( 'countInstancesOfType' )->with( - $this->equalTo(23) + self::equalTo(23) )->will( - $this->returnValue(0) + self::returnValue(0) ); - $gatewayMock->expects($this->once())->method('loadTypeData')->with(23, 0)->willReturn([]); + $gatewayMock->expects(self::once())->method('loadTypeData')->with(23, 0)->willReturn([]); $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once())->method('extractTypesFromRows')->with([])->willReturn([new Type()]); + $mapperMock->expects(self::once())->method('extractTypesFromRows')->with([])->willReturn([new Type()]); $gatewayMock->expects( - $this->once() + self::once() )->method( 'delete' )->with( - $this->equalTo(23), - $this->equalTo(0) + self::equalTo(23), + self::equalTo(0) ); $handler = $this->getHandler(); $res = $handler->delete(23, 0); - $this->assertTrue($res); + self::assertTrue($res); } public function testDeleteThrowsBadStateException() @@ -613,16 +614,16 @@ public function testDeleteThrowsBadStateException() $gatewayMock = $this->getGatewayMock(); $gatewayMock->expects( - $this->once() + self::once() )->method( 'countInstancesOfType' )->with( - $this->equalTo(23) + self::equalTo(23) )->will( - $this->returnValue(1) + self::returnValue(1) ); - $gatewayMock->expects($this->never())->method('delete'); + $gatewayMock->expects(self::never())->method('delete'); $handler = $this->getHandler(); $res = $handler->delete(23, 0); @@ -635,14 +636,14 @@ public function testCreateVersion() $gatewayMock = $this->getGatewayMock(); $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createCreateStructFromType') ->with( - $this->isInstanceOf( + self::isInstanceOf( Type::class ) )->will( - $this->returnValue(new CreateStruct()) + self::returnValue(new CreateStruct()) ); $handlerMock = $this->getMockBuilder(Handler::class) @@ -655,29 +656,30 @@ public function testCreateVersion() ]) ->getMock(); - $handlerMock->expects($this->once()) + $handlerMock->expects(self::once()) ->method('load') ->with( - $this->equalTo($contentTypeId, Type::STATUS_DEFINED) + self::equalTo($contentTypeId), + self::equalTo(Type::STATUS_DEFINED), )->will( - $this->returnValue( + self::returnValue( new Type() ) ); $typeDraft = new Type(); - $handlerMock->expects($this->once()) + $handlerMock->expects(self::once()) ->method('internalCreate') ->with( - $this->isInstanceOf(CreateStruct::class), - $this->equalTo($contentTypeId) + self::isInstanceOf(CreateStruct::class), + self::equalTo($contentTypeId) )->will( - $this->returnValue($typeDraft) + self::returnValue($typeDraft) ); $res = $handlerMock->createDraft($userId, $contentTypeId); - $this->assertSame( + self::assertSame( $typeDraft, $res ); @@ -687,10 +689,10 @@ public function testCopy() { $gatewayMock = $this->getGatewayMock(); $mapperMock = $this->getMapperMock(['createCreateStructFromType']); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createCreateStructFromType') ->with( - $this->isInstanceOf( + self::isInstanceOf( Type::class ) )->willReturn( @@ -714,10 +716,11 @@ public function testCopy() 'status' => Type::STATUS_DEFINED, ]); - $handlerMock->expects($this->once()) + $handlerMock->expects(self::once()) ->method('load') ->with( - $this->equalTo($type->id, Type::STATUS_DEFINED) + self::equalTo($type->id), + self::equalTo(Type::STATUS_DEFINED), )->willReturn( $type ); @@ -726,28 +729,28 @@ public function testCopy() $typeCopy->id = 24; $typeCopy->identifier = 'copy_of' . $type->identifier . '_' . $type->id; - $handlerMock->expects($this->once()) + $handlerMock->expects(self::once()) ->method('internalCreate') ->with( - $this->isInstanceOf(CreateStruct::class), + self::isInstanceOf(CreateStruct::class), )->willReturn( $typeCopy ); - $handlerMock->expects($this->once()) + $handlerMock->expects(self::once()) ->method('update') ->with( - $this->equalTo($typeCopy->id), - $this->equalTo(Type::STATUS_DEFINED), - $this->isInstanceOf(UpdateStruct::class) + self::equalTo($typeCopy->id), + self::equalTo(Type::STATUS_DEFINED), + self::isInstanceOf(UpdateStruct::class) ) ->will( - $this->returnValue($typeCopy) + self::returnValue($typeCopy) ); $res = $handlerMock->copy($userId, $type->id, Type::STATUS_DEFINED); - $this->assertEquals( + self::assertEquals( $typeCopy, $res ); @@ -756,12 +759,12 @@ public function testCopy() public function testLink() { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('insertGroupAssignment') ->with( - $this->equalTo(3), - $this->equalTo(23), - $this->equalTo(1) + self::equalTo(3), + self::equalTo(23), + self::equalTo(1) ); $mapperMock = $this->getMapperMock(); @@ -769,25 +772,25 @@ public function testLink() $handler = $this->getHandler(); $res = $handler->link(3, 23, 1); - $this->assertTrue($res); + self::assertTrue($res); } public function testUnlinkSuccess() { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('countGroupsForType') ->with( - $this->equalTo(23), - $this->equalTo(1) - )->will($this->returnValue(2)); + self::equalTo(23), + self::equalTo(1) + )->will(self::returnValue(2)); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('deleteGroupAssignment') ->with( - $this->equalTo(3), - $this->equalTo(23), - $this->equalTo(1) + self::equalTo(3), + self::equalTo(23), + self::equalTo(1) ); $mapperMock = $this->getMapperMock(); @@ -795,7 +798,7 @@ public function testUnlinkSuccess() $handler = $this->getHandler(); $res = $handler->unlink(3, 23, 1); - $this->assertTrue($res); + self::assertTrue($res); } public function testUnlinkFailure() @@ -804,14 +807,14 @@ public function testUnlinkFailure() $this->expectExceptionMessage('Type with ID "23" in status "1" cannot be unlinked from its last group.'); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('countGroupsForType') ->with( - $this->equalTo(23), - $this->equalTo(1) + self::equalTo(23), + self::equalTo(1) ) // Only 1 group assigned - ->will($this->returnValue(1)); + ->will(self::returnValue(1)); $mapperMock = $this->getMapperMock(); @@ -827,32 +830,32 @@ public function testGetFieldDefinition() 'extractMultilingualData', ] ); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractFieldFromRow') ->with( - $this->equalTo([]) + self::equalTo([]) )->will( - $this->returnValue(new FieldDefinition()) + self::returnValue(new FieldDefinition()) ); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('extractMultilingualData') ->with( - $this->equalTo([ + self::equalTo([ [], ]) )->will( - $this->returnValue([]) + self::returnValue([]) ); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('loadFieldDefinition') ->with( - $this->equalTo(42), - $this->equalTo(Type::STATUS_DEFINED) + self::equalTo(42), + self::equalTo(Type::STATUS_DEFINED) )->will( - $this->returnValue([ + self::returnValue([ [], ]) ); @@ -860,7 +863,7 @@ public function testGetFieldDefinition() $handler = $this->getHandler(); $fieldDefinition = $handler->getFieldDefinition(42, Type::STATUS_DEFINED); - $this->assertInstanceOf( + self::assertInstanceOf( FieldDefinition::class, $fieldDefinition ); @@ -871,45 +874,45 @@ public function testAddFieldDefinition() $mapperMock = $this->getMapperMock( ['toStorageFieldDefinition'] ); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('toStorageFieldDefinition') ->with( - $this->isInstanceOf( + self::isInstanceOf( FieldDefinition::class ), - $this->isInstanceOf( + self::isInstanceOf( StorageFieldDefinition::class ) ); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('insertFieldDefinition') ->with( - $this->equalTo(23), - $this->equalTo(1), - $this->isInstanceOf( + self::equalTo(23), + self::equalTo(1), + self::isInstanceOf( FieldDefinition::class ), - $this->isInstanceOf( + self::isInstanceOf( StorageFieldDefinition::class ) )->will( - $this->returnValue(42) + self::returnValue(42) ); $fieldDef = new FieldDefinition(); $storageDispatcherMock = $this->getStorageDispatcherMock(); $storageDispatcherMock - ->expects($this->once()) + ->expects(self::once()) ->method('storeFieldConstraintsData') ->with($fieldDef); $handler = $this->getHandler(); $handler->addFieldDefinition(23, 1, $fieldDef); - $this->assertEquals( + self::assertEquals( 42, $fieldDef->id ); @@ -918,17 +921,17 @@ public function testAddFieldDefinition() public function testGetContentCount() { $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('countInstancesOfType') ->with( - $this->equalTo(23) + self::equalTo(23) )->will( - $this->returnValue(42) + self::returnValue(42) ); $handler = $this->getHandler(); - $this->assertEquals( + self::assertEquals( 42, $handler->getContentCount(23) ); @@ -938,17 +941,17 @@ public function testRemoveFieldDefinition() { $storageDispatcherMock = $this->getStorageDispatcherMock(); $storageDispatcherMock - ->expects($this->once()) + ->expects(self::once()) ->method('deleteFieldConstraintsData') ->with('ezstring', 42); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('deleteFieldDefinition') ->with( - $this->equalTo(23), - $this->equalTo(1), - $this->equalTo(42) + self::equalTo(23), + self::equalTo(1), + self::equalTo(42) ); $handler = $this->getHandler(); @@ -962,25 +965,25 @@ public function testUpdateFieldDefinition() $mapperMock = $this->getMapperMock( ['toStorageFieldDefinition'] ); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('toStorageFieldDefinition') ->with( - $this->identicalTo($fieldDef), - $this->isInstanceOf(StorageFieldDefinition::class) + self::identicalTo($fieldDef), + self::isInstanceOf(StorageFieldDefinition::class) ); $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('updateFieldDefinition') ->with( - $this->equalTo(23), - $this->equalTo(1), + self::equalTo(23), + self::equalTo(1), $fieldDef ); $storageDispatcherMock = $this->getStorageDispatcherMock(); $storageDispatcherMock - ->expects($this->once()) + ->expects(self::once()) ->method('storeFieldConstraintsData') ->with($fieldDef); @@ -993,34 +996,34 @@ public function testPublish() $handler = $this->getPartlyMockedHandler(['load']); $updateHandlerMock = $this->getUpdateHandlerMock(); - $handler->expects($this->exactly(2)) + $handler->expects(self::exactly(2)) ->method('load') ->with( - $this->equalTo(23), - $this->logicalOr( - $this->equalTo(0), - $this->equalTo(1) + self::equalTo(23), + self::logicalOr( + self::equalTo(0), + self::equalTo(1) ) )->will( - $this->returnValue(new Type()) + self::returnValue(new Type()) ); - $updateHandlerMock->expects($this->once()) + $updateHandlerMock->expects(self::once()) ->method('updateContentObjects') ->with( - $this->isInstanceOf(Type::class), - $this->isInstanceOf(Type::class) + self::isInstanceOf(Type::class), + self::isInstanceOf(Type::class) ); - $updateHandlerMock->expects($this->once()) + $updateHandlerMock->expects(self::once()) ->method('deleteOldType') ->with( - $this->isInstanceOf(Type::class) + self::isInstanceOf(Type::class) ); - $updateHandlerMock->expects($this->once()) + $updateHandlerMock->expects(self::once()) ->method('publishNewType') ->with( - $this->isInstanceOf(Type::class), - $this->equalTo(0) + self::isInstanceOf(Type::class), + self::equalTo(0) ); $handler->publish(23); @@ -1031,33 +1034,33 @@ public function testPublishNoOldType() $handler = $this->getPartlyMockedHandler(['load']); $updateHandlerMock = $this->getUpdateHandlerMock(); - $handler->expects($this->at(0)) + $handler->expects(self::at(0)) ->method('load') ->with( - $this->equalTo(23), - $this->equalTo(1) + self::equalTo(23), + self::equalTo(1) )->will( - $this->returnValue(new Type()) + self::returnValue(new Type()) ); - $handler->expects($this->at(1)) + $handler->expects(self::at(1)) ->method('load') ->with( - $this->equalTo(23), - $this->equalTo(0) + self::equalTo(23), + self::equalTo(0) )->will( - $this->throwException(new Exception\TypeNotFound(23, 0)) + self::throwException(new Exception\TypeNotFound(23, 0)) ); - $updateHandlerMock->expects($this->never()) + $updateHandlerMock->expects(self::never()) ->method('updateContentObjects'); - $updateHandlerMock->expects($this->never()) + $updateHandlerMock->expects(self::never()) ->method('deleteOldType'); - $updateHandlerMock->expects($this->once()) + $updateHandlerMock->expects(self::once()) ->method('publishNewType') ->with( - $this->isInstanceOf(Type::class), - $this->equalTo(0) + self::isInstanceOf(Type::class), + self::equalTo(0) ); $handler->publish(23); @@ -1194,15 +1197,15 @@ protected function getContentTypeCreateStructFixture() public function testRemoveContentTypeTranslation() { $mapperMock = $this->getMapperMock(); - $mapperMock->expects($this->once()) + $mapperMock->expects(self::once()) ->method('createUpdateStructFromType') ->with( - $this->isInstanceOf( + self::isInstanceOf( Type::class ) ) ->will( - $this->returnValue(new UpdateStruct()) + self::returnValue(new UpdateStruct()) ); $handlerMock = $this->getMockBuilder(Handler::class) @@ -1215,28 +1218,28 @@ public function testRemoveContentTypeTranslation() ]) ->getMock(); - $handlerMock->expects($this->once()) + $handlerMock->expects(self::once()) ->method('load') ->with( - $this->equalTo(23), - $this->equalTo(1) + self::equalTo(23), + self::equalTo(1) ) - ->will($this->returnValue(new Type(['id' => 23]))); + ->will(self::returnValue(new Type(['id' => 23]))); - $handlerMock->expects($this->once()) + $handlerMock->expects(self::once()) ->method('update') ->with( - $this->equalTo(23), - $this->equalTo(1), - $this->isInstanceOf( + self::equalTo(23), + self::equalTo(1), + self::isInstanceOf( UpdateStruct::class ) ) - ->will($this->returnValue(new Type())); + ->will(self::returnValue(new Type())); $res = $handlerMock->removeContentTypeTranslation(23, 'eng-GB'); - $this->assertInstanceOf( + self::assertInstanceOf( Type::class, $res ); diff --git a/tests/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/AddFieldTest.php b/tests/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/AddFieldTest.php index 74bb0971ee..850af03874 100644 --- a/tests/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/AddFieldTest.php +++ b/tests/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/AddFieldTest.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\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action; use Ibexa\Contracts\Core\Persistence\Content; @@ -66,7 +67,7 @@ public function testConstructor() $this->getContentMapperMock() ); - $this->assertInstanceOf(AddField::class, $action); + self::assertInstanceOf(AddField::class, $action); } public function testApplySingleVersionSingleTranslation() @@ -77,34 +78,34 @@ public function testApplySingleVersionSingleTranslation() $action = $this->getMockedAction(['insertField']); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('listVersionNumbers') - ->with($this->equalTo($contentId)) - ->will($this->returnValue($versionNumbers)); + ->with(self::equalTo($contentId)) + ->will(self::returnValue($versionNumbers)); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('loadVersionedNameData') - ->with($this->equalTo([['id' => $contentId, 'version' => 1]])) - ->will($this->returnValue([])); + ->with(self::equalTo([['id' => $contentId, 'version' => 1]])) + ->will(self::returnValue([])); $this->getContentGatewayMock() - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('load') ->with($contentId, 1) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->getContentMapperMock() - ->expects($this->once()) + ->expects(self::once()) ->method('extractContentFromRows') ->with([], []) - ->will($this->returnValue([$content])); + ->will(self::returnValue([$content])); $action - ->expects($this->once()) + ->expects(self::once()) ->method('insertField') ->with($content, $this->getFieldReference(null, 1, 'cro-HR')) - ->will($this->returnValue('fieldId1')); + ->will(self::returnValue('fieldId1')); $action->apply($contentId); } @@ -117,40 +118,40 @@ public function testApplySingleVersionMultipleTranslations() $action = $this->getMockedAction(['insertField']); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('listVersionNumbers') - ->with($this->equalTo($contentId)) - ->will($this->returnValue($versionNumbers)); + ->with(self::equalTo($contentId)) + ->will(self::returnValue($versionNumbers)); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('loadVersionedNameData') - ->with($this->equalTo([['id' => $contentId, 'version' => 1]])) - ->will($this->returnValue([])); + ->with(self::equalTo([['id' => $contentId, 'version' => 1]])) + ->will(self::returnValue([])); $this->getContentGatewayMock() - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('load') ->with($contentId, 1) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->getContentMapperMock() - ->expects($this->once()) + ->expects(self::once()) ->method('extractContentFromRows') ->with([], []) - ->will($this->returnValue([$content])); + ->will(self::returnValue([$content])); $action - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('insertField') ->with($content, $this->getFieldReference(null, 1, 'eng-GB')) - ->will($this->returnValue('fieldId1')); + ->will(self::returnValue('fieldId1')); $action - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('insertField') ->with($content, $this->getFieldReference(null, 1, 'ger-DE')) - ->will($this->returnValue('fieldId2')); + ->will(self::returnValue('fieldId2')); $action->apply($contentId); } @@ -164,52 +165,52 @@ public function testApplyMultipleVersionsSingleTranslation() $action = $this->getMockedAction(['insertField']); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('listVersionNumbers') - ->with($this->equalTo($contentId)) - ->will($this->returnValue($versionNumbers)); + ->with(self::equalTo($contentId)) + ->will(self::returnValue($versionNumbers)); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('loadVersionedNameData') - ->with($this->equalTo([['id' => $contentId, 'version' => 1], ['id' => $contentId, 'version' => 2]])) - ->will($this->returnValue([])); + ->with(self::equalTo([['id' => $contentId, 'version' => 1], ['id' => $contentId, 'version' => 2]])) + ->will(self::returnValue([])); $this->getContentGatewayMock() - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('load') ->with($contentId, 1) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->getContentMapperMock() - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('extractContentFromRows') ->with([], []) - ->will($this->returnValue([$content1])); + ->will(self::returnValue([$content1])); $this->getContentGatewayMock() - ->expects($this->at(3)) + ->expects(self::at(3)) ->method('load') ->with($contentId, 2) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->getContentMapperMock() - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('extractContentFromRows') ->with([], []) - ->will($this->returnValue([$content2])); + ->will(self::returnValue([$content2])); $action - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('insertField') ->with($content1, $this->getFieldReference(null, 1, 'eng-GB')) - ->will($this->returnValue('fieldId1')); + ->will(self::returnValue('fieldId1')); $action - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('insertField') ->with($content2, $this->getFieldReference('fieldId1', 2, 'eng-GB')) - ->will($this->returnValue('fieldId1')); + ->will(self::returnValue('fieldId1')); $action->apply($contentId); } @@ -223,64 +224,64 @@ public function testApplyMultipleVersionsMultipleTranslations() $action = $this->getMockedAction(['insertField']); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('listVersionNumbers') - ->with($this->equalTo($contentId)) - ->will($this->returnValue($versionNumbers)); + ->with(self::equalTo($contentId)) + ->will(self::returnValue($versionNumbers)); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('loadVersionedNameData') - ->with($this->equalTo([['id' => $contentId, 'version' => 1], ['id' => $contentId, 'version' => 2]])) - ->will($this->returnValue([])); + ->with(self::equalTo([['id' => $contentId, 'version' => 1], ['id' => $contentId, 'version' => 2]])) + ->will(self::returnValue([])); $this->getContentGatewayMock() - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('load') ->with($contentId, 1) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->getContentMapperMock() - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('extractContentFromRows') ->with([], []) - ->will($this->returnValue([$content1])); + ->will(self::returnValue([$content1])); $this->getContentGatewayMock() - ->expects($this->at(3)) + ->expects(self::at(3)) ->method('load') ->with($contentId, 2) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->getContentMapperMock() - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('extractContentFromRows') ->with([], []) - ->will($this->returnValue([$content2])); + ->will(self::returnValue([$content2])); $action - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('insertField') ->with($content1, $this->getFieldReference(null, 1, 'eng-GB')) - ->will($this->returnValue('fieldId1')); + ->will(self::returnValue('fieldId1')); $action - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('insertField') ->with($content1, $this->getFieldReference(null, 1, 'ger-DE')) - ->will($this->returnValue('fieldId2')); + ->will(self::returnValue('fieldId2')); $action - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('insertField') ->with($content2, $this->getFieldReference('fieldId1', 2, 'eng-GB')) - ->will($this->returnValue('fieldId1')); + ->will(self::returnValue('fieldId1')); $action - ->expects($this->at(3)) + ->expects(self::at(3)) ->method('insertField') ->with($content2, $this->getFieldReference('fieldId2', 2, 'ger-DE')) - ->will($this->returnValue('fieldId2')); + ->will(self::returnValue('fieldId2')); $action->apply($contentId); } @@ -298,30 +299,30 @@ public function testInsertNewField() $field->value = $value; $this->getFieldValueConverterMock() - ->expects($this->once()) + ->expects(self::once()) ->method('toStorageValue') ->with( $value, - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(StorageFieldValue::class) ); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('insertNewField') ->with( $content, $field, - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(StorageFieldValue::class) ) - ->will($this->returnValue(23)); + ->will(self::returnValue(23)); $this->getContentStorageHandlerMock() - ->expects($this->once()) + ->expects(self::once()) ->method('storeFieldData') ->with($versionInfo, $field) - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); - $this->getContentGatewayMock()->expects($this->never())->method('updateField'); + $this->getContentGatewayMock()->expects(self::never())->method('updateField'); $action = $this->getMockedAction(); @@ -330,8 +331,8 @@ public function testInsertNewField() $refMethod->setAccessible(true); $fieldId = $refMethod->invoke($action, $content, $field); - $this->assertEquals(23, $fieldId); - $this->assertEquals(23, $field->id); + self::assertEquals(23, $fieldId); + self::assertEquals(23, $field->id); } public function testInsertNewFieldUpdating() @@ -347,35 +348,35 @@ public function testInsertNewFieldUpdating() $field->value = $value; $this->getFieldValueConverterMock() - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('toStorageValue') ->with( $value, - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(StorageFieldValue::class) ); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('insertNewField') ->with( $content, $field, - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(StorageFieldValue::class) ) - ->will($this->returnValue(23)); + ->will(self::returnValue(23)); $this->getContentStorageHandlerMock() - ->expects($this->once()) + ->expects(self::once()) ->method('storeFieldData') ->with($versionInfo, $field) - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('updateField') ->with( $field, - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(StorageFieldValue::class) ); $action = $this->getMockedAction(); @@ -385,8 +386,8 @@ public function testInsertNewFieldUpdating() $refMethod->setAccessible(true); $fieldId = $refMethod->invoke($action, $content, $field); - $this->assertEquals(23, $fieldId); - $this->assertEquals(23, $field->id); + self::assertEquals(23, $fieldId); + self::assertEquals(23, $field->id); } public function testInsertExistingField() @@ -402,29 +403,29 @@ public function testInsertExistingField() $field->value = $value; $this->getFieldValueConverterMock() - ->expects($this->once()) + ->expects(self::once()) ->method('toStorageValue') ->with( $value, - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(StorageFieldValue::class) ); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('insertExistingField') ->with( $content, $field, - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(StorageFieldValue::class) ); $this->getContentStorageHandlerMock() - ->expects($this->once()) + ->expects(self::once()) ->method('storeFieldData') ->with($versionInfo, $field) - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); - $this->getContentGatewayMock()->expects($this->never())->method('updateField'); + $this->getContentGatewayMock()->expects(self::never())->method('updateField'); $action = $this->getMockedAction(); @@ -433,8 +434,8 @@ public function testInsertExistingField() $refMethod->setAccessible(true); $fieldId = $refMethod->invoke($action, $content, $field); - $this->assertEquals(32, $fieldId); - $this->assertEquals(32, $field->id); + self::assertEquals(32, $fieldId); + self::assertEquals(32, $field->id); } public function testInsertExistingFieldUpdating() @@ -450,34 +451,34 @@ public function testInsertExistingFieldUpdating() $field->value = $value; $this->getFieldValueConverterMock() - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('toStorageValue') ->with( $value, - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(StorageFieldValue::class) ); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('insertExistingField') ->with( $content, $field, - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(StorageFieldValue::class) ); $this->getContentStorageHandlerMock() - ->expects($this->once()) + ->expects(self::once()) ->method('storeFieldData') ->with($versionInfo, $field) - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('updateField') ->with( $field, - $this->isInstanceOf(StorageFieldValue::class) + self::isInstanceOf(StorageFieldValue::class) ); $action = $this->getMockedAction(); @@ -487,8 +488,8 @@ public function testInsertExistingFieldUpdating() $refMethod->setAccessible(true); $fieldId = $refMethod->invoke($action, $content, $field); - $this->assertEquals(32, $fieldId); - $this->assertEquals(32, $field->id); + self::assertEquals(32, $fieldId); + self::assertEquals(32, $field->id); } /** diff --git a/tests/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/RemoveFieldTest.php b/tests/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/RemoveFieldTest.php index 434f513d02..034b5143d6 100644 --- a/tests/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/RemoveFieldTest.php +++ b/tests/lib/Persistence/Legacy/Content/Type/ContentUpdater/Action/RemoveFieldTest.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\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action; use Ibexa\Contracts\Core\Persistence\Content; @@ -51,40 +52,40 @@ public function testApplySingleVersionSingleTranslation() $content = $this->getContentFixture(1, ['cro-HR' => $fieldId]); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('listVersionNumbers') - ->with($this->equalTo($contentId)) - ->will($this->returnValue($versionNumbers)); + ->with(self::equalTo($contentId)) + ->will(self::returnValue($versionNumbers)); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('loadVersionedNameData') - ->with($this->equalTo([['id' => $contentId, 'version' => 1]])) - ->will($this->returnValue([])); + ->with(self::equalTo([['id' => $contentId, 'version' => 1]])) + ->will(self::returnValue([])); $this->getContentGatewayMock() - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('load') ->with($contentId, 1) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->getContentMapperMock() - ->expects($this->once()) + ->expects(self::once()) ->method('extractContentFromRows') ->with([], []) - ->will($this->returnValue([$content])); + ->will(self::returnValue([$content])); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('deleteField') - ->with($this->equalTo($fieldId)); + ->with(self::equalTo($fieldId)); - $this->getContentStorageHandlerMock()->expects($this->once()) + $this->getContentStorageHandlerMock()->expects(self::once()) ->method('deleteFieldData') ->with( - $this->equalTo('ezstring'), + self::equalTo('ezstring'), $content->versionInfo, - $this->equalTo([$fieldId]) + self::equalTo([$fieldId]) ); $action->apply($contentId); @@ -100,62 +101,62 @@ public function testApplyMultipleVersionsSingleTranslation() $content2 = $this->getContentFixture(2, ['cro-HR' => $fieldId]); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('listVersionNumbers') - ->with($this->equalTo($contentId)) - ->will($this->returnValue($versionNumbers)); + ->with(self::equalTo($contentId)) + ->will(self::returnValue($versionNumbers)); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('loadVersionedNameData') - ->with($this->equalTo([['id' => $contentId, 'version' => 1], ['id' => $contentId, 'version' => 2]])) - ->will($this->returnValue([])); + ->with(self::equalTo([['id' => $contentId, 'version' => 1], ['id' => $contentId, 'version' => 2]])) + ->will(self::returnValue([])); $this->getContentGatewayMock() - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('load') ->with($contentId, 1) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->getContentMapperMock() - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('extractContentFromRows') ->with([], []) - ->will($this->returnValue([$content1])); + ->will(self::returnValue([$content1])); $this->getContentGatewayMock() - ->expects($this->at(3)) + ->expects(self::at(3)) ->method('load') ->with($contentId, 2) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->getContentMapperMock() - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('extractContentFromRows') ->with([], []) - ->will($this->returnValue([$content2])); + ->will(self::returnValue([$content2])); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('deleteField') - ->with($this->equalTo($fieldId)); + ->with(self::equalTo($fieldId)); $this->getContentStorageHandlerMock() - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('deleteFieldData') ->with( - $this->equalTo('ezstring'), + self::equalTo('ezstring'), $content1->versionInfo, - $this->equalTo([$fieldId]) + self::equalTo([$fieldId]) ); $this->getContentStorageHandlerMock() - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('deleteFieldData') ->with( - $this->equalTo('ezstring'), + self::equalTo('ezstring'), $content2->versionInfo, - $this->equalTo([$fieldId]) + self::equalTo([$fieldId]) ); $action->apply($contentId); @@ -172,73 +173,73 @@ public function testApplyMultipleVersionsMultipleTranslations() $content2 = $this->getContentFixture(2, ['cro-HR' => $fieldId1, 'hun-HU' => $fieldId2]); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('listVersionNumbers') - ->with($this->equalTo($contentId)) - ->will($this->returnValue($versionNumbers)); + ->with(self::equalTo($contentId)) + ->will(self::returnValue($versionNumbers)); $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('loadVersionedNameData') - ->with($this->equalTo([['id' => $contentId, 'version' => 1], ['id' => $contentId, 'version' => 2]])) - ->will($this->returnValue([])); + ->with(self::equalTo([['id' => $contentId, 'version' => 1], ['id' => $contentId, 'version' => 2]])) + ->will(self::returnValue([])); $this->getContentGatewayMock() - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('load') ->with($contentId, 1) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->getContentMapperMock() - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('extractContentFromRows') ->with([], []) - ->will($this->returnValue([$content1])); + ->will(self::returnValue([$content1])); $this->getContentGatewayMock() - ->expects($this->at(3)) + ->expects(self::at(3)) ->method('load') ->with($contentId, 2) - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->getContentMapperMock() - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('extractContentFromRows') ->with([], []) - ->will($this->returnValue([$content2])); + ->will(self::returnValue([$content2])); $this->getContentGatewayMock() - ->expects($this->at(5)) + ->expects(self::at(5)) ->method('deleteField') - ->with($this->equalTo($fieldId1)); + ->with(self::equalTo($fieldId1)); $this->getContentGatewayMock() - ->expects($this->at(6)) + ->expects(self::at(6)) ->method('deleteField') - ->with($this->equalTo($fieldId2)); + ->with(self::equalTo($fieldId2)); $this->getContentStorageHandlerMock() - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('deleteFieldData') ->with( - $this->equalTo('ezstring'), + self::equalTo('ezstring'), $content1->versionInfo, - $this->equalTo([$fieldId1, $fieldId2]) + self::equalTo([$fieldId1, $fieldId2]) ); $this->getContentStorageHandlerMock() - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('deleteFieldData') ->with( - $this->equalTo('ezstring'), + self::equalTo('ezstring'), $content2->versionInfo, - $this->equalTo([$fieldId1, $fieldId2]) + self::equalTo([$fieldId1, $fieldId2]) ); $this->getContentGatewayMock() - ->expects($this->at(4)) + ->expects(self::at(4)) ->method('removeRelationsByFieldDefinitionId') - ->with($this->equalTo(42)); + ->with(self::equalTo(42)); $action->apply($contentId); } diff --git a/tests/lib/Persistence/Legacy/Content/Type/ContentUpdaterTest.php b/tests/lib/Persistence/Legacy/Content/Type/ContentUpdaterTest.php index 13eb38a168..6758f41d14 100644 --- a/tests/lib/Persistence/Legacy/Content/Type/ContentUpdaterTest.php +++ b/tests/lib/Persistence/Legacy/Content/Type/ContentUpdaterTest.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\Core\Persistence\Legacy\Content\Type; use Ibexa\Contracts\Core\Persistence\Content\Type; @@ -65,11 +66,11 @@ public function testDetermineActions() $toType = $this->getToTypeFixture(); $converterRegMock = $this->getConverterRegistryMock(); - $converterRegMock->expects($this->once()) + $converterRegMock->expects(self::once()) ->method('getConverter') ->with('ezstring') ->will( - $this->returnValue( + self::returnValue( ($converterMock = $this->createMock(Converter::class)) ) ); @@ -78,7 +79,7 @@ public function testDetermineActions() $actions = $updater->determineActions($fromType, $toType); - $this->assertEquals( + self::assertEquals( [ new ContentUpdater\Action\RemoveField( $this->getContentGatewayMock(), @@ -108,10 +109,10 @@ public function testApplyUpdates() '', false ); - $actionA->expects($this->at(0)) + $actionA->expects(self::at(0)) ->method('apply') ->with(11); - $actionA->expects($this->at(1)) + $actionA->expects(self::at(1)) ->method('apply') ->with(22); $actionB = $this->getMockForAbstractClass( @@ -120,21 +121,21 @@ public function testApplyUpdates() '', false ); - $actionB->expects($this->at(0)) + $actionB->expects(self::at(0)) ->method('apply') ->with(11); - $actionB->expects($this->at(1)) + $actionB->expects(self::at(1)) ->method('apply') ->with(22); $actions = [$actionA, $actionB]; $this->getContentGatewayMock() - ->expects($this->once()) + ->expects(self::once()) ->method('getContentIdsByContentTypeId') ->with(23) ->will( - $this->returnValue([11, 22]) + self::returnValue([11, 22]) ); $updater->applyUpdates(23, $actions); diff --git a/tests/lib/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabaseTest.php b/tests/lib/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabaseTest.php index f6b066ea9a..953d4f423a 100644 --- a/tests/lib/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabaseTest.php +++ b/tests/lib/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabaseTest.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\Core\Persistence\Legacy\Content\Type\Gateway; use Ibexa\Contracts\Core\Persistence\Content\Location; @@ -198,11 +199,11 @@ public function testCountTypesInGroup() $gateway = $this->getGateway(); - $this->assertEquals( + self::assertEquals( 3, $gateway->countTypesInGroup(1) ); - $this->assertEquals( + self::assertEquals( 0, $gateway->countTypesInGroup(23) ); @@ -216,11 +217,11 @@ public function testCountGroupsForType() $gateway = $this->getGateway(); - $this->assertEquals( + self::assertEquals( 1, $gateway->countGroupsForType(1, 1) ); - $this->assertEquals( + self::assertEquals( 0, $gateway->countGroupsForType(23, 0) ); @@ -257,7 +258,7 @@ public function testLoadGroupData() $gateway = $this->getGateway(); $data = $gateway->loadGroupData([2]); - $this->assertEquals( + self::assertEquals( [ [ 'created' => '1031216941', @@ -282,7 +283,7 @@ public function testLoadGroupDataByIdentifier() $gateway = $this->getGateway(); $data = $gateway->loadGroupDataByIdentifier('Users'); - $this->assertEquals( + self::assertEquals( [ [ 'created' => '1031216941', @@ -307,12 +308,12 @@ public function testLoadAllGroupsData() $gateway = $this->getGateway(); $data = $gateway->loadAllGroupsData(); - $this->assertCount( + self::assertCount( 3, $data ); - $this->assertEquals( + self::assertEquals( [ 'created' => '1031216941', 'creator_id' => '14', @@ -335,7 +336,7 @@ public function testLoadTypesDataForGroup() $gateway = $this->getGateway(); $rows = $gateway->loadTypesDataForGroup(1, 0); - $this->assertCount( + self::assertCount( 4, $rows ); @@ -350,11 +351,11 @@ public function testLoadTypeData() $gateway = $this->getGateway(); $rows = $gateway->loadTypeData(1, 0); - $this->assertCount( + self::assertCount( 3, $rows ); - $this->assertCount( + self::assertCount( 50, $rows[0] ); @@ -378,11 +379,11 @@ public function testLoadTypeDataByIdentifier() $gateway = $this->getGateway(); $rows = $gateway->loadTypeDataByIdentifier('folder', 0); - $this->assertCount( + self::assertCount( 3, $rows ); - $this->assertCount( + self::assertCount( 50, $rows[0] ); @@ -397,11 +398,11 @@ public function testLoadTypeDataByRemoteId() $gateway = $this->getGateway(); $rows = $gateway->loadTypeDataByRemoteId('a3d405b81be900468eb153d774f4f0d2', 0); - $this->assertCount( + self::assertCount( 3, $rows ); - $this->assertCount( + self::assertCount( 50, $rows[0] ); @@ -943,7 +944,7 @@ public function testCountInstancesOfTypeExist() $gateway = $this->getGateway(); $res = $gateway->countInstancesOfType(3, 0); - $this->assertEquals( + self::assertEquals( 6, $res ); @@ -959,7 +960,7 @@ public function testCountInstancesOfTypeNotExist() $gateway = $this->getGateway(); $res = $gateway->countInstancesOfType(23422342, 1); - $this->assertEquals( + self::assertEquals( 0, $res ); diff --git a/tests/lib/Persistence/Legacy/Content/Type/MapperTest.php b/tests/lib/Persistence/Legacy/Content/Type/MapperTest.php index ac0c855526..424fc60e2d 100644 --- a/tests/lib/Persistence/Legacy/Content/Type/MapperTest.php +++ b/tests/lib/Persistence/Legacy/Content/Type/MapperTest.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\Core\Persistence\Legacy\Content\Type; use Ibexa\Contracts\Core\Persistence\Content\Location; @@ -39,7 +40,7 @@ public function testCreateGroupFromCreateStruct() $group = $mapper->createGroupFromCreateStruct($createStruct); - $this->assertInstanceOf( + self::assertInstanceOf( Group::class, $group ); @@ -94,7 +95,7 @@ public function testTypeFromCreateStruct() $type = $mapper->createTypeFromCreateStruct($struct); foreach ($struct as $propName => $propVal) { - $this->assertEquals( + self::assertEquals( $struct->$propName, $type->$propName, "Property \${$propName} not equal" @@ -204,7 +205,7 @@ public function testCreateStructFromType() // Iterate through struct, since it has fewer props foreach ($struct as $propName => $propVal) { - $this->assertEquals( + self::assertEquals( $struct->$propName, $type->$propName, "Property \${$propName} not equal" @@ -287,7 +288,7 @@ public function testExtractGroupsFromRows() $groupFixtureSystem->identifier = 'System'; $groupFixtureSystem->isSystem = true; - $this->assertEquals( + self::assertEquals( [$groupFixtureMedia, $groupFixtureSystem], $groups ); @@ -300,7 +301,7 @@ public function testExtractTypesFromRowsSingle() $mapper = $this->getNonConvertingMapper(); $types = $mapper->extractTypesFromRows($rows); - $this->assertCount( + self::assertCount( 1, $types, 'Incorrect number of types extracted' @@ -332,7 +333,7 @@ public function testExtractTypesFromRowsSingle() $types[0] ); - $this->assertCount( + self::assertCount( 4, $types[0]->fieldDefinitions, 'Incorrect number of field definitions' @@ -377,13 +378,13 @@ public function testExtractTypesFromRowsSingle() public function testToStorageFieldDefinition() { $converterMock = $this->createMock(Converter::class); - $converterMock->expects($this->once()) + $converterMock->expects(self::once()) ->method('toStorageFieldDefinition') ->with( - $this->isInstanceOf( + self::isInstanceOf( FieldDefinition::class ), - $this->isInstanceOf( + self::isInstanceOf( StorageFieldDefinition::class ) ); @@ -415,14 +416,14 @@ public function testToFieldDefinition() $fieldDef->fieldType = 'some_type'; $converterMock = $this->createMock(Converter::class); - $converterMock->expects($this->once()) + $converterMock->expects(self::once()) ->method('toFieldDefinition') ->with($storageFieldDef, $fieldDef); $converterRegistry = new ConverterRegistry(['some_type' => $converterMock]); $storageDispatcher = $this->getStorageDispatcherMock(); $storageDispatcher - ->expects($this->once()) + ->expects(self::once()) ->method('loadFieldConstraintsData') ->with($fieldDef); @@ -452,14 +453,14 @@ protected function getNonConvertingMapper() ->getMock(); // Dedicatedly tested test - $mapper->expects($this->atLeastOnce()) + $mapper->expects(self::atLeastOnce()) ->method('toFieldDefinition') ->with( - $this->isInstanceOf( + self::isInstanceOf( StorageFieldDefinition::class ) )->will( - $this->returnCallback( + self::returnCallback( static function () { return new FieldDefinition(); } diff --git a/tests/lib/Persistence/Legacy/Content/Type/StorageDispatcherTest.php b/tests/lib/Persistence/Legacy/Content/Type/StorageDispatcherTest.php index 50f4e3ab40..c99c84d98d 100644 --- a/tests/lib/Persistence/Legacy/Content/Type/StorageDispatcherTest.php +++ b/tests/lib/Persistence/Legacy/Content/Type/StorageDispatcherTest.php @@ -25,7 +25,7 @@ public function testPublishFieldConstraintsData(): void { $storage = $this->createMock(FieldConstraintsStorage::class); $storage - ->expects($this->once()) + ->expects(self::once()) ->method('publishFieldConstraintsData') ->with(self::EXAMPLE_FIELD_DEFINITION_ID); @@ -46,7 +46,7 @@ public function testStoreFieldConstraintsData(): void $storage = $this->createMock(FieldConstraintsStorage::class); $storage - ->expects($this->once()) + ->expects(self::once()) ->method('storeFieldConstraintsData') ->with(self::EXAMPLE_FIELD_DEFINITION_ID, $status, $constraints); @@ -81,7 +81,7 @@ public function testLoadFieldConstraintsData(): void $storage = $this->createMock(FieldConstraintsStorage::class); $storage - ->expects($this->once()) + ->expects(self::once()) ->method('getFieldConstraintsData') ->with(self::EXAMPLE_FIELD_DEFINITION_ID) ->willReturn($constraints); @@ -125,7 +125,7 @@ public function testDeleteFieldConstraintsData(): void { $storage = $this->createMock(FieldConstraintsStorage::class); $storage - ->expects($this->once()) + ->expects(self::once()) ->method('deleteFieldConstraintsData') ->with(self::EXAMPLE_FIELD_DEFINITION_ID); @@ -156,7 +156,7 @@ private function createStorageRegistryMockWithoutExternalStorage(): StorageRegis $registry = $this->createMock(StorageRegistryInterface::class); $registry->method('hasStorage')->with(self::EXAMPLE_FIELD_TYPE_IDENTIFIER)->willReturn(false); $registry - ->expects($this->never()) + ->expects(self::never()) ->method('getStorage') ->with(self::EXAMPLE_FIELD_TYPE_IDENTIFIER); diff --git a/tests/lib/Persistence/Legacy/Content/Type/Update/Handler/DoctrineDatabaseTest.php b/tests/lib/Persistence/Legacy/Content/Type/Update/Handler/DoctrineDatabaseTest.php index b051d3f509..3ae2e0f163 100644 --- a/tests/lib/Persistence/Legacy/Content/Type/Update/Handler/DoctrineDatabaseTest.php +++ b/tests/lib/Persistence/Legacy/Content/Type/Update/Handler/DoctrineDatabaseTest.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\Core\Persistence\Legacy\Content\Type\Update\Handler; use Ibexa\Contracts\Core\Persistence\Content\Type; @@ -37,22 +38,22 @@ public function testUpdateContentObjects() $updaterMock = $this->getContentUpdaterMock(); - $updaterMock->expects($this->once()) + $updaterMock->expects(self::once()) ->method('determineActions') ->with( - $this->isInstanceOf( + self::isInstanceOf( Type::class ), - $this->isInstanceOf( + self::isInstanceOf( Type::class ) - )->will($this->returnValue([])); + )->will(self::returnValue([])); - $updaterMock->expects($this->once()) + $updaterMock->expects(self::once()) ->method('applyUpdates') ->with( - $this->equalTo(23), - $this->equalTo([]) + self::equalTo(23), + self::equalTo([]) ); $types = $this->getTypeFixtures(); @@ -66,11 +67,11 @@ public function testDeleteOldType() $gatewayMock = $this->getGatewayMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('delete') ->with( - $this->equalTo(23), - $this->equalTo(0) + self::equalTo(23), + self::equalTo(0) ); $types = $this->getTypeFixtures(); @@ -85,9 +86,9 @@ public function testPublishNewType() $gatewayMock = $this->getGatewayMock(); $updaterMock = $this->getContentUpdaterMock(); - $gatewayMock->expects($this->once()) + $gatewayMock->expects(self::once()) ->method('publishTypeAndFields') - ->with($this->equalTo(23), $this->equalTo(1), $this->equalTo(0)); + ->with(self::equalTo(23), self::equalTo(1), self::equalTo(0)); $types = $this->getTypeFixtures(); diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/Gateway/DoctrineDatabaseTest.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/Gateway/DoctrineDatabaseTest.php index b5a4d87770..33dcae560c 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/Gateway/DoctrineDatabaseTest.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/Gateway/DoctrineDatabaseTest.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\Core\Persistence\Legacy\Content\UrlAlias\Gateway; use Ibexa\Core\Persistence\Legacy\Content\Language\Gateway\DoctrineDatabase as LanguageGateway; diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/SlugConverterTest.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/SlugConverterTest.php index ea188520d3..d7b0ebee88 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/SlugConverterTest.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/SlugConverterTest.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\Core\Persistence\Legacy\Content\UrlAlias; use Ibexa\Core\Persistence\Legacy\Content\UrlAlias\SlugConverter; @@ -31,17 +32,17 @@ public function testConvert() $transformedText = 'test text c '; $slug = 'test_text_c'; - $transformationProcessor->expects($this->atLeastOnce()) + $transformationProcessor->expects(self::atLeastOnce()) ->method('transform') ->with($text, ['test_command1']) - ->will($this->returnValue($transformedText)); + ->will(self::returnValue($transformedText)); - $slugConverter->expects($this->once()) + $slugConverter->expects(self::once()) ->method('cleanupText') - ->with($this->equalTo($transformedText), $this->equalTo('test_cleanup1')) - ->will($this->returnValue($slug)); + ->with(self::equalTo($transformedText), self::equalTo('test_cleanup1')) + ->will(self::returnValue($slug)); - $this->assertEquals( + self::assertEquals( $slug, $slugConverter->convert($text) ); @@ -59,17 +60,17 @@ public function testConvertWithDefaultTextFallback() $transformedText = 'test text c '; $slug = 'test_text_c'; - $transformationProcessor->expects($this->atLeastOnce()) + $transformationProcessor->expects(self::atLeastOnce()) ->method('transform') ->with($defaultText, ['test_command1']) - ->will($this->returnValue($transformedText)); + ->will(self::returnValue($transformedText)); - $slugConverter->expects($this->once()) + $slugConverter->expects(self::once()) ->method('cleanupText') - ->with($this->equalTo($transformedText), $this->equalTo('test_cleanup1')) - ->will($this->returnValue($slug)); + ->with(self::equalTo($transformedText), self::equalTo('test_cleanup1')) + ->will(self::returnValue($slug)); - $this->assertEquals( + self::assertEquals( $slug, $slugConverter->convert('', $defaultText) ); @@ -87,17 +88,17 @@ public function testConvertWithGivenTransformation() $transformedText = 'test text c '; $slug = 'test_text_c'; - $transformationProcessor->expects($this->atLeastOnce()) + $transformationProcessor->expects(self::atLeastOnce()) ->method('transform') ->with($text, ['test_command2']) - ->will($this->returnValue($transformedText)); + ->will(self::returnValue($transformedText)); - $slugConverter->expects($this->once()) + $slugConverter->expects(self::once()) ->method('cleanupText') - ->with($this->equalTo($transformedText), $this->equalTo('test_cleanup2')) - ->will($this->returnValue($slug)); + ->with(self::equalTo($transformedText), self::equalTo('test_cleanup2')) + ->will(self::returnValue($slug)); - $this->assertEquals( + self::assertEquals( $slug, $slugConverter->convert($text, '_1', 'testTransformation2') ); @@ -122,7 +123,7 @@ public function testGetUniqueCounterValue($text, $isRootLevel, $returnValue) { $slugConverter = $this->getMockedSlugConverter(); - $this->assertEquals( + self::assertEquals( $returnValue, $slugConverter->getUniqueCounterValue($text, $isRootLevel) ); @@ -164,7 +165,7 @@ public function testCleanupText($text, $method, $expected) $actual = $testMethod->invoke($this->getMockedSlugConverter(), $text, $method); - $this->assertEquals( + self::assertEquals( $expected, $actual ); @@ -216,7 +217,7 @@ public function testConvertNoMocking($text, $defaultText, $transformation, $expe ); $slugConverter = new SlugConverter($transformationProcessor); - $this->assertEquals( + self::assertEquals( $expected, $slugConverter->convert($text, $defaultText, $transformation) ); diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/UrlAliasHandlerTest.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/UrlAliasHandlerTest.php index 13569aefd1..748f7d2b75 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/UrlAliasHandlerTest.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/UrlAliasHandlerTest.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\Core\Persistence\Legacy\Content\UrlAlias; use Ibexa\Contracts\Core\Persistence\Content\UrlAlias; @@ -342,7 +343,9 @@ public function providerForTestLookupLocationUrlAlias() * Testing that UrlAlias is found and has expected state. * * @dataProvider providerForTestLookupLocationUrlAlias + * * @depends testLookup + * * @group location */ public function testLookupLocationUrlAlias( @@ -390,7 +393,9 @@ public function testLookupLocationUrlAlias( * * * @dataProvider providerForTestLookupLocationUrlAlias + * * @depends testLookup + * * @group case-correction * @group location * @@ -518,7 +523,9 @@ public function providerForTestLookupLocationMultipleLanguages() * Test for the lookup() method. * * @dataProvider providerForTestLookupLocationMultipleLanguages + * * @depends testLookup + * * @group multiple-languages * @group location */ @@ -560,6 +567,7 @@ public function testLookupLocationMultipleLanguages( * @todo document * * @depends testLookup + * * @group history * @group location */ @@ -698,7 +706,9 @@ public function providerForTestLookupCustomLocationUrlAlias() * Testing that UrlAlias is found and has expected state. * * @dataProvider providerForTestLookupCustomLocationUrlAlias + * * @depends testLookup + * * @group location * @group custom */ @@ -740,7 +750,9 @@ public function testLookupCustomLocationUrlAlias( * Testing that UrlAlias is found and has expected state. * * @dataProvider providerForTestLookupCustomLocationUrlAlias + * * @depends testLookup + * * @group location * @group custom */ @@ -797,7 +809,9 @@ public function providerForTestLookupVirtualUrlAlias() * Testing that NOP action redirects to site root. * * @dataProvider providerForTestLookupVirtualUrlAlias + * * @depends testLookup + * * @group virtual */ public function testLookupVirtualUrlAlias($url, $id) @@ -866,7 +880,9 @@ public function providerForTestLookupResourceUrlAlias() * Testing that UrlAlias is found and has expected state. * * @dataProvider providerForTestLookupResourceUrlAlias + * * @depends testLookup + * * @group resource */ public function testLookupResourceUrlAlias( @@ -908,7 +924,9 @@ public function testLookupResourceUrlAlias( * Testing that UrlAlias is found and has expected state. * * @dataProvider providerForTestLookupResourceUrlAlias + * * @depends testLookup + * * @group resource */ public function testLookupResourceUrlAliasCaseInsensitive( @@ -1038,8 +1056,8 @@ public function testListURLAliasesForLocation() * * @todo document * - * * @depends testLookupLocationUrlAlias + * * @group publish */ public function testPublishUrlAliasForLocation() @@ -1082,8 +1100,8 @@ public function testPublishUrlAliasForLocation() * * @todo document * - * * @depends testPublishUrlAliasForLocation + * * @group publish */ public function testPublishUrlAliasForLocationRepublish() @@ -1108,8 +1126,8 @@ public function testPublishUrlAliasForLocationRepublish() * * @todo document * - * * @depends testPublishUrlAliasForLocation + * * @group publish */ public function testPublishUrlAliasCreatesUniqueAlias() @@ -1160,9 +1178,10 @@ public function providerForTestPublishUrlAliasForLocationComplex() * * @todo document * - * * @dataProvider providerForTestPublishUrlAliasForLocationComplex + * * @depends testPublishUrlAliasForLocation + * * @group publish */ public function testPublishUrlAliasForLocationComplex( @@ -1209,8 +1228,8 @@ public function testPublishUrlAliasForLocationComplex( * * @todo document * - * * @depends testPublishUrlAliasForLocation + * * @group publish */ public function testPublishUrlAliasForLocationSameAliasForMultipleLanguages() @@ -1258,8 +1277,8 @@ public function testPublishUrlAliasForLocationSameAliasForMultipleLanguages() * * @todo document * - * * @depends testPublishUrlAliasForLocation + * * @group publish */ public function testPublishUrlAliasForLocationDowngradesOldEntryToHistory() @@ -1330,9 +1349,9 @@ public function testPublishUrlAliasForLocationDowngradesOldEntryToHistory() * * @todo document * - * * @depends testPublishUrlAliasForLocation * @depends testPublishUrlAliasForLocationSameAliasForMultipleLanguages + * * @group publish * @group downgrade */ @@ -1405,9 +1424,9 @@ public function testPublishUrlAliasForLocationDowngradesOldEntryRemovesLanguage( * * @todo document * - * * @depends testPublishUrlAliasForLocation * @depends testPublishUrlAliasForLocationDowngradesOldEntryToHistory + * * @group publish */ public function testPublishUrlAliasForLocationReusesHistory() @@ -1438,9 +1457,9 @@ public function testPublishUrlAliasForLocationReusesHistory() * * @todo document * - * * @depends testPublishUrlAliasForLocation * @depends testPublishUrlAliasForLocationDowngradesOldEntryToHistory + * * @group publish */ public function testPublishUrlAliasForLocationReusesHistoryOfDifferentLanguage() @@ -1491,8 +1510,8 @@ public function testPublishUrlAliasForLocationReusesHistoryOfDifferentLanguage() * * @todo document * - * * @depends testPublishUrlAliasForLocation + * * @group publish */ public function testPublishUrlAliasForLocationReusesCustomAlias() @@ -1516,7 +1535,6 @@ public function testPublishUrlAliasForLocationReusesCustomAlias() * * @todo document * - * * @depends testPublishUrlAliasForLocation */ public function testPublishUrlAliasForLocationReusingNopElement() @@ -1587,7 +1605,6 @@ public function testPublishUrlAliasForLocationReusingNopElement() * * @todo document * - * * @depends testPublishUrlAliasForLocation * @depends testPublishUrlAliasForLocationReusingNopElement */ @@ -1636,7 +1653,6 @@ public function testPublishUrlAliasForLocationReusingNopElementChangesCustomPath * * @todo document * - * * @depends testPublishUrlAliasForLocation * @depends testPublishUrlAliasForLocationReusingNopElementChangesCustomPath */ @@ -1690,7 +1706,7 @@ public function testPublishUrlAliasReuseNopCleanupCustomAliasIsDestroyed() $handler->publishUrlAliasForLocation(314, 2, 'nop-element', 'cro-HR', false); $urlAlias = $handler->lookup('jedan'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('jedan'), @@ -1713,7 +1729,7 @@ public function testPublishUrlAliasReuseNopCleanupCustomAliasIsDestroyed() ); $urlAlias = $handler->lookup('nop-element'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('nop-element'), @@ -1742,7 +1758,7 @@ public function testPublishUrlAliasReuseNopCleanupCustomAliasIsDestroyed() try { $handler->lookup('nop-element/search'); - $this->fail('Custom alias is not destroyed'); + self::fail('Custom alias is not destroyed'); } catch (NotFoundException $e) { // Custom alias is destroyed by reusing NOP entry with existing autogenerated alias // on the same level (that means link and ID are updated to the existing alias ID, @@ -1763,7 +1779,7 @@ public function testPublishUrlAliasReuseHistoryCleanup() $handler->publishUrlAliasForLocation(314, 2, 'tri', 'cro-HR', false); $urlAlias = $handler->lookup('jedan'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('jedan'), @@ -1786,7 +1802,7 @@ public function testPublishUrlAliasReuseHistoryCleanup() ); $urlAlias = $handler->lookup('tri'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('tri'), @@ -1827,7 +1843,7 @@ public function testPublishUrlAliasReuseAutogeneratedCleanup() $handler->publishUrlAliasForLocation(314, 2, 'dva', 'cro-HR', false); $urlAlias = $handler->lookup('jedan'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('jedan'), @@ -1850,7 +1866,7 @@ public function testPublishUrlAliasReuseAutogeneratedCleanup() ); $urlAlias = $handler->lookup('dva'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('dva'), @@ -1891,22 +1907,22 @@ public function testCreateCustomUrlAliasBehaviour() $handlerMock = $this->getPartlyMockedHandler(['createUrlAlias']); $handlerMock->expects( - $this->once() + self::once() )->method( 'createUrlAlias' )->with( - $this->equalTo('eznode:1'), - $this->equalTo('path'), - $this->equalTo(false), - $this->equalTo(null), - $this->equalTo(false) + self::equalTo('eznode:1'), + self::equalTo('path'), + self::equalTo(false), + self::equalTo(null), + self::equalTo(false) )->will( - $this->returnValue( + self::returnValue( new UrlAlias() ) ); - $this->assertInstanceOf( + self::assertInstanceOf( UrlAlias::class, $handlerMock->createCustomUrlAlias(1, 'path') ); @@ -1924,22 +1940,22 @@ public function testCreateGlobalUrlAliasBehaviour() $handlerMock = $this->getPartlyMockedHandler(['createUrlAlias']); $handlerMock->expects( - $this->once() + self::once() )->method( 'createUrlAlias' )->with( - $this->equalTo('module/module'), - $this->equalTo('path'), - $this->equalTo(false), - $this->equalTo(null), - $this->equalTo(false) + self::equalTo('module/module'), + self::equalTo('path'), + self::equalTo(false), + self::equalTo(null), + self::equalTo(false) )->will( - $this->returnValue( + self::returnValue( new UrlAlias() ) ); - $this->assertInstanceOf( + self::assertInstanceOf( UrlAlias::class, $handlerMock->createGlobalUrlAlias('module/module', 'path') ); @@ -2526,7 +2542,7 @@ public function testLocationDeleted() foreach ($removedAliases as $path) { try { $handler->lookup($path); - $this->fail("Alias '$path' not removed!"); + self::fail("Alias '$path' not removed!"); } catch (NotFoundException $e) { // Do nothing } @@ -3174,7 +3190,9 @@ public function providerForTestPublishUrlAliasForLocationSkipsReservedWord() * Test for the publishUrlAliasForLocation() method. * * @dataProvider providerForTestPublishUrlAliasForLocationSkipsReservedWord + * * @covers \Ibexa\Core\Persistence\Legacy\Content\UrlAlias\Handler::publishUrlAliasForLocation + * * @group publish */ public function testPublishUrlAliasForLocationSkipsReservedWord($text, $alias) @@ -3186,8 +3204,8 @@ public function testPublishUrlAliasForLocationSkipsReservedWord($text, $alias) $urlAlias = $handler->lookup($alias); - $this->assertEquals(314, $urlAlias->destination); - $this->assertEquals(['kli-KR'], $urlAlias->languageCodes); + self::assertEquals(314, $urlAlias->destination); + self::assertEquals(['kli-KR'], $urlAlias->languageCodes); } /** @@ -3204,13 +3222,13 @@ public function testLocationSwappedSimple() $handler->locationSwapped(316, 314, 317, 315); - $this->assertEquals( + self::assertEquals( $countBeforeReusing, $this->countRows() ); $urlAlias = $handler->lookup('jedan/swap'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap'), @@ -3243,7 +3261,7 @@ public function testLocationSwappedSimple() ); $urlAlias = $handler->lookup('dva/swap'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap'), @@ -3290,13 +3308,13 @@ public function testLocationSwappedSimpleWithHistory() $handler->locationSwapped(316, 314, 317, 315); - $this->assertEquals( + self::assertEquals( $countBeforeReusing, $this->countRows() ); $urlAlias = $handler->lookup('jedan/swap'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap'), @@ -3329,7 +3347,7 @@ public function testLocationSwappedSimpleWithHistory() ); $urlAlias = $handler->lookup('dva/swap'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap'), @@ -3362,7 +3380,7 @@ public function testLocationSwappedSimpleWithHistory() ); $urlAlias = $handler->lookup('jedan/swap-new'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap-new'), @@ -3395,7 +3413,7 @@ public function testLocationSwappedSimpleWithHistory() ); $urlAlias = $handler->lookup('dva/swap-new'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap-new'), @@ -3450,7 +3468,7 @@ public function testLocationSwappedSimpleWithConflict() $handler->locationSwapped(316, 314, 317, 315); - $this->assertEquals( + self::assertEquals( $countBeforeReusing + 2, $this->countRows() ); @@ -3461,14 +3479,14 @@ public function testLocationSwappedSimpleWithConflict() $urlAlias1Historized = $handler->lookup('jedan/swap-new-1'); $urlAlias2Historized = $handler->lookup('dva/swap-new-2'); - $this->assertEquals($urlAlias1TakenExpected, $urlAlias1Taken); - $this->assertEquals($urlAlias2TakenExpected, $urlAlias2Taken); + self::assertEquals($urlAlias1TakenExpected, $urlAlias1Taken); + self::assertEquals($urlAlias2TakenExpected, $urlAlias2Taken); - $this->assertEquals($urlAlias1HistorizedExpected, $urlAlias1Historized); - $this->assertEquals($urlAlias2HistorizedExpected, $urlAlias2Historized); + self::assertEquals($urlAlias1HistorizedExpected, $urlAlias1Historized); + self::assertEquals($urlAlias2HistorizedExpected, $urlAlias2Historized); $urlAlias1New = $handler->lookup('jedan/swap-new-22'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap-new-22'), @@ -3501,7 +3519,7 @@ public function testLocationSwappedSimpleWithConflict() ); $urlAlias2New = $handler->lookup('dva/swap-new-12'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap-new-12'), @@ -3548,13 +3566,13 @@ public function testLocationSwappedSiblingsSimple() $handler->locationSwapped(314, 2, 315, 2); - $this->assertEquals( + self::assertEquals( $countBeforeReusing, $this->countRows() ); $urlAlias = $handler->lookup('jedan'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('jedan'), @@ -3581,7 +3599,7 @@ public function testLocationSwappedSiblingsSimple() ); $urlAlias = $handler->lookup('dva'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('dva'), @@ -3622,13 +3640,13 @@ public function testLocationSwappedSiblingsSimpleReverse() $handler->locationSwapped(315, 2, 314, 2); - $this->assertEquals( + self::assertEquals( $countBeforeReusing, $this->countRows() ); $urlAlias = $handler->lookup('jedan'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('jedan'), @@ -3655,7 +3673,7 @@ public function testLocationSwappedSiblingsSimpleReverse() ); $urlAlias = $handler->lookup('dva'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('dva'), @@ -3696,13 +3714,13 @@ public function testLocationSwappedSiblingsSimpleWithHistory() $handler->locationSwapped(314, 2, 315, 2); - $this->assertEquals( + self::assertEquals( $countBeforeReusing, $this->countRows() ); $urlAlias = $handler->lookup('jedan'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('jedan'), @@ -3729,7 +3747,7 @@ public function testLocationSwappedSiblingsSimpleWithHistory() ); $urlAlias = $handler->lookup('dva'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('dva'), @@ -3756,7 +3774,7 @@ public function testLocationSwappedSiblingsSimpleWithHistory() ); $urlAlias = $handler->lookup('jedan-new'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('jedan-new'), @@ -3783,7 +3801,7 @@ public function testLocationSwappedSiblingsSimpleWithHistory() ); $urlAlias = $handler->lookup('dva-new'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('dva-new'), @@ -3824,13 +3842,13 @@ public function testLocationSwappedSiblingsSimpleWithHistoryReverse() $handler->locationSwapped(315, 2, 314, 2); - $this->assertEquals( + self::assertEquals( $countBeforeReusing, $this->countRows() ); $urlAlias = $handler->lookup('jedan'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('jedan'), @@ -3857,7 +3875,7 @@ public function testLocationSwappedSiblingsSimpleWithHistoryReverse() ); $urlAlias = $handler->lookup('dva'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('dva'), @@ -3884,7 +3902,7 @@ public function testLocationSwappedSiblingsSimpleWithHistoryReverse() ); $urlAlias = $handler->lookup('jedan-new'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('jedan-new'), @@ -3911,7 +3929,7 @@ public function testLocationSwappedSiblingsSimpleWithHistoryReverse() ); $urlAlias = $handler->lookup('dva-new'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('dva-new'), @@ -3952,13 +3970,13 @@ public function testLocationSwappedSiblingsSameName() $handler->locationSwapped(314, 2, 315, 2); - $this->assertEquals( + self::assertEquals( $countBeforeReusing, $this->countRows() ); $urlAlias = $handler->lookup('swap'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('swap'), @@ -3985,7 +4003,7 @@ public function testLocationSwappedSiblingsSameName() ); $urlAlias = $handler->lookup('swap2'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('swap2'), @@ -4026,13 +4044,13 @@ public function testLocationSwappedSiblingsSameNameReverse() $handler->locationSwapped(315, 2, 314, 2); - $this->assertEquals( + self::assertEquals( $countBeforeReusing, $this->countRows() ); $urlAlias = $handler->lookup('swap'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('swap'), @@ -4059,7 +4077,7 @@ public function testLocationSwappedSiblingsSameNameReverse() ); $urlAlias = $handler->lookup('swap2'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('swap2'), @@ -4100,13 +4118,13 @@ public function testLocationSwappedSiblingsSameNameMultipleLanguages() $handler->locationSwapped(314, 2, 315, 2); - $this->assertEquals( + self::assertEquals( $countBeforeReusing, $this->countRows() ); $urlAlias = $handler->lookup('swap-hr'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('swap-hr'), @@ -4134,7 +4152,7 @@ public function testLocationSwappedSiblingsSameNameMultipleLanguages() ); $urlAlias = $handler->lookup('swap-hr2'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('swap-hr2'), @@ -4162,7 +4180,7 @@ public function testLocationSwappedSiblingsSameNameMultipleLanguages() ); $urlAlias = $handler->lookup('swap-en'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('swap-en'), @@ -4190,7 +4208,7 @@ public function testLocationSwappedSiblingsSameNameMultipleLanguages() ); $urlAlias = $handler->lookup('swap-en2'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '0-' . md5('swap-en2'), @@ -4237,7 +4255,7 @@ public function testLocationSwappedMultipleLanguagesSimple() $handler->locationSwapped(316, 314, 317, 315); - $this->assertEquals( + self::assertEquals( $countBeforeReusing, $this->countRows() ); @@ -4247,10 +4265,10 @@ public function testLocationSwappedMultipleLanguagesSimple() $urlAlias2HR = $handler->lookup('dva/swap-hr'); $urlAlias2EN = $handler->lookup('dva/swap-en'); - $this->assertEquals($urlAlias1HRExpected, $urlAlias1HR); - $this->assertEquals($urlAlias1ENExpected, $urlAlias1EN); - $this->assertEquals($urlAlias2HRExpected, $urlAlias2HR); - $this->assertEquals($urlAlias2ENExpected, $urlAlias2EN); + self::assertEquals($urlAlias1HRExpected, $urlAlias1HR); + self::assertEquals($urlAlias1ENExpected, $urlAlias1EN); + self::assertEquals($urlAlias2HRExpected, $urlAlias2HR); + self::assertEquals($urlAlias2ENExpected, $urlAlias2EN); } /** @@ -4267,13 +4285,13 @@ public function testLocationSwappedMultipleLanguagesDifferentLanguagesSimple() $handler->locationSwapped(316, 314, 317, 315); - $this->assertEquals( + self::assertEquals( $countBeforeReusing + 2, $this->countRows() ); $urlAlias = $handler->lookup('jedan/swap-hr'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap-hr'), @@ -4307,7 +4325,7 @@ public function testLocationSwappedMultipleLanguagesDifferentLanguagesSimple() ); $urlAlias = $handler->lookup('jedan/swap-de'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap-de'), @@ -4341,7 +4359,7 @@ public function testLocationSwappedMultipleLanguagesDifferentLanguagesSimple() ); $urlAlias = $handler->lookup('jedan/swap-en'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap-en'), @@ -4374,7 +4392,7 @@ public function testLocationSwappedMultipleLanguagesDifferentLanguagesSimple() ); $urlAlias = $handler->lookup('dva/swap-hr'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap-hr'), @@ -4408,7 +4426,7 @@ public function testLocationSwappedMultipleLanguagesDifferentLanguagesSimple() ); $urlAlias = $handler->lookup('dva/swap-en'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap-en'), @@ -4442,7 +4460,7 @@ public function testLocationSwappedMultipleLanguagesDifferentLanguagesSimple() ); $urlAlias = $handler->lookup('dva/swap-de'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap-de'), @@ -4489,13 +4507,13 @@ public function testLocationSwappedMultipleLanguagesDifferentLanguages() $handler->locationSwapped(317, 315, 316, 314); - $this->assertEquals( + self::assertEquals( $countBeforeReusing + 2, $this->countRows() ); $urlAlias = $handler->lookup('jedan/swap-this'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap-this'), @@ -4531,7 +4549,7 @@ public function testLocationSwappedMultipleLanguagesDifferentLanguages() ); $urlAlias = $handler->lookup('jedan/swap-en'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap-en'), @@ -4564,7 +4582,7 @@ public function testLocationSwappedMultipleLanguagesDifferentLanguages() ); $urlAlias = $handler->lookup('dva/swap-hr'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap-hr'), @@ -4597,7 +4615,7 @@ public function testLocationSwappedMultipleLanguagesDifferentLanguages() ); $urlAlias = $handler->lookup('dva/swap-this'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap-this'), @@ -4647,13 +4665,13 @@ public function testLocationSwappedMultipleLanguagesWithCompositeHistory() $handler->locationSwapped(317, 315, 316, 314); - $this->assertEquals( + self::assertEquals( $countBeforeReusing + 4, $this->countRows() ); $urlAlias = $handler->lookup('jedan/swap-this'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap-this'), @@ -4686,7 +4704,7 @@ public function testLocationSwappedMultipleLanguagesWithCompositeHistory() ); $urlAlias = $handler->lookup('jedan/swap-en'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap-en'), @@ -4719,7 +4737,7 @@ public function testLocationSwappedMultipleLanguagesWithCompositeHistory() ); $urlAlias = $handler->lookup('jedan/swap-hr'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap-hr'), @@ -4754,7 +4772,7 @@ public function testLocationSwappedMultipleLanguagesWithCompositeHistory() ); $urlAlias = $handler->lookup('jedan/swap-that'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap-that'), @@ -4790,7 +4808,7 @@ public function testLocationSwappedMultipleLanguagesWithCompositeHistory() ); $urlAlias = $handler->lookup('dva/swap-hr'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap-hr'), @@ -4823,7 +4841,7 @@ public function testLocationSwappedMultipleLanguagesWithCompositeHistory() ); $urlAlias = $handler->lookup('dva/swap-that'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap-that'), @@ -4858,7 +4876,7 @@ public function testLocationSwappedMultipleLanguagesWithCompositeHistory() ); $urlAlias = $handler->lookup('dva/swap-this'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap-this'), @@ -4892,7 +4910,7 @@ public function testLocationSwappedMultipleLanguagesWithCompositeHistory() ); $urlAlias = $handler->lookup('dva/swap-en'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap-en'), @@ -4940,13 +4958,13 @@ public function testLocationSwappedWithReusingExternalHistory() $handler->locationSwapped(318, 314, 319, 315); - $this->assertEquals( + self::assertEquals( $countBeforeReusing, $this->countRows() ); $urlAlias = $handler->lookup('jedan/swap-that'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap-that'), @@ -4979,7 +4997,7 @@ public function testLocationSwappedWithReusingExternalHistory() ); $urlAlias = $handler->lookup('dva/swap-this'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap-this'), @@ -5012,7 +5030,7 @@ public function testLocationSwappedWithReusingExternalHistory() ); $urlAlias = $handler->lookup('dva/swap-that'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap-that'), @@ -5045,7 +5063,7 @@ public function testLocationSwappedWithReusingExternalHistory() ); $urlAlias = $handler->lookup('jedan/swap-this'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap-this'), @@ -5092,13 +5110,13 @@ public function testLocationSwappedWithReusingNopEntry() $handler->locationSwapped(316, 314, 317, 315); - $this->assertEquals( + self::assertEquals( $countBeforeReusing + 1, $this->countRows() ); $urlAlias = $handler->lookup('jedan/swap-that'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap-that'), @@ -5131,7 +5149,7 @@ public function testLocationSwappedWithReusingNopEntry() ); $urlAlias = $handler->lookup('dva/swap-this'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap-this'), @@ -5164,7 +5182,7 @@ public function testLocationSwappedWithReusingNopEntry() ); $urlAlias = $handler->lookup('dva/swap-that'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '3-' . md5('swap-that'), @@ -5197,7 +5215,7 @@ public function testLocationSwappedWithReusingNopEntry() ); $urlAlias = $handler->lookup('jedan/swap-this'); - $this->assertEquals( + self::assertEquals( new UrlAlias( [ 'id' => '2-' . md5('swap-this'), @@ -5234,6 +5252,7 @@ public function testLocationSwappedWithReusingNopEntry() * Test for the locationSwapped() method. * * @depends testLocationSwappedWithReusingNopEntry + * * @group swap */ public function testLocationSwappedWithReusingNopEntryCustomAliasIsDestroyed() @@ -5246,7 +5265,7 @@ public function testLocationSwappedWithReusingNopEntryCustomAliasIsDestroyed() try { $handler->lookup('jedan/swap-that/search'); - $this->fail('Custom alias is not destroyed'); + self::fail('Custom alias is not destroyed'); } catch (NotFoundException $e) { // Custom alias is destroyed by reusing NOP entry with existing autogenerated alias // on the same level (that means link and ID are updated to the existing alias ID, @@ -5269,7 +5288,7 @@ public function testLocationSwappedUpdatesLocationPathIdentificationString() $handler->locationSwapped(314, 2, 315, 2); - $this->assertEquals( + self::assertEquals( $countBeforeReusing, $this->countRows() ); @@ -5296,7 +5315,7 @@ public function testLocationSwappedMultipleLanguagesUpdatesLocationPathIdentific $handler->locationSwapped(314, 2, 315, 2); - $this->assertEquals( + self::assertEquals( $countBeforeReusing, $this->countRows() ); diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/UrlAliasMapperTest.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/UrlAliasMapperTest.php index 2c76721889..90cc7a82c6 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/UrlAliasMapperTest.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/UrlAliasMapperTest.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\Core\Persistence\Legacy\Content\UrlAlias; use Ibexa\Contracts\Core\Persistence\Content\UrlAlias; diff --git a/tests/lib/Persistence/Legacy/Content/UrlWildcard/UrlWildcardMapperTest.php b/tests/lib/Persistence/Legacy/Content/UrlWildcard/UrlWildcardMapperTest.php index 8df9df5265..26b65e60c1 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlWildcard/UrlWildcardMapperTest.php +++ b/tests/lib/Persistence/Legacy/Content/UrlWildcard/UrlWildcardMapperTest.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\Core\Persistence\Legacy\Content\UrlWildcard; use Ibexa\Contracts\Core\Persistence\Content\UrlWildcard; diff --git a/tests/lib/Persistence/Legacy/FieldValue/Converter/ImageConverterTest.php b/tests/lib/Persistence/Legacy/FieldValue/Converter/ImageConverterTest.php index 804176ce0c..589724b461 100644 --- a/tests/lib/Persistence/Legacy/FieldValue/Converter/ImageConverterTest.php +++ b/tests/lib/Persistence/Legacy/FieldValue/Converter/ImageConverterTest.php @@ -60,7 +60,7 @@ public function testToStorageValue(FieldValue $fieldValue, string $expectedXml): $this->imageConverter->toStorageValue($fieldValue, $storageValue); - $this->assertEquals( + self::assertEquals( $expectedXml, $storageValue->dataText ); @@ -154,7 +154,7 @@ public function testToFieldValue(string $xml, FieldValue $expectedFieldValue): v $fieldValue = new FieldValue(); $this->imageConverter->toFieldValue($storageValue, $fieldValue); - $this->assertEquals( + self::assertEquals( $expectedFieldValue->data, $fieldValue->data ); diff --git a/tests/lib/Persistence/Legacy/HandlerTest.php b/tests/lib/Persistence/Legacy/HandlerTest.php index 3000d07044..5a1a9a44cd 100644 --- a/tests/lib/Persistence/Legacy/HandlerTest.php +++ b/tests/lib/Persistence/Legacy/HandlerTest.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\Core\Persistence\Legacy; use Ibexa\Contracts\Core\Container; @@ -36,11 +37,11 @@ public function testContentHandler(): void $handler = $this->getHandlerFixture(); $contentHandler = $handler->contentHandler(); - $this->assertInstanceOf( + self::assertInstanceOf( SPIContentHandler::class, $contentHandler ); - $this->assertInstanceOf( + self::assertInstanceOf( ContentHandler::class, $contentHandler ); @@ -50,7 +51,7 @@ public function testContentHandlerTwice(): void { $handler = $this->getHandlerFixture(); - $this->assertSame( + self::assertSame( $handler->contentHandler(), $handler->contentHandler() ); @@ -61,7 +62,7 @@ public function testContentTypeHandler(): void $handler = $this->getHandlerFixture(); $contentTypeHandler = $handler->contentTypeHandler(); - $this->assertInstanceOf( + self::assertInstanceOf( SPIContentTypeHandler::class, $contentTypeHandler ); @@ -72,7 +73,7 @@ public function testContentLanguageHandler(): void $handler = $this->getHandlerFixture(); $contentLanguageHandler = $handler->contentLanguageHandler(); - $this->assertInstanceOf( + self::assertInstanceOf( SPILanguageHandler::class, $contentLanguageHandler ); @@ -82,7 +83,7 @@ public function testContentTypeHandlerTwice(): void { $handler = $this->getHandlerFixture(); - $this->assertSame( + self::assertSame( $handler->contentTypeHandler(), $handler->contentTypeHandler() ); @@ -93,11 +94,11 @@ public function testLocationHandler(): void $handler = $this->getHandlerFixture(); $locationHandler = $handler->locationHandler(); - $this->assertInstanceOf( + self::assertInstanceOf( SPILocationHandler::class, $locationHandler ); - $this->assertInstanceOf( + self::assertInstanceOf( LocationHandler::class, $locationHandler ); @@ -107,7 +108,7 @@ public function testLocationHandlerTwice(): void { $handler = $this->getHandlerFixture(); - $this->assertSame( + self::assertSame( $handler->locationHandler(), $handler->locationHandler() ); @@ -118,11 +119,11 @@ public function testUserHandler(): void $handler = $this->getHandlerFixture(); $userHandler = $handler->userHandler(); - $this->assertInstanceOf( + self::assertInstanceOf( SPIUserHandler::class, $userHandler ); - $this->assertInstanceOf( + self::assertInstanceOf( UserHandler::class, $userHandler ); @@ -132,7 +133,7 @@ public function testUserHandlerTwice(): void { $handler = $this->getHandlerFixture(); - $this->assertSame( + self::assertSame( $handler->userHandler(), $handler->userHandler() ); @@ -143,11 +144,11 @@ public function testSectionHandler(): void $handler = $this->getHandlerFixture(); $sectionHandler = $handler->sectionHandler(); - $this->assertInstanceOf( + self::assertInstanceOf( SPISectionHandler::class, $sectionHandler ); - $this->assertInstanceOf( + self::assertInstanceOf( SectionHandler::class, $sectionHandler ); @@ -157,7 +158,7 @@ public function testSectionHandlerTwice(): void { $handler = $this->getHandlerFixture(); - $this->assertSame( + self::assertSame( $handler->sectionHandler(), $handler->sectionHandler() ); @@ -168,11 +169,11 @@ public function testUrlAliasHandler(): void $handler = $this->getHandlerFixture(); $urlAliasHandler = $handler->urlAliasHandler(); - $this->assertInstanceOf( + self::assertInstanceOf( SPIUrlAliasHandler::class, $urlAliasHandler ); - $this->assertInstanceOf( + self::assertInstanceOf( UrlAliasHandler::class, $urlAliasHandler ); @@ -182,7 +183,7 @@ public function testUrlAliasHandlerTwice(): void { $handler = $this->getHandlerFixture(); - $this->assertSame( + self::assertSame( $handler->urlAliasHandler(), $handler->urlAliasHandler() ); @@ -192,7 +193,7 @@ public function testNotificationHandlerTwice(): void { $handler = $this->getHandlerFixture(); - $this->assertSame( + self::assertSame( $handler->notificationHandler(), $handler->notificationHandler() ); @@ -203,11 +204,11 @@ public function testTransactionHandler(): void $handler = $this->getHandlerFixture(); $transactionHandler = $handler->transactionHandler(); - $this->assertInstanceOf( + self::assertInstanceOf( SPITransactionHandler::class, $transactionHandler ); - $this->assertInstanceOf( + self::assertInstanceOf( TransactionHandler::class, $transactionHandler ); @@ -217,7 +218,7 @@ public function testTransactionHandlerTwice(): void { $handler = $this->getHandlerFixture(); - $this->assertSame( + self::assertSame( $handler->transactionHandler(), $handler->transactionHandler() ); diff --git a/tests/lib/Persistence/Legacy/Notification/Gateway/DoctrineDatabaseTest.php b/tests/lib/Persistence/Legacy/Notification/Gateway/DoctrineDatabaseTest.php index 369459d921..ff7ff7245e 100644 --- a/tests/lib/Persistence/Legacy/Notification/Gateway/DoctrineDatabaseTest.php +++ b/tests/lib/Persistence/Legacy/Notification/Gateway/DoctrineDatabaseTest.php @@ -50,7 +50,7 @@ public function testInsert() $data = $this->loadNotification($id); - $this->assertEquals([ + self::assertEquals([ 'id' => $id, 'owner_id' => '14', 'is_pending' => 1, @@ -64,7 +64,7 @@ public function testGetNotificationById() { $data = $this->getGateway()->getNotificationById(self::EXISTING_NOTIFICATION_ID); - $this->assertEquals([ + self::assertEquals([ self::EXISTING_NOTIFICATION_DATA, ], $data); } @@ -82,7 +82,7 @@ public function testUpdateNotification() $this->getGateway()->updateNotification($notification); - $this->assertEquals([ + self::assertEquals([ 'id' => (string) self::EXISTING_NOTIFICATION_ID, 'owner_id' => '14', 'is_pending' => '0', @@ -94,14 +94,14 @@ public function testUpdateNotification() public function testCountUserNotifications() { - $this->assertEquals(5, $this->getGateway()->countUserNotifications( + self::assertEquals(5, $this->getGateway()->countUserNotifications( self::EXISTING_NOTIFICATION_DATA['owner_id'] )); } public function testCountUserPendingNotifications() { - $this->assertEquals( + self::assertEquals( 3, $this->getGateway()->countUserPendingNotifications( self::EXISTING_NOTIFICATION_DATA['owner_id'] @@ -117,7 +117,7 @@ public function testLoadUserNotifications() $results = $this->getGateway()->loadUserNotifications($userId, $offset, $limit); - $this->assertEquals([ + self::assertEquals([ [ 'id' => '4', 'owner_id' => '14', @@ -149,7 +149,7 @@ public function testDelete() { $this->getGateway()->delete(self::EXISTING_NOTIFICATION_ID); - $this->assertEmpty($this->loadNotification(self::EXISTING_NOTIFICATION_ID)); + self::assertEmpty($this->loadNotification(self::EXISTING_NOTIFICATION_ID)); } /** diff --git a/tests/lib/Persistence/Legacy/Notification/HandlerTest.php b/tests/lib/Persistence/Legacy/Notification/HandlerTest.php index 3dd8d06225..3cb27052c3 100644 --- a/tests/lib/Persistence/Legacy/Notification/HandlerTest.php +++ b/tests/lib/Persistence/Legacy/Notification/HandlerTest.php @@ -51,13 +51,13 @@ public function testCreateNotification() ]); $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('insert') ->with($createStruct) ->willReturn(self::NOTIFICATION_ID); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('extractNotificationsFromRows') ->willReturn([new Notification([ 'id' => self::NOTIFICATION_ID, @@ -65,7 +65,7 @@ public function testCreateNotification() $notification = $this->handler->createNotification($createStruct); - $this->assertEquals($notification->id, self::NOTIFICATION_ID); + self::assertEquals($notification->id, self::NOTIFICATION_ID); } public function testCountPendingNotifications() @@ -74,12 +74,12 @@ public function testCountPendingNotifications() $expectedCount = 12; $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('countUserPendingNotifications') ->with($ownerId) ->willReturn($expectedCount); - $this->assertEquals($expectedCount, $this->handler->countPendingNotifications($ownerId)); + self::assertEquals($expectedCount, $this->handler->countPendingNotifications($ownerId)); } public function testGetNotificationById() @@ -95,18 +95,18 @@ public function testGetNotificationById() ]); $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('getNotificationById') ->with(self::NOTIFICATION_ID) ->willReturn($rows); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('extractNotificationsFromRows') ->with($rows) ->willReturn([$object]); - $this->assertEquals($object, $this->handler->getNotificationById(self::NOTIFICATION_ID)); + self::assertEquals($object, $this->handler->getNotificationById(self::NOTIFICATION_ID)); } public function testUpdateNotification() @@ -128,18 +128,18 @@ public function testUpdateNotification() $spiNotification = new Notification($data); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('createNotificationFromUpdateStruct') ->with($updateStruct) ->willReturn($spiNotification); $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('updateNotification') ->with($spiNotification); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('extractNotificationsFromRows') ->willReturn([new Notification([ 'id' => self::NOTIFICATION_ID, @@ -154,12 +154,12 @@ public function testCountNotifications() $expectedCount = 12; $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('countUserNotifications') ->with($ownerId) ->willReturn($expectedCount); - $this->assertEquals($expectedCount, $this->handler->countNotifications($ownerId)); + self::assertEquals($expectedCount, $this->handler->countNotifications($ownerId)); } public function testLoadUserNotifications() @@ -181,18 +181,18 @@ public function testLoadUserNotifications() ]; $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('loadUserNotifications') ->with($ownerId, $offset, $limit) ->willReturn($rows); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('extractNotificationsFromRows') ->with($rows) ->willReturn($objects); - $this->assertEquals($objects, $this->handler->loadUserNotifications($ownerId, $offset, $limit)); + self::assertEquals($objects, $this->handler->loadUserNotifications($ownerId, $offset, $limit)); } public function testDelete() @@ -202,7 +202,7 @@ public function testDelete() ]); $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('delete') ->with($notification->id); diff --git a/tests/lib/Persistence/Legacy/Notification/MapperTest.php b/tests/lib/Persistence/Legacy/Notification/MapperTest.php index 73f7dfd3a4..3111707694 100644 --- a/tests/lib/Persistence/Legacy/Notification/MapperTest.php +++ b/tests/lib/Persistence/Legacy/Notification/MapperTest.php @@ -74,7 +74,7 @@ public function testExtractNotificationsFromRows() ]), ]; - $this->assertEquals($objects, $this->mapper->extractNotificationsFromRows($rows)); + self::assertEquals($objects, $this->mapper->extractNotificationsFromRows($rows)); } public function testExtractNotificationsFromRowsThrowsRuntimeException() @@ -101,7 +101,7 @@ public function testCreateNotificationFromUpdateStruct() 'isPending' => false, ]); - $this->assertEquals(new Notification([ + self::assertEquals(new Notification([ 'isPending' => false, ]), $this->mapper->createNotificationFromUpdateStruct($updateStruct)); } diff --git a/tests/lib/Persistence/Legacy/Setting/SettingHandlerTest.php b/tests/lib/Persistence/Legacy/Setting/SettingHandlerTest.php index 20bb9113fb..4d7f78ed81 100644 --- a/tests/lib/Persistence/Legacy/Setting/SettingHandlerTest.php +++ b/tests/lib/Persistence/Legacy/Setting/SettingHandlerTest.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\Core\Persistence\Legacy\Setting; use Ibexa\Contracts\Core\Persistence\Setting\Setting; @@ -123,7 +124,7 @@ public function testUpdate(): void self::identicalTo('group_d1'), self::identicalTo('identifier_e2') ) - ->will($this->returnValue([ + ->will(self::returnValue([ 'group' => 'group_d1', 'identifier' => 'identifier_e2', 'value' => 'value_f3', @@ -166,7 +167,7 @@ public function testUpdateFailsToLoad(): void self::identicalTo('group_d1'), self::identicalTo('identifier_e2') ) - ->will($this->returnValue(null)); + ->will(self::returnValue(null)); $this->expectException(NotFoundException::class); $this->expectExceptionMessage(<<<ERROR diff --git a/tests/lib/Persistence/Legacy/SharedGateway/GatewayFactoryTest.php b/tests/lib/Persistence/Legacy/SharedGateway/GatewayFactoryTest.php index a75aab39c8..5718ae5f58 100644 --- a/tests/lib/Persistence/Legacy/SharedGateway/GatewayFactoryTest.php +++ b/tests/lib/Persistence/Legacy/SharedGateway/GatewayFactoryTest.php @@ -75,7 +75,7 @@ public function getTestBuildSharedGatewayData(): Traversable $connectionMock = $this ->createMock(Connection::class); $connectionMock - ->expects($this->any()) + ->expects(self::any()) ->method('getDatabasePlatform') ->willReturn($databasePlatform); diff --git a/tests/lib/Persistence/Legacy/TestCase.php b/tests/lib/Persistence/Legacy/TestCase.php index 72b9593222..e4f21f0a36 100644 --- a/tests/lib/Persistence/Legacy/TestCase.php +++ b/tests/lib/Persistence/Legacy/TestCase.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\Core\Persistence\Legacy; use Doctrine\Common\EventManager as DoctrineEventManager; @@ -248,7 +249,7 @@ protected function assertPropertiesCorrect(array $properties, $object) ); } foreach ($properties as $propName => $propVal) { - $this->assertSame( + self::assertSame( $propVal, $object->$propName, "Incorrect value for \${$propName}" @@ -276,7 +277,7 @@ protected function assertStructsEqual( $propertyNames = $this->getPublicPropertyNames($expStruct); } foreach ($propertyNames as $propName) { - $this->assertEquals( + self::assertEquals( $expStruct->$propName, $actStruct->$propName, "Properties \${$propName} not same" diff --git a/tests/lib/Persistence/Legacy/TransactionHandlerTest.php b/tests/lib/Persistence/Legacy/TransactionHandlerTest.php index 47f7e7beee..31b093539f 100644 --- a/tests/lib/Persistence/Legacy/TransactionHandlerTest.php +++ b/tests/lib/Persistence/Legacy/TransactionHandlerTest.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\Core\Persistence\Legacy; use Doctrine\DBAL\Connection; @@ -38,14 +39,14 @@ public function testBeginTransaction() { $handler = $this->getTransactionHandler(); $this->getConnectionMock() - ->expects($this->once()) + ->expects(self::once()) ->method('beginTransaction'); $this->getContentTypeHandlerMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $this->getLanguageHandlerMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $handler->beginTransaction(); } @@ -54,14 +55,14 @@ public function testCommit() { $handler = $this->getTransactionHandler(); $this->getConnectionMock() - ->expects($this->once()) + ->expects(self::once()) ->method('commit'); $this->getContentTypeHandlerMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $this->getLanguageHandlerMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $handler->commit(); } @@ -73,15 +74,15 @@ public function testCommitException() $handler = $this->getTransactionHandler(); $this->getConnectionMock() - ->expects($this->once()) + ->expects(self::once()) ->method('commit') - ->will($this->throwException(new Exception('test'))); + ->will(self::throwException(new Exception('test'))); $this->getContentTypeHandlerMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $this->getLanguageHandlerMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $handler->commit(); } @@ -90,13 +91,13 @@ public function testRollback() { $handler = $this->getTransactionHandler(); $this->getConnectionMock() - ->expects($this->once()) + ->expects(self::once()) ->method('rollback'); $this->getContentTypeHandlerMock() - ->expects($this->once()) + ->expects(self::once()) ->method('clearCache'); $this->getLanguageHandlerMock() - ->expects($this->once()) + ->expects(self::once()) ->method('clearCache'); $handler->rollback(); @@ -109,15 +110,15 @@ public function testRollbackException() $handler = $this->getTransactionHandler(); $this->getConnectionMock() - ->expects($this->once()) + ->expects(self::once()) ->method('rollback') - ->will($this->throwException(new Exception('test'))); + ->will(self::throwException(new Exception('test'))); $this->getContentTypeHandlerMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $this->getLanguageHandlerMock() - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $handler->rollback(); } diff --git a/tests/lib/Persistence/Legacy/URL/HandlerTest.php b/tests/lib/Persistence/Legacy/URL/HandlerTest.php index 1fbed75d42..6684177386 100644 --- a/tests/lib/Persistence/Legacy/URL/HandlerTest.php +++ b/tests/lib/Persistence/Legacy/URL/HandlerTest.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\Core\Persistence\Legacy\URL; use Ibexa\Contracts\Core\Persistence\URL\URL; @@ -42,17 +43,17 @@ public function testUpdateUrl() $url = $this->getUrl(1, 'http://ibexa.co'); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('createURLFromUpdateStruct') ->with($urlUpdateStruct) ->willReturn($url); $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('updateUrl') ->with($url); - $this->assertEquals($url, $this->handler->updateUrl($url->id, $urlUpdateStruct)); + self::assertEquals($url, $this->handler->updateUrl($url->id, $urlUpdateStruct)); } public function testFind() @@ -83,18 +84,18 @@ public function testFind() ]; $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('find') ->with($query->filter, $query->offset, $query->limit, $query->sortClauses, $query->performCount) ->willReturn($results); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('extractURLsFromRows') ->with($results['rows']) ->willReturn($expected['items']); - $this->assertEquals($expected, $this->handler->find($query)); + self::assertEquals($expected, $this->handler->find($query)); } public function testLoadByIdWithoutUrlData() @@ -104,13 +105,13 @@ public function testLoadByIdWithoutUrlData() $id = 1; $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('loadUrlData') ->with($id) ->willReturn([]); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('extractURLsFromRows') ->with([]) ->willReturn([]); @@ -123,18 +124,18 @@ public function testLoadByIdWithUrlData() $url = $this->getUrl(1, 'http://ibexa.co'); $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('loadUrlData') ->with($url->id) ->willReturn([$url]); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('extractURLsFromRows') ->with([$url]) ->willReturn([$url]); - $this->assertEquals($url, $this->handler->loadById($url->id)); + self::assertEquals($url, $this->handler->loadById($url->id)); } public function testLoadByUrlWithoutUrlData() @@ -144,13 +145,13 @@ public function testLoadByUrlWithoutUrlData() $url = 'http://ibexa.co'; $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('loadUrlDataByUrl') ->with($url) ->willReturn([]); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('extractURLsFromRows') ->with([]) ->willReturn([]); @@ -163,18 +164,18 @@ public function testLoadByUrlWithUrlData() $url = $this->getUrl(1, 'http://ibexa.co'); $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('loadUrlDataByUrl') ->with($url->url) ->willReturn([$url]); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('extractURLsFromRows') ->with([$url]) ->willReturn([$url]); - $this->assertEquals($url, $this->handler->loadByUrl($url->url)); + self::assertEquals($url, $this->handler->loadByUrl($url->url)); } public function testFindUsages() @@ -183,12 +184,12 @@ public function testFindUsages() $ids = [1, 2, 3]; $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('findUsages') ->with($url->id) - ->will($this->returnValue($ids)); + ->will(self::returnValue($ids)); - $this->assertEquals($ids, $this->handler->findUsages($url->id)); + self::assertEquals($ids, $this->handler->findUsages($url->id)); } private function getUrl($id = 1, $urlAddr = 'http://ibexa.co') diff --git a/tests/lib/Persistence/Legacy/URL/MapperTest.php b/tests/lib/Persistence/Legacy/URL/MapperTest.php index 7603a5044a..ff65bf282c 100644 --- a/tests/lib/Persistence/Legacy/URL/MapperTest.php +++ b/tests/lib/Persistence/Legacy/URL/MapperTest.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\Core\Persistence\Legacy\URL; use Ibexa\Contracts\Core\Persistence\URL\URL; @@ -38,7 +39,7 @@ public function testCreateURLFromUpdateStruct() $expected->created = 0; $expected->modified = $urlUpdateStruct->modified; - $this->assertEquals($expected, $this->mapper->createURLFromUpdateStruct($urlUpdateStruct)); + self::assertEquals($expected, $this->mapper->createURLFromUpdateStruct($urlUpdateStruct)); } public function testExtractURLsFromRows() @@ -82,7 +83,7 @@ public function testExtractURLsFromRows() $urlEzplatformCom->created = (int)$rows[1]['created']; $urlEzplatformCom->modified = (int)$rows[1]['modified']; - $this->assertEquals([$urlEzNo, $urlEzplatformCom], $this->mapper->extractURLsFromRows($rows)); + self::assertEquals([$urlEzNo, $urlEzplatformCom], $this->mapper->extractURLsFromRows($rows)); } } diff --git a/tests/lib/Persistence/Legacy/URL/Query/CriteriaConverterTest.php b/tests/lib/Persistence/Legacy/URL/Query/CriteriaConverterTest.php index ccc199b14f..9b549f5688 100644 --- a/tests/lib/Persistence/Legacy/URL/Query/CriteriaConverterTest.php +++ b/tests/lib/Persistence/Legacy/URL/Query/CriteriaConverterTest.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\Core\Persistence\Legacy\URL\Query; use Doctrine\DBAL\Query\QueryBuilder; @@ -36,29 +37,29 @@ public function testConvertCriteriaSuccess(): void $selectQuery = $this->createMock(QueryBuilder::class); $fooCriterionHandler - ->expects($this->once()) + ->expects(self::once()) ->method('accept') ->with($barCriterion) ->willReturn(false); $fooCriterionHandler - ->expects($this->never()) + ->expects(self::never()) ->method('handle'); $barCriterionHandler - ->expects($this->once()) + ->expects(self::once()) ->method('accept') ->with($barCriterion) ->willReturn(true); $sqlExpression = 'SQL EXPRESSION'; $barCriterionHandler - ->expects($this->once()) + ->expects(self::once()) ->method('handle') ->with($criteriaConverter, $selectQuery, $barCriterion) ->willReturn($sqlExpression); - $this->assertEquals( + self::assertEquals( $sqlExpression, $criteriaConverter->convertCriteria( $selectQuery, diff --git a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/CriterionHandlerTest.php b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/CriterionHandlerTest.php index 8f7497f3e6..5f21aee5ef 100644 --- a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/CriterionHandlerTest.php +++ b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/CriterionHandlerTest.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\Query\Expression\CompositeExpression; @@ -28,7 +29,7 @@ abstract public function testHandle(); */ protected function assertHandlerAcceptsCriterion(CriterionHandler $handler, $criterionClass) { - $this->assertTrue($handler->accept($this->createMock($criterionClass))); + self::assertTrue($handler->accept($this->createMock($criterionClass))); } /** @@ -39,7 +40,7 @@ protected function assertHandlerAcceptsCriterion(CriterionHandler $handler, $cri */ protected function assertHandlerRejectsCriterion(CriterionHandler $handler, $criterionClass) { - $this->assertFalse($handler->accept($this->createMock($criterionClass))); + self::assertFalse($handler->accept($this->createMock($criterionClass))); } /** @@ -63,23 +64,23 @@ protected function mockConverterForLogicalOperator( ); $expressionBuilder = $this->createMock(ExpressionBuilder::class); $expressionBuilder - ->expects($this->any()) + ->expects(self::any()) ->method($expressionBuilderMethod) ->with($fooExpr, $barExpr) ->willReturn($compositeExpression); $queryBuilder - ->expects($this->any()) + ->expects(self::any()) ->method('expr') ->willReturn($expressionBuilder); $converter = $this->createMock(CriteriaConverter::class); $converter - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('convertCriteria') ->with($queryBuilder, $foo) ->willReturn($fooExpr); $converter - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('convertCriteria') ->with($queryBuilder, $bar) ->willReturn($barExpr); diff --git a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalAndTest.php b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalAndTest.php index c38530f72c..d8a1749a25 100644 --- a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalAndTest.php +++ b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalAndTest.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\Query\Expression\CompositeExpression; @@ -21,8 +22,8 @@ public function testAccept() { $handler = new LogicalAndHandler(); - $this->assertTrue($handler->accept($this->createMock(LogicalAnd::class))); - $this->assertFalse($handler->accept($this->createMock(Criterion::class))); + self::assertTrue($handler->accept($this->createMock(LogicalAnd::class))); + self::assertFalse($handler->accept($this->createMock(Criterion::class))); } /** @@ -58,7 +59,7 @@ public function testHandle(): void new LogicalAnd([$foo, $bar]) ); - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } } diff --git a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalNotTest.php b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalNotTest.php index 23dd93d009..f93986c862 100644 --- a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalNotTest.php +++ b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalNotTest.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; @@ -40,7 +41,7 @@ public function testHandle(): void $converter = $this->createMock(CriteriaConverter::class); $converter - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('convertCriteria') ->with($queryBuilder, $foo) ->willReturn($fooExpr); @@ -52,7 +53,7 @@ public function testHandle(): void new LogicalNot($foo) ); - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } } diff --git a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalOrTest.php b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalOrTest.php index f7e3c2e006..813e397547 100644 --- a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalOrTest.php +++ b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/LogicalOrTest.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\Query\Expression\CompositeExpression; @@ -58,7 +59,7 @@ public function testHandle(): void new LogicalOr([$foo, $bar]) ); - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } } diff --git a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchAllTest.php b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchAllTest.php index fa13a51b62..ab66a46b2d 100644 --- a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchAllTest.php +++ b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchAllTest.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; @@ -39,7 +40,7 @@ public function testHandle() $handler = new MatchAllHandler(); $actual = $handler->handle($converter, $queryBuilder, $criterion); - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } } diff --git a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchNoneTest.php b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchNoneTest.php index bb748fed78..d879099b92 100644 --- a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchNoneTest.php +++ b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/MatchNoneTest.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\Query\QueryBuilder; @@ -39,7 +40,7 @@ public function testHandle() $handler = new MatchNoneHandler(); $actual = $handler->handle($converter, $query, $criterion); - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } } diff --git a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/PatternTest.php b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/PatternTest.php index a9b3196ff4..ed89b4a6f1 100644 --- a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/PatternTest.php +++ b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/PatternTest.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\ParameterType; @@ -36,17 +37,17 @@ public function testHandle() $expected = 'url LIKE :pattern'; $expressionBuilder = $this->createMock(ExpressionBuilder::class); $expressionBuilder - ->expects($this->once()) + ->expects(self::once()) ->method('like') ->with('url', ':pattern') ->willReturn($expected); $queryBuilder = $this->createMock(QueryBuilder::class); $queryBuilder - ->expects($this->any()) + ->expects(self::any()) ->method('expr') ->willReturn($expressionBuilder); $queryBuilder - ->expects($this->once()) + ->expects(self::once()) ->method('createNamedParameter') ->with('%' . $criterion->pattern . '%', ParameterType::STRING, ':pattern') ->willReturn(':pattern'); @@ -56,7 +57,7 @@ public function testHandle() $handler = new PatternHandler(); $actual = $handler->handle($converter, $queryBuilder, $criterion); - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } } diff --git a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/ValidityTest.php b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/ValidityTest.php index bf1bc8f684..f9dce0c7a4 100644 --- a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/ValidityTest.php +++ b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/ValidityTest.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\Core\Persistence\Legacy\URL\Query\CriterionHandler; use Doctrine\DBAL\ParameterType; @@ -37,18 +38,18 @@ public function testHandle() $expressionBuilder = $this->createMock(ExpressionBuilder::class); $expressionBuilder - ->expects($this->once()) + ->expects(self::once()) ->method('eq') ->with('is_valid', ':is_valid') ->willReturn($expected); $queryBuilder = $this->createMock(QueryBuilder::class); $queryBuilder - ->expects($this->any()) + ->expects(self::any()) ->method('expr') ->willReturn($expressionBuilder); $queryBuilder - ->expects($this->any()) + ->expects(self::any()) ->method('createNamedParameter') ->with((int)$criterion->isValid, ParameterType::INTEGER, ':is_valid') ->willReturn(':is_valid'); @@ -58,7 +59,7 @@ public function testHandle() $handler = new ValidityHandler(); $actual = $handler->handle($converter, $queryBuilder, $criterion); - $this->assertEquals($expected, $actual); + self::assertEquals($expected, $actual); } } diff --git a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/VisibleOnlyTest.php b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/VisibleOnlyTest.php index 2287d6281e..3a3358962c 100644 --- a/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/VisibleOnlyTest.php +++ b/tests/lib/Persistence/Legacy/URL/Query/CriterionHandler/VisibleOnlyTest.php @@ -46,8 +46,8 @@ public function testHandle(): void $queryBuilder = $this->createDoctrineQueryBuilder(); $actual = $handler->handle($converter, $queryBuilder, $criterion); - $this->assertEquals($expected, $actual); - $this->assertSame($expectedQueryParameters, $queryBuilder->getParameters()); + self::assertEquals($expected, $actual); + self::assertSame($expectedQueryParameters, $queryBuilder->getParameters()); } /** @@ -62,7 +62,7 @@ private function createDoctrineQueryBuilder(): QueryBuilder $expressionBuilder = new ExpressionBuilder($connection); $connection - ->expects($this->any()) + ->expects(self::any()) ->method('getExpressionBuilder') ->willReturn($expressionBuilder); diff --git a/tests/lib/Persistence/Legacy/User/Role/Gateway/DoctrineDatabaseTest.php b/tests/lib/Persistence/Legacy/User/Role/Gateway/DoctrineDatabaseTest.php index e58c9f10fc..22359d062b 100644 --- a/tests/lib/Persistence/Legacy/User/Role/Gateway/DoctrineDatabaseTest.php +++ b/tests/lib/Persistence/Legacy/User/Role/Gateway/DoctrineDatabaseTest.php @@ -80,7 +80,7 @@ public function testLoadRoleAssignment(): void { $gateway = $this->getDatabaseGateway(); - $this->assertEquals( + self::assertEquals( [ [ 'contentobject_id' => '12', @@ -101,7 +101,7 @@ public function testLoadRoleAssignmentsByGroupId(): void { $gateway = $this->getDatabaseGateway(); - $this->assertEquals( + self::assertEquals( [ [ 'contentobject_id' => '11', @@ -136,7 +136,7 @@ public function testLoadRoleAssignmentsByRoleId(): void { $gateway = $this->getDatabaseGateway(); - $this->assertEquals( + self::assertEquals( [ [ 'contentobject_id' => '11', diff --git a/tests/lib/Persistence/Legacy/User/Role/LimitationConverterTest.php b/tests/lib/Persistence/Legacy/User/Role/LimitationConverterTest.php index e08459fa0c..249b349a26 100644 --- a/tests/lib/Persistence/Legacy/User/Role/LimitationConverterTest.php +++ b/tests/lib/Persistence/Legacy/User/Role/LimitationConverterTest.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\Core\Persistence\Legacy\User\Role; use Ibexa\Contracts\Core\Persistence\User\Policy; @@ -42,7 +43,7 @@ public function testObjectStateToLegacy() Limitation::STATE => '*', ]; $converter->toLegacy($policy); - $this->assertEquals( + self::assertEquals( [ ObjectStateLimitationHandler::STATE_GROUP . 'ez_lock' => '*', ], @@ -55,7 +56,7 @@ public function testObjectStateToLegacy() Limitation::STATE => [1, 2], ]; $converter->toLegacy($policy); - $this->assertEquals( + self::assertEquals( [ ObjectStateLimitationHandler::STATE_GROUP . 'ez_lock' => [1, 2], ], @@ -68,7 +69,7 @@ public function testObjectStateToLegacy() Limitation::STATE => [1, 2, 3, 4], ]; $converter->toLegacy($policy); - $this->assertEquals( + self::assertEquals( [ ObjectStateLimitationHandler::STATE_GROUP . 'ez_lock' => [1, 2], ], @@ -95,7 +96,7 @@ public function testObjectStateToSPI() ObjectStateLimitationHandler::STATE_GROUP . 'ez_lock' => '*', ]; $converter->toSPI($policy); - $this->assertEquals( + self::assertEquals( [ Limitation::STATE => '*', ], @@ -108,7 +109,7 @@ public function testObjectStateToSPI() ObjectStateLimitationHandler::STATE_GROUP . 'ez_lock' => [1, 2], ]; $converter->toSPI($policy); - $this->assertEquals( + self::assertEquals( [ Limitation::STATE => [1, 2], ], @@ -121,7 +122,7 @@ public function testObjectStateToSPI() ObjectStateLimitationHandler::STATE_GROUP . 'ez_lock' => [1, 2, 3, 4], ]; $converter->toSPI($policy); - $this->assertEquals( + self::assertEquals( [ Limitation::STATE => [1, 2, 3, 4], ], @@ -136,12 +137,12 @@ public function testObjectStateToSPI() ]; $converter->toSPI($policy); - $this->assertArrayHasKey(Limitation::STATE, $policy->limitations); + self::assertArrayHasKey(Limitation::STATE, $policy->limitations); // Don't expect backend to return sorted result, so lets sort values before testing sort($policy->limitations[Limitation::STATE], SORT_NUMERIC); - $this->assertEquals( + self::assertEquals( [1, 2, 5], $policy->limitations[Limitation::STATE], 'Expected State limitation to be transformed into StateGroup_ limitations' diff --git a/tests/lib/Persistence/Legacy/User/UserHandlerTest.php b/tests/lib/Persistence/Legacy/User/UserHandlerTest.php index e5f1fa989c..8038205875 100644 --- a/tests/lib/Persistence/Legacy/User/UserHandlerTest.php +++ b/tests/lib/Persistence/Legacy/User/UserHandlerTest.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\Core\Persistence\Legacy\User; use DateInterval; @@ -117,7 +118,7 @@ public function testLoadUser() $user = $this->getValidUser(); - $this->assertEquals( + self::assertEquals( $user, $handler->load($user->id) ); @@ -153,7 +154,7 @@ public function testLoadUserByLogin() $user = $this->getValidUser(); $loadedUser = $handler->loadByLogin($user->login); - $this->assertEquals( + self::assertEquals( $user, $loadedUser ); @@ -225,7 +226,7 @@ public function testLoadUserByEmail() $validUser = $this->getValidUser(); $user = $handler->loadByEmail($validUser->email); - $this->assertEquals( + self::assertEquals( $validUser, $user ); @@ -245,7 +246,7 @@ public function testLoadUsersByEmail() $user = $this->getValidUser(); $users = $handler->loadUsersByEmail($user->email); - $this->assertEquals( + self::assertEquals( $user, $users[0] ); @@ -277,7 +278,7 @@ public function testLoadUserByToken() $handler->updateUserToken($userToken); $loadedUser = $handler->loadUserByToken($userToken->hashKey); - $this->assertEquals( + self::assertEquals( $user, $loadedUser ); @@ -409,7 +410,7 @@ public function testCreateNewRoleRoleId() $roleDraft = $handler->createRole($createStruct); - $this->assertSame(1, $roleDraft->id); + self::assertSame(1, $roleDraft->id); } public function testLoadRole() @@ -423,7 +424,7 @@ public function testLoadRole() $handler->publishRoleDraft($roleDraft->id); $role = $handler->loadRole($roleDraft->id); - $this->assertEquals( + self::assertEquals( $roleDraft->id, $role->id ); @@ -446,7 +447,7 @@ public function testLoadRoleWithPolicies() $handler->publishRoleDraft($roleDraft->id); $loaded = $handler->loadRole($roleDraft->id); - $this->assertEquals( + self::assertEquals( [ new Persistence\User\Policy( [ @@ -484,7 +485,7 @@ public function testLoadRoleWithPoliciesAndGroups() $handler->publishRoleDraft($roleDraft->id); $loaded = $handler->loadRole($roleDraft->id); - $this->assertEquals( + self::assertEquals( [ new Persistence\User\Policy( [ @@ -522,7 +523,7 @@ public function testLoadRoleWithPolicyLimitations() $handler->publishRoleDraft($roleDraft->id); $loaded = $handler->loadRole($roleDraft->id); - $this->assertEquals( + self::assertEquals( [ new Persistence\User\Policy( [ @@ -546,14 +547,14 @@ public function testLoadRoles() { $handler = $this->getUserHandler(); - $this->assertEquals( + self::assertEquals( [], $handler->loadRoles() ); $role = $this->createTestRole($handler); - $this->assertEquals( + self::assertEquals( [$role], $handler->loadRoles() ); @@ -664,7 +665,7 @@ public function testAddPolicyPolicyId() $policy = $handler->addPolicy($role->id, $policy); - $this->assertEquals(1, $policy->id); + self::assertEquals(1, $policy->id); } public function testAddPolicyLimitations() @@ -919,7 +920,7 @@ public function testLoadPoliciesForUser() $policies = $handler->loadPoliciesByUserId(10); // Anonymous user // Verify, that we received an array of Policy objects - $this->assertTrue( + self::assertTrue( array_reduce( array_map( static function ($policy) { @@ -933,7 +934,7 @@ static function ($a, $b) { true ) ); - $this->assertCount(8, $policies); + self::assertCount(8, $policies); } public function testLoadRoleAssignmentsByGroupId() @@ -941,7 +942,7 @@ public function testLoadRoleAssignmentsByGroupId() $this->insertSharedDatabaseFixture(); $handler = $this->getUserHandler(); - $this->assertEquals( + self::assertEquals( [ new Persistence\User\RoleAssignment( [ @@ -961,7 +962,7 @@ public function testLoadRoleAssignmentsByGroupId() $handler->loadRoleAssignmentsByGroupId(11)// 11: Members ); - $this->assertEquals( + self::assertEquals( [ new Persistence\User\RoleAssignment( [ @@ -974,7 +975,7 @@ public function testLoadRoleAssignmentsByGroupId() $handler->loadRoleAssignmentsByGroupId(42)// 42: Anonymous users ); - $this->assertEquals( + self::assertEquals( [], $handler->loadRoleAssignmentsByGroupId(10)// 10: Anonymous User ); @@ -985,7 +986,7 @@ public function testLoadRoleAssignmentsByGroupIdInherited() $this->insertSharedDatabaseFixture(); $handler = $this->getUserHandler(); - $this->assertEquals( + self::assertEquals( [ new Persistence\User\RoleAssignment( [ @@ -1004,7 +1005,7 @@ public function testLoadComplexRoleAssignments() $this->insertSharedDatabaseFixture(); $handler = $this->getUserHandler(); - $this->assertEquals( + self::assertEquals( [ new Persistence\User\RoleAssignment( [ @@ -1035,7 +1036,7 @@ public function testLoadComplexRoleAssignments() $handler->loadRoleAssignmentsByGroupId(13) ); - $this->assertEquals( + self::assertEquals( [ new Persistence\User\RoleAssignment( [ diff --git a/tests/lib/Persistence/Legacy/UserPreference/Gateway/DoctrineDatabaseTest.php b/tests/lib/Persistence/Legacy/UserPreference/Gateway/DoctrineDatabaseTest.php index 444fd5be30..b61dd533ef 100644 --- a/tests/lib/Persistence/Legacy/UserPreference/Gateway/DoctrineDatabaseTest.php +++ b/tests/lib/Persistence/Legacy/UserPreference/Gateway/DoctrineDatabaseTest.php @@ -47,7 +47,7 @@ public function testInsert() $data = $this->loadUserPreference($id); - $this->assertEquals([ + self::assertEquals([ 'id' => $id, 'user_id' => '14', 'name' => 'setting_3', @@ -65,7 +65,7 @@ public function testUpdateUserPreference() $this->getGateway()->setUserPreference($userPreference); - $this->assertEquals([ + self::assertEquals([ 'id' => (string) self::EXISTING_USER_PREFERENCE_ID, 'user_id' => '14', 'name' => 'timezone', @@ -75,7 +75,7 @@ public function testUpdateUserPreference() public function testCountUserPreferences() { - $this->assertEquals(3, $this->getGateway()->countUserPreferences( + self::assertEquals(3, $this->getGateway()->countUserPreferences( self::EXISTING_USER_PREFERENCE_DATA['user_id'] )); } @@ -88,7 +88,7 @@ public function testLoadUserPreferences() $results = $this->getGateway()->loadUserPreferences($userId, $offset, $limit); - $this->assertEquals([ + self::assertEquals([ [ 'id' => '2', 'user_id' => '14', diff --git a/tests/lib/Persistence/Legacy/UserPreference/HandlerTest.php b/tests/lib/Persistence/Legacy/UserPreference/HandlerTest.php index 18d4205c9c..08a952527c 100644 --- a/tests/lib/Persistence/Legacy/UserPreference/HandlerTest.php +++ b/tests/lib/Persistence/Legacy/UserPreference/HandlerTest.php @@ -47,13 +47,13 @@ public function testSetUserPreference() ]); $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('setUserPreference') ->with($setStruct) ->willReturn(self::USER_PREFERENCE_ID); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('extractUserPreferencesFromRows') ->willReturn([new UserPreference([ 'id' => self::USER_PREFERENCE_ID, @@ -61,7 +61,7 @@ public function testSetUserPreference() $userPreference = $this->handler->setUserPreference($setStruct); - $this->assertEquals($userPreference->id, self::USER_PREFERENCE_ID); + self::assertEquals($userPreference->id, self::USER_PREFERENCE_ID); } public function testCountUserPreferences() @@ -70,12 +70,12 @@ public function testCountUserPreferences() $expectedCount = 12; $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('countUserPreferences') ->with($ownerId) ->willReturn($expectedCount); - $this->assertEquals($expectedCount, $this->handler->countUserPreferences($ownerId)); + self::assertEquals($expectedCount, $this->handler->countUserPreferences($ownerId)); } public function testLoadUserPreferences() @@ -97,18 +97,18 @@ public function testLoadUserPreferences() ]; $this->gateway - ->expects($this->once()) + ->expects(self::once()) ->method('loadUserPreferences') ->with($ownerId, $offset, $limit) ->willReturn($rows); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('extractUserPreferencesFromRows') ->with($rows) ->willReturn($objects); - $this->assertEquals($objects, $this->handler->loadUserPreferences($ownerId, $offset, $limit)); + self::assertEquals($objects, $this->handler->loadUserPreferences($ownerId, $offset, $limit)); } } diff --git a/tests/lib/Persistence/Legacy/UserPreference/MapperTest.php b/tests/lib/Persistence/Legacy/UserPreference/MapperTest.php index 98483bc8ee..c8d2ee3942 100644 --- a/tests/lib/Persistence/Legacy/UserPreference/MapperTest.php +++ b/tests/lib/Persistence/Legacy/UserPreference/MapperTest.php @@ -57,7 +57,7 @@ public function testExtractUserPreferencesFromRows() ]), ]; - $this->assertEquals($objects, $this->mapper->extractUserPreferencesFromRows($rows)); + self::assertEquals($objects, $this->mapper->extractUserPreferencesFromRows($rows)); } } diff --git a/tests/lib/Persistence/TransformationProcessor/TransformationProcessorDefinitionBasedParserTest.php b/tests/lib/Persistence/TransformationProcessor/TransformationProcessorDefinitionBasedParserTest.php index b97711af39..70824df383 100644 --- a/tests/lib/Persistence/TransformationProcessor/TransformationProcessorDefinitionBasedParserTest.php +++ b/tests/lib/Persistence/TransformationProcessor/TransformationProcessorDefinitionBasedParserTest.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\Core\Persistence\TransformationProcessor; use Ibexa\Core\Persistence; @@ -32,7 +33,7 @@ public function testParse($file) $parser = new Persistence\TransformationProcessor\DefinitionBased\Parser(); $fixture = include $file . '.result'; - $this->assertEquals( + self::assertEquals( $fixture, $parser->parse($file) ); diff --git a/tests/lib/Persistence/TransformationProcessor/TransformationProcessorDefinitionBasedTest.php b/tests/lib/Persistence/TransformationProcessor/TransformationProcessorDefinitionBasedTest.php index 29a5003b21..5915bc0ecd 100644 --- a/tests/lib/Persistence/TransformationProcessor/TransformationProcessorDefinitionBasedTest.php +++ b/tests/lib/Persistence/TransformationProcessor/TransformationProcessorDefinitionBasedTest.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\Core\Persistence\TransformationProcessor; use Ibexa\Core\Persistence; @@ -28,7 +29,7 @@ public function testSimpleNormalizationLowercase() { $processor = $this->getProcessor(); - $this->assertSame( + self::assertSame( 'hello world!', $processor->transform('Hello World!', ['ascii_lowercase']) ); @@ -38,7 +39,7 @@ public function testSimpleNormalizationUppercase() { $processor = $this->getProcessor(); - $this->assertSame( + self::assertSame( 'HELLO WORLD!', $processor->transform('Hello World!', ['ascii_uppercase']) ); @@ -48,7 +49,7 @@ public function testApplyAllLowercaseNormalizations() { $processor = $this->getProcessor(); - $this->assertSame( + self::assertSame( 'hello world!', $processor->transformByGroup('Hello World!', 'lowercase') ); @@ -63,7 +64,7 @@ public function testAllNormalizations() { $processor = $this->getProcessor(); - $this->assertSame( + self::assertSame( 'HELLO WORLD.', $processor->transform('Hello World!') ); diff --git a/tests/lib/Persistence/TransformationProcessor/TransformationProcessorPcreCompilerTest.php b/tests/lib/Persistence/TransformationProcessor/TransformationProcessorPcreCompilerTest.php index 5781f975ff..d23f4dddda 100644 --- a/tests/lib/Persistence/TransformationProcessor/TransformationProcessorPcreCompilerTest.php +++ b/tests/lib/Persistence/TransformationProcessor/TransformationProcessorPcreCompilerTest.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\Core\Persistence\TransformationProcessor; use Ibexa\Core\Persistence; @@ -45,7 +46,7 @@ public function testCompileMap() ) ); - $this->assertSame( + self::assertSame( 'aeöü', $this->applyTransformations($rules, 'äöü') ); @@ -63,7 +64,7 @@ public function testCompileMapRemove() ) ); - $this->assertSame( + self::assertSame( 'öü', $this->applyTransformations($rules, 'äöü') ); @@ -81,7 +82,7 @@ public function testCompileMapKeep() ) ); - $this->assertSame( + self::assertSame( 'äöü', $this->applyTransformations($rules, 'äöü') ); @@ -99,7 +100,7 @@ public function testCompileMapAscii() ) ); - $this->assertSame( + self::assertSame( 'Aöü', $this->applyTransformations($rules, 'äöü') ); @@ -117,7 +118,7 @@ public function testCompileMapUnicode() ) ); - $this->assertSame( + self::assertSame( 'åöü', $this->applyTransformations($rules, 'äöü') ); @@ -135,7 +136,7 @@ public function testCompileReplace() ) ); - $this->assertSame( + self::assertSame( 'aaaaaaaçè', $this->applyTransformations($rules, 'àáâãäåæçè') ); @@ -153,7 +154,7 @@ public function testCompileTranspose() ) ); - $this->assertSame( + self::assertSame( 'Þßàáâãäçè', $this->applyTransformations($rules, 'àáâãäåæçè') ); @@ -171,7 +172,7 @@ public function testCompileTransposeAsciiLowercase() ) ); - $this->assertSame( + self::assertSame( 'hello world', $this->applyTransformations($rules, 'Hello World') ); @@ -189,7 +190,7 @@ public function testCompileTransposePlus() ) ); - $this->assertSame( + self::assertSame( 'âãäåæçèçè', $this->applyTransformations($rules, 'àáâãäåæçè') ); @@ -207,7 +208,7 @@ public function testCompileModuloTranspose() ) ); - $this->assertSame( + self::assertSame( 'ßááããååçè', $this->applyTransformations($rules, 'àáâãäåæçè') ); diff --git a/tests/lib/Persistence/TransformationProcessor/TransformationProcessorPreprocessedBasedTest.php b/tests/lib/Persistence/TransformationProcessor/TransformationProcessorPreprocessedBasedTest.php index eac4764acb..cbf1db4cf5 100644 --- a/tests/lib/Persistence/TransformationProcessor/TransformationProcessorPreprocessedBasedTest.php +++ b/tests/lib/Persistence/TransformationProcessor/TransformationProcessorPreprocessedBasedTest.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\Core\Persistence\TransformationProcessor; use Ibexa\Core\Persistence; @@ -27,7 +28,7 @@ public function testSimpleNormalizationLowercase() { $processor = $this->getProcessor(); - $this->assertSame( + self::assertSame( 'hello world!', $processor->transform('Hello World!', ['ascii_lowercase']) ); @@ -37,7 +38,7 @@ public function testSimpleNormalizationUppercase() { $processor = $this->getProcessor(); - $this->assertSame( + self::assertSame( 'HELLO WORLD!', $processor->transform('Hello World!', ['ascii_uppercase']) ); @@ -52,7 +53,7 @@ public function testAllNormalizations() { $processor = $this->getProcessor(); - $this->assertSame( + self::assertSame( 'HELLO WORLD.', $processor->transform('Hello World!') ); diff --git a/tests/lib/Query/QueryFactoryTest.php b/tests/lib/Query/QueryFactoryTest.php index d15fc70316..ce4961f737 100644 --- a/tests/lib/Query/QueryFactoryTest.php +++ b/tests/lib/Query/QueryFactoryTest.php @@ -41,13 +41,13 @@ public function testCreate(): void $queryType = $this->createMock(QueryType::class); $queryType - ->expects($this->once()) + ->expects(self::once()) ->method('getQuery') ->with(self::EXAMPLE_QUERY_PARAMS) ->willReturn($expectedQuery); $this->queryTypeRegistry - ->expects($this->once()) + ->expects(self::once()) ->method('getQueryType') ->with(self::EXAMPLE_QUERY_TYPE) ->willReturn($queryType); @@ -57,7 +57,7 @@ public function testCreate(): void self::EXAMPLE_QUERY_PARAMS ); - $this->assertEquals($expectedQuery, $actualQuery); + self::assertEquals($expectedQuery, $actualQuery); } } diff --git a/tests/lib/QueryType/BuiltIn/AbstractQueryTypeTest.php b/tests/lib/QueryType/BuiltIn/AbstractQueryTypeTest.php index 2a53114f68..996033ec89 100644 --- a/tests/lib/QueryType/BuiltIn/AbstractQueryTypeTest.php +++ b/tests/lib/QueryType/BuiltIn/AbstractQueryTypeTest.php @@ -70,12 +70,12 @@ protected function setUp(): void */ final public function testGetQuery(array $parameters, Query $expectedQuery): void { - $this->assertEquals($expectedQuery, $this->queryType->getQuery($parameters)); + self::assertEquals($expectedQuery, $this->queryType->getQuery($parameters)); } final public function testGetName(): void { - $this->assertEquals( + self::assertEquals( $this->getExpectedName(), $this->queryType->getName() ); @@ -83,7 +83,7 @@ final public function testGetName(): void final public function testGetSupportedParameters(): void { - $this->assertEqualsCanonicalizing( + self::assertEqualsCanonicalizing( $this->getExpectedSupportedParameters(), $this->queryType->getSupportedParameters() ); diff --git a/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/CustomFieldSortClauseParserTest.php b/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/CustomFieldSortClauseParserTest.php index 2b6f314155..3de9451bdb 100644 --- a/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/CustomFieldSortClauseParserTest.php +++ b/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/CustomFieldSortClauseParserTest.php @@ -42,7 +42,7 @@ public function testParse(): void $parser->method('parseSortDirection')->willReturn(Query::SORT_ASC); - $this->assertEquals( + self::assertEquals( new CustomField( self::EXAMPLE_SEARCH_INDEX_FIELD, Query::SORT_ASC @@ -53,7 +53,7 @@ public function testParse(): void public function testSupports(): void { - $this->assertTrue($this->parser->supports('custom_field')); + self::assertTrue($this->parser->supports('custom_field')); } } diff --git a/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/DefaultSortClauseParserTest.php b/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/DefaultSortClauseParserTest.php index 8ad71c8939..73ba7925fb 100644 --- a/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/DefaultSortClauseParserTest.php +++ b/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/DefaultSortClauseParserTest.php @@ -35,12 +35,12 @@ public function testParse(): void $parser = $this->createMock(SortSpecParserInterface::class); $parser->method('parseSortDirection')->willReturn(Query::SORT_ASC); - $this->assertEquals( + self::assertEquals( new Location\Depth(Query::SORT_ASC), $this->defaultSortClauseParser->parse($parser, 'depth') ); - $this->assertEquals( + self::assertEquals( new Location\Priority(Query::SORT_ASC), $this->defaultSortClauseParser->parse($parser, 'priority') ); @@ -62,11 +62,11 @@ public function testParseThrowsUnsupportedSortClauseException(): void public function testSupports(): void { - $this->assertTrue($this->defaultSortClauseParser->supports('depth')); - $this->assertTrue($this->defaultSortClauseParser->supports('priority')); - $this->assertTrue($this->defaultSortClauseParser->supports('id')); + self::assertTrue($this->defaultSortClauseParser->supports('depth')); + self::assertTrue($this->defaultSortClauseParser->supports('priority')); + self::assertTrue($this->defaultSortClauseParser->supports('id')); - $this->assertFalse($this->defaultSortClauseParser->supports('unsupported')); + self::assertFalse($this->defaultSortClauseParser->supports('unsupported')); } } diff --git a/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/FieldSortClauseParserTest.php b/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/FieldSortClauseParserTest.php index 67f8f516fd..613135f003 100644 --- a/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/FieldSortClauseParserTest.php +++ b/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/FieldSortClauseParserTest.php @@ -46,7 +46,7 @@ public function testParse(): void $parser->method('parseSortDirection')->willReturn(Query::SORT_ASC); - $this->assertEquals( + self::assertEquals( new Field(self::EXAMPLE_CONTENT_TYPE_ID, self::EXAMPLE_FIELD_ID, Query::SORT_ASC), $this->fieldSortClauseParser->parse($parser, 'field') ); @@ -54,7 +54,7 @@ public function testParse(): void public function testSupports(): void { - $this->assertTrue($this->fieldSortClauseParser->supports('field')); + self::assertTrue($this->fieldSortClauseParser->supports('field')); } } diff --git a/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/MapDistanceSortClauseParserTest.php b/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/MapDistanceSortClauseParserTest.php index 53e79cc717..80fd905831 100644 --- a/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/MapDistanceSortClauseParserTest.php +++ b/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/MapDistanceSortClauseParserTest.php @@ -52,7 +52,7 @@ public function testParse(): void $parser->method('parseSortDirection')->willReturn(Query::SORT_ASC); - $this->assertEquals( + self::assertEquals( new MapLocationDistance( self::EXAMPLE_CONTENT_TYPE_ID, self::EXAMPLE_FIELD_ID, @@ -66,7 +66,7 @@ public function testParse(): void public function testSupports(): void { - $this->assertTrue($this->mapDistanceSortClauseParser->supports('map_distance')); + self::assertTrue($this->mapDistanceSortClauseParser->supports('map_distance')); } } diff --git a/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/RandomSortClauseParserTest.php b/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/RandomSortClauseParserTest.php index ef8ad4af4c..a29839618c 100644 --- a/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/RandomSortClauseParserTest.php +++ b/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParser/RandomSortClauseParserTest.php @@ -42,7 +42,7 @@ public function testParse(): void $parser->method('parseSortDirection')->willReturn(Query::SORT_ASC); - $this->assertEquals( + self::assertEquals( new Random(self::EXAMPLE_SEED, Query::SORT_ASC), $this->randomSortClauseParser->parse($parser, 'random') ); @@ -50,7 +50,7 @@ public function testParse(): void public function testSupports(): void { - $this->assertTrue($this->randomSortClauseParser->supports('random')); + self::assertTrue($this->randomSortClauseParser->supports('random')); } } diff --git a/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParserDispatcherTest.php b/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParserDispatcherTest.php index a324383604..257fba4008 100644 --- a/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParserDispatcherTest.php +++ b/tests/lib/QueryType/BuiltIn/SortSpec/SortClauseParserDispatcherTest.php @@ -30,7 +30,7 @@ public function testParse(): void $dispatcher = new SortClauseParserDispatcher([$parser]); - $this->assertEquals( + self::assertEquals( $sortClause, $dispatcher->parse($sortSpecParser, self::EXAMPLE_SORT_CLAUSE) ); @@ -59,7 +59,7 @@ public function testSupports(): void $dispatcher = new SortClauseParserDispatcher([$parser]); - $this->assertTrue($dispatcher->supports(self::EXAMPLE_SORT_CLAUSE)); + self::assertTrue($dispatcher->supports(self::EXAMPLE_SORT_CLAUSE)); } } diff --git a/tests/lib/QueryType/BuiltIn/SortSpec/SortSpecLexerTest.php b/tests/lib/QueryType/BuiltIn/SortSpec/SortSpecLexerTest.php index 5535ef5837..4fa3ee4698 100644 --- a/tests/lib/QueryType/BuiltIn/SortSpec/SortSpecLexerTest.php +++ b/tests/lib/QueryType/BuiltIn/SortSpec/SortSpecLexerTest.php @@ -22,7 +22,7 @@ public function testTokenize(string $input, iterable $expectedTokens): void $lexer = new SortSpecLexer(); $lexer->tokenize($input); - $this->assertEquals($expectedTokens, $lexer->getAll()); + self::assertEquals($expectedTokens, $lexer->getAll()); } public function dataProviderForTokenize(): iterable @@ -178,7 +178,7 @@ public function testConsume(): void $output[] = $lexer->consume(); } - $this->assertEquals([ + self::assertEquals([ new Token(Token::TYPE_ID, 'foo', 0), new Token(Token::TYPE_COMMA, ',', 3), new Token(Token::TYPE_ASC, 'asc', 5), diff --git a/tests/lib/QueryType/BuiltIn/SortSpec/SortSpecParserTest.php b/tests/lib/QueryType/BuiltIn/SortSpec/SortSpecParserTest.php index 1f04b168f9..19483b357f 100644 --- a/tests/lib/QueryType/BuiltIn/SortSpec/SortSpecParserTest.php +++ b/tests/lib/QueryType/BuiltIn/SortSpec/SortSpecParserTest.php @@ -28,7 +28,7 @@ public function testParseSortDirection(array $input, string $expectedDirection): $lexer = new SortSpecLexerStub($input); $parser = new SortSpecParser($this->createMock(SortClauseParserInterface::class), $lexer); - $this->assertEquals($expectedDirection, $parser->parseSortDirection()); + self::assertEquals($expectedDirection, $parser->parseSortDirection()); } public function dataProviderForParseSortDirection(): iterable @@ -77,7 +77,7 @@ public function testParseSortClauseList(): void ->with($parser, self::EXAMPLE_SORT_CLAUSE_ID) ->willReturnOnConsecutiveCalls($sortClauseA, $sortClauseB); - $this->assertEquals( + self::assertEquals( [$sortClauseA, $sortClauseB], $parser->parseSortClausesList() ); @@ -95,12 +95,12 @@ public function testParseSortClause(): void $sortClause = $this->createMock(SortClause::class); $sortClauseArgsParser - ->expects($this->once()) + ->expects(self::once()) ->method('parse') ->with($parser, self::EXAMPLE_SORT_CLAUSE_ID) ->willReturn($sortClause); - $this->assertEquals($sortClause, $parser->parseSortClause()); + self::assertEquals($sortClause, $parser->parseSortClause()); } public function testMatch(): void @@ -108,15 +108,15 @@ public function testMatch(): void $token = new Token(Token::TYPE_ID, self::EXAMPLE_SORT_CLAUSE_ID); $lexer = $this->createMock(SortSpecLexerInterface::class); - $lexer->expects($this->once())->method('peek')->willReturn($token); - $lexer->expects($this->once())->method('consume')->willReturn($token); + $lexer->expects(self::once())->method('peek')->willReturn($token); + $lexer->expects(self::once())->method('consume')->willReturn($token); $parser = new SortSpecParser( $this->createMock(SortClauseParserInterface::class), $lexer ); - $this->assertEquals($token, $parser->match(Token::TYPE_ID)); + self::assertEquals($token, $parser->match(Token::TYPE_ID)); } public function testMatchAny(): void @@ -124,15 +124,15 @@ public function testMatchAny(): void $token = new Token(Token::TYPE_ASC); $lexer = $this->createMock(SortSpecLexerInterface::class); - $lexer->expects($this->once())->method('peek')->willReturn($token); - $lexer->expects($this->once())->method('consume')->willReturn($token); + $lexer->expects(self::once())->method('peek')->willReturn($token); + $lexer->expects(self::once())->method('consume')->willReturn($token); $parser = new SortSpecParser( $this->createMock(SortClauseParserInterface::class), $lexer ); - $this->assertEquals($token, $parser->matchAnyOf(Token::TYPE_ASC, Token::TYPE_DESC)); + self::assertEquals($token, $parser->matchAnyOf(Token::TYPE_ASC, Token::TYPE_DESC)); } } diff --git a/tests/lib/Repository/Common/FacetedSearchProvider.php b/tests/lib/Repository/Common/FacetedSearchProvider.php index 1c290d098e..440142f963 100644 --- a/tests/lib/Repository/Common/FacetedSearchProvider.php +++ b/tests/lib/Repository/Common/FacetedSearchProvider.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\Core\Repository\Common; use Ibexa\Contracts\Core\Repository\Values\Content\Query; diff --git a/tests/lib/Repository/ContentThumbnail/ContentFieldStrategyTest.php b/tests/lib/Repository/ContentThumbnail/ContentFieldStrategyTest.php index c9db0f8cf9..b36a030310 100644 --- a/tests/lib/Repository/ContentThumbnail/ContentFieldStrategyTest.php +++ b/tests/lib/Repository/ContentThumbnail/ContentFieldStrategyTest.php @@ -50,19 +50,19 @@ public function testHasStrategy(): void $this->getFieldTypeBasedThumbnailStrategy('example'), ])); - $this->assertTrue($contentFieldStrategy->hasStrategy('example')); - $this->assertFalse($contentFieldStrategy->hasStrategy('something_else')); + self::assertTrue($contentFieldStrategy->hasStrategy('example')); + self::assertFalse($contentFieldStrategy->hasStrategy('something_else')); } public function testAddStrategy(): void { $contentFieldStrategy = new ContentFieldStrategy(new ArrayIterator()); - $this->assertFalse($contentFieldStrategy->hasStrategy('example')); + self::assertFalse($contentFieldStrategy->hasStrategy('example')); $contentFieldStrategy->addStrategy('example', $this->getFieldTypeBasedThumbnailStrategy('example')); - $this->assertTrue($contentFieldStrategy->hasStrategy('example')); + self::assertTrue($contentFieldStrategy->hasStrategy('example')); } public function testSetStrategies(): void @@ -71,16 +71,16 @@ public function testSetStrategies(): void $this->getFieldTypeBasedThumbnailStrategy('previous'), ])); - $this->assertTrue($contentFieldStrategy->hasStrategy('previous')); + self::assertTrue($contentFieldStrategy->hasStrategy('previous')); $contentFieldStrategy->setStrategies([ $this->getFieldTypeBasedThumbnailStrategy('new-example-1'), $this->getFieldTypeBasedThumbnailStrategy('new-example-2'), ]); - $this->assertFalse($contentFieldStrategy->hasStrategy('previous')); - $this->assertTrue($contentFieldStrategy->hasStrategy('new-example-1')); - $this->assertTrue($contentFieldStrategy->hasStrategy('new-example-2')); + self::assertFalse($contentFieldStrategy->hasStrategy('previous')); + self::assertTrue($contentFieldStrategy->hasStrategy('new-example-1')); + self::assertTrue($contentFieldStrategy->hasStrategy('new-example-2')); } public function testGetThumbnailFound(): void @@ -96,8 +96,8 @@ public function testGetThumbnailFound(): void $thumbnail = $contentFieldStrategy->getThumbnail($field); - $this->assertInstanceOf(Thumbnail::class, $thumbnail); - $this->assertEquals('example-value', $thumbnail->resource); + self::assertInstanceOf(Thumbnail::class, $thumbnail); + self::assertEquals('example-value', $thumbnail->resource); } public function testGetThumbnailNotFound(): void diff --git a/tests/lib/Repository/ContentThumbnail/StaticStrategyTest.php b/tests/lib/Repository/ContentThumbnail/StaticStrategyTest.php index 8780bcba70..ac83a2fdc3 100644 --- a/tests/lib/Repository/ContentThumbnail/StaticStrategyTest.php +++ b/tests/lib/Repository/ContentThumbnail/StaticStrategyTest.php @@ -34,7 +34,7 @@ public function testStaticStrategy() $fieldMocks, ); - $this->assertEquals( + self::assertEquals( new Thumbnail([ 'resource' => $resource, ]), diff --git a/tests/lib/Repository/ContentThumbnail/ThumbnailChainStrategyTest.php b/tests/lib/Repository/ContentThumbnail/ThumbnailChainStrategyTest.php index 59eef016e4..9979962144 100644 --- a/tests/lib/Repository/ContentThumbnail/ThumbnailChainStrategyTest.php +++ b/tests/lib/Repository/ContentThumbnail/ThumbnailChainStrategyTest.php @@ -30,12 +30,12 @@ public function testThumbnailStrategyChaining(): void ]; $firstStrategyMock - ->expects($this->once()) + ->expects(self::once()) ->method('getThumbnail') ->willReturn(null); $secondStrategyMock - ->expects($this->once()) + ->expects(self::once()) ->method('getThumbnail') ->willReturn(new Thumbnail()); @@ -49,7 +49,7 @@ public function testThumbnailStrategyChaining(): void $fieldMocks ); - $this->assertInstanceOf(Thumbnail::class, $result); + self::assertInstanceOf(Thumbnail::class, $result); } public function testThumbnailStrategyChainBreakOnThumbnailFound(): void @@ -66,19 +66,19 @@ public function testThumbnailStrategyChainBreakOnThumbnailFound(): void ]; $firstStrategyMock - ->expects($this->once()) + ->expects(self::once()) ->method('getThumbnail') ->willReturn(null); $secondStrategyMock - ->expects($this->once()) + ->expects(self::once()) ->method('getThumbnail') ->willReturn(new Thumbnail([ 'resource' => 'second', ])); $thirdStrategyMock - ->expects($this->never()) + ->expects(self::never()) ->method('getThumbnail') ->willReturn(new Thumbnail([ 'resource' => 'third', @@ -95,8 +95,8 @@ public function testThumbnailStrategyChainBreakOnThumbnailFound(): void $fieldMocks ); - $this->assertInstanceOf(Thumbnail::class, $result); - $this->assertEquals(new Thumbnail(['resource' => 'second']), $result); + self::assertInstanceOf(Thumbnail::class, $result); + self::assertEquals(new Thumbnail(['resource' => 'second']), $result); } } diff --git a/tests/lib/Repository/ContentValidator/ContentValidatorStrategyTest.php b/tests/lib/Repository/ContentValidator/ContentValidatorStrategyTest.php index b28b45d2cf..00966aa8a1 100644 --- a/tests/lib/Repository/ContentValidator/ContentValidatorStrategyTest.php +++ b/tests/lib/Repository/ContentValidator/ContentValidatorStrategyTest.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\Core\Repository\ContentValidator; use Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException; @@ -31,7 +32,7 @@ public function testKnownValidationObject(): void ]); $errors = $contentValidatorStrategy->validate(new ObjectState()); - $this->assertEquals(['test'], $errors); + self::assertEquals(['test'], $errors); } public function testSupportsUnknownValidationObject(): void @@ -39,7 +40,7 @@ public function testSupportsUnknownValidationObject(): void $contentValidatorStrategy = new ContentValidatorStrategy([]); $supports = $contentValidatorStrategy->supports(new ObjectState()); - $this->assertFalse($supports); + self::assertFalse($supports); } public function testSuportsKnownValidationObject(): void @@ -50,7 +51,7 @@ public function testSuportsKnownValidationObject(): void $supports = $contentValidatorStrategy->supports(new ObjectState()); - $this->assertTrue($supports); + self::assertTrue($supports); } public function testMergeValidationErrors(): void @@ -71,7 +72,7 @@ public function testMergeValidationErrors(): void ]); $errors = $contentValidatorStrategy->validate(new ObjectState()); - $this->assertEquals([ + self::assertEquals([ 123 => ['eng-GB' => '123-eng-GB'], 321 => ['pol-PL' => '321-pol-PL'], 456 => [ diff --git a/tests/lib/Repository/Decorator/BookmarkServiceDecoratorTest.php b/tests/lib/Repository/Decorator/BookmarkServiceDecoratorTest.php index 538aa839d8..d78248b3bd 100644 --- a/tests/lib/Repository/Decorator/BookmarkServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/BookmarkServiceDecoratorTest.php @@ -34,7 +34,7 @@ public function testCreateBookmarkDecorator() $parameters = [$this->createMock(Location::class)]; - $serviceMock->expects($this->once())->method('createBookmark')->with(...$parameters); + $serviceMock->expects(self::once())->method('createBookmark')->with(...$parameters); $decoratedService->createBookmark(...$parameters); } @@ -46,7 +46,7 @@ public function testDeleteBookmarkDecorator() $parameters = [$this->createMock(Location::class)]; - $serviceMock->expects($this->once())->method('deleteBookmark')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteBookmark')->with(...$parameters); $decoratedService->deleteBookmark(...$parameters); } @@ -61,7 +61,7 @@ public function testLoadBookmarksDecorator() 606, ]; - $serviceMock->expects($this->once())->method('loadBookmarks')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadBookmarks')->with(...$parameters); $decoratedService->loadBookmarks(...$parameters); } @@ -73,7 +73,7 @@ public function testIsBookmarkedDecorator() $parameters = [$this->createMock(Location::class)]; - $serviceMock->expects($this->once())->method('isBookmarked')->with(...$parameters); + $serviceMock->expects(self::once())->method('isBookmarked')->with(...$parameters); $decoratedService->isBookmarked(...$parameters); } diff --git a/tests/lib/Repository/Decorator/ContentServiceDecoratorTest.php b/tests/lib/Repository/Decorator/ContentServiceDecoratorTest.php index 71ec775c27..2ae5ef567e 100644 --- a/tests/lib/Repository/Decorator/ContentServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/ContentServiceDecoratorTest.php @@ -48,7 +48,7 @@ public function testLoadContentInfoDecorator() $parameters = [self::EXAMPLE_CONTENT_ID]; - $serviceMock->expects($this->once())->method('loadContentInfo')->with(...$parameters)->willReturn($this->createMock(ContentInfo::class)); + $serviceMock->expects(self::once())->method('loadContentInfo')->with(...$parameters)->willReturn($this->createMock(ContentInfo::class)); $decoratedService->loadContentInfo(...$parameters); } @@ -60,7 +60,7 @@ public function testLoadContentInfoListDecorator() $parameters = [['random_value_5ced05ce154173.99718966']]; - $serviceMock->expects($this->once())->method('loadContentInfoList')->with(...$parameters)->willReturn([]); + $serviceMock->expects(self::once())->method('loadContentInfoList')->with(...$parameters)->willReturn([]); $decoratedService->loadContentInfoList(...$parameters); } @@ -72,7 +72,7 @@ public function testLoadContentInfoByRemoteIdDecorator() $parameters = ['random_value_5ced05ce1541a6.54558542']; - $serviceMock->expects($this->once())->method('loadContentInfoByRemoteId')->with(...$parameters)->willReturn($this->createMock(ContentInfo::class)); + $serviceMock->expects(self::once())->method('loadContentInfoByRemoteId')->with(...$parameters)->willReturn($this->createMock(ContentInfo::class)); $decoratedService->loadContentInfoByRemoteId(...$parameters); } @@ -87,7 +87,7 @@ public function testLoadVersionInfoDecorator() self::EXAMPLE_VERSION_NO, ]; - $serviceMock->expects($this->once())->method('loadVersionInfo')->with(...$parameters)->willReturn($this->createMock(VersionInfo::class)); + $serviceMock->expects(self::once())->method('loadVersionInfo')->with(...$parameters)->willReturn($this->createMock(VersionInfo::class)); $decoratedService->loadVersionInfo(...$parameters); } @@ -102,7 +102,7 @@ public function testLoadVersionInfoByIdDecorator() self::EXAMPLE_VERSION_NO, ]; - $serviceMock->expects($this->once())->method('loadVersionInfoById')->with(...$parameters)->willReturn($this->createMock(VersionInfo::class)); + $serviceMock->expects(self::once())->method('loadVersionInfoById')->with(...$parameters)->willReturn($this->createMock(VersionInfo::class)); $decoratedService->loadVersionInfoById(...$parameters); } @@ -119,7 +119,7 @@ public function testLoadContentByContentInfoDecorator() true, ]; - $serviceMock->expects($this->once())->method('loadContentByContentInfo')->with(...$parameters)->willReturn($this->createMock(Content::class)); + $serviceMock->expects(self::once())->method('loadContentByContentInfo')->with(...$parameters)->willReturn($this->createMock(Content::class)); $decoratedService->loadContentByContentInfo(...$parameters); } @@ -135,7 +135,7 @@ public function testLoadContentByVersionInfoDecorator() true, ]; - $serviceMock->expects($this->once())->method('loadContentByVersionInfo')->with(...$parameters)->willReturn($this->createMock(Content::class)); + $serviceMock->expects(self::once())->method('loadContentByVersionInfo')->with(...$parameters)->willReturn($this->createMock(Content::class)); $decoratedService->loadContentByVersionInfo(...$parameters); } @@ -152,7 +152,7 @@ public function testLoadContentDecorator() true, ]; - $serviceMock->expects($this->once())->method('loadContent')->with(...$parameters)->willReturn($this->createMock(Content::class)); + $serviceMock->expects(self::once())->method('loadContent')->with(...$parameters)->willReturn($this->createMock(Content::class)); $decoratedService->loadContent(...$parameters); } @@ -169,7 +169,7 @@ public function testLoadContentByRemoteIdDecorator() true, ]; - $serviceMock->expects($this->once())->method('loadContentByRemoteId')->with(...$parameters)->willReturn($this->createMock(Content::class)); + $serviceMock->expects(self::once())->method('loadContentByRemoteId')->with(...$parameters)->willReturn($this->createMock(Content::class)); $decoratedService->loadContentByRemoteId(...$parameters); } @@ -185,7 +185,7 @@ public function testLoadContentListByContentInfoDecorator() true, ]; - $serviceMock->expects($this->once())->method('loadContentListByContentInfo')->with(...$parameters)->willReturn([]); + $serviceMock->expects(self::once())->method('loadContentListByContentInfo')->with(...$parameters)->willReturn([]); $decoratedService->loadContentListByContentInfo(...$parameters); } @@ -200,7 +200,7 @@ public function testCreateContentDecorator() ['random_value_5ced05ce155881.06739513'], ]; - $serviceMock->expects($this->once())->method('createContent')->with(...$parameters)->willReturn($this->createMock(Content::class)); + $serviceMock->expects(self::once())->method('createContent')->with(...$parameters)->willReturn($this->createMock(Content::class)); $decoratedService->createContent(...$parameters); } @@ -215,7 +215,7 @@ public function testUpdateContentMetadataDecorator() $this->createMock(ContentMetadataUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updateContentMetadata')->with(...$parameters)->willReturn($this->createMock(Content::class)); + $serviceMock->expects(self::once())->method('updateContentMetadata')->with(...$parameters)->willReturn($this->createMock(Content::class)); $decoratedService->updateContentMetadata(...$parameters); } @@ -227,7 +227,7 @@ public function testDeleteContentDecorator() $parameters = [$this->createMock(ContentInfo::class)]; - $serviceMock->expects($this->once())->method('deleteContent')->with(...$parameters)->willReturn([]); + $serviceMock->expects(self::once())->method('deleteContent')->with(...$parameters)->willReturn([]); $decoratedService->deleteContent(...$parameters); } @@ -243,7 +243,7 @@ public function testCreateContentDraftDecorator() $this->createMock(User::class), ]; - $serviceMock->expects($this->once())->method('createContentDraft')->with(...$parameters)->willReturn($this->createMock(Content::class)); + $serviceMock->expects(self::once())->method('createContentDraft')->with(...$parameters)->willReturn($this->createMock(Content::class)); $decoratedService->createContentDraft(...$parameters); } @@ -255,7 +255,7 @@ public function testLoadContentDraftsDecorator() $parameters = [$this->createMock(User::class)]; - $serviceMock->expects($this->once())->method('loadContentDrafts')->with(...$parameters)->willReturn([]); + $serviceMock->expects(self::once())->method('loadContentDrafts')->with(...$parameters)->willReturn([]); $decoratedService->loadContentDrafts(...$parameters); } @@ -270,7 +270,7 @@ public function testUpdateContentDecorator() $this->createMock(ContentUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updateContent')->with(...$parameters)->willReturn($this->createMock(Content::class)); + $serviceMock->expects(self::once())->method('updateContent')->with(...$parameters)->willReturn($this->createMock(Content::class)); $decoratedService->updateContent(...$parameters); } @@ -282,7 +282,7 @@ public function testPublishVersionDecorator() $parameters = [$this->createMock(VersionInfo::class)]; - $serviceMock->expects($this->once())->method('publishVersion')->with(...$parameters)->willReturn($this->createMock(Content::class)); + $serviceMock->expects(self::once())->method('publishVersion')->with(...$parameters)->willReturn($this->createMock(Content::class)); $decoratedService->publishVersion(...$parameters); } @@ -294,7 +294,7 @@ public function testDeleteVersionDecorator() $parameters = [$this->createMock(VersionInfo::class)]; - $serviceMock->expects($this->once())->method('deleteVersion')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteVersion')->with(...$parameters); $decoratedService->deleteVersion(...$parameters); } @@ -306,7 +306,7 @@ public function testLoadVersionsDecorator() $parameters = [$this->createMock(ContentInfo::class)]; - $serviceMock->expects($this->once())->method('loadVersions')->with(...$parameters)->willReturn([]); + $serviceMock->expects(self::once())->method('loadVersions')->with(...$parameters)->willReturn([]); $decoratedService->loadVersions(...$parameters); } @@ -322,7 +322,7 @@ public function testCopyContentDecorator() $this->createMock(VersionInfo::class), ]; - $serviceMock->expects($this->once())->method('copyContent')->with(...$parameters)->willReturn($this->createMock(Content::class)); + $serviceMock->expects(self::once())->method('copyContent')->with(...$parameters)->willReturn($this->createMock(Content::class)); $decoratedService->copyContent(...$parameters); } @@ -334,7 +334,7 @@ public function testLoadRelationsDecorator() $parameters = [$this->createMock(VersionInfo::class)]; - $serviceMock->expects($this->once())->method('loadRelations')->with(...$parameters)->willReturn([]); + $serviceMock->expects(self::once())->method('loadRelations')->with(...$parameters)->willReturn([]); $decoratedService->loadRelations(...$parameters); } @@ -346,7 +346,7 @@ public function testLoadReverseRelationsDecorator() $parameters = [$this->createMock(ContentInfo::class)]; - $serviceMock->expects($this->once())->method('loadReverseRelations')->with(...$parameters)->willReturn([]); + $serviceMock->expects(self::once())->method('loadReverseRelations')->with(...$parameters)->willReturn([]); $decoratedService->loadReverseRelations(...$parameters); } @@ -361,7 +361,7 @@ public function testAddRelationDecorator() $this->createMock(ContentInfo::class), ]; - $serviceMock->expects($this->once())->method('addRelation')->with(...$parameters)->willReturn($this->createMock(Relation::class)); + $serviceMock->expects(self::once())->method('addRelation')->with(...$parameters)->willReturn($this->createMock(Relation::class)); $decoratedService->addRelation(...$parameters); } @@ -376,7 +376,7 @@ public function testDeleteRelationDecorator() $this->createMock(ContentInfo::class), ]; - $serviceMock->expects($this->once())->method('deleteRelation')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteRelation')->with(...$parameters); $decoratedService->deleteRelation(...$parameters); } @@ -391,7 +391,7 @@ public function testDeleteTranslationDecorator() self::EXAMPLE_LANGUAGE_CODE, ]; - $serviceMock->expects($this->once())->method('deleteTranslation')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteTranslation')->with(...$parameters); $decoratedService->deleteTranslation(...$parameters); } @@ -406,7 +406,7 @@ public function testDeleteTranslationFromDraftDecorator() 'random_value_5ced05ce156d37.22902273', ]; - $serviceMock->expects($this->once())->method('deleteTranslationFromDraft')->with(...$parameters)->willReturn($this->createMock(Content::class)); + $serviceMock->expects(self::once())->method('deleteTranslationFromDraft')->with(...$parameters)->willReturn($this->createMock(Content::class)); $decoratedService->deleteTranslationFromDraft(...$parameters); } @@ -418,7 +418,7 @@ public function testHideContentDecorator() $parameters = [$this->createMock(ContentInfo::class)]; - $serviceMock->expects($this->once())->method('hideContent')->with(...$parameters); + $serviceMock->expects(self::once())->method('hideContent')->with(...$parameters); $decoratedService->hideContent(...$parameters); } @@ -430,7 +430,7 @@ public function testRevealContentDecorator() $parameters = [$this->createMock(ContentInfo::class)]; - $serviceMock->expects($this->once())->method('revealContent')->with(...$parameters); + $serviceMock->expects(self::once())->method('revealContent')->with(...$parameters); $decoratedService->revealContent(...$parameters); } @@ -445,7 +445,7 @@ public function testNewContentCreateStructDecorator() 'random_value_5ced05ce156db7.87562997', ]; - $serviceMock->expects($this->once())->method('newContentCreateStruct')->with(...$parameters)->willReturn($this->createMock(ContentCreateStruct::class)); + $serviceMock->expects(self::once())->method('newContentCreateStruct')->with(...$parameters)->willReturn($this->createMock(ContentCreateStruct::class)); $decoratedService->newContentCreateStruct(...$parameters); } @@ -457,7 +457,7 @@ public function testNewContentMetadataUpdateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newContentMetadataUpdateStruct')->with(...$parameters)->willReturn($this->createMock(ContentMetadataUpdateStruct::class)); + $serviceMock->expects(self::once())->method('newContentMetadataUpdateStruct')->with(...$parameters)->willReturn($this->createMock(ContentMetadataUpdateStruct::class)); $decoratedService->newContentMetadataUpdateStruct(...$parameters); } @@ -469,7 +469,7 @@ public function testNewContentUpdateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newContentUpdateStruct')->with(...$parameters)->willReturn($this->createMock(ContentUpdateStruct::class)); + $serviceMock->expects(self::once())->method('newContentUpdateStruct')->with(...$parameters)->willReturn($this->createMock(ContentUpdateStruct::class)); $decoratedService->newContentUpdateStruct(...$parameters); } diff --git a/tests/lib/Repository/Decorator/ContentTypeServiceDecoratorTest.php b/tests/lib/Repository/Decorator/ContentTypeServiceDecoratorTest.php index 4c33354bad..0d63158785 100644 --- a/tests/lib/Repository/Decorator/ContentTypeServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/ContentTypeServiceDecoratorTest.php @@ -44,7 +44,7 @@ public function testCreateContentTypeGroupDecorator() $parameters = [$this->createMock(ContentTypeGroupCreateStruct::class)]; - $serviceMock->expects($this->once())->method('createContentTypeGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('createContentTypeGroup')->with(...$parameters); $decoratedService->createContentTypeGroup(...$parameters); } @@ -59,7 +59,7 @@ public function testLoadContentTypeGroupDecorator() ['prioritized_language_value'], ]; - $serviceMock->expects($this->once())->method('loadContentTypeGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadContentTypeGroup')->with(...$parameters); $decoratedService->loadContentTypeGroup(...$parameters); } @@ -74,7 +74,7 @@ public function testLoadContentTypeGroupByIdentifierDecorator() ['prioritized_language_value'], ]; - $serviceMock->expects($this->once())->method('loadContentTypeGroupByIdentifier')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadContentTypeGroupByIdentifier')->with(...$parameters); $decoratedService->loadContentTypeGroupByIdentifier(...$parameters); } @@ -86,7 +86,7 @@ public function testLoadContentTypeGroupsDecorator() $parameters = [['prioritized_language_value']]; - $serviceMock->expects($this->once())->method('loadContentTypeGroups')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadContentTypeGroups')->with(...$parameters); $decoratedService->loadContentTypeGroups(...$parameters); } @@ -101,7 +101,7 @@ public function testUpdateContentTypeGroupDecorator() $this->createMock(ContentTypeGroupUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updateContentTypeGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('updateContentTypeGroup')->with(...$parameters); $decoratedService->updateContentTypeGroup(...$parameters); } @@ -113,7 +113,7 @@ public function testDeleteContentTypeGroupDecorator() $parameters = [$this->createMock(ContentTypeGroup::class)]; - $serviceMock->expects($this->once())->method('deleteContentTypeGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteContentTypeGroup')->with(...$parameters); $decoratedService->deleteContentTypeGroup(...$parameters); } @@ -128,7 +128,7 @@ public function testCreateContentTypeDecorator() ['content_type_group_identifier'], ]; - $serviceMock->expects($this->once())->method('createContentType')->with(...$parameters); + $serviceMock->expects(self::once())->method('createContentType')->with(...$parameters); $decoratedService->createContentType(...$parameters); } @@ -143,7 +143,7 @@ public function testLoadContentTypeDecorator() ['prioritized_language_value'], ]; - $serviceMock->expects($this->once())->method('loadContentType')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadContentType')->with(...$parameters); $decoratedService->loadContentType(...$parameters); } @@ -158,7 +158,7 @@ public function testLoadContentTypeByIdentifierDecorator() ['prioritized_language_value'], ]; - $serviceMock->expects($this->once())->method('loadContentTypeByIdentifier')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadContentTypeByIdentifier')->with(...$parameters); $decoratedService->loadContentTypeByIdentifier(...$parameters); } @@ -173,7 +173,7 @@ public function testLoadContentTypeByRemoteIdDecorator() ['random_value_5ced05ce102338.43562070'], ]; - $serviceMock->expects($this->once())->method('loadContentTypeByRemoteId')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadContentTypeByRemoteId')->with(...$parameters); $decoratedService->loadContentTypeByRemoteId(...$parameters); } @@ -185,7 +185,7 @@ public function testLoadContentTypeDraftDecorator() $parameters = [1, true]; - $serviceMock->expects($this->once())->method('loadContentTypeDraft')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadContentTypeDraft')->with(...$parameters); $decoratedService->loadContentTypeDraft(...$parameters); } @@ -200,7 +200,7 @@ public function testLoadContentTypeListDecorator() ['random_value_5ced05ce102394.49260758'], ]; - $serviceMock->expects($this->once())->method('loadContentTypeList')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadContentTypeList')->with(...$parameters); $decoratedService->loadContentTypeList(...$parameters); } @@ -215,7 +215,7 @@ public function testLoadContentTypesDecorator() ['random_value_5ced05ce1023d7.35531928'], ]; - $serviceMock->expects($this->once())->method('loadContentTypes')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadContentTypes')->with(...$parameters); $decoratedService->loadContentTypes(...$parameters); } @@ -227,7 +227,7 @@ public function testCreateContentTypeDraftDecorator() $parameters = [$this->createMock(ContentType::class)]; - $serviceMock->expects($this->once())->method('createContentTypeDraft')->with(...$parameters); + $serviceMock->expects(self::once())->method('createContentTypeDraft')->with(...$parameters); $decoratedService->createContentTypeDraft(...$parameters); } @@ -242,7 +242,7 @@ public function testUpdateContentTypeDraftDecorator() $this->createMock(ContentTypeUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updateContentTypeDraft')->with(...$parameters); + $serviceMock->expects(self::once())->method('updateContentTypeDraft')->with(...$parameters); $decoratedService->updateContentTypeDraft(...$parameters); } @@ -254,7 +254,7 @@ public function testDeleteContentTypeDecorator() $parameters = [$this->createMock(ContentType::class)]; - $serviceMock->expects($this->once())->method('deleteContentType')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteContentType')->with(...$parameters); $decoratedService->deleteContentType(...$parameters); } @@ -269,7 +269,7 @@ public function testCopyContentTypeDecorator() $this->createMock(User::class), ]; - $serviceMock->expects($this->once())->method('copyContentType')->with(...$parameters); + $serviceMock->expects(self::once())->method('copyContentType')->with(...$parameters); $decoratedService->copyContentType(...$parameters); } @@ -284,7 +284,7 @@ public function testAssignContentTypeGroupDecorator() $this->createMock(ContentTypeGroup::class), ]; - $serviceMock->expects($this->once())->method('assignContentTypeGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('assignContentTypeGroup')->with(...$parameters); $decoratedService->assignContentTypeGroup(...$parameters); } @@ -299,7 +299,7 @@ public function testUnassignContentTypeGroupDecorator() $this->createMock(ContentTypeGroup::class), ]; - $serviceMock->expects($this->once())->method('unassignContentTypeGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('unassignContentTypeGroup')->with(...$parameters); $decoratedService->unassignContentTypeGroup(...$parameters); } @@ -314,7 +314,7 @@ public function testAddFieldDefinitionDecorator() $this->createMock(FieldDefinitionCreateStruct::class), ]; - $serviceMock->expects($this->once())->method('addFieldDefinition')->with(...$parameters); + $serviceMock->expects(self::once())->method('addFieldDefinition')->with(...$parameters); $decoratedService->addFieldDefinition(...$parameters); } @@ -329,7 +329,7 @@ public function testRemoveFieldDefinitionDecorator() $this->createMock(FieldDefinition::class), ]; - $serviceMock->expects($this->once())->method('removeFieldDefinition')->with(...$parameters); + $serviceMock->expects(self::once())->method('removeFieldDefinition')->with(...$parameters); $decoratedService->removeFieldDefinition(...$parameters); } @@ -345,7 +345,7 @@ public function testUpdateFieldDefinitionDecorator() $this->createMock(FieldDefinitionUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updateFieldDefinition')->with(...$parameters); + $serviceMock->expects(self::once())->method('updateFieldDefinition')->with(...$parameters); $decoratedService->updateFieldDefinition(...$parameters); } @@ -357,7 +357,7 @@ public function testPublishContentTypeDraftDecorator() $parameters = [$this->createMock(ContentTypeDraft::class)]; - $serviceMock->expects($this->once())->method('publishContentTypeDraft')->with(...$parameters); + $serviceMock->expects(self::once())->method('publishContentTypeDraft')->with(...$parameters); $decoratedService->publishContentTypeDraft(...$parameters); } @@ -369,7 +369,7 @@ public function testNewContentTypeGroupCreateStructDecorator() $parameters = ['random_value_5ced05ce105ab6.78784768']; - $serviceMock->expects($this->once())->method('newContentTypeGroupCreateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newContentTypeGroupCreateStruct')->with(...$parameters); $decoratedService->newContentTypeGroupCreateStruct(...$parameters); } @@ -381,7 +381,7 @@ public function testNewContentTypeCreateStructDecorator() $parameters = ['random_value_5ced05ce105af0.66964747']; - $serviceMock->expects($this->once())->method('newContentTypeCreateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newContentTypeCreateStruct')->with(...$parameters); $decoratedService->newContentTypeCreateStruct(...$parameters); } @@ -393,7 +393,7 @@ public function testNewContentTypeUpdateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newContentTypeUpdateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newContentTypeUpdateStruct')->with(...$parameters); $decoratedService->newContentTypeUpdateStruct(...$parameters); } @@ -405,7 +405,7 @@ public function testNewContentTypeGroupUpdateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newContentTypeGroupUpdateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newContentTypeGroupUpdateStruct')->with(...$parameters); $decoratedService->newContentTypeGroupUpdateStruct(...$parameters); } @@ -420,7 +420,7 @@ public function testNewFieldDefinitionCreateStructDecorator() 'random_value_5ced05ce105b57.01268982', ]; - $serviceMock->expects($this->once())->method('newFieldDefinitionCreateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newFieldDefinitionCreateStruct')->with(...$parameters); $decoratedService->newFieldDefinitionCreateStruct(...$parameters); } @@ -432,7 +432,7 @@ public function testNewFieldDefinitionUpdateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newFieldDefinitionUpdateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newFieldDefinitionUpdateStruct')->with(...$parameters); $decoratedService->newFieldDefinitionUpdateStruct(...$parameters); } @@ -444,7 +444,7 @@ public function testIsContentTypeUsedDecorator() $parameters = [$this->createMock(ContentType::class)]; - $serviceMock->expects($this->once())->method('isContentTypeUsed')->with(...$parameters); + $serviceMock->expects(self::once())->method('isContentTypeUsed')->with(...$parameters); $decoratedService->isContentTypeUsed(...$parameters); } @@ -459,7 +459,7 @@ public function testRemoveContentTypeTranslationDecorator() 'random_value_5ced05ce105c21.42399370', ]; - $serviceMock->expects($this->once())->method('removeContentTypeTranslation')->with(...$parameters); + $serviceMock->expects(self::once())->method('removeContentTypeTranslation')->with(...$parameters); $decoratedService->removeContentTypeTranslation(...$parameters); } diff --git a/tests/lib/Repository/Decorator/FieldTypeServiceDecoratorTest.php b/tests/lib/Repository/Decorator/FieldTypeServiceDecoratorTest.php index 5f64e4f594..371e743645 100644 --- a/tests/lib/Repository/Decorator/FieldTypeServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/FieldTypeServiceDecoratorTest.php @@ -33,7 +33,7 @@ public function testGetFieldTypesDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('getFieldTypes')->with(...$parameters); + $serviceMock->expects(self::once())->method('getFieldTypes')->with(...$parameters); $decoratedService->getFieldTypes(...$parameters); } @@ -45,7 +45,7 @@ public function testGetFieldTypeDecorator() $parameters = ['random_value_5ced05ce0eda66.08473991']; - $serviceMock->expects($this->once())->method('getFieldType')->with(...$parameters); + $serviceMock->expects(self::once())->method('getFieldType')->with(...$parameters); $decoratedService->getFieldType(...$parameters); } @@ -57,7 +57,7 @@ public function testHasFieldTypeDecorator() $parameters = ['random_value_5ced05ce0edab1.24451920']; - $serviceMock->expects($this->once())->method('hasFieldType')->with(...$parameters); + $serviceMock->expects(self::once())->method('hasFieldType')->with(...$parameters); $decoratedService->hasFieldType(...$parameters); } diff --git a/tests/lib/Repository/Decorator/LanguageServiceDecoratorTest.php b/tests/lib/Repository/Decorator/LanguageServiceDecoratorTest.php index b6023105d1..68736d8053 100644 --- a/tests/lib/Repository/Decorator/LanguageServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/LanguageServiceDecoratorTest.php @@ -35,7 +35,7 @@ public function testCreateLanguageDecorator() $parameters = [$this->createMock(LanguageCreateStruct::class)]; - $serviceMock->expects($this->once())->method('createLanguage')->with(...$parameters); + $serviceMock->expects(self::once())->method('createLanguage')->with(...$parameters); $decoratedService->createLanguage(...$parameters); } @@ -50,7 +50,7 @@ public function testUpdateLanguageNameDecorator() 'random_value_5ced05ce0e4e45.35668562', ]; - $serviceMock->expects($this->once())->method('updateLanguageName')->with(...$parameters); + $serviceMock->expects(self::once())->method('updateLanguageName')->with(...$parameters); $decoratedService->updateLanguageName(...$parameters); } @@ -62,7 +62,7 @@ public function testEnableLanguageDecorator() $parameters = [$this->createMock(Language::class)]; - $serviceMock->expects($this->once())->method('enableLanguage')->with(...$parameters); + $serviceMock->expects(self::once())->method('enableLanguage')->with(...$parameters); $decoratedService->enableLanguage(...$parameters); } @@ -74,7 +74,7 @@ public function testDisableLanguageDecorator() $parameters = [$this->createMock(Language::class)]; - $serviceMock->expects($this->once())->method('disableLanguage')->with(...$parameters); + $serviceMock->expects(self::once())->method('disableLanguage')->with(...$parameters); $decoratedService->disableLanguage(...$parameters); } @@ -86,7 +86,7 @@ public function testLoadLanguageDecorator() $parameters = ['random_value_5ced05ce0e4f44.11240129']; - $serviceMock->expects($this->once())->method('loadLanguage')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadLanguage')->with(...$parameters); $decoratedService->loadLanguage(...$parameters); } @@ -98,7 +98,7 @@ public function testLoadLanguagesDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('loadLanguages')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadLanguages')->with(...$parameters); $decoratedService->loadLanguages(...$parameters); } @@ -110,7 +110,7 @@ public function testLoadLanguageByIdDecorator() $parameters = [100]; - $serviceMock->expects($this->once())->method('loadLanguageById')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadLanguageById')->with(...$parameters); $decoratedService->loadLanguageById(...$parameters); } @@ -122,7 +122,7 @@ public function testLoadLanguageListByCodeDecorator() $parameters = [['random_value_5ced05ce0e4fb1.09879860']]; - $serviceMock->expects($this->once())->method('loadLanguageListByCode')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadLanguageListByCode')->with(...$parameters); $decoratedService->loadLanguageListByCode(...$parameters); } @@ -134,7 +134,7 @@ public function testLoadLanguageListByIdDecorator() $parameters = [['random_value_5ced05ce0e4fd1.13022531']]; - $serviceMock->expects($this->once())->method('loadLanguageListById')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadLanguageListById')->with(...$parameters); $decoratedService->loadLanguageListById(...$parameters); } @@ -146,7 +146,7 @@ public function testDeleteLanguageDecorator() $parameters = [$this->createMock(Language::class)]; - $serviceMock->expects($this->once())->method('deleteLanguage')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteLanguage')->with(...$parameters); $decoratedService->deleteLanguage(...$parameters); } @@ -158,7 +158,7 @@ public function testGetDefaultLanguageCodeDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('getDefaultLanguageCode')->with(...$parameters); + $serviceMock->expects(self::once())->method('getDefaultLanguageCode')->with(...$parameters); $decoratedService->getDefaultLanguageCode(...$parameters); } @@ -170,7 +170,7 @@ public function testNewLanguageCreateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newLanguageCreateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newLanguageCreateStruct')->with(...$parameters); $decoratedService->newLanguageCreateStruct(...$parameters); } diff --git a/tests/lib/Repository/Decorator/LocationServiceDecoratorTest.php b/tests/lib/Repository/Decorator/LocationServiceDecoratorTest.php index 2e579230e3..4aef5882a2 100644 --- a/tests/lib/Repository/Decorator/LocationServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/LocationServiceDecoratorTest.php @@ -45,7 +45,7 @@ public function testCopySubtreeDecorator() $this->createMock(Location::class), ]; - $serviceMock->expects($this->once())->method('copySubtree')->with(...$parameters); + $serviceMock->expects(self::once())->method('copySubtree')->with(...$parameters); $decoratedService->copySubtree(...$parameters); } @@ -61,7 +61,7 @@ public function testLoadLocationDecorator() true, ]; - $serviceMock->expects($this->once())->method('loadLocation')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadLocation')->with(...$parameters); $decoratedService->loadLocation(...$parameters); } @@ -77,7 +77,7 @@ public function testLoadLocationListDecorator() true, ]; - $serviceMock->expects($this->once())->method('loadLocationList')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadLocationList')->with(...$parameters); $decoratedService->loadLocationList(...$parameters); } @@ -93,7 +93,7 @@ public function testLoadLocationByRemoteIdDecorator() true, ]; - $serviceMock->expects($this->once())->method('loadLocationByRemoteId')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadLocationByRemoteId')->with(...$parameters); $decoratedService->loadLocationByRemoteId(...$parameters); } @@ -109,7 +109,7 @@ public function testLoadLocationsDecorator() ['random_value_5ced05ce1603f9.50138109'], ]; - $serviceMock->expects($this->once())->method('loadLocations')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadLocations')->with(...$parameters); $decoratedService->loadLocations(...$parameters); } @@ -126,7 +126,7 @@ public function testLoadLocationChildrenDecorator() ['random_value_5ced05ce160459.73858583'], ]; - $serviceMock->expects($this->once())->method('loadLocationChildren')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadLocationChildren')->with(...$parameters); $decoratedService->loadLocationChildren(...$parameters); } @@ -141,7 +141,7 @@ public function testLoadParentLocationsForDraftContentDecorator() ['random_value_5ced05ce160494.77580729'], ]; - $serviceMock->expects($this->once())->method('loadParentLocationsForDraftContent')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadParentLocationsForDraftContent')->with(...$parameters); $decoratedService->loadParentLocationsForDraftContent(...$parameters); } @@ -153,7 +153,7 @@ public function testGetLocationChildCountDecorator() $parameters = [$this->createMock(Location::class)]; - $serviceMock->expects($this->once())->method('getLocationChildCount')->with(...$parameters); + $serviceMock->expects(self::once())->method('getLocationChildCount')->with(...$parameters); $decoratedService->getLocationChildCount(...$parameters); } @@ -168,7 +168,7 @@ public function testCreateLocationDecorator() $this->createMock(LocationCreateStruct::class), ]; - $serviceMock->expects($this->once())->method('createLocation')->with(...$parameters); + $serviceMock->expects(self::once())->method('createLocation')->with(...$parameters); $decoratedService->createLocation(...$parameters); } @@ -183,7 +183,7 @@ public function testUpdateLocationDecorator() $this->createMock(LocationUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updateLocation')->with(...$parameters); + $serviceMock->expects(self::once())->method('updateLocation')->with(...$parameters); $decoratedService->updateLocation(...$parameters); } @@ -198,7 +198,7 @@ public function testSwapLocationDecorator() $this->createMock(Location::class), ]; - $serviceMock->expects($this->once())->method('swapLocation')->with(...$parameters); + $serviceMock->expects(self::once())->method('swapLocation')->with(...$parameters); $decoratedService->swapLocation(...$parameters); } @@ -210,7 +210,7 @@ public function testHideLocationDecorator() $parameters = [$this->createMock(Location::class)]; - $serviceMock->expects($this->once())->method('hideLocation')->with(...$parameters); + $serviceMock->expects(self::once())->method('hideLocation')->with(...$parameters); $decoratedService->hideLocation(...$parameters); } @@ -222,7 +222,7 @@ public function testUnhideLocationDecorator() $parameters = [$this->createMock(Location::class)]; - $serviceMock->expects($this->once())->method('unhideLocation')->with(...$parameters); + $serviceMock->expects(self::once())->method('unhideLocation')->with(...$parameters); $decoratedService->unhideLocation(...$parameters); } @@ -237,7 +237,7 @@ public function testMoveSubtreeDecorator() $this->createMock(Location::class), ]; - $serviceMock->expects($this->once())->method('moveSubtree')->with(...$parameters); + $serviceMock->expects(self::once())->method('moveSubtree')->with(...$parameters); $decoratedService->moveSubtree(...$parameters); } @@ -249,7 +249,7 @@ public function testDeleteLocationDecorator() $parameters = [$this->createMock(Location::class)]; - $serviceMock->expects($this->once())->method('deleteLocation')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteLocation')->with(...$parameters); $decoratedService->deleteLocation(...$parameters); } @@ -261,7 +261,7 @@ public function testNewLocationCreateStructDecorator() $parameters = [self::EXAMPLE_LOCATION_ID]; - $serviceMock->expects($this->once())->method('newLocationCreateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newLocationCreateStruct')->with(...$parameters); $decoratedService->newLocationCreateStruct(...$parameters); } @@ -273,7 +273,7 @@ public function testNewLocationUpdateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newLocationUpdateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newLocationUpdateStruct')->with(...$parameters); $decoratedService->newLocationUpdateStruct(...$parameters); } @@ -285,7 +285,7 @@ public function testGetAllLocationsCountDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('getAllLocationsCount')->with(...$parameters); + $serviceMock->expects(self::once())->method('getAllLocationsCount')->with(...$parameters); $decoratedService->getAllLocationsCount(...$parameters); } @@ -300,7 +300,7 @@ public function testLoadAllLocationsDecorator() 847, ]; - $serviceMock->expects($this->once())->method('loadAllLocations')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadAllLocations')->with(...$parameters); $decoratedService->loadAllLocations(...$parameters); } diff --git a/tests/lib/Repository/Decorator/NotificationServiceDecoratorTest.php b/tests/lib/Repository/Decorator/NotificationServiceDecoratorTest.php index 23271ed559..7fb308e153 100644 --- a/tests/lib/Repository/Decorator/NotificationServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/NotificationServiceDecoratorTest.php @@ -38,7 +38,7 @@ public function testLoadNotificationsDecorator() 959, ]; - $serviceMock->expects($this->once())->method('loadNotifications')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadNotifications')->with(...$parameters); $decoratedService->loadNotifications(...$parameters); } @@ -50,7 +50,7 @@ public function testGetNotificationDecorator() $parameters = [469]; - $serviceMock->expects($this->once())->method('getNotification')->with(...$parameters); + $serviceMock->expects(self::once())->method('getNotification')->with(...$parameters); $decoratedService->getNotification(...$parameters); } @@ -62,7 +62,7 @@ public function testMarkNotificationAsReadDecorator() $parameters = [$this->createMock(Notification::class)]; - $serviceMock->expects($this->once())->method('markNotificationAsRead')->with(...$parameters); + $serviceMock->expects(self::once())->method('markNotificationAsRead')->with(...$parameters); $decoratedService->markNotificationAsRead(...$parameters); } @@ -74,7 +74,7 @@ public function testGetPendingNotificationCountDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('getPendingNotificationCount')->with(...$parameters); + $serviceMock->expects(self::once())->method('getPendingNotificationCount')->with(...$parameters); $decoratedService->getPendingNotificationCount(...$parameters); } @@ -86,7 +86,7 @@ public function testGetNotificationCountDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('getNotificationCount')->with(...$parameters); + $serviceMock->expects(self::once())->method('getNotificationCount')->with(...$parameters); $decoratedService->getNotificationCount(...$parameters); } @@ -98,7 +98,7 @@ public function testCreateNotificationDecorator() $parameters = [$this->createMock(CreateStruct::class)]; - $serviceMock->expects($this->once())->method('createNotification')->with(...$parameters); + $serviceMock->expects(self::once())->method('createNotification')->with(...$parameters); $decoratedService->createNotification(...$parameters); } @@ -110,7 +110,7 @@ public function testDeleteNotificationDecorator() $parameters = [$this->createMock(Notification::class)]; - $serviceMock->expects($this->once())->method('deleteNotification')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteNotification')->with(...$parameters); $decoratedService->deleteNotification(...$parameters); } diff --git a/tests/lib/Repository/Decorator/ObjectStateServiceDecoratorTest.php b/tests/lib/Repository/Decorator/ObjectStateServiceDecoratorTest.php index 89e633188d..a9c18ab742 100644 --- a/tests/lib/Repository/Decorator/ObjectStateServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/ObjectStateServiceDecoratorTest.php @@ -40,7 +40,7 @@ public function testCreateObjectStateGroupDecorator() $parameters = [$this->createMock(ObjectStateGroupCreateStruct::class)]; - $serviceMock->expects($this->once())->method('createObjectStateGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('createObjectStateGroup')->with(...$parameters); $decoratedService->createObjectStateGroup(...$parameters); } @@ -55,7 +55,7 @@ public function testLoadObjectStateGroupDecorator() ['eng-GB'], ]; - $serviceMock->expects($this->once())->method('loadObjectStateGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadObjectStateGroup')->with(...$parameters); $decoratedService->loadObjectStateGroup(...$parameters); } @@ -72,14 +72,14 @@ public function testLoadObjectStateGroupByIdentifierDecorator(): void ]; $serviceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadObjectStateGroupByIdentifier') ->with(...$parameters) ->willReturn($expectedObjectStateGroup); $actualObjectStateGroup = $decoratedService->loadObjectStateGroupByIdentifier(...$parameters); - $this->assertEquals( + self::assertEquals( $expectedObjectStateGroup, $actualObjectStateGroup ); @@ -96,7 +96,7 @@ public function testLoadObjectStateGroupsDecorator() ['eng-GB'], ]; - $serviceMock->expects($this->once())->method('loadObjectStateGroups')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadObjectStateGroups')->with(...$parameters); $decoratedService->loadObjectStateGroups(...$parameters); } @@ -111,7 +111,7 @@ public function testLoadObjectStatesDecorator() ['random_value_5ced05ce168263.48122762'], ]; - $serviceMock->expects($this->once())->method('loadObjectStates')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadObjectStates')->with(...$parameters); $decoratedService->loadObjectStates(...$parameters); } @@ -126,7 +126,7 @@ public function testUpdateObjectStateGroupDecorator() $this->createMock(ObjectStateGroupUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updateObjectStateGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('updateObjectStateGroup')->with(...$parameters); $decoratedService->updateObjectStateGroup(...$parameters); } @@ -138,7 +138,7 @@ public function testDeleteObjectStateGroupDecorator() $parameters = [$this->createMock(ObjectStateGroup::class)]; - $serviceMock->expects($this->once())->method('deleteObjectStateGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteObjectStateGroup')->with(...$parameters); $decoratedService->deleteObjectStateGroup(...$parameters); } @@ -153,7 +153,7 @@ public function testCreateObjectStateDecorator() $this->createMock(ObjectStateCreateStruct::class), ]; - $serviceMock->expects($this->once())->method('createObjectState')->with(...$parameters); + $serviceMock->expects(self::once())->method('createObjectState')->with(...$parameters); $decoratedService->createObjectState(...$parameters); } @@ -168,7 +168,7 @@ public function testLoadObjectStateDecorator() ['eng-GB'], ]; - $serviceMock->expects($this->once())->method('loadObjectState')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadObjectState')->with(...$parameters); $decoratedService->loadObjectState(...$parameters); } @@ -186,14 +186,14 @@ public function testLoadObjectStateDecoratorByIdentifier(): void ]; $serviceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadObjectStateByIdentifier') ->with(...$parameters) ->willReturn($expectedObjectState); $actualObjectState = $decoratedService->loadObjectStateByIdentifier(...$parameters); - $this->assertEquals( + self::assertEquals( $expectedObjectState, $actualObjectState ); @@ -209,7 +209,7 @@ public function testUpdateObjectStateDecorator() $this->createMock(ObjectStateUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updateObjectState')->with(...$parameters); + $serviceMock->expects(self::once())->method('updateObjectState')->with(...$parameters); $decoratedService->updateObjectState(...$parameters); } @@ -224,7 +224,7 @@ public function testSetPriorityOfObjectStateDecorator() 100, ]; - $serviceMock->expects($this->once())->method('setPriorityOfObjectState')->with(...$parameters); + $serviceMock->expects(self::once())->method('setPriorityOfObjectState')->with(...$parameters); $decoratedService->setPriorityOfObjectState(...$parameters); } @@ -236,7 +236,7 @@ public function testDeleteObjectStateDecorator() $parameters = [$this->createMock(ObjectState::class)]; - $serviceMock->expects($this->once())->method('deleteObjectState')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteObjectState')->with(...$parameters); $decoratedService->deleteObjectState(...$parameters); } @@ -252,7 +252,7 @@ public function testSetContentStateDecorator() $this->createMock(ObjectState::class), ]; - $serviceMock->expects($this->once())->method('setContentState')->with(...$parameters); + $serviceMock->expects(self::once())->method('setContentState')->with(...$parameters); $decoratedService->setContentState(...$parameters); } @@ -267,7 +267,7 @@ public function testGetContentStateDecorator() $this->createMock(ObjectStateGroup::class), ]; - $serviceMock->expects($this->once())->method('getContentState')->with(...$parameters); + $serviceMock->expects(self::once())->method('getContentState')->with(...$parameters); $decoratedService->getContentState(...$parameters); } @@ -279,7 +279,7 @@ public function testGetContentCountDecorator() $parameters = [$this->createMock(ObjectState::class)]; - $serviceMock->expects($this->once())->method('getContentCount')->with(...$parameters); + $serviceMock->expects(self::once())->method('getContentCount')->with(...$parameters); $decoratedService->getContentCount(...$parameters); } @@ -291,7 +291,7 @@ public function testNewObjectStateGroupCreateStructDecorator() $parameters = ['random_value_5ced05ce169c83.55416136']; - $serviceMock->expects($this->once())->method('newObjectStateGroupCreateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newObjectStateGroupCreateStruct')->with(...$parameters); $decoratedService->newObjectStateGroupCreateStruct(...$parameters); } @@ -303,7 +303,7 @@ public function testNewObjectStateGroupUpdateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newObjectStateGroupUpdateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newObjectStateGroupUpdateStruct')->with(...$parameters); $decoratedService->newObjectStateGroupUpdateStruct(...$parameters); } @@ -315,7 +315,7 @@ public function testNewObjectStateCreateStructDecorator() $parameters = ['random_value_5ced05ce169cc9.01447563']; - $serviceMock->expects($this->once())->method('newObjectStateCreateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newObjectStateCreateStruct')->with(...$parameters); $decoratedService->newObjectStateCreateStruct(...$parameters); } @@ -327,7 +327,7 @@ public function testNewObjectStateUpdateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newObjectStateUpdateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newObjectStateUpdateStruct')->with(...$parameters); $decoratedService->newObjectStateUpdateStruct(...$parameters); } diff --git a/tests/lib/Repository/Decorator/RoleServiceDecoratorTest.php b/tests/lib/Repository/Decorator/RoleServiceDecoratorTest.php index 16606a9bdc..c8ee832ba4 100644 --- a/tests/lib/Repository/Decorator/RoleServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/RoleServiceDecoratorTest.php @@ -47,7 +47,7 @@ public function testCreateRoleDecorator() $parameters = [$this->createMock(RoleCreateStruct::class)]; - $serviceMock->expects($this->once())->method('createRole')->with(...$parameters); + $serviceMock->expects(self::once())->method('createRole')->with(...$parameters); $decoratedService->createRole(...$parameters); } @@ -59,7 +59,7 @@ public function testCreateRoleDraftDecorator() $parameters = [$this->createMock(Role::class)]; - $serviceMock->expects($this->once())->method('createRoleDraft')->with(...$parameters); + $serviceMock->expects(self::once())->method('createRoleDraft')->with(...$parameters); $decoratedService->createRoleDraft(...$parameters); } @@ -71,7 +71,7 @@ public function testLoadRoleDraftDecorator() $parameters = [self::ROLE_ID]; - $serviceMock->expects($this->once())->method('loadRoleDraft')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadRoleDraft')->with(...$parameters); $decoratedService->loadRoleDraft(...$parameters); } @@ -83,7 +83,7 @@ public function testLoadRoleDraftByRoleIdDecorator() $parameters = [self::ROLE_ID]; - $serviceMock->expects($this->once())->method('loadRoleDraftByRoleId')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadRoleDraftByRoleId')->with(...$parameters); $decoratedService->loadRoleDraftByRoleId(...$parameters); } @@ -98,7 +98,7 @@ public function testUpdateRoleDraftDecorator() $this->createMock(RoleUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updateRoleDraft')->with(...$parameters); + $serviceMock->expects(self::once())->method('updateRoleDraft')->with(...$parameters); $decoratedService->updateRoleDraft(...$parameters); } @@ -113,7 +113,7 @@ public function testAddPolicyByRoleDraftDecorator() $this->createMock(PolicyCreateStruct::class), ]; - $serviceMock->expects($this->once())->method('addPolicyByRoleDraft')->with(...$parameters); + $serviceMock->expects(self::once())->method('addPolicyByRoleDraft')->with(...$parameters); $decoratedService->addPolicyByRoleDraft(...$parameters); } @@ -128,7 +128,7 @@ public function testRemovePolicyByRoleDraftDecorator() $this->createMock(PolicyDraft::class), ]; - $serviceMock->expects($this->once())->method('removePolicyByRoleDraft')->with(...$parameters); + $serviceMock->expects(self::once())->method('removePolicyByRoleDraft')->with(...$parameters); $decoratedService->removePolicyByRoleDraft(...$parameters); } @@ -144,7 +144,7 @@ public function testUpdatePolicyByRoleDraftDecorator() $this->createMock(PolicyUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updatePolicyByRoleDraft')->with(...$parameters); + $serviceMock->expects(self::once())->method('updatePolicyByRoleDraft')->with(...$parameters); $decoratedService->updatePolicyByRoleDraft(...$parameters); } @@ -156,7 +156,7 @@ public function testDeleteRoleDraftDecorator() $parameters = [$this->createMock(RoleDraft::class)]; - $serviceMock->expects($this->once())->method('deleteRoleDraft')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteRoleDraft')->with(...$parameters); $decoratedService->deleteRoleDraft(...$parameters); } @@ -168,7 +168,7 @@ public function testPublishRoleDraftDecorator() $parameters = [$this->createMock(RoleDraft::class)]; - $serviceMock->expects($this->once())->method('publishRoleDraft')->with(...$parameters); + $serviceMock->expects(self::once())->method('publishRoleDraft')->with(...$parameters); $decoratedService->publishRoleDraft(...$parameters); } @@ -180,7 +180,7 @@ public function testLoadRoleDecorator() $parameters = [self::ROLE_ID]; - $serviceMock->expects($this->once())->method('loadRole')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadRole')->with(...$parameters); $decoratedService->loadRole(...$parameters); } @@ -192,7 +192,7 @@ public function testLoadRoleByIdentifierDecorator() $parameters = ['random_value_5ced05ce14b742.13672543']; - $serviceMock->expects($this->once())->method('loadRoleByIdentifier')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadRoleByIdentifier')->with(...$parameters); $decoratedService->loadRoleByIdentifier(...$parameters); } @@ -204,7 +204,7 @@ public function testLoadRolesDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('loadRoles')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadRoles')->with(...$parameters); $decoratedService->loadRoles(...$parameters); } @@ -216,7 +216,7 @@ public function testDeleteRoleDecorator() $parameters = [$this->createMock(Role::class)]; - $serviceMock->expects($this->once())->method('deleteRole')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteRole')->with(...$parameters); $decoratedService->deleteRole(...$parameters); } @@ -232,7 +232,7 @@ public function testAssignRoleToUserGroupDecorator() $this->createMock(RoleLimitation::class), ]; - $serviceMock->expects($this->once())->method('assignRoleToUserGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('assignRoleToUserGroup')->with(...$parameters); $decoratedService->assignRoleToUserGroup(...$parameters); } @@ -248,7 +248,7 @@ public function testAssignRoleToUserDecorator() $this->createMock(RoleLimitation::class), ]; - $serviceMock->expects($this->once())->method('assignRoleToUser')->with(...$parameters); + $serviceMock->expects(self::once())->method('assignRoleToUser')->with(...$parameters); $decoratedService->assignRoleToUser(...$parameters); } @@ -260,7 +260,7 @@ public function testLoadRoleAssignmentDecorator() $parameters = [self::ROLE_ASSIGNMENT_ID]; - $serviceMock->expects($this->once())->method('loadRoleAssignment')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadRoleAssignment')->with(...$parameters); $decoratedService->loadRoleAssignment(...$parameters); } @@ -272,7 +272,7 @@ public function testGetRoleAssignmentsDecorator() $parameters = [$this->createMock(Role::class)]; - $serviceMock->expects($this->once())->method('getRoleAssignments')->with(...$parameters); + $serviceMock->expects(self::once())->method('getRoleAssignments')->with(...$parameters); $decoratedService->getRoleAssignments(...$parameters); } @@ -287,7 +287,7 @@ public function testGetRoleAssignmentsForUserDecorator() true, ]; - $serviceMock->expects($this->once())->method('getRoleAssignmentsForUser')->with(...$parameters); + $serviceMock->expects(self::once())->method('getRoleAssignmentsForUser')->with(...$parameters); $decoratedService->getRoleAssignmentsForUser(...$parameters); } @@ -299,7 +299,7 @@ public function testGetRoleAssignmentsForUserGroupDecorator() $parameters = [$this->createMock(UserGroup::class)]; - $serviceMock->expects($this->once())->method('getRoleAssignmentsForUserGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('getRoleAssignmentsForUserGroup')->with(...$parameters); $decoratedService->getRoleAssignmentsForUserGroup(...$parameters); } @@ -311,7 +311,7 @@ public function testRemoveRoleAssignmentDecorator() $parameters = [$this->createMock(RoleAssignment::class)]; - $serviceMock->expects($this->once())->method('removeRoleAssignment')->with(...$parameters); + $serviceMock->expects(self::once())->method('removeRoleAssignment')->with(...$parameters); $decoratedService->removeRoleAssignment(...$parameters); } @@ -323,7 +323,7 @@ public function testNewRoleCreateStructDecorator() $parameters = ['random_value_5ced05ce14d674.30093215']; - $serviceMock->expects($this->once())->method('newRoleCreateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newRoleCreateStruct')->with(...$parameters); $decoratedService->newRoleCreateStruct(...$parameters); } @@ -338,7 +338,7 @@ public function testNewPolicyCreateStructDecorator() 'random_value_5ced05ce14d6b6.22048821', ]; - $serviceMock->expects($this->once())->method('newPolicyCreateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newPolicyCreateStruct')->with(...$parameters); $decoratedService->newPolicyCreateStruct(...$parameters); } @@ -350,7 +350,7 @@ public function testNewPolicyUpdateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newPolicyUpdateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newPolicyUpdateStruct')->with(...$parameters); $decoratedService->newPolicyUpdateStruct(...$parameters); } @@ -362,7 +362,7 @@ public function testNewRoleUpdateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newRoleUpdateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newRoleUpdateStruct')->with(...$parameters); $decoratedService->newRoleUpdateStruct(...$parameters); } @@ -374,7 +374,7 @@ public function testGetLimitationTypeDecorator() $parameters = ['random_value_5ced05ce14d714.69905914']; - $serviceMock->expects($this->once())->method('getLimitationType')->with(...$parameters); + $serviceMock->expects(self::once())->method('getLimitationType')->with(...$parameters); $decoratedService->getLimitationType(...$parameters); } @@ -389,7 +389,7 @@ public function testGetLimitationTypesByModuleFunctionDecorator() 'random_value_5ced05ce14d743.90303575', ]; - $serviceMock->expects($this->once())->method('getLimitationTypesByModuleFunction')->with(...$parameters); + $serviceMock->expects(self::once())->method('getLimitationTypesByModuleFunction')->with(...$parameters); $decoratedService->getLimitationTypesByModuleFunction(...$parameters); } diff --git a/tests/lib/Repository/Decorator/SearchServiceDecoratorTest.php b/tests/lib/Repository/Decorator/SearchServiceDecoratorTest.php index d87382a6bc..49e0603a9b 100644 --- a/tests/lib/Repository/Decorator/SearchServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/SearchServiceDecoratorTest.php @@ -40,7 +40,7 @@ public function testFindContentDecorator() true, ]; - $serviceMock->expects($this->once())->method('findContent')->with(...$parameters); + $serviceMock->expects(self::once())->method('findContent')->with(...$parameters); $decoratedService->findContent(...$parameters); } @@ -56,7 +56,7 @@ public function testFindContentInfoDecorator() true, ]; - $serviceMock->expects($this->once())->method('findContentInfo')->with(...$parameters); + $serviceMock->expects(self::once())->method('findContentInfo')->with(...$parameters); $decoratedService->findContentInfo(...$parameters); } @@ -72,7 +72,7 @@ public function testFindSingleDecorator() true, ]; - $serviceMock->expects($this->once())->method('findSingle')->with(...$parameters); + $serviceMock->expects(self::once())->method('findSingle')->with(...$parameters); $decoratedService->findSingle(...$parameters); } @@ -89,7 +89,7 @@ public function testSuggestDecorator() $this->createMock(Criterion::class), ]; - $serviceMock->expects($this->once())->method('suggest')->with(...$parameters); + $serviceMock->expects(self::once())->method('suggest')->with(...$parameters); $decoratedService->suggest(...$parameters); } @@ -105,7 +105,7 @@ public function testFindLocationsDecorator() true, ]; - $serviceMock->expects($this->once())->method('findLocations')->with(...$parameters); + $serviceMock->expects(self::once())->method('findLocations')->with(...$parameters); $decoratedService->findLocations(...$parameters); } @@ -120,7 +120,7 @@ public function testSupportsDecorator(int $capability): void $serviceMock = $this->createServiceMock(); $decoratedService = $this->createDecorator($serviceMock); - $serviceMock->expects($this->once())->method('supports')->with($capability); + $serviceMock->expects(self::once())->method('supports')->with($capability); $decoratedService->supports($capability); } diff --git a/tests/lib/Repository/Decorator/SectionServiceDecoratorTest.php b/tests/lib/Repository/Decorator/SectionServiceDecoratorTest.php index af6a0e9ce9..3a0ede8226 100644 --- a/tests/lib/Repository/Decorator/SectionServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/SectionServiceDecoratorTest.php @@ -40,7 +40,7 @@ public function testCreateSectionDecorator() $parameters = [$this->createMock(SectionCreateStruct::class)]; - $serviceMock->expects($this->once())->method('createSection')->with(...$parameters); + $serviceMock->expects(self::once())->method('createSection')->with(...$parameters); $decoratedService->createSection(...$parameters); } @@ -55,7 +55,7 @@ public function testUpdateSectionDecorator() $this->createMock(SectionUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updateSection')->with(...$parameters); + $serviceMock->expects(self::once())->method('updateSection')->with(...$parameters); $decoratedService->updateSection(...$parameters); } @@ -67,7 +67,7 @@ public function testLoadSectionDecorator() $parameters = [self::EXAMPLE_SECTION_ID]; - $serviceMock->expects($this->once())->method('loadSection')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadSection')->with(...$parameters); $decoratedService->loadSection(...$parameters); } @@ -79,7 +79,7 @@ public function testLoadSectionsDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('loadSections')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadSections')->with(...$parameters); $decoratedService->loadSections(...$parameters); } @@ -91,7 +91,7 @@ public function testLoadSectionByIdentifierDecorator() $parameters = ['random_value_5ced05ce10cd87.67751220']; - $serviceMock->expects($this->once())->method('loadSectionByIdentifier')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadSectionByIdentifier')->with(...$parameters); $decoratedService->loadSectionByIdentifier(...$parameters); } @@ -103,7 +103,7 @@ public function testCountAssignedContentsDecorator() $parameters = [$this->createMock(Section::class)]; - $serviceMock->expects($this->once())->method('countAssignedContents')->with(...$parameters); + $serviceMock->expects(self::once())->method('countAssignedContents')->with(...$parameters); $decoratedService->countAssignedContents(...$parameters); } @@ -115,7 +115,7 @@ public function testIsSectionUsedDecorator() $parameters = [$this->createMock(Section::class)]; - $serviceMock->expects($this->once())->method('isSectionUsed')->with(...$parameters); + $serviceMock->expects(self::once())->method('isSectionUsed')->with(...$parameters); $decoratedService->isSectionUsed(...$parameters); } @@ -130,7 +130,7 @@ public function testAssignSectionDecorator() $this->createMock(Section::class), ]; - $serviceMock->expects($this->once())->method('assignSection')->with(...$parameters); + $serviceMock->expects(self::once())->method('assignSection')->with(...$parameters); $decoratedService->assignSection(...$parameters); } @@ -145,7 +145,7 @@ public function testAssignSectionToSubtreeDecorator() $this->createMock(Section::class), ]; - $serviceMock->expects($this->once())->method('assignSectionToSubtree')->with(...$parameters); + $serviceMock->expects(self::once())->method('assignSectionToSubtree')->with(...$parameters); $decoratedService->assignSectionToSubtree(...$parameters); } @@ -157,7 +157,7 @@ public function testDeleteSectionDecorator() $parameters = [$this->createMock(Section::class)]; - $serviceMock->expects($this->once())->method('deleteSection')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteSection')->with(...$parameters); $decoratedService->deleteSection(...$parameters); } @@ -169,7 +169,7 @@ public function testNewSectionCreateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newSectionCreateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newSectionCreateStruct')->with(...$parameters); $decoratedService->newSectionCreateStruct(...$parameters); } @@ -181,7 +181,7 @@ public function testNewSectionUpdateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newSectionUpdateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newSectionUpdateStruct')->with(...$parameters); $decoratedService->newSectionUpdateStruct(...$parameters); } diff --git a/tests/lib/Repository/Decorator/SettingServiceDecoratorTest.php b/tests/lib/Repository/Decorator/SettingServiceDecoratorTest.php index 332d5c54f5..e0f95fcc5e 100644 --- a/tests/lib/Repository/Decorator/SettingServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/SettingServiceDecoratorTest.php @@ -39,7 +39,7 @@ public function testCreateSettingDecorator() $parameters = [$this->createMock(SettingCreateStruct::class)]; - $serviceMock->expects($this->once())->method('createSetting')->with(...$parameters); + $serviceMock->expects(self::once())->method('createSetting')->with(...$parameters); $decoratedService->createSetting(...$parameters); } @@ -54,7 +54,7 @@ public function testUpdateSettingDecorator() $this->createMock(SettingUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updateSetting')->with(...$parameters); + $serviceMock->expects(self::once())->method('updateSetting')->with(...$parameters); $decoratedService->updateSetting(...$parameters); } @@ -69,7 +69,7 @@ public function testLoadSettingDecorator() self::EXAMPLE_SETTING_IDENTIFIER, ]; - $serviceMock->expects($this->once())->method('loadSetting')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadSetting')->with(...$parameters); $decoratedService->loadSetting(...$parameters); } @@ -81,7 +81,7 @@ public function testDeleteSettingDecorator() $parameters = [$this->createMock(Setting::class)]; - $serviceMock->expects($this->once())->method('deleteSetting')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteSetting')->with(...$parameters); $decoratedService->deleteSetting(...$parameters); } @@ -93,7 +93,7 @@ public function testNewSettingCreateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newSettingCreateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newSettingCreateStruct')->with(...$parameters); $decoratedService->newSettingCreateStruct(...$parameters); } @@ -105,7 +105,7 @@ public function testNewSettingUpdateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newSettingUpdateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newSettingUpdateStruct')->with(...$parameters); $decoratedService->newSettingUpdateStruct(...$parameters); } diff --git a/tests/lib/Repository/Decorator/TranslationServiceDecoratorTest.php b/tests/lib/Repository/Decorator/TranslationServiceDecoratorTest.php index 95a3ad4b76..e9f79bc47c 100644 --- a/tests/lib/Repository/Decorator/TranslationServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/TranslationServiceDecoratorTest.php @@ -37,7 +37,7 @@ public function testTranslateDecorator() 'random_value_5ced05ce16efc3.57825052', ]; - $serviceMock->expects($this->once())->method('translate')->with(...$parameters); + $serviceMock->expects(self::once())->method('translate')->with(...$parameters); $decoratedService->translate(...$parameters); } @@ -52,7 +52,7 @@ public function testTranslateStringDecorator() 'random_value_5ced05ce16f065.78328330', ]; - $serviceMock->expects($this->once())->method('translateString')->with(...$parameters); + $serviceMock->expects(self::once())->method('translateString')->with(...$parameters); $decoratedService->translateString(...$parameters); } diff --git a/tests/lib/Repository/Decorator/TrashServiceDecoratorTest.php b/tests/lib/Repository/Decorator/TrashServiceDecoratorTest.php index be533efc27..84d248da8a 100644 --- a/tests/lib/Repository/Decorator/TrashServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/TrashServiceDecoratorTest.php @@ -36,7 +36,7 @@ public function testLoadTrashItemDecorator() $parameters = [1]; - $serviceMock->expects($this->once())->method('loadTrashItem')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadTrashItem')->with(...$parameters); $decoratedService->loadTrashItem(...$parameters); } @@ -48,7 +48,7 @@ public function testTrashDecorator() $parameters = [$this->createMock(Location::class)]; - $serviceMock->expects($this->once())->method('trash')->with(...$parameters); + $serviceMock->expects(self::once())->method('trash')->with(...$parameters); $decoratedService->trash(...$parameters); } @@ -63,7 +63,7 @@ public function testRecoverDecorator() $this->createMock(Location::class), ]; - $serviceMock->expects($this->once())->method('recover')->with(...$parameters); + $serviceMock->expects(self::once())->method('recover')->with(...$parameters); $decoratedService->recover(...$parameters); } @@ -75,7 +75,7 @@ public function testEmptyTrashDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('emptyTrash')->with(...$parameters); + $serviceMock->expects(self::once())->method('emptyTrash')->with(...$parameters); $decoratedService->emptyTrash(...$parameters); } @@ -87,7 +87,7 @@ public function testDeleteTrashItemDecorator() $parameters = [$this->createMock(TrashItem::class)]; - $serviceMock->expects($this->once())->method('deleteTrashItem')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteTrashItem')->with(...$parameters); $decoratedService->deleteTrashItem(...$parameters); } @@ -99,7 +99,7 @@ public function testFindTrashItemsDecorator() $parameters = [$this->createMock(Query::class)]; - $serviceMock->expects($this->once())->method('findTrashItems')->with(...$parameters); + $serviceMock->expects(self::once())->method('findTrashItems')->with(...$parameters); $decoratedService->findTrashItems(...$parameters); } diff --git a/tests/lib/Repository/Decorator/URLAliasServiceDecoratorTest.php b/tests/lib/Repository/Decorator/URLAliasServiceDecoratorTest.php index c81a849d60..05f09e2e9b 100644 --- a/tests/lib/Repository/Decorator/URLAliasServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/URLAliasServiceDecoratorTest.php @@ -43,7 +43,7 @@ public function testCreateUrlAliasDecorator() true, ]; - $serviceMock->expects($this->once())->method('createUrlAlias')->with(...$parameters); + $serviceMock->expects(self::once())->method('createUrlAlias')->with(...$parameters); $decoratedService->createUrlAlias(...$parameters); } @@ -61,7 +61,7 @@ public function testCreateGlobalUrlAliasDecorator() true, ]; - $serviceMock->expects($this->once())->method('createGlobalUrlAlias')->with(...$parameters); + $serviceMock->expects(self::once())->method('createGlobalUrlAlias')->with(...$parameters); $decoratedService->createGlobalUrlAlias(...$parameters); } @@ -77,7 +77,7 @@ public function testListLocationAliasesDecorator() 'random_value_5ced05ce0f4720.32499208', ]; - $serviceMock->expects($this->once())->method('listLocationAliases')->with(...$parameters); + $serviceMock->expects(self::once())->method('listLocationAliases')->with(...$parameters); $decoratedService->listLocationAliases(...$parameters); } @@ -93,7 +93,7 @@ public function testListGlobalAliasesDecorator() self::EXAMPLE_LIMIT, ]; - $serviceMock->expects($this->once())->method('listGlobalAliases')->with(...$parameters); + $serviceMock->expects(self::once())->method('listGlobalAliases')->with(...$parameters); $decoratedService->listGlobalAliases(...$parameters); } @@ -105,7 +105,7 @@ public function testRemoveAliasesDecorator() $parameters = [['random_value_5ced05ce0f4797.71498070']]; - $serviceMock->expects($this->once())->method('removeAliases')->with(...$parameters); + $serviceMock->expects(self::once())->method('removeAliases')->with(...$parameters); $decoratedService->removeAliases(...$parameters); } @@ -120,7 +120,7 @@ public function testLookupDecorator() 'random_value_5ced05ce0f47d7.99589118', ]; - $serviceMock->expects($this->once())->method('lookup')->with(...$parameters); + $serviceMock->expects(self::once())->method('lookup')->with(...$parameters); $decoratedService->lookup(...$parameters); } @@ -135,7 +135,7 @@ public function testReverseLookupDecorator() 'random_value_5ced05ce0f4803.92292057', ]; - $serviceMock->expects($this->once())->method('reverseLookup')->with(...$parameters); + $serviceMock->expects(self::once())->method('reverseLookup')->with(...$parameters); $decoratedService->reverseLookup(...$parameters); } @@ -147,7 +147,7 @@ public function testLoadDecorator() $parameters = ['random_value_5ced05ce0f4839.47843200']; - $serviceMock->expects($this->once())->method('load')->with(...$parameters); + $serviceMock->expects(self::once())->method('load')->with(...$parameters); $decoratedService->load(...$parameters); } @@ -159,7 +159,7 @@ public function testRefreshSystemUrlAliasesForLocationDecorator() $parameters = [$this->createMock(Location::class)]; - $serviceMock->expects($this->once())->method('refreshSystemUrlAliasesForLocation')->with(...$parameters); + $serviceMock->expects(self::once())->method('refreshSystemUrlAliasesForLocation')->with(...$parameters); $decoratedService->refreshSystemUrlAliasesForLocation(...$parameters); } @@ -171,7 +171,7 @@ public function testDeleteCorruptedUrlAliasesDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('deleteCorruptedUrlAliases')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteCorruptedUrlAliases')->with(...$parameters); $decoratedService->deleteCorruptedUrlAliases(...$parameters); } diff --git a/tests/lib/Repository/Decorator/URLServiceDecoratorTest.php b/tests/lib/Repository/Decorator/URLServiceDecoratorTest.php index 2ddf07e7b0..aba793e84f 100644 --- a/tests/lib/Repository/Decorator/URLServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/URLServiceDecoratorTest.php @@ -36,7 +36,7 @@ public function testCreateUpdateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('createUpdateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('createUpdateStruct')->with(...$parameters); $decoratedService->createUpdateStruct(...$parameters); } @@ -48,7 +48,7 @@ public function testFindUrlsDecorator() $parameters = [$this->createMock(URLQuery::class)]; - $serviceMock->expects($this->once())->method('findUrls')->with(...$parameters); + $serviceMock->expects(self::once())->method('findUrls')->with(...$parameters); $decoratedService->findUrls(...$parameters); } @@ -64,7 +64,7 @@ public function testFindUsagesDecorator() 100, ]; - $serviceMock->expects($this->once())->method('findUsages')->with(...$parameters); + $serviceMock->expects(self::once())->method('findUsages')->with(...$parameters); $decoratedService->findUsages(...$parameters); } @@ -76,7 +76,7 @@ public function testLoadByIdDecorator() $parameters = [1]; - $serviceMock->expects($this->once())->method('loadById')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadById')->with(...$parameters); $decoratedService->loadById(...$parameters); } @@ -88,7 +88,7 @@ public function testLoadByUrlDecorator() $parameters = ['random_value_5ced05ce172635.77719845']; - $serviceMock->expects($this->once())->method('loadByUrl')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadByUrl')->with(...$parameters); $decoratedService->loadByUrl(...$parameters); } @@ -103,7 +103,7 @@ public function testUpdateUrlDecorator() $this->createMock(URLUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updateUrl')->with(...$parameters); + $serviceMock->expects(self::once())->method('updateUrl')->with(...$parameters); $decoratedService->updateUrl(...$parameters); } diff --git a/tests/lib/Repository/Decorator/URLWildcardServiceDecoratorTest.php b/tests/lib/Repository/Decorator/URLWildcardServiceDecoratorTest.php index d6faa6f966..df525ca428 100644 --- a/tests/lib/Repository/Decorator/URLWildcardServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/URLWildcardServiceDecoratorTest.php @@ -38,7 +38,7 @@ public function testCreateDecorator() true, ]; - $serviceMock->expects($this->once())->method('create')->with(...$parameters); + $serviceMock->expects(self::once())->method('create')->with(...$parameters); $decoratedService->create(...$parameters); } @@ -50,7 +50,7 @@ public function testRemoveDecorator() $parameters = [$this->createMock(URLWildcard::class)]; - $serviceMock->expects($this->once())->method('remove')->with(...$parameters); + $serviceMock->expects(self::once())->method('remove')->with(...$parameters); $decoratedService->remove(...$parameters); } @@ -62,7 +62,7 @@ public function testLoadDecorator() $parameters = [1]; - $serviceMock->expects($this->once())->method('load')->with(...$parameters); + $serviceMock->expects(self::once())->method('load')->with(...$parameters); $decoratedService->load(...$parameters); } @@ -77,7 +77,7 @@ public function testLoadAllDecorator() 100, ]; - $serviceMock->expects($this->once())->method('loadAll')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadAll')->with(...$parameters); $decoratedService->loadAll(...$parameters); } @@ -89,7 +89,7 @@ public function testTranslateDecorator() $parameters = ['ibexa.co']; - $serviceMock->expects($this->once())->method('translate')->with(...$parameters); + $serviceMock->expects(self::once())->method('translate')->with(...$parameters); $decoratedService->translate(...$parameters); } diff --git a/tests/lib/Repository/Decorator/UserPreferenceServiceDecoratorTest.php b/tests/lib/Repository/Decorator/UserPreferenceServiceDecoratorTest.php index 1fa544f83b..6add35ad56 100644 --- a/tests/lib/Repository/Decorator/UserPreferenceServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/UserPreferenceServiceDecoratorTest.php @@ -33,7 +33,7 @@ public function testSetUserPreferenceDecorator() $parameters = [['random_value_5ced05ce1437c3.99987071']]; - $serviceMock->expects($this->once())->method('setUserPreference')->with(...$parameters); + $serviceMock->expects(self::once())->method('setUserPreference')->with(...$parameters); $decoratedService->setUserPreference(...$parameters); } @@ -45,7 +45,7 @@ public function testGetUserPreferenceDecorator() $parameters = ['random_value_5ced05ce143830.91322594']; - $serviceMock->expects($this->once())->method('getUserPreference')->with(...$parameters); + $serviceMock->expects(self::once())->method('getUserPreference')->with(...$parameters); $decoratedService->getUserPreference(...$parameters); } @@ -60,7 +60,7 @@ public function testLoadUserPreferencesDecorator() 922, ]; - $serviceMock->expects($this->once())->method('loadUserPreferences')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadUserPreferences')->with(...$parameters); $decoratedService->loadUserPreferences(...$parameters); } @@ -72,7 +72,7 @@ public function testGetUserPreferenceCountDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('getUserPreferenceCount')->with(...$parameters); + $serviceMock->expects(self::once())->method('getUserPreferenceCount')->with(...$parameters); $decoratedService->getUserPreferenceCount(...$parameters); } diff --git a/tests/lib/Repository/Decorator/UserServiceDecoratorTest.php b/tests/lib/Repository/Decorator/UserServiceDecoratorTest.php index 23cb2ab1be..18f6852eb6 100644 --- a/tests/lib/Repository/Decorator/UserServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/UserServiceDecoratorTest.php @@ -53,7 +53,7 @@ public function testCreateUserGroupDecorator() $this->createMock(UserGroup::class), ]; - $serviceMock->expects($this->once())->method('createUserGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('createUserGroup')->with(...$parameters); $decoratedService->createUserGroup(...$parameters); } @@ -68,7 +68,7 @@ public function testLoadUserGroupDecorator() ['random_value_5ced05ce176389.48271998'], ]; - $serviceMock->expects($this->once())->method('loadUserGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadUserGroup')->with(...$parameters); $decoratedService->loadUserGroup(...$parameters); } @@ -83,7 +83,7 @@ public function testLoadUserGroupByRemoteIdDecorator(): void [self::EXAMPLE_LANGUAGE_CODE], ]; - $serviceMock->expects($this->once())->method('loadUserGroupByRemoteId')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadUserGroupByRemoteId')->with(...$parameters); $decoratedService->loadUserGroupByRemoteId(...$parameters); } @@ -100,7 +100,7 @@ public function testLoadSubUserGroupsDecorator() ['random_value_5ced05ce176401.55725588'], ]; - $serviceMock->expects($this->once())->method('loadSubUserGroups')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadSubUserGroups')->with(...$parameters); $decoratedService->loadSubUserGroups(...$parameters); } @@ -112,7 +112,7 @@ public function testDeleteUserGroupDecorator() $parameters = [$this->createMock(UserGroup::class)]; - $serviceMock->expects($this->once())->method('deleteUserGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteUserGroup')->with(...$parameters); $decoratedService->deleteUserGroup(...$parameters); } @@ -127,7 +127,7 @@ public function testMoveUserGroupDecorator() $this->createMock(UserGroup::class), ]; - $serviceMock->expects($this->once())->method('moveUserGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('moveUserGroup')->with(...$parameters); $decoratedService->moveUserGroup(...$parameters); } @@ -142,7 +142,7 @@ public function testUpdateUserGroupDecorator() $this->createMock(UserGroupUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updateUserGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('updateUserGroup')->with(...$parameters); $decoratedService->updateUserGroup(...$parameters); } @@ -157,7 +157,7 @@ public function testCreateUserDecorator() ['random_value_5ced05ce177102.13726421'], ]; - $serviceMock->expects($this->once())->method('createUser')->with(...$parameters); + $serviceMock->expects(self::once())->method('createUser')->with(...$parameters); $decoratedService->createUser(...$parameters); } @@ -172,7 +172,7 @@ public function testLoadUserDecorator() ['random_value_5ced05ce177174.42173129'], ]; - $serviceMock->expects($this->once())->method('loadUser')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadUser')->with(...$parameters); $decoratedService->loadUser(...$parameters); } @@ -187,7 +187,7 @@ public function testCheckUserCredentialsDecorator() 'random_value_5ced05ce1771c7.58152750', ]; - $serviceMock->expects($this->once())->method('checkUserCredentials')->with(...$parameters); + $serviceMock->expects(self::once())->method('checkUserCredentials')->with(...$parameters); $decoratedService->checkUserCredentials(...$parameters); } @@ -202,7 +202,7 @@ public function testLoadUserByLoginDecorator() ['random_value_5ced05ce177226.14195829'], ]; - $serviceMock->expects($this->once())->method('loadUserByLogin')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadUserByLogin')->with(...$parameters); $decoratedService->loadUserByLogin(...$parameters); } @@ -217,7 +217,7 @@ public function testLoadUsersByEmailDecorator() ['random_value_5ced05ce177252.76037474'], ]; - $serviceMock->expects($this->once())->method('loadUsersByEmail')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadUsersByEmail')->with(...$parameters); $decoratedService->loadUsersByEmail(...$parameters); } @@ -232,7 +232,7 @@ public function testLoadUserByTokenDecorator() ['random_value_5ced05ce177287.80858763'], ]; - $serviceMock->expects($this->once())->method('loadUserByToken')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadUserByToken')->with(...$parameters); $decoratedService->loadUserByToken(...$parameters); } @@ -244,7 +244,7 @@ public function testDeleteUserDecorator() $parameters = [$this->createMock(User::class)]; - $serviceMock->expects($this->once())->method('deleteUser')->with(...$parameters); + $serviceMock->expects(self::once())->method('deleteUser')->with(...$parameters); $decoratedService->deleteUser(...$parameters); } @@ -259,7 +259,7 @@ public function testUpdateUserDecorator() $this->createMock(UserUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updateUser')->with(...$parameters); + $serviceMock->expects(self::once())->method('updateUser')->with(...$parameters); $decoratedService->updateUser(...$parameters); } @@ -274,7 +274,7 @@ public function testUpdateUserPasswordDecorator(): void 'H@xi0r!', ]; - $serviceMock->expects($this->once())->method('updateUserPassword')->with(...$parameters); + $serviceMock->expects(self::once())->method('updateUserPassword')->with(...$parameters); $decoratedService->updateUserPassword(...$parameters); } @@ -289,7 +289,7 @@ public function testUpdateUserTokenDecorator() $this->createMock(UserTokenUpdateStruct::class), ]; - $serviceMock->expects($this->once())->method('updateUserToken')->with(...$parameters); + $serviceMock->expects(self::once())->method('updateUserToken')->with(...$parameters); $decoratedService->updateUserToken(...$parameters); } @@ -301,7 +301,7 @@ public function testExpireUserTokenDecorator() $parameters = ['random_value_5ced05ce177e70.34830190']; - $serviceMock->expects($this->once())->method('expireUserToken')->with(...$parameters); + $serviceMock->expects(self::once())->method('expireUserToken')->with(...$parameters); $decoratedService->expireUserToken(...$parameters); } @@ -316,7 +316,7 @@ public function testAssignUserToUserGroupDecorator() $this->createMock(UserGroup::class), ]; - $serviceMock->expects($this->once())->method('assignUserToUserGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('assignUserToUserGroup')->with(...$parameters); $decoratedService->assignUserToUserGroup(...$parameters); } @@ -331,7 +331,7 @@ public function testUnAssignUserFromUserGroupDecorator() $this->createMock(UserGroup::class), ]; - $serviceMock->expects($this->once())->method('unAssignUserFromUserGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('unAssignUserFromUserGroup')->with(...$parameters); $decoratedService->unAssignUserFromUserGroup(...$parameters); } @@ -348,7 +348,7 @@ public function testLoadUserGroupsOfUserDecorator() ['random_value_5ced05ce177f66.49237325'], ]; - $serviceMock->expects($this->once())->method('loadUserGroupsOfUser')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadUserGroupsOfUser')->with(...$parameters); $decoratedService->loadUserGroupsOfUser(...$parameters); } @@ -365,7 +365,7 @@ public function testLoadUsersOfUserGroupDecorator() ['random_value_5ced05ce177fc8.32448790'], ]; - $serviceMock->expects($this->once())->method('loadUsersOfUserGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('loadUsersOfUserGroup')->with(...$parameters); $decoratedService->loadUsersOfUserGroup(...$parameters); } @@ -377,7 +377,7 @@ public function testIsUserDecorator() $parameters = [$this->createMock(Content::class)]; - $serviceMock->expects($this->once())->method('isUser')->with(...$parameters); + $serviceMock->expects(self::once())->method('isUser')->with(...$parameters); $decoratedService->isUser(...$parameters); } @@ -389,7 +389,7 @@ public function testIsUserGroupDecorator() $parameters = [$this->createMock(Content::class)]; - $serviceMock->expects($this->once())->method('isUserGroup')->with(...$parameters); + $serviceMock->expects(self::once())->method('isUserGroup')->with(...$parameters); $decoratedService->isUserGroup(...$parameters); } @@ -407,7 +407,7 @@ public function testNewUserCreateStructDecorator() $this->createMock(ContentType::class), ]; - $serviceMock->expects($this->once())->method('newUserCreateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newUserCreateStruct')->with(...$parameters); $decoratedService->newUserCreateStruct(...$parameters); } @@ -422,7 +422,7 @@ public function testNewUserGroupCreateStructDecorator() $this->createMock(ContentType::class), ]; - $serviceMock->expects($this->once())->method('newUserGroupCreateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newUserGroupCreateStruct')->with(...$parameters); $decoratedService->newUserGroupCreateStruct(...$parameters); } @@ -434,7 +434,7 @@ public function testNewUserUpdateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newUserUpdateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newUserUpdateStruct')->with(...$parameters); $decoratedService->newUserUpdateStruct(...$parameters); } @@ -446,7 +446,7 @@ public function testNewUserGroupUpdateStructDecorator() $parameters = []; - $serviceMock->expects($this->once())->method('newUserGroupUpdateStruct')->with(...$parameters); + $serviceMock->expects(self::once())->method('newUserGroupUpdateStruct')->with(...$parameters); $decoratedService->newUserGroupUpdateStruct(...$parameters); } @@ -461,7 +461,7 @@ public function testValidatePasswordDecorator() $this->createMock(PasswordValidationContext::class), ]; - $serviceMock->expects($this->once())->method('validatePassword')->with(...$parameters); + $serviceMock->expects(self::once())->method('validatePassword')->with(...$parameters); $decoratedService->validatePassword(...$parameters); } diff --git a/tests/lib/Repository/Helper/FieldTypeRegistryTest.php b/tests/lib/Repository/Helper/FieldTypeRegistryTest.php index 8a503fd729..7f2ae3a368 100644 --- a/tests/lib/Repository/Helper/FieldTypeRegistryTest.php +++ b/tests/lib/Repository/Helper/FieldTypeRegistryTest.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\Core\Repository\Helper; use Ibexa\Contracts\Core\FieldType\FieldType; @@ -24,7 +25,7 @@ public function testConstructor() $fieldTypes = [self::FIELD_TYPE_ID => $fieldType]; $registry = new FieldTypeRegistry($fieldTypes); - $this->assertTrue($registry->hasFieldType(self::FIELD_TYPE_ID)); + self::assertTrue($registry->hasFieldType(self::FIELD_TYPE_ID)); } protected function getFieldTypeMock() @@ -42,7 +43,7 @@ public function testGetFieldType() $fieldType = $registry->getFieldType(self::FIELD_TYPE_ID); - $this->assertInstanceOf( + self::assertInstanceOf( FieldType::class, $fieldType ); @@ -81,15 +82,15 @@ public function testGetFieldTypes() $fieldTypes = $registry->getFieldTypes(); - $this->assertIsArray($fieldTypes); - $this->assertCount(2, $fieldTypes); - $this->assertArrayHasKey(self::FIELD_TYPE_ID, $fieldTypes); - $this->assertInstanceOf( + self::assertIsArray($fieldTypes); + self::assertCount(2, $fieldTypes); + self::assertArrayHasKey(self::FIELD_TYPE_ID, $fieldTypes); + self::assertInstanceOf( FieldType::class, $fieldTypes[self::FIELD_TYPE_ID] ); - $this->assertArrayHasKey('two', $fieldTypes); - $this->assertInstanceOf( + self::assertArrayHasKey('two', $fieldTypes); + self::assertInstanceOf( FieldType::class, $fieldTypes['two'] ); diff --git a/tests/lib/Repository/IdManager/Php.php b/tests/lib/Repository/IdManager/Php.php index d858bb7354..a987e1e3ee 100644 --- a/tests/lib/Repository/IdManager/Php.php +++ b/tests/lib/Repository/IdManager/Php.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\Core\Repository\IdManager; use Ibexa\Tests\Integration\Core\Repository\IdManager; diff --git a/tests/lib/Repository/Iterator/BatchIteratorAdapter/AbstractSearchAdapterTest.php b/tests/lib/Repository/Iterator/BatchIteratorAdapter/AbstractSearchAdapterTest.php index bac886e79f..cd307ac652 100644 --- a/tests/lib/Repository/Iterator/BatchIteratorAdapter/AbstractSearchAdapterTest.php +++ b/tests/lib/Repository/Iterator/BatchIteratorAdapter/AbstractSearchAdapterTest.php @@ -43,20 +43,20 @@ final public function testFetch(): void $searchService = $this->createMock(SearchService::class); $searchService - ->expects($this->once()) + ->expects(self::once()) ->method($this->getExpectedFindMethod()) ->with($expectedQuery, self::EXAMPLE_LANGUAGE_FILTER, true) ->willReturn($searchResults); $adapter = $this->createAdapterUnderTest($searchService, $originalQuery, self::EXAMPLE_LANGUAGE_FILTER, true); - $this->assertSame( + self::assertSame( $expectedIterator, $adapter->fetch(self::EXAMPLE_OFFSET, self::EXAMPLE_LIMIT), ); - $this->assertEquals(0, $originalQuery->offset); - $this->assertEquals(25, $originalQuery->limit); + self::assertEquals(0, $originalQuery->offset); + self::assertEquals(25, $originalQuery->limit); } abstract protected function createAdapterUnderTest( diff --git a/tests/lib/Repository/Iterator/BatchIteratorAdapter/ContentFilteringAdapterTest.php b/tests/lib/Repository/Iterator/BatchIteratorAdapter/ContentFilteringAdapterTest.php index a90d018ee0..c69e133aa5 100644 --- a/tests/lib/Repository/Iterator/BatchIteratorAdapter/ContentFilteringAdapterTest.php +++ b/tests/lib/Repository/Iterator/BatchIteratorAdapter/ContentFilteringAdapterTest.php @@ -53,7 +53,7 @@ public function testFetch(): void $contentService = $this->createMock(ContentService::class); $contentService - ->expects($this->once()) + ->expects(self::once()) ->method('find') ->with($expectedFilter, self::EXAMPLE_LANGUAGE_FILTER) ->willReturn($contentList); diff --git a/tests/lib/Repository/Iterator/BatchIteratorAdapter/LocationFilteringAdapterTest.php b/tests/lib/Repository/Iterator/BatchIteratorAdapter/LocationFilteringAdapterTest.php index 3a58cb9157..87f5b580fd 100644 --- a/tests/lib/Repository/Iterator/BatchIteratorAdapter/LocationFilteringAdapterTest.php +++ b/tests/lib/Repository/Iterator/BatchIteratorAdapter/LocationFilteringAdapterTest.php @@ -56,7 +56,7 @@ public function testFetch(): void $locationService = $this->createMock(LocationService::class); $locationService - ->expects($this->once()) + ->expects(self::once()) ->method('find') ->with($expectedFilter, self::EXAMPLE_LANGUAGE_FILTER) ->willReturn($locationList); diff --git a/tests/lib/Repository/Iterator/BatchIteratorTest.php b/tests/lib/Repository/Iterator/BatchIteratorTest.php index 2d493389f0..e1bf910057 100644 --- a/tests/lib/Repository/Iterator/BatchIteratorTest.php +++ b/tests/lib/Repository/Iterator/BatchIteratorTest.php @@ -21,8 +21,8 @@ public function testIterateOverDummyResultSet(): void $iterator = new BatchIterator($adapter); $iterator->setBatchSize(7); - $this->assertEquals($expectedData, iterator_to_array($iterator)); - $this->assertEquals(15, $adapter->getFetchCounter()); + self::assertEquals($expectedData, iterator_to_array($iterator)); + self::assertEquals(15, $adapter->getFetchCounter()); } public function testIterateOverResultSetSmallerThenBatchSize(): void @@ -33,8 +33,8 @@ public function testIterateOverResultSetSmallerThenBatchSize(): void $iterator = new BatchIterator($adapter); $iterator->setBatchSize(100); - $this->assertEquals($expectedData, iterator_to_array($iterator)); - $this->assertEquals(1, $adapter->getFetchCounter()); + self::assertEquals($expectedData, iterator_to_array($iterator)); + self::assertEquals(1, $adapter->getFetchCounter()); } public function testIterateOverEmptyResultSet(): void @@ -44,8 +44,8 @@ public function testIterateOverEmptyResultSet(): void $iterator = new BatchIterator($adapter); $iterator->setBatchSize(10); - $this->assertEquals([], iterator_to_array($iterator)); - $this->assertEquals(1, $adapter->getFetchCounter()); + self::assertEquals([], iterator_to_array($iterator)); + self::assertEquals(1, $adapter->getFetchCounter()); } } diff --git a/tests/lib/Repository/LocationResolver/PermissionAwareLocationResolverTest.php b/tests/lib/Repository/LocationResolver/PermissionAwareLocationResolverTest.php index b885bd978a..31d186f1b8 100644 --- a/tests/lib/Repository/LocationResolver/PermissionAwareLocationResolverTest.php +++ b/tests/lib/Repository/LocationResolver/PermissionAwareLocationResolverTest.php @@ -45,7 +45,7 @@ public function testResolveMainLocation(): void ->method('loadLocation') ->willReturn($location); - $this->assertSame($location, $this->locationResolver->resolveLocation($contentInfo)); + self::assertSame($location, $this->locationResolver->resolveLocation($contentInfo)); } /** @@ -66,7 +66,7 @@ public function testResolveSecondaryLocation(): void ->method('loadLocations') ->willReturn([$location1, $location2]); - $this->assertSame($location1, $this->locationResolver->resolveLocation($contentInfo)); + self::assertSame($location1, $this->locationResolver->resolveLocation($contentInfo)); } /** diff --git a/tests/lib/Repository/Mapper/ContentLocationMapper/DecoratedLocationServiceTest.php b/tests/lib/Repository/Mapper/ContentLocationMapper/DecoratedLocationServiceTest.php index 3cc1b5c43e..7d74b7bab3 100644 --- a/tests/lib/Repository/Mapper/ContentLocationMapper/DecoratedLocationServiceTest.php +++ b/tests/lib/Repository/Mapper/ContentLocationMapper/DecoratedLocationServiceTest.php @@ -51,7 +51,7 @@ public function testLoadLocation(): void ->willReturn($location); $this->mapper - ->expects($this->once()) + ->expects(self::once()) ->method('setMapping') ->with(1, 2); @@ -85,7 +85,7 @@ public function testLoadLocationList(): void ->willReturn($locations); $this->mapper - ->expects($this->atLeastOnce()) + ->expects(self::atLeastOnce()) ->method('setMapping') ->withConsecutive([1, 2], [3, 4]); @@ -128,7 +128,7 @@ public function testLoadLocations(): void ->willReturn($locations); $this->mapper - ->expects($this->atLeastOnce()) + ->expects(self::atLeastOnce()) ->method('setMapping') ->withConsecutive([1, 2], [3, 4]); @@ -173,7 +173,7 @@ public function testLoadLocationChildren(): void ->willReturn($locationList); $this->mapper - ->expects($this->atLeastOnce()) + ->expects(self::atLeastOnce()) ->method('setMapping') ->withConsecutive([1, 2], [3, 4]); @@ -212,7 +212,7 @@ public function testLoadAllLocations(): void ->willReturn($locations); $this->mapper - ->expects($this->atLeastOnce()) + ->expects(self::atLeastOnce()) ->method('setMapping') ->withConsecutive([1, 2], [3, 4]); diff --git a/tests/lib/Repository/NameSchema/NameSchemaServiceTest.php b/tests/lib/Repository/NameSchema/NameSchemaServiceTest.php index 95c9d6a820..d0099d92dd 100644 --- a/tests/lib/Repository/NameSchema/NameSchemaServiceTest.php +++ b/tests/lib/Repository/NameSchema/NameSchemaServiceTest.php @@ -365,7 +365,7 @@ protected function getEventDispatcherMock( } /** - * @param array{limit?: integer, sequence?: string} $settings + * @param array{limit?: int, sequence?: string} $settings */ private function buildNameSchemaService( AbstractSchemaEvent $event, diff --git a/tests/lib/Repository/Permission/CachedPermissionServiceTest.php b/tests/lib/Repository/Permission/CachedPermissionServiceTest.php index f37668b42f..23207b92d6 100644 --- a/tests/lib/Repository/Permission/CachedPermissionServiceTest.php +++ b/tests/lib/Repository/Permission/CachedPermissionServiceTest.php @@ -75,13 +75,13 @@ public function testPermissionResolverPassTrough($method, array $arguments, $exp { if ($expectedReturn !== null) { $this->getPermissionResolverMock([$method]) - ->expects($this->once()) + ->expects(self::once()) ->method($method) ->with(...$arguments) ->willReturn($expectedReturn); } else { $this->getPermissionResolverMock([$method]) - ->expects($this->once()) + ->expects(self::once()) ->method($method) ->with(...$arguments); } @@ -89,7 +89,7 @@ public function testPermissionResolverPassTrough($method, array $arguments, $exp $cachedService = $this->getCachedPermissionService(); $actualReturn = $cachedService->$method(...$arguments); - $this->assertSame($expectedReturn, $actualReturn); + self::assertSame($expectedReturn, $actualReturn); } public function testGetPermissionsCriterionPassTrough() @@ -100,7 +100,7 @@ public function testGetPermissionsCriterionPassTrough() ->getMockForAbstractClass(); $this->getPermissionCriterionResolverMock(['getPermissionsCriterion']) - ->expects($this->once()) + ->expects(self::once()) ->method('getPermissionsCriterion') ->with('content', 'remove') ->willReturn($criterionMock); @@ -108,7 +108,7 @@ public function testGetPermissionsCriterionPassTrough() $cachedService = $this->getCachedPermissionService(); $actualReturn = $cachedService->getPermissionsCriterion('content', 'remove'); - $this->assertSame($criterionMock, $actualReturn); + self::assertSame($criterionMock, $actualReturn); } public function testGetPermissionsCriterionCaching() @@ -119,7 +119,7 @@ public function testGetPermissionsCriterionCaching() ->getMockForAbstractClass(); $this->getPermissionCriterionResolverMock(['getPermissionsCriterion']) - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('getPermissionsCriterion') ->with('content', 'read') ->willReturn($criterionMock); @@ -127,15 +127,15 @@ public function testGetPermissionsCriterionCaching() $cachedService = $this->getCachedPermissionService(2); $actualReturn = $cachedService->getPermissionsCriterion('content', 'read'); - $this->assertSame($criterionMock, $actualReturn); + self::assertSame($criterionMock, $actualReturn); // +1 $actualReturn = $cachedService->getPermissionsCriterion('content', 'read'); - $this->assertSame($criterionMock, $actualReturn); + self::assertSame($criterionMock, $actualReturn); // +3, time() will be called twice and cache will be updated $actualReturn = $cachedService->getPermissionsCriterion('content', 'read'); - $this->assertSame($criterionMock, $actualReturn); + self::assertSame($criterionMock, $actualReturn); } public function testSetCurrentUserReferenceCacheClear(): void @@ -146,7 +146,7 @@ public function testSetCurrentUserReferenceCacheClear(): void ->getMockForAbstractClass(); $this->getPermissionCriterionResolverMock(['getPermissionsCriterion']) - ->expects($this->once()) + ->expects(self::once()) ->method('getPermissionsCriterion') ->with('content', 'read') ->willReturn($criterionMock); @@ -154,7 +154,7 @@ public function testSetCurrentUserReferenceCacheClear(): void $cachedService = $this->getCachedPermissionService(2); $actualReturn = $cachedService->getPermissionsCriterion('content', 'read'); - $this->assertSame($criterionMock, $actualReturn); + self::assertSame($criterionMock, $actualReturn); $userRef = $this ->getMockBuilder(UserReference::class) diff --git a/tests/lib/Repository/Permission/PermissionCriterionResolverTest.php b/tests/lib/Repository/Permission/PermissionCriterionResolverTest.php index b9c041e7bd..3103766269 100644 --- a/tests/lib/Repository/Permission/PermissionCriterionResolverTest.php +++ b/tests/lib/Repository/Permission/PermissionCriterionResolverTest.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\Core\Repository\Permission; use Ibexa\Contracts\Core\Limitation\Type; @@ -32,13 +33,13 @@ public function providerForTestGetPermissionsCriterion() ->getMockBuilder(Limitation::class) ->getMockForAbstractClass(); $limitationMock - ->expects($this->any()) + ->expects(self::any()) ->method('getIdentifier') - ->will($this->returnValue('limitationIdentifier')); + ->will(self::returnValue('limitationIdentifier')); $targetOnlyLimitationMock = $this->createMock(Limitation::class); $targetOnlyLimitationMock - ->expects($this->any()) + ->expects(self::any()) ->method('getIdentifier') ->willReturn('targetOnlyLimitationIdentifier'); @@ -242,30 +243,30 @@ protected function mockServices($criterionMock, $limitationCount, $permissionSet ); $limitationTypeMock - ->expects($this->any()) + ->expects(self::any()) ->method('getCriterion') ->with( - $this->isInstanceOf(Limitation::class), - $this->equalTo($userMock) + self::isInstanceOf(Limitation::class), + self::equalTo($userMock) ) - ->will($this->returnValue($criterionMock)); + ->will(self::returnValue($criterionMock)); $targetOnlyLimitationTypeMock - ->expects($this->never()) + ->expects(self::never()) ->method('getCriterion'); $targetOnlyLimitationTypeMock - ->expects($this->any()) + ->expects(self::any()) ->method('getCriterionByTarget') ->with( - $this->isInstanceOf(Limitation::class), - $this->equalTo($userMock), - $this->anything() + self::isInstanceOf(Limitation::class), + self::equalTo($userMock), + self::anything() ) ->willReturn($criterionMock); $limitationServiceMock - ->expects($this->exactly($limitationCount)) + ->expects(self::exactly($limitationCount)) ->method('getLimitationType') ->willReturnMap([ ['limitationIdentifier', $limitationTypeMock], @@ -273,15 +274,15 @@ protected function mockServices($criterionMock, $limitationCount, $permissionSet ]); $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess') - ->with($this->equalTo('content'), $this->equalTo('read')) - ->will($this->returnValue($permissionSets)); + ->with(self::equalTo('content'), self::equalTo('read')) + ->will(self::returnValue($permissionSets)); $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('getCurrentUserReference') - ->will($this->returnValue($userMock)); + ->will(self::returnValue($userMock)); } /** @@ -300,7 +301,7 @@ public function testGetPermissionsCriterion( $permissionsCriterion = $criterionResolver->getPermissionsCriterion('content', 'read', []); - $this->assertEquals($expectedCriterion, $permissionsCriterion); + self::assertEquals($expectedCriterion, $permissionsCriterion); } public function providerForTestGetPermissionsCriterionBooleanPermissionSets() @@ -320,16 +321,16 @@ public function testGetPermissionsCriterionBooleanPermissionSets($permissionSets { $permissionResolverMock = $this->getPermissionResolverMock(['hasAccess']); $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess') - ->with($this->equalTo('testModule'), $this->equalTo('testFunction')) - ->will($this->returnValue($permissionSets)); + ->with(self::equalTo('testModule'), self::equalTo('testFunction')) + ->will(self::returnValue($permissionSets)); $criterionResolver = $this->getPermissionCriterionResolverMock(null); $permissionsCriterion = $criterionResolver->getPermissionsCriterion('testModule', 'testFunction'); - $this->assertEquals($permissionSets, $permissionsCriterion); + self::assertEquals($permissionSets, $permissionsCriterion); } /** diff --git a/tests/lib/Repository/Service/Mock/Base.php b/tests/lib/Repository/Service/Mock/Base.php index dfda628e4f..72a17fa6ae 100644 --- a/tests/lib/Repository/Service/Mock/Base.php +++ b/tests/lib/Repository/Service/Mock/Base.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\Core\Repository\Service\Mock; use Ibexa\Contracts\Core\Persistence\Filter\Content\Handler as ContentFilteringHandler; @@ -262,49 +263,49 @@ protected function getPersistenceMock() if (!isset($this->persistenceMock)) { $this->persistenceMock = $this->createMock(Handler::class); - $this->persistenceMock->expects($this->any()) + $this->persistenceMock->expects(self::any()) ->method('contentHandler') - ->will($this->returnValue($this->getPersistenceMockHandler('Content\\Handler'))); + ->will(self::returnValue($this->getPersistenceMockHandler('Content\\Handler'))); - $this->persistenceMock->expects($this->any()) + $this->persistenceMock->expects(self::any()) ->method('contentTypeHandler') - ->will($this->returnValue($this->getPersistenceMockHandler('Content\\Type\\Handler'))); + ->will(self::returnValue($this->getPersistenceMockHandler('Content\\Type\\Handler'))); - $this->persistenceMock->expects($this->any()) + $this->persistenceMock->expects(self::any()) ->method('contentLanguageHandler') - ->will($this->returnValue($this->getPersistenceMockHandler('Content\\Language\\Handler'))); + ->will(self::returnValue($this->getPersistenceMockHandler('Content\\Language\\Handler'))); - $this->persistenceMock->expects($this->any()) + $this->persistenceMock->expects(self::any()) ->method('locationHandler') - ->will($this->returnValue($this->getPersistenceMockHandler('Content\\Location\\Handler'))); + ->will(self::returnValue($this->getPersistenceMockHandler('Content\\Location\\Handler'))); - $this->persistenceMock->expects($this->any()) + $this->persistenceMock->expects(self::any()) ->method('objectStateHandler') - ->will($this->returnValue($this->getPersistenceMockHandler('Content\\ObjectState\\Handler'))); + ->will(self::returnValue($this->getPersistenceMockHandler('Content\\ObjectState\\Handler'))); - $this->persistenceMock->expects($this->any()) + $this->persistenceMock->expects(self::any()) ->method('trashHandler') - ->will($this->returnValue($this->getPersistenceMockHandler('Content\\Location\\Trash\\Handler'))); + ->will(self::returnValue($this->getPersistenceMockHandler('Content\\Location\\Trash\\Handler'))); - $this->persistenceMock->expects($this->any()) + $this->persistenceMock->expects(self::any()) ->method('userHandler') - ->will($this->returnValue($this->getPersistenceMockHandler('User\\Handler'))); + ->will(self::returnValue($this->getPersistenceMockHandler('User\\Handler'))); - $this->persistenceMock->expects($this->any()) + $this->persistenceMock->expects(self::any()) ->method('sectionHandler') - ->will($this->returnValue($this->getPersistenceMockHandler('Content\\Section\\Handler'))); + ->will(self::returnValue($this->getPersistenceMockHandler('Content\\Section\\Handler'))); - $this->persistenceMock->expects($this->any()) + $this->persistenceMock->expects(self::any()) ->method('urlAliasHandler') - ->will($this->returnValue($this->getPersistenceMockHandler('Content\\UrlAlias\\Handler'))); + ->will(self::returnValue($this->getPersistenceMockHandler('Content\\UrlAlias\\Handler'))); - $this->persistenceMock->expects($this->any()) + $this->persistenceMock->expects(self::any()) ->method('urlWildcardHandler') - ->will($this->returnValue($this->getPersistenceMockHandler('Content\\UrlWildcard\\Handler'))); + ->will(self::returnValue($this->getPersistenceMockHandler('Content\\UrlWildcard\\Handler'))); - $this->persistenceMock->expects($this->any()) + $this->persistenceMock->expects(self::any()) ->method('urlWildcardHandler') - ->will($this->returnValue($this->getPersistenceMockHandler('URL\\Handler'))); + ->will(self::returnValue($this->getPersistenceMockHandler('URL\\Handler'))); } return $this->persistenceMock; diff --git a/tests/lib/Repository/Service/Mock/BookmarkTest.php b/tests/lib/Repository/Service/Mock/BookmarkTest.php index 234032eb1b..597e663d1e 100644 --- a/tests/lib/Repository/Service/Mock/BookmarkTest.php +++ b/tests/lib/Repository/Service/Mock/BookmarkTest.php @@ -38,13 +38,13 @@ protected function setUp(): void $permissionResolverMock = $this->createMock(PermissionResolver::class); $permissionResolverMock - ->expects($this->atLeastOnce()) + ->expects(self::atLeastOnce()) ->method('getCurrentUserReference') ->willReturn(new UserReference(self::CURRENT_USER_ID)); $repository = $this->getRepositoryMock(); $repository - ->expects($this->atLeastOnce()) + ->expects(self::atLeastOnce()) ->method('getPermissionResolver') ->willReturn($permissionResolverMock); } @@ -59,7 +59,7 @@ public function testCreateBookmark() $this->assertLocationIsLoaded($location); $this->bookmarkHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadByUserIdAndLocationId') ->with(self::CURRENT_USER_ID, [self::LOCATION_ID]) ->willReturn([]); @@ -91,7 +91,7 @@ public function testCreateBookmarkThrowsInvalidArgumentException() $this->assertLocationIsLoaded($location); $this->bookmarkHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadByUserIdAndLocationId') ->with(self::CURRENT_USER_ID, [self::LOCATION_ID]) ->willReturn([self::LOCATION_ID => new Bookmark()]); @@ -115,7 +115,7 @@ public function testCreateBookmarkWithRollback() $this->assertLocationIsLoaded($location); $this->bookmarkHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadByUserIdAndLocationId') ->with(self::CURRENT_USER_ID, [self::LOCATION_ID]) ->willReturn([]); @@ -142,7 +142,7 @@ public function testDeleteBookmarkExisting() $bookmark = new Bookmark(['id' => self::BOOKMARK_ID]); $this->bookmarkHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadByUserIdAndLocationId') ->with(self::CURRENT_USER_ID, [self::LOCATION_ID]) ->willReturn([self::LOCATION_ID => $bookmark]); @@ -169,7 +169,7 @@ public function testDeleteBookmarkWithRollback() $this->assertLocationIsLoaded($location); $this->bookmarkHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadByUserIdAndLocationId') ->with(self::CURRENT_USER_ID, [self::LOCATION_ID]) ->willReturn([self::LOCATION_ID => new Bookmark(['id' => self::BOOKMARK_ID])]); @@ -196,7 +196,7 @@ public function testDeleteBookmarkNonExisting() $this->assertLocationIsLoaded($location); $this->bookmarkHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadByUserIdAndLocationId') ->with(self::CURRENT_USER_ID, [self::LOCATION_ID]) ->willReturn([]); @@ -222,13 +222,13 @@ public function testLoadBookmarks() }, range(1, $expectedTotalCount)); $this->bookmarkHandler - ->expects($this->once()) + ->expects(self::once()) ->method('countUserBookmarks') ->with(self::CURRENT_USER_ID) ->willReturn($expectedTotalCount); $this->bookmarkHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadUserBookmarks') ->with(self::CURRENT_USER_ID, $offset, $limit) ->willReturn(array_map(static function ($locationId) { @@ -237,7 +237,7 @@ public function testLoadBookmarks() $locationServiceMock = $this->createMock(LocationService::class); $locationServiceMock - ->expects($this->exactly($expectedTotalCount)) + ->expects(self::exactly($expectedTotalCount)) ->method('loadLocation') ->willReturnCallback(function ($locationId) { return $this->createLocation($locationId); @@ -245,14 +245,14 @@ public function testLoadBookmarks() $repository = $this->getRepositoryMock(); $repository - ->expects($this->any()) + ->expects(self::any()) ->method('getLocationService') ->willReturn($locationServiceMock); $bookmarks = $this->createBookmarkService()->loadBookmarks($offset, $limit); - $this->assertEquals($expectedTotalCount, $bookmarks->totalCount); - $this->assertEquals($expectedItems, $bookmarks->items); + self::assertEquals($expectedTotalCount, $bookmarks->totalCount); + self::assertEquals($expectedItems, $bookmarks->items); } /** @@ -261,19 +261,19 @@ public function testLoadBookmarks() public function testLoadBookmarksEmptyList() { $this->bookmarkHandler - ->expects($this->once()) + ->expects(self::once()) ->method('countUserBookmarks') ->with(self::CURRENT_USER_ID) ->willReturn(0); $this->bookmarkHandler - ->expects($this->never()) + ->expects(self::never()) ->method('loadUserBookmarks'); $bookmarks = $this->createBookmarkService()->loadBookmarks(0, 10); - $this->assertEquals(0, $bookmarks->totalCount); - $this->assertEmpty($bookmarks->items); + self::assertEquals(0, $bookmarks->totalCount); + self::assertEmpty($bookmarks->items); } /** @@ -282,12 +282,12 @@ public function testLoadBookmarksEmptyList() public function testLocationShouldNotBeBookmarked() { $this->bookmarkHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadByUserIdAndLocationId') ->with(self::CURRENT_USER_ID, [self::LOCATION_ID]) ->willReturn([]); - $this->assertFalse($this->createBookmarkService()->isBookmarked($this->createLocation(self::LOCATION_ID))); + self::assertFalse($this->createBookmarkService()->isBookmarked($this->createLocation(self::LOCATION_ID))); } /** @@ -296,25 +296,25 @@ public function testLocationShouldNotBeBookmarked() public function testLocationShouldBeBookmarked() { $this->bookmarkHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadByUserIdAndLocationId') ->with(self::CURRENT_USER_ID, [self::LOCATION_ID]) ->willReturn([self::LOCATION_ID => new Bookmark()]); - $this->assertTrue($this->createBookmarkService()->isBookmarked($this->createLocation(self::LOCATION_ID))); + self::assertTrue($this->createBookmarkService()->isBookmarked($this->createLocation(self::LOCATION_ID))); } private function assertLocationIsLoaded(Location $location): MockObject { $locationServiceMock = $this->createMock(LocationService::class); $locationServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadLocation') ->willReturn($location); $repository = $this->getRepositoryMock(); $repository - ->expects($this->once()) + ->expects(self::once()) ->method('getLocationService') ->willReturn($locationServiceMock); @@ -324,28 +324,28 @@ private function assertLocationIsLoaded(Location $location): MockObject private function assertTransactionIsNotStarted(callable $operation): void { $repository = $this->getRepositoryMock(); - $repository->expects($this->never())->method('beginTransaction'); + $repository->expects(self::never())->method('beginTransaction'); $operation(); - $repository->expects($this->never())->method('commit'); - $repository->expects($this->never())->method('rollback'); + $repository->expects(self::never())->method('commit'); + $repository->expects(self::never())->method('rollback'); } private function assertTransactionIsCommitted(callable $operation): void { $repository = $this->getRepositoryMock(); - $repository->expects($this->once())->method('beginTransaction'); + $repository->expects(self::once())->method('beginTransaction'); $operation(); - $repository->expects($this->once())->method('commit'); - $repository->expects($this->never())->method('rollback'); + $repository->expects(self::once())->method('commit'); + $repository->expects(self::never())->method('rollback'); } private function assertTransactionIsRollback(callable $operation): void { $repository = $this->getRepositoryMock(); - $repository->expects($this->once())->method('beginTransaction'); + $repository->expects(self::once())->method('beginTransaction'); $operation(); - $repository->expects($this->never())->method('commit'); - $repository->expects($this->once())->method('rollback'); + $repository->expects(self::never())->method('commit'); + $repository->expects(self::once())->method('rollback'); } private function createLocation(int $id = self::CURRENT_USER_ID, string $name = 'Lorem ipsum...'): Location diff --git a/tests/lib/Repository/Service/Mock/ContentTest.php b/tests/lib/Repository/Service/Mock/ContentTest.php index 5f10cdb39d..c49445b0d6 100644 --- a/tests/lib/Repository/Service/Mock/ContentTest.php +++ b/tests/lib/Repository/Service/Mock/ContentTest.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\Core\Repository\Service\Mock; use Exception; @@ -117,44 +118,45 @@ public function testLoadVersionInfoById() $versionInfoMock = $this->createMock(APIVersionInfo::class); $permissionResolver = $this->getPermissionResolverMock(); - $versionInfoMock->expects($this->once()) + $versionInfoMock->expects(self::once()) ->method('isPublished') ->willReturn(true); - $contentServiceMock->expects($this->never()) + $contentServiceMock->expects(self::never()) ->method('loadContentInfo'); - $contentHandler->expects($this->once()) + $contentHandler->expects(self::once()) ->method('loadVersionInfo') ->with( - $this->equalTo(42), - $this->equalTo(null) + self::equalTo(42), + self::equalTo(null) )->will( - $this->returnValue(new SPIVersionInfo()) + self::returnValue(new SPIVersionInfo()) ); - $domainMapperMock->expects($this->once()) + $domainMapperMock->expects(self::once()) ->method('buildVersionInfoDomainObject') ->with(new SPIVersionInfo()) - ->will($this->returnValue($versionInfoMock)); + ->will(self::returnValue($versionInfoMock)); - $permissionResolver->expects($this->once()) + $permissionResolver->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('content'), - $this->equalTo('read'), - $this->equalTo($versionInfoMock) - )->will($this->returnValue(true)); + self::equalTo('content'), + self::equalTo('read'), + self::equalTo($versionInfoMock) + )->will(self::returnValue(true)); $result = $contentServiceMock->loadVersionInfoById(42); - $this->assertEquals($versionInfoMock, $result); + self::assertEquals($versionInfoMock, $result); } /** * Test for the loadVersionInfo() method, of a draft. * * @depends testLoadVersionInfoById + * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersionInfoById */ public function testLoadVersionInfoByIdAndVersionNumber() @@ -166,37 +168,37 @@ public function testLoadVersionInfoByIdAndVersionNumber() $domainMapperMock = $this->getContentDomainMapperMock(); $versionInfoMock = $this->createMock(APIVersionInfo::class); - $versionInfoMock->expects($this->any()) + $versionInfoMock->expects(self::any()) ->method('__get') ->with('status') ->willReturn(APIVersionInfo::STATUS_DRAFT); - $contentServiceMock->expects($this->never()) + $contentServiceMock->expects(self::never()) ->method('loadContentInfo'); - $contentHandler->expects($this->once()) + $contentHandler->expects(self::once()) ->method('loadVersionInfo') ->with( - $this->equalTo(42), - $this->equalTo(2) + self::equalTo(42), + self::equalTo(2) )->willReturn(new SPIVersionInfo()); - $domainMapperMock->expects($this->once()) + $domainMapperMock->expects(self::once()) ->method('buildVersionInfoDomainObject') ->with(new SPIVersionInfo()) ->willReturn($versionInfoMock); - $permissionResolver->expects($this->once()) + $permissionResolver->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('content'), - $this->equalTo('versionread'), - $this->equalTo($versionInfoMock) + self::equalTo('content'), + self::equalTo('versionread'), + self::equalTo($versionInfoMock) )->willReturn(true); $result = $contentServiceMock->loadVersionInfoById(42, 2); - $this->assertEquals($versionInfoMock, $result); + self::assertEquals($versionInfoMock, $result); } /** @@ -212,13 +214,13 @@ public function testLoadVersionInfoByIdThrowsNotFoundException() /** @var \PHPUnit\Framework\MockObject\MockObject $contentHandler */ $contentHandler = $this->getPersistenceMock()->contentHandler(); - $contentHandler->expects($this->once()) + $contentHandler->expects(self::once()) ->method('loadVersionInfo') ->with( - $this->equalTo(42), - $this->equalTo(24) + self::equalTo(42), + self::equalTo(24) )->will( - $this->throwException( + self::throwException( new NotFoundException( 'Content', [ @@ -248,31 +250,31 @@ public function testLoadVersionInfoByIdThrowsUnauthorizedExceptionNonPublishedVe $versionInfoMock = $this->createMock(APIVersionInfo::class); $permissionResolver = $this->getPermissionResolverMock(); - $versionInfoMock->expects($this->any()) + $versionInfoMock->expects(self::any()) ->method('isPublished') ->willReturn(false); - $contentHandler->expects($this->once()) + $contentHandler->expects(self::once()) ->method('loadVersionInfo') ->with( - $this->equalTo(42), - $this->equalTo(24) + self::equalTo(42), + self::equalTo(24) )->will( - $this->returnValue(new SPIVersionInfo()) + self::returnValue(new SPIVersionInfo()) ); - $domainMapperMock->expects($this->once()) + $domainMapperMock->expects(self::once()) ->method('buildVersionInfoDomainObject') ->with(new SPIVersionInfo()) - ->will($this->returnValue($versionInfoMock)); + ->will(self::returnValue($versionInfoMock)); - $permissionResolver->expects($this->once()) + $permissionResolver->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('content'), - $this->equalTo('versionread'), - $this->equalTo($versionInfoMock) - )->will($this->returnValue(false)); + self::equalTo('content'), + self::equalTo('versionread'), + self::equalTo($versionInfoMock) + )->will(self::returnValue(false)); $contentServiceMock->loadVersionInfoById(42, 24); } @@ -291,35 +293,35 @@ public function testLoadVersionInfoByIdPublishedVersion() $versionInfoMock = $this->createMock(APIVersionInfo::class); $permissionResolver = $this->getPermissionResolverMock(); - $versionInfoMock->expects($this->once()) + $versionInfoMock->expects(self::once()) ->method('isPublished') ->willReturn(true); - $contentHandler->expects($this->once()) + $contentHandler->expects(self::once()) ->method('loadVersionInfo') ->with( - $this->equalTo(42), - $this->equalTo(24) + self::equalTo(42), + self::equalTo(24) )->will( - $this->returnValue(new SPIVersionInfo()) + self::returnValue(new SPIVersionInfo()) ); - $domainMapperMock->expects($this->once()) + $domainMapperMock->expects(self::once()) ->method('buildVersionInfoDomainObject') ->with(new SPIVersionInfo()) - ->will($this->returnValue($versionInfoMock)); + ->will(self::returnValue($versionInfoMock)); - $permissionResolver->expects($this->once()) + $permissionResolver->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('content'), - $this->equalTo('read'), - $this->equalTo($versionInfoMock) - )->will($this->returnValue(true)); + self::equalTo('content'), + self::equalTo('read'), + self::equalTo($versionInfoMock) + )->will(self::returnValue(true)); $result = $contentServiceMock->loadVersionInfoById(42, 24); - $this->assertEquals($versionInfoMock, $result); + self::assertEquals($versionInfoMock, $result); } /** @@ -336,41 +338,42 @@ public function testLoadVersionInfoByIdNonPublishedVersion() $versionInfoMock = $this->createMock(APIVersionInfo::class); $permissionResolver = $this->getPermissionResolverMock(); - $versionInfoMock->expects($this->once()) + $versionInfoMock->expects(self::once()) ->method('isPublished') ->willReturn(false); - $contentHandler->expects($this->once()) + $contentHandler->expects(self::once()) ->method('loadVersionInfo') ->with( - $this->equalTo(42), - $this->equalTo(24) + self::equalTo(42), + self::equalTo(24) )->will( - $this->returnValue(new SPIVersionInfo()) + self::returnValue(new SPIVersionInfo()) ); - $domainMapperMock->expects($this->once()) + $domainMapperMock->expects(self::once()) ->method('buildVersionInfoDomainObject') ->with(new SPIVersionInfo()) - ->will($this->returnValue($versionInfoMock)); + ->will(self::returnValue($versionInfoMock)); - $permissionResolver->expects($this->once()) + $permissionResolver->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('content'), - $this->equalTo('versionread'), - $this->equalTo($versionInfoMock) - )->will($this->returnValue(true)); + self::equalTo('content'), + self::equalTo('versionread'), + self::equalTo($versionInfoMock) + )->will(self::returnValue(true)); $result = $contentServiceMock->loadVersionInfoById(42, 24); - $this->assertEquals($versionInfoMock, $result); + self::assertEquals($versionInfoMock, $result); } /** * Test for the loadVersionInfo() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::loadVersionInfo + * * @depends Ibexa\Tests\Core\Repository\Service\Mock\ContentTest::testLoadVersionInfoById * @depends Ibexa\Tests\Core\Repository\Service\Mock\ContentTest::testLoadVersionInfoByIdThrowsNotFoundException * @depends Ibexa\Tests\Core\Repository\Service\Mock\ContentTest::testLoadVersionInfoByIdThrowsUnauthorizedExceptionNonPublishedVersion @@ -385,14 +388,14 @@ public function testLoadVersionInfo() ['loadVersionInfoById'] ); $contentServiceMock->expects( - $this->once() + self::once() )->method( 'loadVersionInfoById' )->with( - $this->equalTo(42), - $this->equalTo(7) + self::equalTo(42), + self::equalTo(7) )->will( - $this->returnValue($expectedResult) + self::returnValue($expectedResult) ); $result = $contentServiceMock->loadVersionInfo( @@ -400,7 +403,7 @@ public function testLoadVersionInfo() 7 ); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } public function testLoadContent() @@ -411,27 +414,27 @@ public function testLoadContent() $permissionResolver = $this->getPermissionResolverMock(); $content - ->expects($this->once()) + ->expects(self::once()) ->method('getVersionInfo') - ->will($this->returnValue($versionInfo)); + ->will(self::returnValue($versionInfo)); $versionInfo - ->expects($this->once()) + ->expects(self::once()) ->method('isPublished') ->willReturn(true); $contentId = 123; $contentService - ->expects($this->once()) + ->expects(self::once()) ->method('internalLoadContentById') ->with($contentId) - ->will($this->returnValue($content)); + ->will(self::returnValue($content)); $permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('canUser') ->with('content', 'read', $content) - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); - $this->assertSame($content, $contentService->loadContent($contentId)); + self::assertSame($content, $contentService->loadContent($contentId)); } public function testLoadContentNonPublished() @@ -442,21 +445,21 @@ public function testLoadContentNonPublished() $permissionResolver = $this->getPermissionResolverMock(); $content - ->expects($this->once()) + ->expects(self::once()) ->method('getVersionInfo') - ->will($this->returnValue($versionInfo)); + ->will(self::returnValue($versionInfo)); $contentId = 123; $contentService - ->expects($this->once()) + ->expects(self::once()) ->method('internalLoadContentById') ->with($contentId) - ->will($this->returnValue($content)); + ->will(self::returnValue($content)); $permissionResolver - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('canUser') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['content', 'read', $content, [], true], ['content', 'versionread', $content, [], true], @@ -464,7 +467,7 @@ public function testLoadContentNonPublished() ) ); - $this->assertSame($content, $contentService->loadContent($contentId)); + self::assertSame($content, $contentService->loadContent($contentId)); } public function testLoadContentUnauthorized() @@ -477,16 +480,16 @@ public function testLoadContentUnauthorized() $content = $this->createMock(APIContent::class); $contentId = 123; $contentService - ->expects($this->once()) + ->expects(self::once()) ->method('internalLoadContentById') ->with($contentId) - ->will($this->returnValue($content)); + ->will(self::returnValue($content)); $permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('canUser') ->with('content', 'read', $content) - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); $contentService->loadContent($contentId); } @@ -502,21 +505,21 @@ public function testLoadContentNotPublishedStatusUnauthorized() ->getMockBuilder(APIVersionInfo::class) ->getMockForAbstractClass(); $content - ->expects($this->once()) + ->expects(self::once()) ->method('getVersionInfo') - ->will($this->returnValue($versionInfo)); + ->will(self::returnValue($versionInfo)); $contentId = 123; $contentService - ->expects($this->once()) + ->expects(self::once()) ->method('internalLoadContentById') ->with($contentId) - ->will($this->returnValue($content)); + ->will(self::returnValue($content)); $permissionResolver - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('canUser') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['content', 'read', $content, [], true], ['content', 'versionread', $content, [], false], @@ -550,13 +553,13 @@ public function testInternalLoadContentById(int $id, ?array $languages, ?int $ve /** @var \PHPUnit\Framework\MockObject\MockObject $contentHandler */ $contentHandler = $this->getPersistenceMock()->contentHandler(); $contentHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadContentInfo') ->with($id) - ->will($this->returnValue($spiContentInfo)); + ->will(self::returnValue($spiContentInfo)); $contentHandler - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with($id, $versionNo, $languages) ->willReturn($spiContent); @@ -566,7 +569,7 @@ public function testInternalLoadContentById(int $id, ?array $languages, ?int $ve $expectedContent = $this->mockBuildContentDomainObject($spiContent, $languages); $actualContent = $contentService->internalLoadContentById($id, $languages, $versionNo, $useAlwaysAvailable); - $this->assertSame($expectedContent, $actualContent); + self::assertSame($expectedContent, $actualContent); } /** @@ -591,13 +594,13 @@ public function testInternalLoadContentByRemoteId(string $remoteId, ?array $lang /** @var \PHPUnit\Framework\MockObject\MockObject $contentHandler */ $contentHandler = $this->getPersistenceMock()->contentHandler(); $contentHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadContentInfoByRemoteId') ->with($remoteId) - ->will($this->returnValue($spiContentInfo)); + ->will(self::returnValue($spiContentInfo)); $contentHandler - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with($realId, $versionNo, $languages) ->willReturn($spiContent); @@ -611,7 +614,7 @@ public function testInternalLoadContentByRemoteId(string $remoteId, ?array $lang $useAlwaysAvailable ); - $this->assertSame($expectedContent, $actualContent); + self::assertSame($expectedContent, $actualContent); } public function internalLoadContentProviderById(): array @@ -651,17 +654,17 @@ public function testInternalLoadContentByIdNotFound(): void /** @var \PHPUnit\Framework\MockObject\MockObject $contentHandler */ $contentHandler = $this->getPersistenceMock()->contentHandler(); $contentHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadContentInfo') ->with($id) ->willReturn(new SPIContent\ContentInfo(['id' => $id])); $contentHandler - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with($id, $versionNo, $languages) ->will( - $this->throwException( + self::throwException( $this->createMock(APINotFoundException::class) ) ); @@ -682,13 +685,13 @@ public function testInternalLoadContentByRemoteIdNotFound(): void /** @var \PHPUnit\Framework\MockObject\MockObject $contentHandler */ $contentHandler = $this->getPersistenceMock()->contentHandler(); $contentHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadContentInfoByRemoteId') ->with($remoteId) ->willReturn(new SPIContent\ContentInfo(['id' => $id])); $contentHandler - ->expects($this->once()) + ->expects(self::once()) ->method('load') ->with($id, $versionNo, $languages) ->willThrowException( @@ -709,12 +712,12 @@ public function testLoadContentByContentInfo() $versionInfo = $this->createMock(APIVersionInfo::class); $content = $this->createMock(APIContent::class); $content->method('getVersionInfo') - ->will($this->returnValue($versionInfo)); + ->will(self::returnValue($versionInfo)); $permissionResolver = $this->getPermissionResolverMock(); - $permissionResolver->expects($this->any()) + $permissionResolver->expects(self::any()) ->method('canUser') - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $contentServiceMock = $this->getPartlyMockedContentService( ['internalLoadContentById'] @@ -724,12 +727,12 @@ public function testLoadContentByContentInfo() ->method( 'internalLoadContentById' )->with( - $this->equalTo(42), - $this->equalTo(['cro-HR']), - $this->equalTo(7), - $this->equalTo(false) + self::equalTo(42), + self::equalTo(['cro-HR']), + self::equalTo(7), + self::equalTo(false) )->will( - $this->returnValue($content) + self::returnValue($content) ); $result = $contentServiceMock->loadContentByContentInfo( @@ -738,7 +741,7 @@ public function testLoadContentByContentInfo() 7 ); - $this->assertEquals($content, $result); + self::assertEquals($content, $result); } /** @@ -754,16 +757,16 @@ public function testLoadContentByVersionInfo() ['loadContent'] ); $contentServiceMock->expects( - $this->once() + self::once() )->method( 'loadContent' )->with( - $this->equalTo(42), - $this->equalTo(['cro-HR']), - $this->equalTo(7), - $this->equalTo(false) + self::equalTo(42), + self::equalTo(['cro-HR']), + self::equalTo(7), + self::equalTo(false) )->will( - $this->returnValue($expectedResult) + self::returnValue($expectedResult) ); $result = $contentServiceMock->loadContentByVersionInfo( @@ -776,7 +779,7 @@ public function testLoadContentByVersionInfo() ['cro-HR'] ); - $this->assertEquals($expectedResult, $result); + self::assertEquals($expectedResult, $result); } /** @@ -792,7 +795,7 @@ public function testDeleteContentThrowsUnauthorizedException() $contentService = $this->getPartlyMockedContentService(['internalLoadContentInfoById']); $contentInfo = $this->createMock(APIContentInfo::class); - $contentInfo->expects($this->any()) + $contentInfo->expects(self::any()) ->method('__get') ->willReturnMap( [ @@ -806,24 +809,24 @@ public function testDeleteContentThrowsUnauthorizedException() $contentHandler = $this->getPersistenceMock()->contentHandler(); $contentHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadVersionInfo') ->with( - $this->equalTo(42), - $this->equalTo(7) + self::equalTo(42), + self::equalTo(7) )->will( - $this->returnValue(new SPIVersionInfo()) + self::returnValue(new SPIVersionInfo()) ); - $contentService->expects($this->once()) + $contentService->expects(self::once()) ->method('internalLoadContentInfoById') ->with(42) - ->will($this->returnValue($contentInfo)); + ->will(self::returnValue($contentInfo)); - $permissionResolver->expects($this->once()) + $permissionResolver->expects(self::once()) ->method('canUser') ->with('content', 'remove') - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); /* @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo */ $contentService->deleteContent($contentInfo); @@ -839,10 +842,10 @@ public function testDeleteContent() $repository = $this->getRepositoryMock(); $permissionResolver = $this->getPermissionResolverMock(); - $permissionResolver->expects($this->once()) + $permissionResolver->expects(self::once()) ->method('canUser') ->with('content', 'remove') - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $contentService = $this->getPartlyMockedContentService(['internalLoadContentInfoById']); /** @var \PHPUnit\Framework\MockObject\MockObject $urlAliasHandler */ @@ -854,12 +857,12 @@ public function testDeleteContent() $contentInfo = $this->createMock(APIContentInfo::class); - $contentService->expects($this->once()) + $contentService->expects(self::once()) ->method('internalLoadContentInfoById') ->with(42) - ->will($this->returnValue($contentInfo)); + ->will(self::returnValue($contentInfo)); - $contentInfo->expects($this->any()) + $contentInfo->expects(self::any()) ->method('__get') ->willReturnMap( [ @@ -873,37 +876,37 @@ public function testDeleteContent() $contentHandler = $this->getPersistenceMock()->contentHandler(); $contentHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadVersionInfo') ->with( - $this->equalTo(42), - $this->equalTo(7) + self::equalTo(42), + self::equalTo(7) )->will( - $this->returnValue(new SPIVersionInfo()) + self::returnValue(new SPIVersionInfo()) ); - $repository->expects($this->once())->method('beginTransaction'); + $repository->expects(self::once())->method('beginTransaction'); $spiLocations = [ new SPILocation(['id' => 1]), new SPILocation(['id' => 2]), ]; - $locationHandler->expects($this->once()) + $locationHandler->expects(self::once()) ->method('loadLocationsByContent') ->with(42) - ->will($this->returnValue($spiLocations)); + ->will(self::returnValue($spiLocations)); - $contentHandler->expects($this->once()) + $contentHandler->expects(self::once()) ->method('deleteContent') ->with(42); foreach ($spiLocations as $index => $spiLocation) { - $urlAliasHandler->expects($this->at($index)) + $urlAliasHandler->expects(self::at($index)) ->method('locationDeleted') ->with($spiLocation->id); } - $repository->expects($this->once())->method('commit'); + $repository->expects(self::once())->method('commit'); /* @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo */ $contentService->deleteContent($contentInfo); @@ -921,10 +924,10 @@ public function testDeleteContentWithRollback() $repository = $this->getRepositoryMock(); $permissionResolver = $this->getPermissionResolverMock(); - $permissionResolver->expects($this->once()) + $permissionResolver->expects(self::once()) ->method('canUser') ->with('content', 'remove') - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $contentService = $this->getPartlyMockedContentService(['internalLoadContentInfoById']); /** @var \PHPUnit\Framework\MockObject\MockObject $locationHandler */ @@ -932,12 +935,12 @@ public function testDeleteContentWithRollback() $contentInfo = $this->createMock(APIContentInfo::class); - $contentService->expects($this->once()) + $contentService->expects(self::once()) ->method('internalLoadContentInfoById') ->with(42) - ->will($this->returnValue($contentInfo)); + ->will(self::returnValue($contentInfo)); - $contentInfo->expects($this->any()) + $contentInfo->expects(self::any()) ->method('__get') ->willReturnMap( [ @@ -951,23 +954,23 @@ public function testDeleteContentWithRollback() $contentHandler = $this->getPersistenceMock()->contentHandler(); $contentHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadVersionInfo') ->with( - $this->equalTo(42), - $this->equalTo(7) + self::equalTo(42), + self::equalTo(7) )->will( - $this->returnValue(new SPIVersionInfo()) + self::returnValue(new SPIVersionInfo()) ); - $repository->expects($this->once())->method('beginTransaction'); + $repository->expects(self::once())->method('beginTransaction'); - $locationHandler->expects($this->once()) + $locationHandler->expects(self::once()) ->method('loadLocationsByContent') ->with(42) - ->will($this->throwException(new \Exception())); + ->will(self::throwException(new \Exception())); - $repository->expects($this->once())->method('rollback'); + $repository->expects(self::once())->method('rollback'); /* @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo */ $contentService->deleteContent($contentInfo); @@ -986,12 +989,12 @@ public function testDeleteVersionThrowsBadStateExceptionLastVersion() $permissionResolver = $this->getPermissionResolverMock(); $permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('canUser') ->with('content', 'versionremove') - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $repository - ->expects($this->never()) + ->expects(self::never()) ->method('beginTransaction'); $contentService = $this->getPartlyMockedContentService(); @@ -1001,16 +1004,16 @@ public function testDeleteVersionThrowsBadStateExceptionLastVersion() $versionInfo = $this->createMock(APIVersionInfo::class); $contentInfo - ->expects($this->any()) + ->expects(self::any()) ->method('__get') ->with('id') - ->will($this->returnValue(42)); + ->will(self::returnValue(42)); $versionInfo - ->expects($this->any()) + ->expects(self::any()) ->method('__get') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['versionNo', 123], ['contentInfo', $contentInfo], @@ -1018,15 +1021,15 @@ public function testDeleteVersionThrowsBadStateExceptionLastVersion() ) ); $versionInfo - ->expects($this->once()) + ->expects(self::once()) ->method('isPublished') ->willReturn(false); $contentHandler - ->expects($this->once()) + ->expects(self::once()) ->method('listVersions') ->with(42) - ->will($this->returnValue(['version'])); + ->will(self::returnValue(['version'])); /* @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo $versionInfo */ $contentService->deleteVersion($versionInfo); @@ -1075,9 +1078,9 @@ public function testCreateContentThrowsUnauthorizedException() $repositoryMock = $this->getRepositoryMock(); $permissionResolver = $this->getPermissionResolverMock(); - $permissionResolver->expects($this->once()) + $permissionResolver->expects(self::once()) ->method('getCurrentUserReference') - ->will($this->returnValue(new UserReference(169))); + ->will(self::returnValue(new UserReference(169))); $mockedService = $this->getPartlyMockedContentService(); $contentTypeServiceMock = $this->getContentTypeServiceMock(); @@ -1096,23 +1099,23 @@ public function testCreateContentThrowsUnauthorizedException() ] ); - $contentTypeServiceMock->expects($this->once()) + $contentTypeServiceMock->expects(self::once()) ->method('loadContentType') - ->with($this->equalTo(123)) - ->will($this->returnValue($contentType)); + ->with(self::equalTo(123)) + ->will(self::returnValue($contentType)); - $repositoryMock->expects($this->once()) + $repositoryMock->expects(self::once()) ->method('getContentTypeService') - ->will($this->returnValue($contentTypeServiceMock)); + ->will(self::returnValue($contentTypeServiceMock)); - $permissionResolver->expects($this->once()) + $permissionResolver->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('content'), - $this->equalTo('create'), - $this->isInstanceOf(get_class($contentCreateStruct)), - $this->equalTo([]) - )->will($this->returnValue(false)); + self::equalTo('content'), + self::equalTo('create'), + self::isInstanceOf(get_class($contentCreateStruct)), + self::equalTo([]) + )->will(self::returnValue(false)); $mockedService->createContent( new ContentCreateStruct( @@ -1129,6 +1132,7 @@ public function testCreateContentThrowsUnauthorizedException() * Test for the createContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent + * * @exceptionMessage Argument '$contentCreateStruct' is invalid: Another content with remoteId 'faraday' exists */ public function testCreateContentThrowsInvalidArgumentExceptionDuplicateRemoteId() @@ -1138,7 +1142,7 @@ public function testCreateContentThrowsInvalidArgumentExceptionDuplicateRemoteId $repositoryMock = $this->getRepositoryMock(); $permissionResolverMock = $this->getPermissionResolverMock(); $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('getCurrentUserReference') ->willReturn($this->createMock(UserReference::class)); @@ -1160,28 +1164,28 @@ public function testCreateContentThrowsInvalidArgumentExceptionDuplicateRemoteId ] ); - $contentTypeServiceMock->expects($this->once()) + $contentTypeServiceMock->expects(self::once()) ->method('loadContentType') - ->with($this->equalTo(123)) - ->will($this->returnValue($contentType)); + ->with(self::equalTo(123)) + ->will(self::returnValue($contentType)); - $repositoryMock->expects($this->once()) + $repositoryMock->expects(self::once()) ->method('getContentTypeService') - ->will($this->returnValue($contentTypeServiceMock)); + ->will(self::returnValue($contentTypeServiceMock)); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('content'), - $this->equalTo('create'), - $this->isInstanceOf(get_class($contentCreateStruct)), - $this->equalTo([]) - )->will($this->returnValue(true)); + self::equalTo('content'), + self::equalTo('create'), + self::isInstanceOf(get_class($contentCreateStruct)), + self::equalTo([]) + )->will(self::returnValue(true)); - $mockedService->expects($this->once()) + $mockedService->expects(self::once()) ->method('loadContentByRemoteId') ->with($contentCreateStruct->remoteId) - ->will($this->returnValue($this->createMock(Content::class))); + ->will(self::returnValue($this->createMock(Content::class))); $mockedService->createContent( new ContentCreateStruct( @@ -1532,6 +1536,7 @@ public function providerForTestCreateContentNonRedundantFieldSet1() * @covers \Ibexa\Contracts\Core\Repository\ContentService::cloneField * @covers \Ibexa\Contracts\Core\Repository\ContentService::getDefaultObjectStates * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent + * * @dataProvider providerForTestCreateContentNonRedundantFieldSet1 */ public function testCreateContentNonRedundantFieldSet1($mainLanguageCode, $structFields, $spiFields) @@ -1634,6 +1639,7 @@ public function providerForTestCreateContentNonRedundantFieldSet2() * @covers \Ibexa\Contracts\Core\Repository\ContentService::cloneField * @covers \Ibexa\Contracts\Core\Repository\ContentService::getDefaultObjectStates * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent + * * @dataProvider providerForTestCreateContentNonRedundantFieldSet2 */ public function testCreateContentNonRedundantFieldSet2($mainLanguageCode, $structFields, $spiFields) @@ -1846,6 +1852,7 @@ protected function fixturesForTestCreateContentNonRedundantFieldSetComplex() * @covers \Ibexa\Contracts\Core\Repository\ContentService::cloneField * @covers \Ibexa\Contracts\Core\Repository\ContentService::getDefaultObjectStates * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent + * * @dataProvider providerForTestCreateContentNonRedundantFieldSetComplex */ public function testCreateContentNonRedundantFieldSetComplex($mainLanguageCode, $structFields, $spiFields) @@ -1895,6 +1902,7 @@ public function providerForTestCreateContentWithInvalidLanguage() * * @covers \Ibexa\Contracts\Core\Repository\ContentService::getLanguageCodesForCreate * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent + * * @dataProvider providerForTestCreateContentWithInvalidLanguage */ public function testCreateContentWithInvalidLanguage($mainLanguageCode, $structFields) @@ -1941,11 +1949,11 @@ public function testCreateContentWithInvalidLanguage($mainLanguageCode, $structF ] ); - $languageHandlerMock->expects($this->any()) + $languageHandlerMock->expects(self::any()) ->method('loadByLanguageCode') - ->with($this->isType('string')) + ->with(self::isType('string')) ->will( - $this->returnCallback( + self::returnCallback( static function ($languageCode) { if ($languageCode === 'Klingon') { throw new NotFoundException('Language', 'Klingon'); @@ -1956,25 +1964,25 @@ static function ($languageCode) { ) ); - $contentTypeServiceMock->expects($this->once()) + $contentTypeServiceMock->expects(self::once()) ->method('loadContentType') - ->with($this->equalTo($contentType->id)) - ->will($this->returnValue($contentType)); + ->with(self::equalTo($contentType->id)) + ->will(self::returnValue($contentType)); - $repositoryMock->expects($this->once()) + $repositoryMock->expects(self::once()) ->method('getContentTypeService') - ->will($this->returnValue($contentTypeServiceMock)); + ->will(self::returnValue($contentTypeServiceMock)); $that = $this; - $permissionResolver->expects($this->any()) + $permissionResolver->expects(self::any()) ->method('canUser') ->with( - $this->equalTo('content'), - $this->equalTo('create'), - $this->isInstanceOf(APIContentCreateStruct::class), - $this->equalTo([]) + self::equalTo('content'), + self::equalTo('create'), + self::isInstanceOf(APIContentCreateStruct::class), + self::equalTo([]) )->will( - $this->returnCallback( + self::returnCallback( static function () use ($that, $contentCreateStruct) { $that->assertEquals($contentCreateStruct, func_get_arg(2)); @@ -1983,11 +1991,11 @@ static function () use ($that, $contentCreateStruct) { ) ); - $domainMapperMock->expects($this->once()) + $domainMapperMock->expects(self::once()) ->method('getUniqueHash') - ->with($this->isInstanceOf(APIContentCreateStruct::class)) + ->with(self::isInstanceOf(APIContentCreateStruct::class)) ->will( - $this->returnCallback( + self::returnCallback( static function ($object) use ($that, $contentCreateStruct) { $that->assertEquals($contentCreateStruct, $object); @@ -2010,10 +2018,10 @@ protected function assertForCreateContentContentValidationException( $permissionResolver = $this->getPermissionResolverMock(); $fieldTypeMock = $this->createMock(FieldType::class); - $fieldTypeMock->expects($this->any()) + $fieldTypeMock->expects(self::any()) ->method('acceptValue') ->will( - $this->returnCallback( + self::returnCallback( static function ($valueString) { return new ValueStub($valueString); } @@ -2040,29 +2048,29 @@ static function ($valueString) { ] ); - $contentTypeServiceMock->expects($this->once()) + $contentTypeServiceMock->expects(self::once()) ->method('loadContentType') - ->with($this->equalTo(123)) - ->will($this->returnValue($contentType)); + ->with(self::equalTo(123)) + ->will(self::returnValue($contentType)); - $repositoryMock->expects($this->once()) + $repositoryMock->expects(self::once()) ->method('getContentTypeService') - ->will($this->returnValue($contentTypeServiceMock)); + ->will(self::returnValue($contentTypeServiceMock)); - $permissionResolver->expects($this->any()) + $permissionResolver->expects(self::any()) ->method('canUser') ->with( - $this->equalTo('content'), - $this->equalTo('create'), - $this->isInstanceOf(get_class($contentCreateStruct)), - $this->equalTo([]) - )->will($this->returnValue(true)); + self::equalTo('content'), + self::equalTo('create'), + self::isInstanceOf(get_class($contentCreateStruct)), + self::equalTo([]) + )->will(self::returnValue(true)); - $mockedService->expects($this->any()) + $mockedService->expects(self::any()) ->method('loadContentByRemoteId') ->with($contentCreateStruct->remoteId) ->will( - $this->throwException(new NotFoundException('Content', 'faraday')) + self::throwException(new NotFoundException('Content', 'faraday')) ); $mockedService->createContent($contentCreateStruct, []); @@ -2092,6 +2100,7 @@ public function providerForTestCreateContentThrowsContentValidationExceptionFiel * @covers \Ibexa\Contracts\Core\Repository\ContentService::getLanguageCodesForCreate * @covers \Ibexa\Contracts\Core\Repository\ContentService::mapFieldsForCreate * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent + * * @dataProvider providerForTestCreateContentThrowsContentValidationExceptionFieldDefinition */ public function testCreateContentThrowsContentValidationExceptionFieldDefinition($mainLanguageCode, $structFields) @@ -2130,6 +2139,7 @@ public function providerForTestCreateContentThrowsContentValidationExceptionTran * @covers \Ibexa\Contracts\Core\Repository\ContentService::getLanguageCodesForCreate * @covers \Ibexa\Contracts\Core\Repository\ContentService::mapFieldsForCreate * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent + * * @dataProvider providerForTestCreateContentThrowsContentValidationExceptionTranslation */ public function testCreateContentThrowsContentValidationExceptionTranslation($mainLanguageCode, $structFields) @@ -2310,6 +2320,7 @@ public function providerForTestCreateContentThrowsContentValidationExceptionRequ * @covers \Ibexa\Contracts\Core\Repository\ContentService::getLanguageCodesForCreate * @covers \Ibexa\Contracts\Core\Repository\ContentService::mapFieldsForCreate * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent + * * @dataProvider providerForTestCreateContentThrowsContentValidationExceptionRequiredField */ public function testCreateContentRequiredField( @@ -2343,7 +2354,7 @@ public function testCreateContentRequiredField( try { $mockedService->createContent($contentCreateStruct, []); } catch (ContentValidationException $e) { - $this->assertEquals( + self::assertEquals( "Value for required field definition '{$identifier}' with language '{$languageCode}' is empty", $e->getMessage() ); @@ -2447,7 +2458,7 @@ static function () use ($that, $contentCreateStruct) { $fieldTypeMock ->method('acceptValue') ->will( - $this->returnCallback( + self::returnCallback( static function ($value) { return $value instanceof SPIValue ? $value @@ -2459,7 +2470,7 @@ static function ($value) { $fieldTypeMock ->method('isEmptyValue') ->will( - $this->returnCallback( + self::returnCallback( static function (ValueStub $value) use ($emptyValue) { return (string)$emptyValue === (string)$value; } @@ -2497,6 +2508,7 @@ public function providerForTestCreateContentThrowsContentFieldValidationExceptio * @covers \Ibexa\Contracts\Core\Repository\ContentService::getLanguageCodesForCreate * @covers \Ibexa\Contracts\Core\Repository\ContentService::mapFieldsForCreate * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent + * * @dataProvider providerForTestCreateContentThrowsContentFieldValidationException */ public function testCreateContentThrowsContentFieldValidationException($mainLanguageCode, $structFields): void @@ -2517,7 +2529,7 @@ public function testCreateContentThrowsContentFieldValidationException($mainLang try { $mockedService->createContent($contentCreateStruct); } catch (ContentFieldValidationException $e) { - $this->assertEquals($allFieldErrors, $e->getFieldErrors()); + self::assertEquals($allFieldErrors, $e->getFieldErrors()); throw $e; } } @@ -2641,41 +2653,41 @@ public function testCreateContentWithLocations() $spiLocationCreateStruct = new SPILocation\CreateStruct(); $parentLocation = new Location(['contentInfo' => new ContentInfo(['sectionId' => 1])]); - $locationServiceMock->expects($this->at(0)) + $locationServiceMock->expects(self::at(0)) ->method('loadLocation') - ->with($this->equalTo(321)) - ->will($this->returnValue($parentLocation)); + ->with(self::equalTo(321)) + ->will(self::returnValue($parentLocation)); - $locationServiceMock->expects($this->at(1)) + $locationServiceMock->expects(self::at(1)) ->method('loadLocation') - ->with($this->equalTo(654)) - ->will($this->returnValue($parentLocation)); + ->with(self::equalTo(654)) + ->will(self::returnValue($parentLocation)); - $repositoryMock->expects($this->atLeastOnce()) + $repositoryMock->expects(self::atLeastOnce()) ->method('getLocationService') - ->will($this->returnValue($locationServiceMock)); + ->will(self::returnValue($locationServiceMock)); - $domainMapperMock->expects($this->at(1)) + $domainMapperMock->expects(self::at(1)) ->method('buildSPILocationCreateStruct') ->with( - $this->equalTo($locationCreateStruct1), - $this->equalTo($parentLocation), - $this->equalTo(true), - $this->equalTo(null), - $this->equalTo(null), - $this->equalTo(false) - )->will($this->returnValue($spiLocationCreateStruct)); - - $domainMapperMock->expects($this->at(2)) + self::equalTo($locationCreateStruct1), + self::equalTo($parentLocation), + self::equalTo(true), + self::equalTo(null), + self::equalTo(null), + self::equalTo(false) + )->will(self::returnValue($spiLocationCreateStruct)); + + $domainMapperMock->expects(self::at(2)) ->method('buildSPILocationCreateStruct') ->with( - $this->equalTo($locationCreateStruct2), - $this->equalTo($parentLocation), - $this->equalTo(false), - $this->equalTo(null), - $this->equalTo(null), - $this->equalTo(false) - )->will($this->returnValue($spiLocationCreateStruct)); + self::equalTo($locationCreateStruct2), + self::equalTo($parentLocation), + self::equalTo(false), + self::equalTo(null), + self::equalTo(null), + self::equalTo(false) + )->will(self::returnValue($spiLocationCreateStruct)); $spiContentCreateStruct = new SPIContentCreateStruct( [ @@ -2704,20 +2716,20 @@ public function testCreateContentWithLocations() ] ); - $handlerMock->expects($this->once()) + $handlerMock->expects(self::once()) ->method('create') - ->with($this->logicalOr($spiContentCreateStruct, $spiContentCreateStruct2)) - ->will($this->returnValue($spiContent)); + ->with(self::logicalOr($spiContentCreateStruct, $spiContentCreateStruct2)) + ->will(self::returnValue($spiContent)); - $domainMapperMock->expects($this->once()) + $domainMapperMock->expects(self::once()) ->method('buildContentDomainObject') ->with( - $this->isInstanceOf(SPIContent::class), - $this->isInstanceOf(APIContentType::class) + self::isInstanceOf(SPIContent::class), + self::isInstanceOf(APIContentType::class) ) ->willReturn($this->createMock(APIContent::class)); - $repositoryMock->expects($this->once())->method('commit'); + $repositoryMock->expects(self::once())->method('commit'); // Execute $mockedService->createContent($contentCreateStruct, $locationCreateStructs); @@ -2786,11 +2798,11 @@ public function testCreateContentWithLocationsDuplicateUnderParent() ] ); - $languageHandlerMock->expects($this->any()) + $languageHandlerMock->expects(self::any()) ->method('loadByLanguageCode') - ->with($this->isType('string')) + ->with(self::isType('string')) ->will( - $this->returnCallback( + self::returnCallback( static function () { return new Language(['id' => 4242]); } @@ -2798,10 +2810,10 @@ static function () { ); $fieldTypeMock = $this->createMock(FieldType::class); - $fieldTypeMock->expects($this->any()) + $fieldTypeMock->expects(self::any()) ->method('acceptValue') ->will( - $this->returnCallback( + self::returnCallback( static function ($valueString) { return new ValueStub($valueString); } @@ -2811,25 +2823,25 @@ static function ($valueString) { $this->toHashFieldTypeMock($fieldTypeMock); $this->getFieldTypeFieldTypeRegistryMock($fieldTypeMock); - $contentTypeServiceMock->expects($this->once()) + $contentTypeServiceMock->expects(self::once()) ->method('loadContentType') - ->with($this->equalTo($contentType->id)) - ->will($this->returnValue($contentType)); + ->with(self::equalTo($contentType->id)) + ->will(self::returnValue($contentType)); - $repositoryMock->expects($this->once()) + $repositoryMock->expects(self::once()) ->method('getContentTypeService') - ->will($this->returnValue($contentTypeServiceMock)); + ->will(self::returnValue($contentTypeServiceMock)); $that = $this; - $permissionResolver->expects($this->once()) + $permissionResolver->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('content'), - $this->equalTo('create'), - $this->isInstanceOf(APIContentCreateStruct::class), - $this->equalTo($locationCreateStructs) + self::equalTo('content'), + self::equalTo('create'), + self::isInstanceOf(APIContentCreateStruct::class), + self::equalTo($locationCreateStructs) )->will( - $this->returnCallback( + self::returnCallback( static function () use ($that, $contentCreateStruct) { $that->assertEquals($contentCreateStruct, func_get_arg(2)); @@ -2838,11 +2850,11 @@ static function () use ($that, $contentCreateStruct) { ) ); - $domainMapperMock->expects($this->once()) + $domainMapperMock->expects(self::once()) ->method('getUniqueHash') - ->with($this->isInstanceOf(APIContentCreateStruct::class)) + ->with(self::isInstanceOf(APIContentCreateStruct::class)) ->will( - $this->returnCallback( + self::returnCallback( static function ($object) use ($that, $contentCreateStruct) { $that->assertEquals($contentCreateStruct, $object); @@ -2851,31 +2863,31 @@ static function ($object) use ($that, $contentCreateStruct) { ) ); - $locationServiceMock->expects($this->once()) + $locationServiceMock->expects(self::once()) ->method('loadLocation') - ->with($this->equalTo(321)) - ->will($this->returnValue($parentLocation)); + ->with(self::equalTo(321)) + ->will(self::returnValue($parentLocation)); - $repositoryMock->expects($this->any()) + $repositoryMock->expects(self::any()) ->method('getLocationService') - ->will($this->returnValue($locationServiceMock)); + ->will(self::returnValue($locationServiceMock)); - $domainMapperMock->expects($this->any()) + $domainMapperMock->expects(self::any()) ->method('buildSPILocationCreateStruct') ->with( - $this->equalTo($locationCreateStruct), - $this->equalTo($parentLocation), - $this->equalTo(true), - $this->equalTo(null), - $this->equalTo(null), - $this->equalTo(false) - )->will($this->returnValue($spiLocationCreateStruct)); + self::equalTo($locationCreateStruct), + self::equalTo($parentLocation), + self::equalTo(true), + self::equalTo(null), + self::equalTo(null), + self::equalTo(false) + )->will(self::returnValue($spiLocationCreateStruct)); $fieldTypeMock = $this->createMock(SPIFieldType::class); $fieldTypeMock ->method('acceptValue') ->will( - $this->returnCallback( + self::returnCallback( static function ($valueString) { return new ValueStub($valueString); } @@ -2884,7 +2896,7 @@ static function ($valueString) { $this->getFieldTypeRegistryMock() ->method('getFieldType') - ->will($this->returnValue($fieldTypeMock)); + ->will(self::returnValue($fieldTypeMock)); $mockedService->createContent( $contentCreateStruct, @@ -2979,20 +2991,20 @@ public function testCreateContentObjectStates() ] ); - $handlerMock->expects($this->once()) + $handlerMock->expects(self::once()) ->method('create') - ->with($this->equalTo($spiContentCreateStruct)) - ->will($this->returnValue($spiContent)); + ->with(self::equalTo($spiContentCreateStruct)) + ->will(self::returnValue($spiContent)); - $domainMapperMock->expects($this->once()) + $domainMapperMock->expects(self::once()) ->method('buildContentDomainObject') ->with( - $this->isInstanceOf(SPIContent::class), - $this->isInstanceOf(APIContentType::class) + self::isInstanceOf(SPIContent::class), + self::isInstanceOf(APIContentType::class) ) ->willReturn($this->createMock(APIContent::class)); - $repositoryMock->expects($this->once())->method('commit'); + $repositoryMock->expects(self::once())->method('commit'); // Execute $mockedService->createContent($contentCreateStruct, []); @@ -3005,6 +3017,7 @@ public function testCreateContentObjectStates() * @covers \Ibexa\Contracts\Core\Repository\ContentService::mapFieldsForCreate * @covers \Ibexa\Contracts\Core\Repository\ContentService::getDefaultObjectStates * @covers \Ibexa\Contracts\Core\Repository\ContentService::createContent + * * @dataProvider providerForTestCreateContentThrowsContentValidationExceptionTranslation */ public function testCreateContentWithRollback() @@ -3038,15 +3051,15 @@ public function testCreateContentWithRollback() ); $repositoryMock = $this->getRepositoryMock(); - $repositoryMock->expects($this->never())->method('commit'); - $repositoryMock->expects($this->once())->method('rollback'); + $repositoryMock->expects(self::never())->method('commit'); + $repositoryMock->expects(self::once())->method('rollback'); /** @var \PHPUnit\Framework\MockObject\MockObject $contentHandlerMock */ $contentHandlerMock = $this->getPersistenceMock()->contentHandler(); - $contentHandlerMock->expects($this->once()) + $contentHandlerMock->expects(self::once()) ->method('create') - ->with($this->anything()) - ->will($this->throwException(new \Exception('Store failed'))); + ->with(self::anything()) + ->will(self::throwException(new \Exception('Store failed'))); // Execute $this->partlyMockedContentService->createContent($contentCreateStruct, []); @@ -3064,6 +3077,7 @@ public function providerForTestUpdateContentThrowsBadStateException() * Test for the updateContent() method. * * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent + * * @dataProvider providerForTestUpdateContentThrowsBadStateException */ public function testUpdateContentThrowsBadStateException($status) @@ -3089,22 +3103,22 @@ public function testUpdateContentThrowsBadStateException($status) $mockedService ->method('loadContent') ->with( - $this->equalTo(42), - $this->equalTo(null), - $this->equalTo(7) + self::equalTo(42), + self::equalTo(null), + self::equalTo(7) )->will( - $this->returnValue($content) + self::returnValue($content) ); $mockedService ->method('internalLoadContentById') ->will( - $this->returnValue($content) + self::returnValue($content) ); $permissionResolverMock = $this->getPermissionResolverMock(); $permissionResolverMock ->method('canUser') - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $contentUpdateStruct = new ContentUpdateStruct(); @@ -3138,24 +3152,24 @@ public function testUpdateContentThrowsUnauthorizedException() ] ); - $mockedService->expects($this->once()) + $mockedService->expects(self::once()) ->method('loadContent') ->with( - $this->equalTo(42), - $this->equalTo(null), - $this->equalTo(7) + self::equalTo(42), + self::equalTo(null), + self::equalTo(7) )->will( - $this->returnValue($content) + self::returnValue($content) ); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('content'), - $this->equalTo('edit'), - $this->equalTo($content), - $this->isType('array') - )->will($this->returnValue(false)); + self::equalTo('content'), + self::equalTo('edit'), + self::equalTo($content), + self::isType('array') + )->will(self::returnValue(false)); $mockedService->updateContent($versionInfo, $contentUpdateStruct); } @@ -3314,7 +3328,7 @@ protected function assertForTestUpdateContentNonRedundantFieldSet( $repositoryMock = $this->getRepositoryMock(); $permissionResolverMock = $this->getPermissionResolverMock(); $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('getCurrentUserReference') ->willReturn(new UserReference(169)); $mockedService = $this->getPartlyMockedContentService(['internalLoadContentById', 'internalLoadRelations'], $permissionResolverMock); @@ -3366,11 +3380,11 @@ static function (Field $field) { ] ); - $languageHandlerMock->expects($this->any()) + $languageHandlerMock->expects(self::any()) ->method('loadByLanguageCode') - ->with($this->isType('string')) + ->with(self::isType('string')) ->will( - $this->returnCallback( + self::returnCallback( static function () { return new Language(['id' => 4242]); } @@ -3380,32 +3394,32 @@ static function () { $mockedService ->method('internalLoadContentById') ->with( - $this->equalTo(42), - $this->equalTo(null), - $this->equalTo(7) + self::equalTo(42), + self::equalTo(null), + self::equalTo(7) )->will( - $this->returnValue($content) + self::returnValue($content) ); - $repositoryMock->expects($this->once())->method('beginTransaction'); + $repositoryMock->expects(self::once())->method('beginTransaction'); - $permissionResolverMock->expects($this->any()) + $permissionResolverMock->expects(self::any()) ->method('canUser') - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); - $contentTypeServiceMock->expects($this->once()) + $contentTypeServiceMock->expects(self::once()) ->method('loadContentType') - ->with($this->equalTo(24)) - ->will($this->returnValue($contentType)); + ->with(self::equalTo(24)) + ->will(self::returnValue($contentType)); - $repositoryMock->expects($this->once()) + $repositoryMock->expects(self::once()) ->method('getContentTypeService') - ->will($this->returnValue($contentTypeServiceMock)); + ->will(self::returnValue($contentTypeServiceMock)); - $fieldTypeMock->expects($this->any()) + $fieldTypeMock->expects(self::any()) ->method('acceptValue') ->will( - $this->returnCallback( + self::returnCallback( static function ($value) { return $value instanceof SPIValue ? $value @@ -3417,41 +3431,41 @@ static function ($value) { $this->toHashFieldTypeMock($fieldTypeMock); $emptyValue = new ValueStub(self::EMPTY_FIELD_VALUE); - $fieldTypeMock->expects($this->any()) + $fieldTypeMock->expects(self::any()) ->method('toPersistenceValue') ->will( - $this->returnCallback( + self::returnCallback( static function (ValueStub $value) { return (string)$value; } ) ); - $fieldTypeMock->expects($this->any()) + $fieldTypeMock->expects(self::any()) ->method('isEmptyValue') ->will( - $this->returnCallback( + self::returnCallback( static function (SPIValue $value) use ($emptyValue) { return (string)$emptyValue === (string)$value; } ) ); - $fieldTypeMock->expects($this->any()) + $fieldTypeMock->expects(self::any()) ->method('validate') - ->will($this->returnValue([])); + ->will(self::returnValue([])); $this->getFieldTypeFieldTypeRegistryMock($fieldTypeMock); $relationProcessorMock - ->expects($this->exactly(count($fieldDefinitions) * count($languageCodes))) + ->expects(self::exactly(count($fieldDefinitions) * count($languageCodes))) ->method('appendFieldRelations') ->with( - $this->isType('array'), - $this->isType('array'), - $this->isInstanceOf(SPIFieldType::class), - $this->isInstanceOf(Value::class), - $this->anything() + self::isType('array'), + self::isType('array'), + self::isInstanceOf(SPIFieldType::class), + self::isInstanceOf(Value::class), + self::anything() ); $values = $this->determineValuesForUpdate( @@ -3461,27 +3475,27 @@ static function (SPIValue $value) use ($emptyValue) { $fieldDefinitions, $languageCodes ); - $nameSchemaServiceMock->expects($this->once()) + $nameSchemaServiceMock->expects(self::once()) ->method('resolveContentNameSchema') ->with( - $this->equalTo($content), - $this->equalTo($values), - $this->equalTo($languageCodes) - )->will($this->returnValue([])); + self::equalTo($content), + self::equalTo($values), + self::equalTo($languageCodes) + )->will(self::returnValue([])); $existingRelations = ['RELATIONS!!!']; $mockedService ->method('internalLoadRelations') ->with($content->versionInfo) - ->will($this->returnValue($existingRelations)); - $relationProcessorMock->expects($this->any()) + ->will(self::returnValue($existingRelations)); + $relationProcessorMock->expects(self::any()) ->method('processFieldRelations') ->with( - $this->isType('array'), - $this->equalTo(42), - $this->isType('int'), - $this->equalTo($contentType), - $this->equalTo($existingRelations) + self::isType('array'), + self::equalTo(42), + self::isType('int'), + self::equalTo($contentType), + self::equalTo($existingRelations) ); $contentUpdateStruct = new ContentUpdateStruct( @@ -3522,23 +3536,23 @@ static function (SPIValue $value) use ($emptyValue) { ] ); - $contentHandlerMock->expects($this->once()) + $contentHandlerMock->expects(self::once()) ->method('updateContent') ->with( 42, 7, - $this->logicalOr($spiContentUpdateStruct, $spiContentUpdateStructTs1, $spiContentUpdateStructTs2, $spiContentUpdateStructTs3) + self::logicalOr($spiContentUpdateStruct, $spiContentUpdateStructTs1, $spiContentUpdateStructTs2, $spiContentUpdateStructTs3) ) - ->will($this->returnValue($spiContent)); + ->will(self::returnValue($spiContent)); - $repositoryMock->expects($this->once())->method('commit'); + $repositoryMock->expects(self::once())->method('commit'); $domainMapperMock ->method('buildContentDomainObject') ->with( - $this->isInstanceOf(SPIContent::class), - $this->isInstanceOf(APIContentType::class) + self::isInstanceOf(SPIContent::class), + self::isInstanceOf(APIContentType::class) ) - ->will($this->returnValue($content)); + ->will(self::returnValue($content)); $mockedService->updateContent($content->versionInfo, $contentUpdateStruct); } @@ -3607,6 +3621,7 @@ public function providerForTestUpdateContentNonRedundantFieldSet1() * @covers \Ibexa\Contracts\Core\Repository\ContentService::getLanguageCodesForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::mapFieldsForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent + * * @dataProvider providerForTestUpdateContentNonRedundantFieldSet1 */ public function testUpdateContentNonRedundantFieldSet1($initialLanguageCode, $structFields, $spiFields) @@ -3820,6 +3835,7 @@ public function providerForTestUpdateContentNonRedundantFieldSet2() * @covers \Ibexa\Contracts\Core\Repository\ContentService::getLanguageCodesForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::mapFieldsForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent + * * @dataProvider providerForTestUpdateContentNonRedundantFieldSet2 */ public function testUpdateContentNonRedundantFieldSet2($initialLanguageCode, $structFields, $spiFields) @@ -4082,6 +4098,7 @@ public function providerForTestUpdateContentNonRedundantFieldSet3() * @covers \Ibexa\Contracts\Core\Repository\ContentService::getLanguageCodesForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::mapFieldsForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent + * * @dataProvider providerForTestUpdateContentNonRedundantFieldSet3 */ public function testUpdateContentNonRedundantFieldSet3($initialLanguageCode, $structFields, $spiFields) @@ -4387,6 +4404,7 @@ public function providerForTestUpdateContentNonRedundantFieldSet4() * @covers \Ibexa\Contracts\Core\Repository\ContentService::getLanguageCodesForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::mapFieldsForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent + * * @dataProvider providerForTestUpdateContentNonRedundantFieldSet4 */ public function testUpdateContentNonRedundantFieldSet4($initialLanguageCode, $structFields, $spiFields) @@ -4767,6 +4785,7 @@ protected function fixturesForTestUpdateContentNonRedundantFieldSetComplex() * @covers \Ibexa\Contracts\Core\Repository\ContentService::getLanguageCodesForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::mapFieldsForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent + * * @dataProvider providerForTestUpdateContentNonRedundantFieldSetComplex */ public function testUpdateContentNonRedundantFieldSetComplex($initialLanguageCode, $structFields, $spiFields) @@ -4817,6 +4836,7 @@ public function providerForTestUpdateContentWithInvalidLanguage() * * @covers \Ibexa\Contracts\Core\Repository\ContentService::getLanguageCodesForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent + * * @dataProvider providerForTestUpdateContentWithInvalidLanguage */ public function testUpdateContentWithInvalidLanguage($initialLanguageCode, $structFields) @@ -4867,17 +4887,17 @@ public function testUpdateContentWithInvalidLanguage($initialLanguageCode, $stru ] ); - $fieldTypeMock->expects($this->any()) - ->method('acceptValue')->will($this->returnValue($fieldValueMock)); + $fieldTypeMock->expects(self::any()) + ->method('acceptValue')->will(self::returnValue($fieldValueMock)); - $this->getFieldTypeRegistryMock()->expects($this->any()) - ->method('getFieldType')->will($this->returnValue($fieldTypeMock)); + $this->getFieldTypeRegistryMock()->expects(self::any()) + ->method('getFieldType')->will(self::returnValue($fieldTypeMock)); - $languageHandlerMock->expects($this->any()) + $languageHandlerMock->expects(self::any()) ->method('loadByLanguageCode') - ->with($this->isType('string')) + ->with(self::isType('string')) ->will( - $this->returnCallback( + self::returnCallback( static function ($languageCode) { if ($languageCode === 'Klingon') { throw new NotFoundException('Language', 'Klingon'); @@ -4891,27 +4911,27 @@ static function ($languageCode) { $mockedService ->method('loadContent') ->with( - $this->equalTo(42), - $this->equalTo(null), - $this->equalTo(7) + self::equalTo(42), + self::equalTo(null), + self::equalTo(7) )->will( - $this->returnValue($content) + self::returnValue($content) ); $mockedService ->method('internalLoadContentById') ->will( - $this->returnValue($content) + self::returnValue($content) ); $permissionResolverMock ->method('canUser') ->with( - $this->equalTo('content'), - $this->equalTo('edit'), - $this->equalTo($content), - $this->isType('array') - )->will($this->returnValue(true)); + self::equalTo('content'), + self::equalTo('edit'), + self::equalTo($content), + self::isType('array') + )->will(self::returnValue(true)); $contentUpdateStruct = new ContentUpdateStruct( [ @@ -4962,7 +4982,7 @@ protected function assertForUpdateContentContentValidationException( $fieldTypeMock ->method('acceptValue') ->will( - $this->returnCallback( + self::returnCallback( static function ($value) { return $value instanceof SPIValue ? $value @@ -4973,14 +4993,14 @@ static function ($value) { $this->toHashFieldTypeMock($fieldTypeMock); - $this->getFieldTypeRegistryMock()->expects($this->any()) - ->method('getFieldType')->will($this->returnValue($fieldTypeMock)); + $this->getFieldTypeRegistryMock()->expects(self::any()) + ->method('getFieldType')->will(self::returnValue($fieldTypeMock)); - $languageHandlerMock->expects($this->any()) + $languageHandlerMock->expects(self::any()) ->method('loadByLanguageCode') - ->with($this->isType('string')) + ->with(self::isType('string')) ->will( - $this->returnCallback( + self::returnCallback( static function ($languageCode) { if ($languageCode === 'Klingon') { throw new NotFoundException('Language', 'Klingon'); @@ -4994,27 +5014,27 @@ static function ($languageCode) { $mockedService ->method('loadContent') ->with( - $this->equalTo(42), - $this->equalTo(null), - $this->equalTo(7) + self::equalTo(42), + self::equalTo(null), + self::equalTo(7) )->will( - $this->returnValue($content) + self::returnValue($content) ); $mockedService ->method('internalLoadContentById') ->will( - $this->returnValue($content) + self::returnValue($content) ); - $permissionResolverMock->expects($this->any()) + $permissionResolverMock->expects(self::any()) ->method('canUser') ->with( - $this->equalTo('content'), - $this->equalTo('edit'), - $this->equalTo($content), - $this->isType('array') - )->will($this->returnValue(true)); + self::equalTo('content'), + self::equalTo('edit'), + self::equalTo($content), + self::isType('array') + )->will(self::returnValue(true)); /* $contentTypeServiceMock->expects($this->once()) @@ -5093,6 +5113,7 @@ public function providerForTestUpdateContentThrowsContentValidationExceptionFiel * @covers \Ibexa\Contracts\Core\Repository\ContentService::getLanguageCodesForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::mapFieldsForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent + * * @dataProvider providerForTestUpdateContentThrowsContentValidationExceptionFieldDefinition */ public function testUpdateContentThrowsContentValidationExceptionFieldDefinition($initialLanguageCode, $structFields) @@ -5131,6 +5152,7 @@ public function providerForTestUpdateContentThrowsContentValidationExceptionTran * @covers \Ibexa\Contracts\Core\Repository\ContentService::getLanguageCodesForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::mapFieldsForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent + * * @dataProvider providerForTestUpdateContentThrowsContentValidationExceptionTranslation */ public function testUpdateContentThrowsContentValidationExceptionTranslation($initialLanguageCode, $structFields) @@ -5260,6 +5282,7 @@ public function providerForTestUpdateContentRequiredField() * @covers \Ibexa\Contracts\Core\Repository\ContentService::getLanguageCodesForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::mapFieldsForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent + * * @dataProvider providerForTestUpdateContentRequiredField */ public function testUpdateContentRequiredField( @@ -5303,7 +5326,7 @@ public function testUpdateContentRequiredField( try { $this->partlyMockedContentService->updateContent($versionInfo, $contentUpdateStruct); } catch (ContentValidationException $e) { - $this->assertEquals( + self::assertEquals( "Value for required field definition '{$identifier}' with language '{$languageCode}' is empty", $e->getMessage() ); @@ -5484,6 +5507,7 @@ public function providerForTestUpdateContentThrowsContentFieldValidationExceptio * @covers \Ibexa\Contracts\Core\Repository\ContentService::getLanguageCodesForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::mapFieldsForUpdate * @covers \Ibexa\Contracts\Core\Repository\ContentService::updateContent + * * @dataProvider providerForTestUpdateContentThrowsContentFieldValidationException */ public function testUpdateContentThrowsContentFieldValidationException( @@ -5508,7 +5532,7 @@ public function testUpdateContentThrowsContentFieldValidationException( try { $this->partlyMockedContentService->updateContent($versionInfo, $contentUpdateStruct); } catch (ContentFieldValidationException $e) { - $this->assertEquals($allFieldErrors, $e->getFieldErrors()); + self::assertEquals($allFieldErrors, $e->getFieldErrors()); throw $e; } } @@ -5561,18 +5585,18 @@ public function testUpdateContentTransactionRollback() ); $repositoryMock = $this->getRepositoryMock(); - $repositoryMock->expects($this->never())->method('commit'); - $repositoryMock->expects($this->once())->method('rollback'); + $repositoryMock->expects(self::never())->method('commit'); + $repositoryMock->expects(self::once())->method('rollback'); /** @var \PHPUnit\Framework\MockObject\MockObject $contentHandlerMock */ $contentHandlerMock = $this->getPersistenceMock()->contentHandler(); - $contentHandlerMock->expects($this->once()) + $contentHandlerMock->expects(self::once()) ->method('updateContent') ->with( - $this->anything(), - $this->anything(), - $this->anything() - )->will($this->throwException(new \Exception('Store failed'))); + self::anything(), + self::anything(), + self::anything() + )->will(self::throwException(new \Exception('Store failed'))); // Execute $this->partlyMockedContentService->updateContent($versionInfo, $contentUpdateStruct); @@ -5596,7 +5620,7 @@ public function testCopyContentThrowsUnauthorizedException() $locationServiceMock = $this->getLocationServiceMock(); $permissionResolver = $this->getPermissionResolverMock(); - $repository->expects($this->once()) + $repository->expects(self::once()) ->method('getLocationService') ->will(self::returnValue($locationServiceMock)); @@ -5723,7 +5747,7 @@ public function testCopyContent() ] ); $spiContent = new SPIContent(['versionInfo' => $spiVersionInfo]); - $contentHandlerMock->expects($this->once()) + $contentHandlerMock->expects(self::once()) ->method('copy') ->with(42, null) ->will(self::returnValue($spiContent)); @@ -5795,19 +5819,19 @@ public function testCopyContentWithVersionInfo() ->method('getPermissionResolver') ->willReturn($permissionResolverMock); - $repositoryMock->expects($this->exactly(3)) + $repositoryMock->expects(self::exactly(3)) ->method('getLocationService') - ->will($this->returnValue($locationServiceMock)); + ->will(self::returnValue($locationServiceMock)); - $locationServiceMock->expects($this->once()) + $locationServiceMock->expects(self::once()) ->method('loadLocation') ->with($locationCreateStruct->parentLocationId) - ->will($this->returnValue($location)); + ->will(self::returnValue($location)); - $contentInfoMock->expects($this->any()) + $contentInfoMock->expects(self::any()) ->method('__get') ->will( - $this->returnValueMap([ + self::returnValueMap([ ['isHidden', true], ['id', 42], ]) @@ -5815,28 +5839,28 @@ public function testCopyContentWithVersionInfo() $versionInfoMock = $this->createMock(APIVersionInfo::class); - $versionInfoMock->expects($this->any()) + $versionInfoMock->expects(self::any()) ->method('__get') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['versionNo', 123], ] ) ); - $versionInfoMock->expects($this->once()) + $versionInfoMock->expects(self::once()) ->method('isDraft') ->willReturn(true); $versionInfoMock ->method('getContentInfo') - ->will($this->returnValue($contentInfoMock)); + ->will(self::returnValue($contentInfoMock)); /** @var \PHPUnit\Framework\MockObject\MockObject $contentHandlerMock */ $contentHandlerMock = $this->getPersistenceMock()->contentHandler(); $domainMapperMock = $this->getContentDomainMapperMock(); - $repositoryMock->expects($this->once())->method('beginTransaction'); - $repositoryMock->expects($this->once())->method('commit'); + $repositoryMock->expects(self::once())->method('beginTransaction'); + $repositoryMock->expects(self::once())->method('commit'); $destinationLocationTarget = (new DestinationLocation($locationCreateStruct->parentLocationId, $contentInfoMock)); $permissionResolverMock @@ -5855,22 +5879,22 @@ public function testCopyContentWithVersionInfo() ] ); $spiContent = new SPIContent(['versionInfo' => $spiVersionInfo]); - $contentHandlerMock->expects($this->once()) + $contentHandlerMock->expects(self::once()) ->method('copy') ->with(42, 123) - ->will($this->returnValue($spiContent)); + ->will(self::returnValue($spiContent)); $this->mockGetDefaultObjectStates(); $this->mockSetDefaultObjectStates(); - $domainMapperMock->expects($this->once()) + $domainMapperMock->expects(self::once()) ->method('buildVersionInfoDomainObject') ->with($spiVersionInfo) - ->will($this->returnValue($versionInfoMock)); + ->will(self::returnValue($versionInfoMock)); /* @var \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo $versionInfoMock */ $content = $this->mockPublishVersion(123456, 126666, true); - $locationServiceMock->expects($this->once()) + $locationServiceMock->expects(self::once()) ->method('createLocation') ->with( $content->getVersionInfo()->getContentInfo(), @@ -5882,11 +5906,11 @@ public function testCopyContentWithVersionInfo() ->with( $content->id ) - ->will($this->returnValue($content)); + ->will(self::returnValue($content)); - $contentService->expects($this->once()) + $contentService->expects(self::once()) ->method('getUnixTimestamp') - ->will($this->returnValue(126666)); + ->will(self::returnValue(126666)); /* @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfoMock */ $contentService->copyContent($contentInfoMock, $locationCreateStruct, $versionInfoMock); @@ -5956,7 +5980,7 @@ public function testCopyContentWithRollback() $contentHandlerMock->expects(self::once()) ->method('copy') ->with(42, null) - ->will($this->throwException(new Exception('Handler threw an exception'))); + ->will(self::throwException(new Exception('Handler threw an exception'))); /* @var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfoMock */ $contentService->copyContent($contentInfoMock, $locationCreateStruct, null); @@ -5984,13 +6008,13 @@ private function mockBuildContentDomainObject(SPIContent $spiContent, array $tra 'fieldDefinitions' => new FieldDefinitionCollection([]), ]); - $repositoryMock->expects($this->once()) + $repositoryMock->expects(self::once()) ->method('getContentTypeService') ->willReturn($contentTypeServiceMock); $contentTypeServiceMock ->method('loadContentType') - ->with($this->equalTo($contentTypeId)) + ->with(self::equalTo($contentTypeId)) ->willReturn($contentType); $content = $this->createMock(APIContent::class); @@ -5998,7 +6022,7 @@ private function mockBuildContentDomainObject(SPIContent $spiContent, array $tra ->willReturn($contentType); $this->getContentDomainMapperMock() - ->expects($this->once()) + ->expects(self::once()) ->method('buildContentDomainObject') ->with($spiContent, $contentType, $translations ?? [], $useAlwaysAvailable) ->willReturn($content); @@ -6017,15 +6041,15 @@ protected function mockGetDefaultObjectStates() ]; /* @var \PHPUnit\Framework\MockObject\MockObject $objectStateHandlerMock */ - $objectStateHandlerMock->expects($this->once()) + $objectStateHandlerMock->expects(self::once()) ->method('loadAllGroups') - ->will($this->returnValue($objectStateGroups)); + ->will(self::returnValue($objectStateGroups)); - $objectStateHandlerMock->expects($this->at(1)) + $objectStateHandlerMock->expects(self::at(1)) ->method('loadObjectStates') - ->with($this->equalTo(10)) + ->with(self::equalTo(10)) ->will( - $this->returnValue( + self::returnValue( [ new SPIObjectState(['id' => 11, 'groupId' => 10]), new SPIObjectState(['id' => 12, 'groupId' => 10]), @@ -6033,11 +6057,11 @@ protected function mockGetDefaultObjectStates() ) ); - $objectStateHandlerMock->expects($this->at(2)) + $objectStateHandlerMock->expects(self::at(2)) ->method('loadObjectStates') - ->with($this->equalTo(20)) + ->with(self::equalTo(20)) ->will( - $this->returnValue( + self::returnValue( [ new SPIObjectState(['id' => 21, 'groupId' => 20]), new SPIObjectState(['id' => 22, 'groupId' => 20]), @@ -6056,7 +6080,7 @@ protected function mockSetDefaultObjectStates() new SPIObjectState(['id' => 21, 'groupId' => 20]), ]; foreach ($defaultObjectStates as $index => $objectState) { - $objectStateHandlerMock->expects($this->at($index + 3)) + $objectStateHandlerMock->expects(self::at($index + 3)) ->method('setContentState') ->with( 42, @@ -6089,10 +6113,10 @@ protected function mockPublishVersion($publicationDate = null, $modificationDate ]); $contentMock = $this->mockBuildContentDomainObject($spiContent); - $contentMock->expects($this->any()) + $contentMock->expects(self::any()) ->method('__get') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['id', 42], ['contentInfo', $contentInfoMock], @@ -6100,25 +6124,25 @@ protected function mockPublishVersion($publicationDate = null, $modificationDate ] ) ); - $contentMock->expects($this->any()) + $contentMock->expects(self::any()) ->method('getVersionInfo') - ->will($this->returnValue($versionInfoMock)); - $versionInfoMock->expects($this->any()) + ->will(self::returnValue($versionInfoMock)); + $versionInfoMock->expects(self::any()) ->method('getContentInfo') - ->will($this->returnValue($contentInfoMock)); - $versionInfoMock->expects($this->any()) + ->will(self::returnValue($contentInfoMock)); + $versionInfoMock->expects(self::any()) ->method('__get') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['languageCodes', ['eng-GB']], ] ) ); - $contentInfoMock->expects($this->any()) + $contentInfoMock->expects(self::any()) ->method('__get') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['alwaysAvailable', true], ['mainLanguageCode', 'eng-GB'], @@ -6136,14 +6160,14 @@ protected function mockPublishVersion($publicationDate = null, $modificationDate $metadataUpdateStruct->modificationDate = $modificationDate ?? $currentTime; $metadataUpdateStruct->isHidden = $isHidden; - $contentHandlerMock->expects($this->once()) + $contentHandlerMock->expects(self::once()) ->method('publish') ->with( 42, 123, $metadataUpdateStruct ) - ->will($this->returnValue($spiContent)); + ->will(self::returnValue($spiContent)); /* @var \Ibexa\Contracts\Core\Repository\Values\Content\Content $contentMock */ $this->mockPublishUrlAliasesForContent($contentMock); @@ -6162,41 +6186,41 @@ protected function mockPublishUrlAliasesForContent(APIContent $content) $locationServiceMock = $this->getLocationServiceMock(); $location = $this->createMock(APILocation::class); - $location->expects($this->at(0)) + $location->expects(self::at(0)) ->method('__get') ->with('id') - ->will($this->returnValue(123)); - $location->expects($this->at(1)) + ->will(self::returnValue(123)); + $location->expects(self::at(1)) ->method('__get') ->with('parentLocationId') - ->will($this->returnValue(456)); + ->will(self::returnValue(456)); $urlAliasNames = ['eng-GB' => 'hello']; - $nameSchemaServiceMock->expects($this->once()) + $nameSchemaServiceMock->expects(self::once()) ->method('resolveUrlAliasSchema') ->with($content) - ->will($this->returnValue($urlAliasNames)); + ->will(self::returnValue($urlAliasNames)); - $locationServiceMock->expects($this->once()) + $locationServiceMock->expects(self::once()) ->method('loadLocations') ->with($content->getVersionInfo()->getContentInfo()) - ->will($this->returnValue([$location])); + ->will(self::returnValue([$location])); - $urlAliasHandlerMock->expects($this->once()) + $urlAliasHandlerMock->expects(self::once()) ->method('publishUrlAliasForLocation') ->with(123, 456, 'hello', 'eng-GB', true, true); - $location->expects($this->at(2)) + $location->expects(self::at(2)) ->method('__get') ->with('id') - ->will($this->returnValue(123)); + ->will(self::returnValue(123)); - $location->expects($this->at(3)) + $location->expects(self::at(3)) ->method('__get') ->with('parentLocationId') - ->will($this->returnValue(456)); + ->will(self::returnValue(456)); - $urlAliasHandlerMock->expects($this->once()) + $urlAliasHandlerMock->expects(self::once()) ->method('archiveUrlAliasesForDeletedTranslations') ->with(123, 456, ['eng-GB']); } @@ -6307,7 +6331,7 @@ protected function getRepositoryMock(): Repository { $repositoryMock = parent::getRepositoryMock(); $repositoryMock - ->expects($this->any()) + ->expects(self::any()) ->method('getPermissionResolver') ->willReturn($this->getPermissionResolverMock()); diff --git a/tests/lib/Repository/Service/Mock/DomainMapperTest.php b/tests/lib/Repository/Service/Mock/DomainMapperTest.php index c30c109a72..2c93fa69f9 100644 --- a/tests/lib/Repository/Service/Mock/DomainMapperTest.php +++ b/tests/lib/Repository/Service/Mock/DomainMapperTest.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\Core\Repository\Service\Mock; use DateTime; @@ -42,11 +43,11 @@ class DomainMapperTest extends BaseServiceMockTest public function testBuildVersionInfo(SPIVersionInfo $spiVersionInfo) { $languageHandlerMock = $this->getLanguageHandlerMock(); - $languageHandlerMock->expects($this->never())->method('load'); + $languageHandlerMock->expects(self::never())->method('load'); $versionInfo = $this->getContentDomainMapper()->buildVersionInfoDomainObject($spiVersionInfo); - $this->assertInstanceOf(APIVersionInfo::class, $versionInfo); + self::assertInstanceOf(APIVersionInfo::class, $versionInfo); } public function testBuildLocationWithContentForRootLocation() @@ -86,10 +87,10 @@ public function testBuildLocationWithContentForRootLocation() ]), ]); - $this->assertInstanceOf(APILocation::class, $apiRootLocation); - $this->assertEquals($spiRootLocation->id, $apiRootLocation->id); - $this->assertEquals($expectedContentInfo->id, $apiRootLocation->getContentInfo()->id); - $this->assertEquals($expectedContent, $apiRootLocation->getContent()); + self::assertInstanceOf(APILocation::class, $apiRootLocation); + self::assertEquals($spiRootLocation->id, $apiRootLocation->id); + self::assertEquals($expectedContentInfo->id, $apiRootLocation->getContentInfo()->id); + self::assertEquals($expectedContent, $apiRootLocation->getContent()); } public function testBuildLocationWithContentThrowsInvalidArgumentException() @@ -106,7 +107,7 @@ public function testBuildLocationWithContentIsAlignedWithBuildLocation() { $spiRootLocation = new Location(['id' => 1, 'parentId' => 1]); - $this->assertEquals( + self::assertEquals( $this->getContentDomainMapper()->buildLocationWithContent($spiRootLocation, null), $this->getContentDomainMapper()->buildLocation($spiRootLocation) ); @@ -229,7 +230,7 @@ public function testBuildLocationDomainObjectsOnSearchResult( ) { $contentHandlerMock = $this->getContentHandlerMock(); $contentHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadContentInfoList') ->with($contentIds) ->willReturn($contentInfoList); @@ -241,17 +242,17 @@ public function testBuildLocationDomainObjectsOnSearchResult( $spiResult = clone $result; $missingLocations = $this->getContentDomainMapper()->buildLocationDomainObjectsOnSearchResult($result, $languageFilter); - $this->assertIsArray($missingLocations); + self::assertIsArray($missingLocations); if (!$missing) { - $this->assertEmpty($missingLocations); + self::assertEmpty($missingLocations); } else { - $this->assertNotEmpty($missingLocations); + self::assertNotEmpty($missingLocations); } - $this->assertCount($missing, $missingLocations); - $this->assertEquals($spiResult->totalCount - $missing, $result->totalCount); - $this->assertCount(count($spiResult->searchHits) - $missing, $result->searchHits); + self::assertCount($missing, $missingLocations); + self::assertEquals($spiResult->totalCount - $missing, $result->totalCount); + self::assertCount(count($spiResult->searchHits) - $missing, $result->searchHits); } /** diff --git a/tests/lib/Repository/Service/Mock/PermissionTest.php b/tests/lib/Repository/Service/Mock/PermissionTest.php index 96b464c382..1c6eab2c2e 100644 --- a/tests/lib/Repository/Service/Mock/PermissionTest.php +++ b/tests/lib/Repository/Service/Mock/PermissionTest.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\Core\Repository\Service\Mock; use Ibexa\Contracts\Core\Limitation\Type; @@ -109,17 +110,17 @@ public function testHasAccessReturnsTrue(array $roles, array $roleAssignments) $mockedService = $this->getPermissionResolverMock(null); $userHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadRoleAssignmentsByGroupId') - ->with($this->equalTo(10), $this->equalTo(true)) - ->will($this->returnValue($roleAssignments)); + ->with(self::equalTo(10), self::equalTo(true)) + ->will(self::returnValue($roleAssignments)); foreach ($roleAssignments as $at => $roleAssignment) { $userHandlerMock - ->expects($this->at($at + 1)) + ->expects(self::at($at + 1)) ->method('loadRole') ->with($roleAssignment->roleId) - ->will($this->returnValue($roles[$roleAssignment->roleId])); + ->will(self::returnValue($roles[$roleAssignment->roleId])); } $result = $mockedService->hasAccess('dummy-module', 'dummy-function'); @@ -180,17 +181,17 @@ public function testHasAccessReturnsFalse(array $roles, array $roleAssignments) $service = $this->getPermissionResolverMock(null); $userHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadRoleAssignmentsByGroupId') - ->with($this->equalTo(10), $this->equalTo(true)) - ->will($this->returnValue($roleAssignments)); + ->with(self::equalTo(10), self::equalTo(true)) + ->will(self::returnValue($roleAssignments)); foreach ($roleAssignments as $at => $roleAssignment) { $userHandlerMock - ->expects($this->at($at + 1)) + ->expects(self::at($at + 1)) ->method('loadRole') ->with($roleAssignment->roleId) - ->will($this->returnValue($roles[$roleAssignment->roleId])); + ->will(self::returnValue($roles[$roleAssignment->roleId])); } $result = $service->hasAccess('dummy-module2', 'dummy-function2'); @@ -208,13 +209,13 @@ public function testHasAccessReturnsFalseButSudoSoTrue() $service = $this->getPermissionResolverMock(null); $repositoryMock = $this->getRepositoryMock(); $repositoryMock - ->expects($this->any()) + ->expects(self::any()) ->method('getPermissionResolver') - ->will($this->returnValue($service)); + ->will(self::returnValue($service)); $userHandlerMock - ->expects($this->never()) - ->method($this->anything()); + ->expects(self::never()) + ->method(self::anything()); $result = $service->sudo( static function (Repository $repo) { @@ -293,22 +294,22 @@ public function testHasAccessReturnsPermissionSets(array $roles, array $roleAssi $permissionResolverMock = $this->getPermissionResolverMock(['getCurrentUserReference']); $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('getCurrentUserReference') - ->will($this->returnValue(new UserReference(14))); + ->will(self::returnValue(new UserReference(14))); $userHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadRoleAssignmentsByGroupId') - ->with($this->isType('integer'), $this->equalTo(true)) - ->will($this->returnValue($roleAssignments)); + ->with(self::isType('integer'), self::equalTo(true)) + ->will(self::returnValue($roleAssignments)); foreach ($roleAssignments as $at => $roleAssignment) { $userHandlerMock - ->expects($this->at($at + 1)) + ->expects(self::at($at + 1)) ->method('loadRole') ->with($roleAssignment->roleId) - ->will($this->returnValue($roles[$roleAssignment->roleId])); + ->will(self::returnValue($roles[$roleAssignment->roleId])); } $permissionSets = []; @@ -318,11 +319,11 @@ public function testHasAccessReturnsPermissionSets(array $roles, array $roleAssi $permissionSet = ['limitation' => null]; foreach ($roles[$roleAssignment->roleId]->policies as $k => $policy) { $policyName = 'policy-' . $i . '-' . $k; - $return = $this->returnValue($policyName); + $return = self::returnValue($policyName); $permissionSet['policies'][] = $policyName; $roleDomainMapper - ->expects($this->at($count++)) + ->expects(self::at($count++)) ->method('buildDomainPolicyObject') ->with($policy) ->will($return); @@ -409,22 +410,22 @@ public function testHasAccessReturnsLimitationNotFoundException(array $roles, ar $permissionResolverMock = $this->getPermissionResolverMock(['getCurrentUserReference']); $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('getCurrentUserReference') - ->will($this->returnValue(new UserReference(14))); + ->will(self::returnValue(new UserReference(14))); $userHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadRoleAssignmentsByGroupId') - ->with($this->isType('integer'), $this->equalTo(true)) - ->will($this->returnValue($roleAssignments)); + ->with(self::isType('integer'), self::equalTo(true)) + ->will(self::returnValue($roleAssignments)); foreach ($roleAssignments as $at => $roleAssignment) { $userHandlerMock - ->expects($this->at($at + 1)) + ->expects(self::at($at + 1)) ->method('loadRole') ->with($roleAssignment->roleId) - ->will($this->returnValue($roles[$roleAssignment->roleId])); + ->will(self::returnValue($roles[$roleAssignment->roleId])); } $count = 0; @@ -434,14 +435,14 @@ public function testHasAccessReturnsLimitationNotFoundException(array $roles, ar foreach ($roles[$roleAssignment->roleId]->policies as $k => $policy) { $policyName = 'policy-' . $i . '-' . $k; if ($policy->limitations === 'notfound') { - $return = $this->throwException(new LimitationNotFoundException('notfound')); + $return = self::throwException(new LimitationNotFoundException('notfound')); } else { - $return = $this->returnValue($policyName); + $return = self::returnValue($policyName); $permissionSet['policies'][] = $policyName; } $roleDomainMapper - ->expects($this->at($count++)) + ->expects(self::at($count++)) ->method('buildDomainPolicyObject') ->with($policy) ->will($return); @@ -589,22 +590,22 @@ public function testHasAccessReturnsPermissionSetsWithRoleLimitation(array $role $permissionResolverMock = $this->getPermissionResolverMock(['getCurrentUserReference']); $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('getCurrentUserReference') - ->will($this->returnValue(new UserReference(14))); + ->will(self::returnValue(new UserReference(14))); $userHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadRoleAssignmentsByGroupId') - ->with($this->isType('integer'), $this->equalTo(true)) - ->will($this->returnValue($roleAssignments)); + ->with(self::isType('integer'), self::equalTo(true)) + ->will(self::returnValue($roleAssignments)); foreach ($roleAssignments as $at => $roleAssignment) { $userHandlerMock - ->expects($this->at($at + 1)) + ->expects(self::at($at + 1)) ->method('loadRole') ->with($roleAssignment->roleId) - ->will($this->returnValue($roles[$roleAssignment->roleId])); + ->will(self::returnValue($roles[$roleAssignment->roleId])); } $permissionSets = []; @@ -615,23 +616,23 @@ public function testHasAccessReturnsPermissionSetsWithRoleLimitation(array $role $policyName = "policy-{$i}-{$k}"; $permissionSet['policies'][] = $policyName; $roleDomainMapper - ->expects($this->at($k)) + ->expects(self::at($k)) ->method('buildDomainPolicyObject') ->with($policy) - ->will($this->returnValue($policyName)); + ->will(self::returnValue($policyName)); } $permissionSet['limitation'] = "limitation-{$i}"; $limitationTypeMock - ->expects($this->at($i)) + ->expects(self::at($i)) ->method('buildValue') ->with($roleAssignment->values) - ->will($this->returnValue($permissionSet['limitation'])); + ->will(self::returnValue($permissionSet['limitation'])); $limitationService - ->expects($this->any()) + ->expects(self::any()) ->method('getLimitationType') ->with($roleAssignment->limitationIdentifier) - ->will($this->returnValue($limitationTypeMock)); + ->will(self::returnValue($limitationTypeMock)); $permissionSets[] = $permissionSet; } @@ -692,10 +693,10 @@ public function testCanUserSimple($permissionSets, $result) $permissionResolverMock = $this->getPermissionResolverMock(['hasAccess']); $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess') - ->with($this->equalTo('test-module'), $this->equalTo('test-function')) - ->will($this->returnValue($permissionSets)); + ->with(self::equalTo('test-module'), self::equalTo('test-function')) + ->will(self::returnValue($permissionSets)); /** @var $valueObject \Ibexa\Contracts\Core\Repository\Values\ValueObject */ $valueObject = $this->getMockForAbstractClass(ValueObject::class); @@ -727,9 +728,9 @@ public function testCanUserWithoutLimitations() ->getMock(); $policyMock - ->expects($this->once()) + ->expects(self::once()) ->method('getLimitations') - ->will($this->returnValue('*')); + ->will(self::returnValue('*')); $permissionSets = [ [ 'limitation' => null, @@ -737,15 +738,15 @@ public function testCanUserWithoutLimitations() ], ]; $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess') - ->with($this->equalTo('test-module'), $this->equalTo('test-function')) - ->will($this->returnValue($permissionSets)); + ->with(self::equalTo('test-module'), self::equalTo('test-function')) + ->will(self::returnValue($permissionSets)); $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('getCurrentUserReference') - ->will($this->returnValue(new UserReference(14))); + ->will(self::returnValue(new UserReference(14))); /** @var $valueObject \Ibexa\Contracts\Core\Repository\Values\ValueObject */ $valueObject = $this->getMockForAbstractClass(ValueObject::class); @@ -767,15 +768,15 @@ private function getPermissionSetsMock() { $roleLimitationMock = $this->createMock(Limitation::class); $roleLimitationMock - ->expects($this->any()) + ->expects(self::any()) ->method('getIdentifier') - ->will($this->returnValue('test-role-limitation-identifier')); + ->will(self::returnValue('test-role-limitation-identifier')); $policyLimitationMock = $this->createMock(Limitation::class); $policyLimitationMock - ->expects($this->any()) + ->expects(self::any()) ->method('getIdentifier') - ->will($this->returnValue('test-policy-limitation-identifier')); + ->will(self::returnValue('test-policy-limitation-identifier')); $policyMock = $this->getMockBuilder(Policy::class) ->setMethods(['getLimitations']) @@ -783,9 +784,9 @@ private function getPermissionSetsMock() ->getMock(); $policyMock - ->expects($this->any()) + ->expects(self::any()) ->method('getLimitations') - ->will($this->returnValue([$policyLimitationMock, $policyLimitationMock])); + ->will(self::returnValue([$policyLimitationMock, $policyLimitationMock])); $permissionSet = [ 'limitation' => clone $roleLimitationMock, @@ -899,30 +900,30 @@ public function testCanUserComplex(array $roleLimitationEvaluations, array $poli $permissionSets = $this->getPermissionSetsMock(); $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess') - ->with($this->equalTo('test-module'), $this->equalTo('test-function')) - ->will($this->returnValue($permissionSets)); + ->with(self::equalTo('test-module'), self::equalTo('test-function')) + ->will(self::returnValue($permissionSets)); $userRef = new UserReference(14); $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('getCurrentUserReference') - ->will($this->returnValue(new UserReference(14))); + ->will(self::returnValue(new UserReference(14))); $invocation = 0; for ($i = 0; $i < count($permissionSets); ++$i) { $limitation = $this->createMock(Type::class); $limitation - ->expects($this->once()) + ->expects(self::once()) ->method('evaluate') ->with($permissionSets[$i]['limitation'], $userRef, $valueObject, [$valueObject]) - ->will($this->returnValue($roleLimitationEvaluations[$i])); + ->will(self::returnValue($roleLimitationEvaluations[$i])); $limitationServiceMock - ->expects($this->at($invocation++)) + ->expects(self::at($invocation++)) ->method('getLimitationType') ->with('test-role-limitation-identifier') - ->will($this->returnValue($limitation)); + ->will(self::returnValue($limitation)); if (!$roleLimitationEvaluations[$i]) { continue; @@ -936,15 +937,15 @@ public function testCanUserComplex(array $roleLimitationEvaluations, array $poli $limitationsPass = true; $limitation = $this->createMock(Type::class); $limitation - ->expects($this->once()) + ->expects(self::once()) ->method('evaluate') ->with($limitations[$k], $userRef, $valueObject, [$valueObject]) - ->will($this->returnValue($policyLimitationEvaluations[$i][$j][$k])); + ->will(self::returnValue($policyLimitationEvaluations[$i][$j][$k])); $limitationServiceMock - ->expects($this->at($invocation++)) + ->expects(self::at($invocation++)) ->method('getLimitationType') ->with('test-policy-limitation-identifier') - ->will($this->returnValue($limitation)); + ->will(self::returnValue($limitation)); if (!$policyLimitationEvaluations[$i][$j][$k]) { $limitationsPass = false; @@ -979,9 +980,9 @@ public function testSetAndGetCurrentUserReference() $userReferenceMock = $this->getUserReferenceMock(); $userReferenceMock - ->expects($this->once()) + ->expects(self::once()) ->method('getUserId') - ->will($this->returnValue(42)); + ->will(self::returnValue(42)); $permissionResolverMock->setCurrentUserReference($userReferenceMock); diff --git a/tests/lib/Repository/Service/Mock/PermissionsCriterionHandlerTest.php b/tests/lib/Repository/Service/Mock/PermissionsCriterionHandlerTest.php index 5b28ecd82f..01792f6289 100644 --- a/tests/lib/Repository/Service/Mock/PermissionsCriterionHandlerTest.php +++ b/tests/lib/Repository/Service/Mock/PermissionsCriterionHandlerTest.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\Core\Repository\Service\Mock; use Ibexa\Contracts\Core\Limitation\Type; @@ -41,14 +42,14 @@ public function testAddPermissionsCriterionWithBooleanPermission($permissionsCri $criterionMock = $this->createMock(Criterion::class); $handler - ->expects($this->once()) + ->expects(self::once()) ->method('getPermissionsCriterion') - ->will($this->returnValue($permissionsCriterion)); + ->will(self::returnValue($permissionsCriterion)); /* @var \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion $criterionMock */ $result = $handler->addPermissionsCriterion($criterionMock); - $this->assertSame($permissionsCriterion, $result); + self::assertSame($permissionsCriterion, $result); } public function providerForTestAddPermissionsCriterion() @@ -78,15 +79,15 @@ public function testAddPermissionsCriterion($permissionsCriterionMock, $givenCri { $handler = $this->getPermissionsCriterionHandlerMock(['getPermissionsCriterion']); $handler - ->expects($this->once()) + ->expects(self::once()) ->method('getPermissionsCriterion') - ->will($this->returnValue($permissionsCriterionMock)); + ->will(self::returnValue($permissionsCriterionMock)); /* @var \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion $criterionMock */ $result = $handler->addPermissionsCriterion($givenCriterion); - $this->assertTrue($result); - $this->assertEquals($expectedCriterion, $givenCriterion); + self::assertTrue($result); + self::assertEquals($expectedCriterion, $givenCriterion); } public function providerForTestGetPermissionsCriterion() @@ -96,9 +97,9 @@ public function providerForTestGetPermissionsCriterion() ->getMockBuilder(APILimitation::class) ->getMockForAbstractClass(); $limitationMock - ->expects($this->any()) + ->expects(self::any()) ->method('getIdentifier') - ->will($this->returnValue('limitationIdentifier')); + ->will(self::returnValue('limitationIdentifier')); $policy1 = new Policy(['limitations' => [$limitationMock]]); $policy2 = new Policy(['limitations' => [$limitationMock, $limitationMock]]); @@ -287,30 +288,30 @@ protected function mockServices($criterionMock, $limitationCount, $permissionSet ); $limitationTypeMock - ->expects($this->any()) + ->expects(self::any()) ->method('getCriterion') ->with( - $this->isInstanceOf(APILimitation::class), - $this->equalTo($userMock) + self::isInstanceOf(APILimitation::class), + self::equalTo($userMock) ) - ->will($this->returnValue($criterionMock)); + ->will(self::returnValue($criterionMock)); $limitationServiceMock - ->expects($this->exactly($limitationCount)) + ->expects(self::exactly($limitationCount)) ->method('getLimitationType') - ->with($this->equalTo('limitationIdentifier')) - ->will($this->returnValue($limitationTypeMock)); + ->with(self::equalTo('limitationIdentifier')) + ->will(self::returnValue($limitationTypeMock)); $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess') - ->with($this->equalTo('content'), $this->equalTo('read')) - ->will($this->returnValue($permissionSets)); + ->with(self::equalTo('content'), self::equalTo('read')) + ->will(self::returnValue($permissionSets)); $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('getCurrentUserReference') - ->will($this->returnValue($userMock)); + ->will(self::returnValue($userMock)); } /** @@ -329,7 +330,7 @@ public function testGetPermissionsCriterion( $permissionsCriterion = $handler->getPermissionsCriterion(); - $this->assertEquals($expectedCriterion, $permissionsCriterion); + self::assertEquals($expectedCriterion, $permissionsCriterion); } public function providerForTestGetPermissionsCriterionBooleanPermissionSets() @@ -349,15 +350,15 @@ public function testGetPermissionsCriterionBooleanPermissionSets($permissionSets { $permissionResolverMock = $this->getPermissionResolverMock(['hasAccess']); $permissionResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess') - ->with($this->equalTo('testModule'), $this->equalTo('testFunction')) - ->will($this->returnValue($permissionSets)); + ->with(self::equalTo('testModule'), self::equalTo('testFunction')) + ->will(self::returnValue($permissionSets)); $handler = $this->getPermissionsCriterionHandlerMock(null); $permissionsCriterion = $handler->getPermissionsCriterion('testModule', 'testFunction'); - $this->assertEquals($permissionSets, $permissionsCriterion); + self::assertEquals($permissionSets, $permissionsCriterion); } /** diff --git a/tests/lib/Repository/Service/Mock/RelationProcessorTest.php b/tests/lib/Repository/Service/Mock/RelationProcessorTest.php index f9b98ac687..4bb4b8a519 100644 --- a/tests/lib/Repository/Service/Mock/RelationProcessorTest.php +++ b/tests/lib/Repository/Service/Mock/RelationProcessorTest.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\Core\Repository\Service\Mock; use Ibexa\Contracts\Core\FieldType\FieldType; @@ -171,10 +172,10 @@ public function testAppendFieldRelations(array $fieldRelations, array $expected) $fieldTypeMock = $this->createMock(FieldType::class); $locationCallCount = 0; - $fieldTypeMock->expects($this->once()) + $fieldTypeMock->expects(self::once()) ->method('getRelations') - ->with($this->equalTo($fieldValueMock)) - ->will($this->returnValue($fieldRelations)); + ->with(self::equalTo($fieldValueMock)) + ->will(self::returnValue($fieldRelations)); $this->assertLocationHandlerExpectation( $locationHandler, @@ -200,7 +201,7 @@ public function testAppendFieldRelations(array $fieldRelations, array $expected) 42 ); - $this->assertEquals($expected, $relations); + self::assertEquals($expected, $relations); } /** @@ -210,11 +211,11 @@ protected function assertLocationHandlerExpectation($locationHandlerMock, $field { if (isset($fieldRelations[$type]['locationIds'])) { foreach ($fieldRelations[$type]['locationIds'] as $locationId) { - $locationHandlerMock->expects($this->at($callCounter)) + $locationHandlerMock->expects(self::at($callCounter)) ->method('load') - ->with($this->equalTo($locationId)) + ->with(self::equalTo($locationId)) ->will( - $this->returnValue( + self::returnValue( new Location( ['contentId' => $locationId + 100] ) @@ -236,11 +237,11 @@ public function testAppendFieldRelationsLocationMappingWorks() $fieldValueMock = $this->getMockForAbstractClass(Value::class); $fieldTypeMock = $this->createMock(FieldType::class); - $fieldTypeMock->expects($this->once()) + $fieldTypeMock->expects(self::once()) ->method('getRelations') - ->with($this->equalTo($fieldValueMock)) + ->with(self::equalTo($fieldValueMock)) ->will( - $this->returnValue( + self::returnValue( [ Relation::FIELD => [100], Relation::ASSET => [100], @@ -256,11 +257,11 @@ public function testAppendFieldRelationsLocationMappingWorks() ) ); - $locationHandler->expects($this->once()) + $locationHandler->expects(self::once()) ->method('load') - ->with($this->equalTo(100)) + ->with(self::equalTo(100)) ->will( - $this->returnValue( + self::returnValue( new Location( ['contentId' => 200] ) @@ -278,7 +279,7 @@ public function testAppendFieldRelationsLocationMappingWorks() 42 ); - $this->assertEquals( + self::assertEquals( [ Relation::ASSET => [42 => [100 => 0]], Relation::FIELD => [42 => [100 => 0]], @@ -298,11 +299,11 @@ public function testAppendFieldRelationsLogsMissingLocations() $fieldDefinitionId = 42; $fieldTypeMock - ->expects($this->once()) + ->expects(self::once()) ->method('getRelations') - ->with($this->equalTo($fieldValueMock)) + ->with(self::equalTo($fieldValueMock)) ->will( - $this->returnValue( + self::returnValue( [ Relation::LINK => [ 'locationIds' => [$locationId], @@ -313,14 +314,14 @@ public function testAppendFieldRelationsLogsMissingLocations() $locationHandler = $this->getPersistenceMock()->locationHandler(); $locationHandler - ->expects($this->any()) + ->expects(self::any()) ->method('load') ->with($locationId) ->willThrowException($this->createMock(NotFoundException::class)); $logger = $this->createMock(LoggerInterface::class); $logger - ->expects($this->once()) + ->expects(self::once()) ->method('error') ->with('Invalid relation: destination location not found', [ 'fieldDefinitionId' => $fieldDefinitionId, @@ -350,18 +351,18 @@ public function testProcessFieldRelationsNoChanges() $contentHandlerMock = $this->getPersistenceMockHandler('Content\\Handler'); $contentTypeMock = $this->createMock(ContentType::class); - $contentTypeMock->expects($this->at(0)) + $contentTypeMock->expects(self::at(0)) ->method('getFieldDefinition') - ->with($this->equalTo('identifier42')) - ->will($this->returnValue(new FieldDefinition(['id' => 42]))); + ->with(self::equalTo('identifier42')) + ->will(self::returnValue(new FieldDefinition(['id' => 42]))); - $contentTypeMock->expects($this->at(1)) + $contentTypeMock->expects(self::at(1)) ->method('getFieldDefinition') - ->with($this->equalTo('identifier43')) - ->will($this->returnValue(new FieldDefinition(['id' => 43]))); + ->with(self::equalTo('identifier43')) + ->will(self::returnValue(new FieldDefinition(['id' => 43]))); - $contentHandlerMock->expects($this->never())->method('addRelation'); - $contentHandlerMock->expects($this->never())->method('removeRelation'); + $contentHandlerMock->expects(self::never())->method('addRelation'); + $contentHandlerMock->expects(self::never())->method('removeRelation'); $existingRelations = [ $this->getStubbedRelation(1, Relation::COMMON, null, 10), @@ -451,10 +452,10 @@ public function testProcessFieldRelationsAddsRelations() Relation::ASSET => [44 => array_flip([18])], ]; - $contentTypeMock->expects($this->never())->method('getFieldDefinition'); - $contentHandlerMock->expects($this->never())->method('removeRelation'); + $contentTypeMock->expects(self::never())->method('getFieldDefinition'); + $contentHandlerMock->expects(self::never())->method('removeRelation'); - $contentHandlerMock->expects($this->at(0)) + $contentHandlerMock->expects(self::at(0)) ->method('addRelation') ->with( new CreateStruct( @@ -468,7 +469,7 @@ public function testProcessFieldRelationsAddsRelations() ) ); - $contentHandlerMock->expects($this->at(1)) + $contentHandlerMock->expects(self::at(1)) ->method('addRelation') ->with( new CreateStruct( @@ -482,7 +483,7 @@ public function testProcessFieldRelationsAddsRelations() ) ); - $contentHandlerMock->expects($this->at(2)) + $contentHandlerMock->expects(self::at(2)) ->method('addRelation') ->with( new CreateStruct( @@ -496,7 +497,7 @@ public function testProcessFieldRelationsAddsRelations() ) ); - $contentHandlerMock->expects($this->at(3)) + $contentHandlerMock->expects(self::at(3)) ->method('addRelation') ->with( new CreateStruct( @@ -565,17 +566,17 @@ public function testProcessFieldRelationsRemovesRelations() Relation::LINK => array_flip([12, 15, 17]), ]; - $contentHandlerMock->expects($this->never())->method('addRelation'); + $contentHandlerMock->expects(self::never())->method('addRelation'); $contentTypeMock->expects(self::at(0)) ->method('getFieldDefinition') - ->with($this->equalTo('identifier42')) - ->will($this->returnValue(new FieldDefinition(['id' => 42]))); + ->with(self::equalTo('identifier42')) + ->will(self::returnValue(new FieldDefinition(['id' => 42]))); $contentTypeMock->expects(self::at(1)) ->method('getFieldDefinition') - ->with($this->equalTo('identifier44')) - ->will($this->returnValue(new FieldDefinition(['id' => 44]))); + ->with(self::equalTo('identifier44')) + ->will(self::returnValue(new FieldDefinition(['id' => 44]))); $contentHandlerMock->expects(self::at(0)) ->method('removeRelation') @@ -629,16 +630,16 @@ public function testProcessFieldRelationsWhenRelationFieldNoLongerExists() $contentTypeMock = $this->createMock(ContentType::class); $contentTypeMock - ->expects($this->at(0)) + ->expects(self::at(0)) ->method('getFieldDefinition') - ->with($this->equalTo('identifier43')) - ->will($this->returnValue(null)); + ->with(self::equalTo('identifier43')) + ->will(self::returnValue(null)); $contentTypeMock - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('getFieldDefinition') - ->with($this->equalTo('identifier44')) - ->will($this->returnValue(null)); + ->with(self::equalTo('identifier44')) + ->will(self::returnValue(null)); $relationProcessor = $this->getPartlyMockedRelationProcessor(); $relationProcessor->processFieldRelations([], 24, 2, $contentTypeMock, $existingRelations); diff --git a/tests/lib/Repository/Service/Mock/RepositoryTest.php b/tests/lib/Repository/Service/Mock/RepositoryTest.php index c3d9497015..179b106d73 100644 --- a/tests/lib/Repository/Service/Mock/RepositoryTest.php +++ b/tests/lib/Repository/Service/Mock/RepositoryTest.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\Core\Repository\Service\Mock; use Ibexa\Tests\Core\Repository\Service\Mock\Base as BaseServiceMockTest; @@ -24,7 +25,7 @@ public function testBeginTransaction() $persistenceHandlerMock = $this->getPersistenceMock(); $persistenceHandlerMock->expects( - $this->once() + self::once() )->method( 'beginTransaction' ); @@ -43,7 +44,7 @@ public function testCommit() $persistenceHandlerMock = $this->getPersistenceMock(); $persistenceHandlerMock->expects( - $this->once() + self::once() )->method( 'commit' ); @@ -64,11 +65,11 @@ public function testCommitThrowsRuntimeException() $persistenceHandlerMock = $this->getPersistenceMock(); $persistenceHandlerMock->expects( - $this->once() + self::once() )->method( 'commit' )->will( - $this->throwException(new \Exception()) + self::throwException(new \Exception()) ); $mockedRepository->commit(); @@ -85,7 +86,7 @@ public function testRollback() $persistenceHandlerMock = $this->getPersistenceMock(); $persistenceHandlerMock->expects( - $this->once() + self::once() )->method( 'rollback' ); @@ -106,11 +107,11 @@ public function testRollbackThrowsRuntimeException() $persistenceHandlerMock = $this->getPersistenceMock(); $persistenceHandlerMock->expects( - $this->once() + self::once() )->method( 'rollback' )->will( - $this->throwException(new \Exception()) + self::throwException(new \Exception()) ); $mockedRepository->rollback(); diff --git a/tests/lib/Repository/Service/Mock/RoleTest.php b/tests/lib/Repository/Service/Mock/RoleTest.php index 0fe6400443..5b5d63832e 100644 --- a/tests/lib/Repository/Service/Mock/RoleTest.php +++ b/tests/lib/Repository/Service/Mock/RoleTest.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\Core\Repository\Service\Mock; use ArrayIterator; @@ -47,17 +48,17 @@ public function testCreateRoleThrowsLimitationValidationException() $limitationMock = $this->createMock(RoleLimitation::class); $limitationTypeMock = $this->createMock(SPIType::class); - $limitationMock->expects($this->any()) + $limitationMock->expects(self::any()) ->method('getIdentifier') - ->will($this->returnValue('mockIdentifier')); + ->will(self::returnValue('mockIdentifier')); - $limitationTypeMock->expects($this->once()) + $limitationTypeMock->expects(self::once()) ->method('acceptValue') - ->with($this->equalTo($limitationMock)); - $limitationTypeMock->expects($this->once()) + ->with(self::equalTo($limitationMock)); + $limitationTypeMock->expects(self::once()) ->method('validate') - ->with($this->equalTo($limitationMock)) - ->will($this->returnValue([42])); + ->with(self::equalTo($limitationMock)) + ->will(self::returnValue([42])); $settings = [ 'policyMap' => ['mockModule' => ['mockFunction' => ['mockIdentifier' => true]]], @@ -74,29 +75,29 @@ public function testCreateRoleThrowsLimitationValidationException() $policyCreateStructMock->module = 'mockModule'; $policyCreateStructMock->function = 'mockFunction'; $roleCreateStructMock->identifier = 'mockIdentifier'; - $roleServiceMock->expects($this->once()) + $roleServiceMock->expects(self::once()) ->method('loadRoleByIdentifier') - ->with($this->equalTo('mockIdentifier')) - ->will($this->throwException(new NotFoundException('Role', 'mockIdentifier'))); + ->with(self::equalTo('mockIdentifier')) + ->will(self::throwException(new NotFoundException('Role', 'mockIdentifier'))); /* @var \PHPUnit\Framework\MockObject\MockObject $roleCreateStructMock */ - $roleCreateStructMock->expects($this->once()) + $roleCreateStructMock->expects(self::once()) ->method('getPolicies') - ->will($this->returnValue([$policyCreateStructMock])); + ->will(self::returnValue([$policyCreateStructMock])); /* @var \PHPUnit\Framework\MockObject\MockObject $policyCreateStructMock */ - $policyCreateStructMock->expects($this->once()) + $policyCreateStructMock->expects(self::once()) ->method('getLimitations') - ->will($this->returnValue([$limitationMock])); + ->will(self::returnValue([$limitationMock])); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('create'), - $this->equalTo($roleCreateStructMock) - )->will($this->returnValue(true)); + self::equalTo('role'), + self::equalTo('create'), + self::equalTo($roleCreateStructMock) + )->will(self::returnValue(true)); /* @var \Ibexa\Contracts\Core\Repository\Values\User\RoleCreateStruct $roleCreateStructMock */ $roleServiceMock->createRole($roleCreateStructMock); @@ -112,17 +113,17 @@ public function testAddPolicyThrowsLimitationValidationException() $limitationMock = $this->createMock(RoleLimitation::class); $limitationTypeMock = $this->createMock(SPIType::class); - $limitationTypeMock->expects($this->once()) + $limitationTypeMock->expects(self::once()) ->method('acceptValue') - ->with($this->equalTo($limitationMock)); - $limitationTypeMock->expects($this->once()) + ->with(self::equalTo($limitationMock)); + $limitationTypeMock->expects(self::once()) ->method('validate') - ->with($this->equalTo($limitationMock)) - ->will($this->returnValue([42])); + ->with(self::equalTo($limitationMock)) + ->will(self::returnValue([42])); - $limitationMock->expects($this->any()) + $limitationMock->expects(self::any()) ->method('getIdentifier') - ->will($this->returnValue('mockIdentifier')); + ->will(self::returnValue('mockIdentifier')); $settings = [ 'policyMap' => ['mockModule' => ['mockFunction' => ['mockIdentifier' => true]]], @@ -134,32 +135,32 @@ public function testAddPolicyThrowsLimitationValidationException() $roleDraftMock = $this->createMock(RoleDraft::class); $policyCreateStructMock = $this->createMock(PolicyCreateStruct::class); - $roleDraftMock->expects($this->any()) + $roleDraftMock->expects(self::any()) ->method('__get') ->with('id') - ->will($this->returnValue(42)); + ->will(self::returnValue(42)); /* @var \Ibexa\Contracts\Core\Repository\Values\User\PolicyCreateStruct $policyCreateStructMock */ $policyCreateStructMock->module = 'mockModule'; $policyCreateStructMock->function = 'mockFunction'; - $roleServiceMock->expects($this->once()) + $roleServiceMock->expects(self::once()) ->method('loadRoleDraft') - ->with($this->equalTo(42)) - ->will($this->returnValue($roleDraftMock)); + ->with(self::equalTo(42)) + ->will(self::returnValue($roleDraftMock)); /* @var \PHPUnit\Framework\MockObject\MockObject $policyCreateStructMock */ - $policyCreateStructMock->expects($this->once()) + $policyCreateStructMock->expects(self::once()) ->method('getLimitations') - ->will($this->returnValue([$limitationMock])); + ->will(self::returnValue([$limitationMock])); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('update'), - $this->equalTo($roleDraftMock) - )->will($this->returnValue(true)); + self::equalTo('role'), + self::equalTo('update'), + self::equalTo($roleDraftMock) + )->will(self::returnValue(true)); /* @var \Ibexa\Contracts\Core\Repository\Values\User\Role $roleDraftMock */ /* @var \Ibexa\Contracts\Core\Repository\Values\User\PolicyCreateStruct $policyCreateStructMock */ @@ -176,17 +177,17 @@ public function testUpdatePolicyThrowsLimitationValidationException() $limitationMock = $this->createMock(RoleLimitation::class); $limitationTypeMock = $this->createMock(SPIType::class); - $limitationTypeMock->expects($this->once()) + $limitationTypeMock->expects(self::once()) ->method('acceptValue') - ->with($this->equalTo($limitationMock)); - $limitationTypeMock->expects($this->once()) + ->with(self::equalTo($limitationMock)); + $limitationTypeMock->expects(self::once()) ->method('validate') - ->with($this->equalTo($limitationMock)) - ->will($this->returnValue([42])); + ->with(self::equalTo($limitationMock)) + ->will(self::returnValue([42])); - $limitationMock->expects($this->any()) + $limitationMock->expects(self::any()) ->method('getIdentifier') - ->will($this->returnValue('mockIdentifier')); + ->will(self::returnValue('mockIdentifier')); $settings = [ 'policyMap' => ['mockModule' => ['mockFunction' => ['mockIdentifier' => true]]], @@ -199,10 +200,10 @@ public function testUpdatePolicyThrowsLimitationValidationException() $policyDraftMock = $this->createMock(PolicyDraft::class); $policyUpdateStructMock = $this->createMock(PolicyUpdateStruct::class); - $policyDraftMock->expects($this->any()) + $policyDraftMock->expects(self::any()) ->method('__get') ->will( - $this->returnCallback( + self::returnCallback( static function ($propertyName) { switch ($propertyName) { case 'module': @@ -217,18 +218,18 @@ static function ($propertyName) { ); /* @var \PHPUnit\Framework\MockObject\MockObject $policyCreateStructMock */ - $policyUpdateStructMock->expects($this->once()) + $policyUpdateStructMock->expects(self::once()) ->method('getLimitations') - ->will($this->returnValue([$limitationMock])); + ->will(self::returnValue([$limitationMock])); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('update'), - $this->equalTo($roleDraftMock) - )->will($this->returnValue(true)); + self::equalTo('role'), + self::equalTo('update'), + self::equalTo($roleDraftMock) + )->will(self::returnValue(true)); /* @var \Ibexa\Contracts\Core\Repository\Values\User\Policy $policyDraftMock */ /* @var \Ibexa\Contracts\Core\Repository\Values\User\PolicyUpdateStruct $policyUpdateStructMock */ @@ -253,14 +254,14 @@ public function testAssignRoleToUserThrowsUnauthorizedException() $userMock = $this->createMock(User::class); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('assign'), - $this->equalTo($userMock), - $this->equalTo([$roleMock]) - )->will($this->returnValue(false)); + self::equalTo('role'), + self::equalTo('assign'), + self::equalTo($userMock), + self::equalTo([$roleMock]) + )->will(self::returnValue(false)); $roleServiceMock->assignRoleToUser($roleMock, $userMock, null); } @@ -275,17 +276,17 @@ public function testAssignRoleToUserThrowsLimitationValidationException() $limitationMock = $this->createMock(RoleLimitation::class); $limitationTypeMock = $this->createMock(SPIType::class); - $limitationTypeMock->expects($this->once()) + $limitationTypeMock->expects(self::once()) ->method('acceptValue') - ->with($this->equalTo($limitationMock)); - $limitationTypeMock->expects($this->once()) + ->with(self::equalTo($limitationMock)); + $limitationTypeMock->expects(self::once()) ->method('validate') - ->with($this->equalTo($limitationMock)) - ->will($this->returnValue([42])); + ->with(self::equalTo($limitationMock)) + ->will(self::returnValue([42])); - $limitationMock->expects($this->once()) + $limitationMock->expects(self::once()) ->method('getIdentifier') - ->will($this->returnValue('testIdentifier')); + ->will(self::returnValue('testIdentifier')); $settings = [ 'limitationTypes' => ['testIdentifier' => $limitationTypeMock], @@ -299,14 +300,14 @@ public function testAssignRoleToUserThrowsLimitationValidationException() $userMock = $this->createMock(User::class); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('assign'), - $this->equalTo($userMock), - $this->equalTo([$roleMock]) - )->will($this->returnValue(true)); + self::equalTo('role'), + self::equalTo('assign'), + self::equalTo($userMock), + self::equalTo([$roleMock]) + )->will(self::returnValue(true)); /* @var \Ibexa\Contracts\Core\Repository\Values\User\Limitation\RoleLimitation $limitationMock */ $roleServiceMock->assignRoleToUser($roleMock, $userMock, $limitationMock); @@ -326,19 +327,19 @@ public function testAssignRoleToUserThrowsBadStateException() $userMock = $this->createMock(User::class); $limitationMock = $this->createMock(RoleLimitation::class); - $limitationMock->expects($this->once()) + $limitationMock->expects(self::once()) ->method('getIdentifier') - ->will($this->returnValue('testIdentifier')); + ->will(self::returnValue('testIdentifier')); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('assign'), - $this->equalTo($userMock), - $this->equalTo([$roleMock]) - )->will($this->returnValue(true)); + self::equalTo('role'), + self::equalTo('assign'), + self::equalTo($userMock), + self::equalTo([$roleMock]) + )->will(self::returnValue(true)); /* @var \Ibexa\Contracts\Core\Repository\Values\User\Limitation\RoleLimitation $limitationMock */ $roleServiceMock->assignRoleToUser($roleMock, $userMock, $limitationMock); @@ -352,17 +353,17 @@ public function testAssignRoleToUser() $limitationMock = $this->createMock(RoleLimitation::class); $limitationTypeMock = $this->createMock(SPIType::class); - $limitationTypeMock->expects($this->once()) + $limitationTypeMock->expects(self::once()) ->method('acceptValue') - ->with($this->equalTo($limitationMock)); - $limitationTypeMock->expects($this->once()) + ->with(self::equalTo($limitationMock)); + $limitationTypeMock->expects(self::once()) ->method('validate') - ->with($this->equalTo($limitationMock)) - ->will($this->returnValue([])); + ->with(self::equalTo($limitationMock)) + ->will(self::returnValue([])); - $limitationMock->expects($this->exactly(2)) + $limitationMock->expects(self::exactly(2)) ->method('getIdentifier') - ->will($this->returnValue('testIdentifier')); + ->will(self::returnValue('testIdentifier')); $settings = [ 'limitationTypes' => ['testIdentifier' => $limitationTypeMock], @@ -375,51 +376,51 @@ public function testAssignRoleToUser() $userMock = $this->createMock(User::class); $userHandlerMock = $this->getPersistenceMockHandler('User\\Handler'); - $userMock->expects($this->any()) + $userMock->expects(self::any()) ->method('__get') ->with('id') - ->will($this->returnValue(24)); + ->will(self::returnValue(24)); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('assign'), - $this->equalTo($userMock), - $this->equalTo([$roleMock]) - )->will($this->returnValue(true)); + self::equalTo('role'), + self::equalTo('assign'), + self::equalTo($userMock), + self::equalTo([$roleMock]) + )->will(self::returnValue(true)); - $roleMock->expects($this->any()) + $roleMock->expects(self::any()) ->method('__get') ->with('id') - ->will($this->returnValue(42)); + ->will(self::returnValue(42)); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('loadRole') - ->with($this->equalTo(42)) - ->will($this->returnValue(new SPIRole(['id' => 42]))); + ->with(self::equalTo(42)) + ->will(self::returnValue(new SPIRole(['id' => 42]))); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('load') - ->with($this->equalTo(24)) - ->will($this->returnValue(new SPIUser(['id' => 24]))); + ->with(self::equalTo(24)) + ->will(self::returnValue(new SPIUser(['id' => 24]))); - $roleServiceMock->expects($this->once()) + $roleServiceMock->expects(self::once()) ->method('checkAssignmentAndFilterLimitationValues') - ->with(24, $this->isInstanceOf(SPIRole::class), ['testIdentifier' => []]) - ->will($this->returnValue(['testIdentifier' => []])); + ->with(24, self::isInstanceOf(SPIRole::class), ['testIdentifier' => []]) + ->will(self::returnValue(['testIdentifier' => []])); - $repository->expects($this->once())->method('beginTransaction'); + $repository->expects(self::once())->method('beginTransaction'); $userHandlerMock = $this->getPersistenceMockHandler('User\\Handler'); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('assignRole') ->with( - $this->equalTo(24), - $this->equalTo(42), - $this->equalTo(['testIdentifier' => []]) + self::equalTo(24), + self::equalTo(42), + self::equalTo(['testIdentifier' => []]) ); - $repository->expects($this->once())->method('commit'); + $repository->expects(self::once())->method('commit'); /* @var \Ibexa\Contracts\Core\Repository\Values\User\Role $roleMock */ /* @var \Ibexa\Contracts\Core\Repository\Values\User\User $userMock */ @@ -438,51 +439,51 @@ public function testAssignRoleToUserWithNullLimitation() $userMock = $this->createMock(User::class); $userHandlerMock = $this->getPersistenceMockHandler('User\\Handler'); - $userMock->expects($this->any()) + $userMock->expects(self::any()) ->method('__get') ->with('id') - ->will($this->returnValue(24)); + ->will(self::returnValue(24)); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('assign'), - $this->equalTo($userMock), - $this->equalTo([$roleMock]) - )->will($this->returnValue(true)); + self::equalTo('role'), + self::equalTo('assign'), + self::equalTo($userMock), + self::equalTo([$roleMock]) + )->will(self::returnValue(true)); - $roleMock->expects($this->any()) + $roleMock->expects(self::any()) ->method('__get') ->with('id') - ->will($this->returnValue(42)); + ->will(self::returnValue(42)); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('loadRole') - ->with($this->equalTo(42)) - ->will($this->returnValue(new SPIRole(['id' => 42]))); + ->with(self::equalTo(42)) + ->will(self::returnValue(new SPIRole(['id' => 42]))); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('load') - ->with($this->equalTo(24)) - ->will($this->returnValue(new SPIUser(['id' => 24]))); + ->with(self::equalTo(24)) + ->will(self::returnValue(new SPIUser(['id' => 24]))); - $roleServiceMock->expects($this->once()) + $roleServiceMock->expects(self::once()) ->method('checkAssignmentAndFilterLimitationValues') - ->with(24, $this->isInstanceOf(SPIRole::class), null) - ->will($this->returnValue(null)); + ->with(24, self::isInstanceOf(SPIRole::class), null) + ->will(self::returnValue(null)); - $repository->expects($this->once())->method('beginTransaction'); + $repository->expects(self::once())->method('beginTransaction'); $userHandlerMock = $this->getPersistenceMockHandler('User\\Handler'); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('assignRole') ->with( - $this->equalTo(24), - $this->equalTo(42), - $this->equalTo(null) + self::equalTo(24), + self::equalTo(42), + self::equalTo(null) ); - $repository->expects($this->once())->method('commit'); + $repository->expects(self::once())->method('commit'); /* @var \Ibexa\Contracts\Core\Repository\Values\User\Role $roleMock */ /* @var \Ibexa\Contracts\Core\Repository\Values\User\User $userMock */ @@ -502,51 +503,51 @@ public function testAssignRoleToUserWithRollback() $userMock = $this->createMock(User::class); $userHandlerMock = $this->getPersistenceMockHandler('User\\Handler'); - $userMock->expects($this->any()) + $userMock->expects(self::any()) ->method('__get') ->with('id') - ->will($this->returnValue(24)); + ->will(self::returnValue(24)); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('assign'), - $this->equalTo($userMock), - $this->equalTo([$roleMock]) - )->will($this->returnValue(true)); + self::equalTo('role'), + self::equalTo('assign'), + self::equalTo($userMock), + self::equalTo([$roleMock]) + )->will(self::returnValue(true)); - $roleMock->expects($this->any()) + $roleMock->expects(self::any()) ->method('__get') ->with('id') - ->will($this->returnValue(42)); + ->will(self::returnValue(42)); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('loadRole') - ->with($this->equalTo(42)) - ->will($this->returnValue(new SPIRole(['id' => 42]))); + ->with(self::equalTo(42)) + ->will(self::returnValue(new SPIRole(['id' => 42]))); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('load') - ->with($this->equalTo(24)) - ->will($this->returnValue(new SPIUser(['id' => 24]))); + ->with(self::equalTo(24)) + ->will(self::returnValue(new SPIUser(['id' => 24]))); - $roleServiceMock->expects($this->once()) + $roleServiceMock->expects(self::once()) ->method('checkAssignmentAndFilterLimitationValues') - ->with(24, $this->isInstanceOf(SPIRole::class), null) - ->will($this->returnValue(null)); + ->with(24, self::isInstanceOf(SPIRole::class), null) + ->will(self::returnValue(null)); - $repository->expects($this->once())->method('beginTransaction'); + $repository->expects(self::once())->method('beginTransaction'); $userHandlerMock = $this->getPersistenceMockHandler('User\\Handler'); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('assignRole') ->with( - $this->equalTo(24), - $this->equalTo(42), - $this->equalTo(null) - )->will($this->throwException(new \Exception())); - $repository->expects($this->once())->method('rollback'); + self::equalTo(24), + self::equalTo(42), + self::equalTo(null) + )->will(self::throwException(new \Exception())); + $repository->expects(self::once())->method('rollback'); /* @var \Ibexa\Contracts\Core\Repository\Values\User\Role $roleMock */ /* @var \Ibexa\Contracts\Core\Repository\Values\User\User $userMock */ @@ -568,14 +569,14 @@ public function testAssignRoleToUserGroupThrowsUnauthorizedException() $userGroupMock = $this->createMock(UserGroup::class); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('assign'), - $this->equalTo($userGroupMock), - $this->equalTo([$roleMock]) - )->will($this->returnValue(false)); + self::equalTo('role'), + self::equalTo('assign'), + self::equalTo($userGroupMock), + self::equalTo([$roleMock]) + )->will(self::returnValue(false)); $roleServiceMock->assignRoleToUserGroup($roleMock, $userGroupMock, null); } @@ -590,17 +591,17 @@ public function testAssignRoleToUserGroupThrowsLimitationValidationException() $limitationMock = $this->createMock(RoleLimitation::class); $limitationTypeMock = $this->createMock(SPIType::class); - $limitationTypeMock->expects($this->once()) + $limitationTypeMock->expects(self::once()) ->method('acceptValue') - ->with($this->equalTo($limitationMock)); - $limitationTypeMock->expects($this->once()) + ->with(self::equalTo($limitationMock)); + $limitationTypeMock->expects(self::once()) ->method('validate') - ->with($this->equalTo($limitationMock)) - ->will($this->returnValue([42])); + ->with(self::equalTo($limitationMock)) + ->will(self::returnValue([42])); - $limitationMock->expects($this->once()) + $limitationMock->expects(self::once()) ->method('getIdentifier') - ->will($this->returnValue('testIdentifier')); + ->will(self::returnValue('testIdentifier')); $settings = [ 'limitationTypes' => ['testIdentifier' => $limitationTypeMock], @@ -615,14 +616,14 @@ public function testAssignRoleToUserGroupThrowsLimitationValidationException() $userGroupMock = $this->createMock(UserGroup::class); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('assign'), - $this->equalTo($userGroupMock), - $this->equalTo([$roleMock]) - )->will($this->returnValue(true)); + self::equalTo('role'), + self::equalTo('assign'), + self::equalTo($userGroupMock), + self::equalTo([$roleMock]) + )->will(self::returnValue(true)); /* @var \Ibexa\Contracts\Core\Repository\Values\User\Limitation\RoleLimitation $limitationMock */ $roleServiceMock->assignRoleToUserGroup($roleMock, $userGroupMock, $limitationMock); @@ -643,19 +644,19 @@ public function testAssignRoleGroupToUserThrowsBadStateException() $userGroupMock = $this->createMock(UserGroup::class); $limitationMock = $this->createMock(RoleLimitation::class); - $limitationMock->expects($this->once()) + $limitationMock->expects(self::once()) ->method('getIdentifier') - ->will($this->returnValue('testIdentifier')); + ->will(self::returnValue('testIdentifier')); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('assign'), - $this->equalTo($userGroupMock), - $this->equalTo([$roleMock]) - )->will($this->returnValue(true)); + self::equalTo('role'), + self::equalTo('assign'), + self::equalTo($userGroupMock), + self::equalTo([$roleMock]) + )->will(self::returnValue(true)); /* @var \Ibexa\Contracts\Core\Repository\Values\User\Limitation\RoleLimitation $limitationMock */ $roleServiceMock->assignRoleToUserGroup($roleMock, $userGroupMock, $limitationMock); @@ -669,17 +670,17 @@ public function testAssignRoleToUserGroup() $limitationMock = $this->createMock(RoleLimitation::class); $limitationTypeMock = $this->createMock(SPIType::class); - $limitationTypeMock->expects($this->once()) + $limitationTypeMock->expects(self::once()) ->method('acceptValue') - ->with($this->equalTo($limitationMock)); - $limitationTypeMock->expects($this->once()) + ->with(self::equalTo($limitationMock)); + $limitationTypeMock->expects(self::once()) ->method('validate') - ->with($this->equalTo($limitationMock)) - ->will($this->returnValue([])); + ->with(self::equalTo($limitationMock)) + ->will(self::returnValue([])); - $limitationMock->expects($this->exactly(2)) + $limitationMock->expects(self::exactly(2)) ->method('getIdentifier') - ->will($this->returnValue('testIdentifier')); + ->will(self::returnValue('testIdentifier')); $settings = [ 'limitationTypes' => ['testIdentifier' => $limitationTypeMock], @@ -693,54 +694,54 @@ public function testAssignRoleToUserGroup() $userServiceMock = $this->createMock(UserService::class); $userHandlerMock = $this->getPersistenceMockHandler('User\\Handler'); - $repository->expects($this->once()) + $repository->expects(self::once()) ->method('getUserService') - ->will($this->returnValue($userServiceMock)); - $userGroupMock->expects($this->any()) + ->will(self::returnValue($userServiceMock)); + $userGroupMock->expects(self::any()) ->method('__get') ->with('id') - ->will($this->returnValue(24)); + ->will(self::returnValue(24)); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('assign'), - $this->equalTo($userGroupMock), - $this->equalTo([$roleMock]) - )->will($this->returnValue(true)); + self::equalTo('role'), + self::equalTo('assign'), + self::equalTo($userGroupMock), + self::equalTo([$roleMock]) + )->will(self::returnValue(true)); - $roleMock->expects($this->any()) + $roleMock->expects(self::any()) ->method('__get') ->with('id') - ->will($this->returnValue(42)); + ->will(self::returnValue(42)); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('loadRole') - ->with($this->equalTo(42)) - ->will($this->returnValue(new SPIRole(['id' => 42]))); + ->with(self::equalTo(42)) + ->will(self::returnValue(new SPIRole(['id' => 42]))); - $userServiceMock->expects($this->once()) + $userServiceMock->expects(self::once()) ->method('loadUserGroup') - ->with($this->equalTo(24)) - ->will($this->returnValue($userGroupMock)); + ->with(self::equalTo(24)) + ->will(self::returnValue($userGroupMock)); - $roleServiceMock->expects($this->once()) + $roleServiceMock->expects(self::once()) ->method('checkAssignmentAndFilterLimitationValues') - ->with(24, $this->isInstanceOf(SPIRole::class), ['testIdentifier' => []]) - ->will($this->returnValue(['testIdentifier' => []])); + ->with(24, self::isInstanceOf(SPIRole::class), ['testIdentifier' => []]) + ->will(self::returnValue(['testIdentifier' => []])); - $repository->expects($this->once())->method('beginTransaction'); + $repository->expects(self::once())->method('beginTransaction'); $userHandlerMock = $this->getPersistenceMockHandler('User\\Handler'); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('assignRole') ->with( - $this->equalTo(24), - $this->equalTo(42), - $this->equalTo(['testIdentifier' => []]) + self::equalTo(24), + self::equalTo(42), + self::equalTo(['testIdentifier' => []]) ); - $repository->expects($this->once())->method('commit'); + $repository->expects(self::once())->method('commit'); /* @var \Ibexa\Contracts\Core\Repository\Values\User\Role $roleMock */ /* @var \Ibexa\Contracts\Core\Repository\Values\User\UserGroup $userGroupMock */ @@ -760,54 +761,54 @@ public function testAssignRoleToUserGroupWithNullLimitation() $userServiceMock = $this->createMock(UserService::class); $userHandlerMock = $this->getPersistenceMockHandler('User\\Handler'); - $repository->expects($this->once()) + $repository->expects(self::once()) ->method('getUserService') - ->will($this->returnValue($userServiceMock)); - $userGroupMock->expects($this->any()) + ->will(self::returnValue($userServiceMock)); + $userGroupMock->expects(self::any()) ->method('__get') ->with('id') - ->will($this->returnValue(24)); + ->will(self::returnValue(24)); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('assign'), - $this->equalTo($userGroupMock), - $this->equalTo([$roleMock]) - )->will($this->returnValue(true)); + self::equalTo('role'), + self::equalTo('assign'), + self::equalTo($userGroupMock), + self::equalTo([$roleMock]) + )->will(self::returnValue(true)); - $roleMock->expects($this->any()) + $roleMock->expects(self::any()) ->method('__get') ->with('id') - ->will($this->returnValue(42)); + ->will(self::returnValue(42)); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('loadRole') - ->with($this->equalTo(42)) - ->will($this->returnValue(new SPIRole(['id' => 42]))); + ->with(self::equalTo(42)) + ->will(self::returnValue(new SPIRole(['id' => 42]))); - $userServiceMock->expects($this->once()) + $userServiceMock->expects(self::once()) ->method('loadUserGroup') - ->with($this->equalTo(24)) - ->will($this->returnValue($userGroupMock)); + ->with(self::equalTo(24)) + ->will(self::returnValue($userGroupMock)); - $roleServiceMock->expects($this->once()) + $roleServiceMock->expects(self::once()) ->method('checkAssignmentAndFilterLimitationValues') - ->with(24, $this->isInstanceOf(SPIRole::class), null) - ->will($this->returnValue(null)); + ->with(24, self::isInstanceOf(SPIRole::class), null) + ->will(self::returnValue(null)); - $repository->expects($this->once())->method('beginTransaction'); + $repository->expects(self::once())->method('beginTransaction'); $userHandlerMock = $this->getPersistenceMockHandler('User\\Handler'); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('assignRole') ->with( - $this->equalTo(24), - $this->equalTo(42), - $this->equalTo(null) + self::equalTo(24), + self::equalTo(42), + self::equalTo(null) ); - $repository->expects($this->once())->method('commit'); + $repository->expects(self::once())->method('commit'); /* @var \Ibexa\Contracts\Core\Repository\Values\User\Role $roleMock */ /* @var \Ibexa\Contracts\Core\Repository\Values\User\UserGroup $userGroupMock */ @@ -828,54 +829,54 @@ public function testAssignRoleToUserGroupWithRollback() $userServiceMock = $this->createMock(UserService::class); $userHandlerMock = $this->getPersistenceMockHandler('User\\Handler'); - $repository->expects($this->once()) + $repository->expects(self::once()) ->method('getUserService') - ->will($this->returnValue($userServiceMock)); - $userGroupMock->expects($this->any()) + ->will(self::returnValue($userServiceMock)); + $userGroupMock->expects(self::any()) ->method('__get') ->with('id') - ->will($this->returnValue(24)); + ->will(self::returnValue(24)); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('assign'), - $this->equalTo($userGroupMock), - $this->equalTo([$roleMock]) - )->will($this->returnValue(true)); + self::equalTo('role'), + self::equalTo('assign'), + self::equalTo($userGroupMock), + self::equalTo([$roleMock]) + )->will(self::returnValue(true)); - $roleMock->expects($this->any()) + $roleMock->expects(self::any()) ->method('__get') ->with('id') - ->will($this->returnValue(42)); + ->will(self::returnValue(42)); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('loadRole') - ->with($this->equalTo(42)) - ->will($this->returnValue(new SPIRole(['id' => 42]))); + ->with(self::equalTo(42)) + ->will(self::returnValue(new SPIRole(['id' => 42]))); - $userServiceMock->expects($this->once()) + $userServiceMock->expects(self::once()) ->method('loadUserGroup') - ->with($this->equalTo(24)) - ->will($this->returnValue($userGroupMock)); + ->with(self::equalTo(24)) + ->will(self::returnValue($userGroupMock)); - $roleServiceMock->expects($this->once()) + $roleServiceMock->expects(self::once()) ->method('checkAssignmentAndFilterLimitationValues') - ->with(24, $this->isInstanceOf(SPIRole::class), null) - ->will($this->returnValue(null)); + ->with(24, self::isInstanceOf(SPIRole::class), null) + ->will(self::returnValue(null)); - $repository->expects($this->once())->method('beginTransaction'); + $repository->expects(self::once())->method('beginTransaction'); $userHandlerMock = $this->getPersistenceMockHandler('User\\Handler'); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('assignRole') ->with( - $this->equalTo(24), - $this->equalTo(42), - $this->equalTo(null) - )->will($this->throwException(new \Exception())); - $repository->expects($this->once())->method('rollback'); + self::equalTo(24), + self::equalTo(42), + self::equalTo(null) + )->will(self::throwException(new \Exception())); + $repository->expects(self::once())->method('rollback'); /* @var \Ibexa\Contracts\Core\Repository\Values\User\Role $roleMock */ /* @var \Ibexa\Contracts\Core\Repository\Values\User\UserGroup $userGroupMock */ @@ -895,10 +896,10 @@ public function testRemovePolicyByRoleDraftThrowsUnauthorizedException() $roleServiceMock = $this->getPartlyMockedRoleService(null, [], $roleDomainMapper); $policyDraftMock = $this->createMock(PolicyDraft::class); - $policyDraftMock->expects($this->any()) + $policyDraftMock->expects(self::any()) ->method('__get') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['roleId', 17], ] @@ -906,13 +907,13 @@ public function testRemovePolicyByRoleDraftThrowsUnauthorizedException() ); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('update'), - $this->equalTo($roleDraftMock) - )->will($this->returnValue(false)); + self::equalTo('role'), + self::equalTo('update'), + self::equalTo($roleDraftMock) + )->will(self::returnValue(false)); /* @var \Ibexa\Contracts\Core\Repository\Values\User\Policy $policyMock */ $roleServiceMock->removePolicyByRoleDraft($roleDraftMock, $policyDraftMock); @@ -928,7 +929,7 @@ public function testRemovePolicyByRoleDraftWithRollback() $repository = $this->getRepositoryMock(); $roleDraftMock = $this->createMock(RoleDraft::class); - $roleDraftMock->expects($this->any()) + $roleDraftMock->expects(self::any()) ->method('__get') ->with('id') ->willReturn(17); @@ -940,10 +941,10 @@ public function testRemovePolicyByRoleDraftWithRollback() $roleServiceMock = $this->getPartlyMockedRoleService(null, [], $roleDomainMapper); $policyDraftMock = $this->createMock(PolicyDraft::class); - $policyDraftMock->expects($this->any()) + $policyDraftMock->expects(self::any()) ->method('__get') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['id', 42], ['roleId', 17], @@ -952,25 +953,25 @@ public function testRemovePolicyByRoleDraftWithRollback() ); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('update'), - $this->equalTo($roleDraftMock) - )->will($this->returnValue(true)); + self::equalTo('role'), + self::equalTo('update'), + self::equalTo($roleDraftMock) + )->will(self::returnValue(true)); - $repository->expects($this->once())->method('beginTransaction'); + $repository->expects(self::once())->method('beginTransaction'); $userHandlerMock = $this->getPersistenceMockHandler('User\\Handler'); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('deletePolicy') ->with( - $this->equalTo(42) - )->will($this->throwException(new \Exception('Handler threw an exception'))); + self::equalTo(42) + )->will(self::throwException(new \Exception('Handler threw an exception'))); - $repository->expects($this->once())->method('rollback'); + $repository->expects(self::once())->method('rollback'); /* @var \Ibexa\Contracts\Core\Repository\Values\User\Policy $policyDraftMock */ $roleServiceMock->removePolicyByRoleDraft($roleDraftMock, $policyDraftMock); @@ -981,7 +982,7 @@ public function testRemovePolicyByRoleDraft() $repository = $this->getRepositoryMock(); $roleDraftMock = $this->createMock(RoleDraft::class); $roleDraftMock - ->expects($this->any()) + ->expects(self::any()) ->method('__get') ->with('id') ->willReturn(17); @@ -994,10 +995,10 @@ public function testRemovePolicyByRoleDraft() $roleServiceMock = $this->getPartlyMockedRoleService(['loadRoleDraft'], [], $roleDomainMapper); $policyDraftMock = $this->createMock(PolicyDraft::class); - $policyDraftMock->expects($this->any()) + $policyDraftMock->expects(self::any()) ->method('__get') ->will( - $this->returnValueMap( + self::returnValueMap( [ ['id', 42], ['roleId', 17], @@ -1006,30 +1007,30 @@ public function testRemovePolicyByRoleDraft() ); $permissionResolverMock = $this->getPermissionResolverMock(); - $permissionResolverMock->expects($this->once()) + $permissionResolverMock->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('role'), - $this->equalTo('update'), - $this->equalTo($roleDraftMock) - )->will($this->returnValue(true)); + self::equalTo('role'), + self::equalTo('update'), + self::equalTo($roleDraftMock) + )->will(self::returnValue(true)); - $repository->expects($this->once())->method('beginTransaction'); + $repository->expects(self::once())->method('beginTransaction'); $userHandlerMock = $this->getPersistenceMockHandler('User\\Handler'); - $userHandlerMock->expects($this->once()) + $userHandlerMock->expects(self::once()) ->method('deletePolicy') ->with( - $this->equalTo(42) + self::equalTo(42) ); - $roleServiceMock->expects($this->once()) + $roleServiceMock->expects(self::once()) ->method('loadRoleDraft') - ->with($this->equalTo(17)) - ->will($this->returnValue($roleDraftMock)); + ->with(self::equalTo(17)) + ->will(self::returnValue($roleDraftMock)); - $repository->expects($this->once())->method('commit'); + $repository->expects(self::once())->method('commit'); /* @var \Ibexa\Contracts\Core\Repository\Values\User\PolicyDraft $policyDraftMock */ $roleServiceMock->removePolicyByRoleDraft($roleDraftMock, $policyDraftMock); @@ -1089,7 +1090,7 @@ protected function getRepositoryMock(): Repository { $repositoryMock = parent::getRepositoryMock(); $repositoryMock - ->expects($this->any()) + ->expects(self::any()) ->method('getPermissionResolver') ->willReturn($this->getPermissionResolverMock()); diff --git a/tests/lib/Repository/Service/Mock/SearchTest.php b/tests/lib/Repository/Service/Mock/SearchTest.php index 848c431a57..fafb892224 100644 --- a/tests/lib/Repository/Service/Mock/SearchTest.php +++ b/tests/lib/Repository/Service/Mock/SearchTest.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\Core\Repository\Service\Mock; use Exception; @@ -115,11 +116,11 @@ public function testFindContentValidatesLocationCriteriaAndSortClauses($query, $ try { $service->findContent($query); } catch (InvalidArgumentException $e) { - $this->assertEquals($exceptionMessage, $e->getMessage()); + self::assertEquals($exceptionMessage, $e->getMessage()); throw $e; } - $this->fail('Expected exception was not thrown'); + self::fail('Expected exception was not thrown'); } public function providerForFindSingleValidatesLocationCriteria() @@ -163,11 +164,11 @@ public function testFindSingleValidatesLocationCriteria($criterion, $exceptionMe try { $service->findSingle($criterion); } catch (InvalidArgumentException $e) { - $this->assertEquals($exceptionMessage, $e->getMessage()); + self::assertEquals($exceptionMessage, $e->getMessage()); throw $e; } - $this->fail('Expected exception was not thrown'); + self::fail('Expected exception was not thrown'); } /** @@ -202,10 +203,10 @@ public function testFindContentThrowsHandlerException() ->getMock(); $query = new Query(['filter' => $criterionMock]); - $permissionsCriterionResolverMock->expects($this->once()) + $permissionsCriterionResolverMock->expects(self::once()) ->method('getPermissionsCriterion') ->with('content', 'read') - ->will($this->throwException(new Exception('Handler threw an exception'))); + ->will(self::throwException(new Exception('Handler threw an exception'))); $service->findContent($query, [], true); } @@ -218,9 +219,9 @@ public function testFindContentThrowsHandlerException() public function testFindContentWhenDomainMapperThrowsException() { $indexer = $this->createMock(BackgroundIndexer::class); - $indexer->expects($this->once()) + $indexer->expects(self::once()) ->method('registerContent') - ->with($this->isInstanceOf(SPIContentInfo::class)); + ->with(self::isInstanceOf(SPIContentInfo::class)); $service = $this->getMockBuilder(SearchService::class) ->setConstructorArgs([ @@ -234,14 +235,14 @@ public function testFindContentWhenDomainMapperThrowsException() $info = new SPIContentInfo(['id' => 33]); $result = new SearchResult(['searchHits' => [new SearchHit(['valueObject' => $info])], 'totalCount' => 2]); - $service->expects($this->once()) + $service->expects(self::once()) ->method('internalFindContentInfo') - ->with($this->isInstanceOf(Query::class)) + ->with(self::isInstanceOf(Query::class)) ->willReturn($result); - $mapper->expects($this->once()) + $mapper->expects(self::once()) ->method('buildContentDomainObjectsOnSearchResult') - ->with($this->equalTo($result), $this->equalTo([])) + ->with(self::equalTo($result), self::equalTo([])) ->willReturnCallback(static function (SearchResult $spiResult) use ($info) { unset($spiResult->searchHits[0]); --$spiResult->totalCount; @@ -251,8 +252,8 @@ public function testFindContentWhenDomainMapperThrowsException() $finalResult = $service->findContent(new Query()); - $this->assertEmpty($finalResult->searchHits, 'Expected search hits to be empty'); - $this->assertEquals(1, $finalResult->totalCount, 'Expected total count to be 1'); + self::assertEmpty($finalResult->searchHits, 'Expected search hits to be empty'); + self::assertEquals(1, $finalResult->totalCount, 'Expected total count to be 1'); } /** @@ -275,7 +276,7 @@ public function testFindContentNoPermissionsFilter() [] ); - $repositoryMock->expects($this->never())->method('getPermissionResolver'); + $repositoryMock->expects(self::never())->method('getPermissionResolver'); $serviceQuery = new Query(); $handlerQuery = new Query(['filter' => new Criterion\MatchAll(), 'limit' => 25]); @@ -284,11 +285,11 @@ public function testFindContentNoPermissionsFilter() $contentMock = $this->getMockForAbstractClass(Content::class); /* @var \PHPUnit\Framework\MockObject\MockObject $searchHandlerMock */ - $searchHandlerMock->expects($this->once()) + $searchHandlerMock->expects(self::once()) ->method('findContent') - ->with($this->equalTo($handlerQuery), $this->equalTo($languageFilter)) + ->with(self::equalTo($handlerQuery), self::equalTo($languageFilter)) ->will( - $this->returnValue( + self::returnValue( new SearchResult( [ 'searchHits' => [new SearchHit(['valueObject' => $spiContentInfo])], @@ -298,9 +299,9 @@ public function testFindContentNoPermissionsFilter() ) ); - $mapper->expects($this->once()) + $mapper->expects(self::once()) ->method('buildContentDomainObjectsOnSearchResult') - ->with($this->isInstanceOf(SearchResult::class), $this->equalTo([])) + ->with(self::isInstanceOf(SearchResult::class), self::equalTo([])) ->willReturnCallback(static function (SearchResult $spiResult) use ($contentMock) { $spiResult->searchHits[0]->valueObject = $contentMock; @@ -309,7 +310,7 @@ public function testFindContentNoPermissionsFilter() $result = $service->findContent($serviceQuery, $languageFilter, false); - $this->assertEquals( + self::assertEquals( new SearchResult( [ 'searchHits' => [new SearchHit(['valueObject' => $contentMock])], @@ -350,17 +351,17 @@ public function testFindContentWithPermission() $spiContentInfo = new SPIContentInfo(); $contentMock = $this->getMockForAbstractClass(Content::class); - $permissionsCriterionResolverMock->expects($this->once()) + $permissionsCriterionResolverMock->expects(self::once()) ->method('getPermissionsCriterion') ->with('content', 'read') - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); /* @var \PHPUnit\Framework\MockObject\MockObject $searchHandlerMock */ - $searchHandlerMock->expects($this->once()) + $searchHandlerMock->expects(self::once()) ->method('findContent') - ->with($this->equalTo($query), $this->equalTo($languageFilter)) + ->with(self::equalTo($query), self::equalTo($languageFilter)) ->will( - $this->returnValue( + self::returnValue( new SearchResult( [ 'searchHits' => [new SearchHit(['valueObject' => $spiContentInfo])], @@ -371,9 +372,9 @@ public function testFindContentWithPermission() ); $domainMapperMock - ->expects($this->once()) + ->expects(self::once()) ->method('buildContentDomainObjectsOnSearchResult') - ->with($this->isInstanceOf(SearchResult::class), $this->equalTo([])) + ->with(self::isInstanceOf(SearchResult::class), self::equalTo([])) ->willReturnCallback(static function (SearchResult $spiResult) use ($contentMock) { $spiResult->searchHits[0]->valueObject = $contentMock; @@ -382,7 +383,7 @@ public function testFindContentWithPermission() $result = $service->findContent($query, $languageFilter, true); - $this->assertEquals( + self::assertEquals( new SearchResult( [ 'searchHits' => [new SearchHit(['valueObject' => $contentMock])], @@ -414,7 +415,7 @@ public function testFindContentWithNoPermission() ); /* @var \PHPUnit\Framework\MockObject\MockObject $searchHandlerMock */ - $searchHandlerMock->expects($this->never())->method('findContent'); + $searchHandlerMock->expects(self::never())->method('findContent'); $criterionMock = $this ->getMockBuilder(Criterion::class) @@ -422,19 +423,19 @@ public function testFindContentWithNoPermission() ->getMock(); $query = new Query(['filter' => $criterionMock]); - $permissionsCriterionResolverMock->expects($this->once()) + $permissionsCriterionResolverMock->expects(self::once()) ->method('getPermissionsCriterion') ->with('content', 'read') - ->will($this->returnValue(false)); + ->will(self::returnValue(false)); - $mapper->expects($this->once()) + $mapper->expects(self::once()) ->method('buildContentDomainObjectsOnSearchResult') - ->with($this->isInstanceOf(SearchResult::class), $this->equalTo([])) + ->with(self::isInstanceOf(SearchResult::class), self::equalTo([])) ->willReturn([]); $result = $service->findContent($query, [], true); - $this->assertEquals( + self::assertEquals( new SearchResult(['time' => 0, 'totalCount' => 0]), $result ); @@ -463,7 +464,7 @@ public function testFindContentWithDefaultQueryValues() /* @var \PHPUnit\Framework\MockObject\MockObject $searchHandlerMock */ $searchHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('findContent') ->with( new Query( @@ -475,7 +476,7 @@ public function testFindContentWithDefaultQueryValues() [] ) ->will( - $this->returnValue( + self::returnValue( new SearchResult( [ 'searchHits' => [new SearchHit(['valueObject' => $spiContentInfo])], @@ -486,9 +487,9 @@ public function testFindContentWithDefaultQueryValues() ); $domainMapperMock - ->expects($this->once()) + ->expects(self::once()) ->method('buildContentDomainObjectsOnSearchResult') - ->with($this->isInstanceOf(SearchResult::class), $this->equalTo([])) + ->with(self::isInstanceOf(SearchResult::class), self::equalTo([])) ->willReturnCallback(static function (SearchResult $spiResult) use ($contentMock) { $spiResult->searchHits[0]->valueObject = $contentMock; @@ -497,7 +498,7 @@ public function testFindContentWithDefaultQueryValues() $result = $service->findContent(new Query(), $languageFilter, false); - $this->assertEquals( + self::assertEquals( new SearchResult( [ 'searchHits' => [new SearchHit(['valueObject' => $contentMock])], @@ -536,7 +537,7 @@ public function testFindSingleThrowsNotFoundException() ->disableOriginalConstructor() ->getMock(); - $permissionsCriterionResolverMock->expects($this->once()) + $permissionsCriterionResolverMock->expects(self::once()) ->method('getPermissionsCriterion') ->with('content', 'read') ->willReturn(false); @@ -574,10 +575,10 @@ public function testFindSingleThrowsHandlerException() ->disableOriginalConstructor() ->getMock(); - $permissionsCriterionResolverMock->expects($this->once()) + $permissionsCriterionResolverMock->expects(self::once()) ->method('getPermissionsCriterion') ->with('content', 'read') - ->will($this->throwException(new Exception('Handler threw an exception'))); + ->will(self::throwException(new Exception('Handler threw an exception'))); $service->findSingle($criterionMock, [], true); } @@ -605,10 +606,10 @@ public function testFindSingle() ); $repositoryMock - ->expects($this->once()) + ->expects(self::once()) ->method('getContentService') ->will( - $this->returnValue( + self::returnValue( $contentServiceMock = $this ->getMockBuilder(ContentService::class) ->disableOriginalConstructor() @@ -622,10 +623,10 @@ public function testFindSingle() ->disableOriginalConstructor() ->getMock(); - $permissionsCriterionResolverMock->expects($this->once()) + $permissionsCriterionResolverMock->expects(self::once()) ->method('getPermissionsCriterion') ->with('content', 'read') - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $languageFilter = []; $spiContentInfo = new SPIContentInfo(['id' => 123]); @@ -633,22 +634,22 @@ public function testFindSingle() /* @var \PHPUnit\Framework\MockObject\MockObject $searchHandlerMock */ $searchHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('findSingle') - ->with($this->equalTo($criterionMock), $this->equalTo($languageFilter)) - ->will($this->returnValue($spiContentInfo)); + ->with(self::equalTo($criterionMock), self::equalTo($languageFilter)) + ->will(self::returnValue($spiContentInfo)); - $domainMapperMock->expects($this->never()) - ->method($this->anything()); + $domainMapperMock->expects(self::never()) + ->method(self::anything()); $contentServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method('internalLoadContentById') - ->will($this->returnValue($contentMock)); + ->will(self::returnValue($contentMock)); $result = $service->findSingle($criterionMock, $languageFilter, true); - $this->assertEquals($contentMock, $result); + self::assertEquals($contentMock, $result); } /** @@ -679,11 +680,11 @@ public function testFindLocationsWithPermission() $locationMock = $this->getMockForAbstractClass(Location::class); /* @var \PHPUnit\Framework\MockObject\MockObject $searchHandlerMock */ - $searchHandlerMock->expects($this->once()) + $searchHandlerMock->expects(self::once()) ->method('findLocations') - ->with($this->equalTo($query)) + ->with(self::equalTo($query)) ->will( - $this->returnValue( + self::returnValue( $spiResult = new SearchResult( [ 'searchHits' => [new SearchHit(['valueObject' => $spiLocation])], @@ -693,10 +694,10 @@ public function testFindLocationsWithPermission() ) ); - $permissionsCriterionResolverMock->expects($this->once()) + $permissionsCriterionResolverMock->expects(self::once()) ->method('getPermissionsCriterion') ->with('content', 'read') - ->will($this->returnValue(true)); + ->will(self::returnValue(true)); $endResult = new SearchResult( [ @@ -705,9 +706,9 @@ public function testFindLocationsWithPermission() ] ); - $domainMapperMock->expects($this->once()) + $domainMapperMock->expects(self::once()) ->method('buildLocationDomainObjectsOnSearchResult') - ->with($this->equalTo($spiResult)) + ->with(self::equalTo($spiResult)) ->willReturnCallback(static function (SearchResult $spiResult) use ($endResult) { $spiResult->searchHits[0] = $endResult->searchHits[0]; @@ -716,7 +717,7 @@ public function testFindLocationsWithPermission() $result = $service->findLocations($query, [], true); - $this->assertEquals( + self::assertEquals( $endResult, $result ); @@ -741,7 +742,7 @@ public function testFindLocationsWithNoPermissionsFilter() [] ); - $repositoryMock->expects($this->never())->method('getPermissionResolver'); + $repositoryMock->expects(self::never())->method('getPermissionResolver'); $serviceQuery = new LocationQuery(); $handlerQuery = new LocationQuery(['filter' => new Criterion\MatchAll(), 'limit' => 25]); @@ -749,11 +750,11 @@ public function testFindLocationsWithNoPermissionsFilter() $locationMock = $this->getMockForAbstractClass(Location::class); /* @var \PHPUnit\Framework\MockObject\MockObject $searchHandlerMock */ - $searchHandlerMock->expects($this->once()) + $searchHandlerMock->expects(self::once()) ->method('findLocations') - ->with($this->equalTo($handlerQuery)) + ->with(self::equalTo($handlerQuery)) ->will( - $this->returnValue( + self::returnValue( $spiResult = new SearchResult( [ 'searchHits' => [new SearchHit(['valueObject' => $spiLocation])], @@ -763,7 +764,7 @@ public function testFindLocationsWithNoPermissionsFilter() ) ); - $permissionsCriterionResolverMock->expects($this->never())->method($this->anything()); + $permissionsCriterionResolverMock->expects(self::never())->method(self::anything()); $endResult = new SearchResult( [ @@ -772,9 +773,9 @@ public function testFindLocationsWithNoPermissionsFilter() ] ); - $domainMapperMock->expects($this->once()) + $domainMapperMock->expects(self::once()) ->method('buildLocationDomainObjectsOnSearchResult') - ->with($this->equalTo($spiResult)) + ->with(self::equalTo($spiResult)) ->willReturnCallback(static function (SearchResult $spiResult) use ($endResult) { $spiResult->searchHits[0] = $endResult->searchHits[0]; @@ -783,7 +784,7 @@ public function testFindLocationsWithNoPermissionsFilter() $result = $service->findLocations($serviceQuery, [], false); - $this->assertEquals( + self::assertEquals( $endResult, $result ); @@ -797,9 +798,9 @@ public function testFindLocationsWithNoPermissionsFilter() public function testFindLocationsBackgroundIndexerWhenDomainMapperThrowsException() { $indexer = $this->createMock(BackgroundIndexer::class); - $indexer->expects($this->once()) + $indexer->expects(self::once()) ->method('registerLocation') - ->with($this->isInstanceOf(SPILocation::class)); + ->with(self::isInstanceOf(SPILocation::class)); $service = $this->getMockBuilder(SearchService::class) ->setConstructorArgs([ @@ -812,20 +813,20 @@ public function testFindLocationsBackgroundIndexerWhenDomainMapperThrowsExceptio ->getMock(); $location = new SPILocation(['id' => 44]); - $service->expects($this->once()) + $service->expects(self::once()) ->method('addPermissionsCriterion') - ->with($this->isInstanceOf(Criterion::class)) + ->with(self::isInstanceOf(Criterion::class)) ->willReturn(true); $result = new SearchResult(['searchHits' => [new SearchHit(['valueObject' => $location])], 'totalCount' => 2]); - $searchHandler->expects($this->once()) + $searchHandler->expects(self::once()) ->method('findLocations') - ->with($this->isInstanceOf(LocationQuery::class), $this->isType('array')) + ->with(self::isInstanceOf(LocationQuery::class), self::isType('array')) ->willReturn($result); - $mapper->expects($this->once()) + $mapper->expects(self::once()) ->method('buildLocationDomainObjectsOnSearchResult') - ->with($this->equalTo($result)) + ->with(self::equalTo($result)) ->willReturnCallback(static function (SearchResult $spiResult) use ($location) { unset($spiResult->searchHits[0]); --$spiResult->totalCount; @@ -835,8 +836,8 @@ public function testFindLocationsBackgroundIndexerWhenDomainMapperThrowsExceptio $finalResult = $service->findLocations(new LocationQuery()); - $this->assertEmpty($finalResult->searchHits, 'Expected search hits to be empty'); - $this->assertEquals(1, $finalResult->totalCount, 'Expected total count to be 1'); + self::assertEmpty($finalResult->searchHits, 'Expected search hits to be empty'); + self::assertEquals(1, $finalResult->totalCount, 'Expected total count to be 1'); } /** @@ -868,10 +869,10 @@ public function testFindLocationsThrowsHandlerException() ->getMock(); $query = new LocationQuery(['filter' => $criterionMock]); - $permissionsCriterionResolverMock->expects($this->once()) + $permissionsCriterionResolverMock->expects(self::once()) ->method('getPermissionsCriterion') ->with('content', 'read') - ->will($this->throwException(new Exception('Handler threw an exception'))); + ->will(self::throwException(new Exception('Handler threw an exception'))); $service->findLocations($query, [], true); } @@ -899,7 +900,7 @@ public function testFindLocationsWithDefaultQueryValues() /* @var \PHPUnit\Framework\MockObject\MockObject $searchHandlerMock */ $searchHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('findLocations') ->with( new LocationQuery( @@ -910,7 +911,7 @@ public function testFindLocationsWithDefaultQueryValues() ) ) ->will( - $this->returnValue( + self::returnValue( $spiResult = new SearchResult( [ 'searchHits' => [new SearchHit(['valueObject' => $spiLocation])], @@ -927,9 +928,9 @@ public function testFindLocationsWithDefaultQueryValues() ] ); - $domainMapperMock->expects($this->once()) + $domainMapperMock->expects(self::once()) ->method('buildLocationDomainObjectsOnSearchResult') - ->with($this->equalTo($spiResult)) + ->with(self::equalTo($spiResult)) ->willReturnCallback(static function (SearchResult $spiResult) use ($endResult) { $spiResult->searchHits[0] = $endResult->searchHits[0]; @@ -938,7 +939,7 @@ public function testFindLocationsWithDefaultQueryValues() $result = $service->findLocations(new LocationQuery(), [], false); - $this->assertEquals( + self::assertEquals( $endResult, $result ); diff --git a/tests/lib/Repository/Service/Mock/UrlAliasTest.php b/tests/lib/Repository/Service/Mock/UrlAliasTest.php index c077982d38..96e419ca44 100644 --- a/tests/lib/Repository/Service/Mock/UrlAliasTest.php +++ b/tests/lib/Repository/Service/Mock/UrlAliasTest.php @@ -73,15 +73,15 @@ public function testLoad() $urlAliasHandlerMock = $this->getPersistenceMock()->urlAliasHandler(); $urlAliasHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadUrlAlias') ->with(self::EXAMPLE_ID) ->willReturn(new SPIUrlAlias()); $mockedService - ->expects($this->once()) + ->expects(self::once()) ->method('extractPath') - ->with($this->isInstanceOf(SPIUrlAlias::class), null) + ->with(self::isInstanceOf(SPIUrlAlias::class), null) ->willReturn('path'); $urlAlias = $mockedService->load(self::EXAMPLE_ID); @@ -99,10 +99,10 @@ public function testLoadThrowsNotFoundException() $urlAliasHandlerMock = $this->getPersistenceMock()->urlAliasHandler(); $urlAliasHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('loadUrlAlias') ->with(self::EXAMPLE_ID) - ->will($this->throwException(new NotFoundException('UrlAlias', self::EXAMPLE_ID))); + ->will(self::throwException(new NotFoundException('UrlAlias', self::EXAMPLE_ID))); $this->expectException(ApiNotFoundException::class); $mockedService->load(self::EXAMPLE_ID); @@ -154,7 +154,7 @@ public function testLoadThrowsNotFoundExceptionPath() ); $this->urlAliasHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadUrlAlias') ->with(self::EXAMPLE_ID) ->willReturn($spiUrlAlias); @@ -172,10 +172,10 @@ public function testRemoveAliasesThrowsInvalidArgumentException() $aliasList = [new URLAlias(['isCustom' => false])]; $mockedService = $this->getPartlyMockedURLAliasServiceService(); $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess')->with( - $this->equalTo('content'), - $this->equalTo('urltranslator') + self::equalTo('content'), + self::equalTo('urltranslator') ) ->willReturn(true); @@ -192,10 +192,10 @@ public function testRemoveAliases() $aliasList = [new URLAlias(['isCustom' => true])]; $spiAliasList = [new SPIUrlAlias(['isCustom' => true])]; $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess')->with( - $this->equalTo('content'), - $this->equalTo('urltranslator') + self::equalTo('content'), + self::equalTo('urltranslator') )->willReturn(true); $repositoryMock = $this->getRepositoryMock(); @@ -205,14 +205,14 @@ public function testRemoveAliases() $urlAliasHandlerMock = $this->getPersistenceMock()->urlAliasHandler(); $repositoryMock - ->expects($this->once()) + ->expects(self::once()) ->method('beginTransaction'); $repositoryMock - ->expects($this->once()) + ->expects(self::once()) ->method('commit'); $urlAliasHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('removeURLAliases') ->with($spiAliasList); @@ -227,10 +227,10 @@ public function testRemoveAliasesWithRollback() $aliasList = [new URLAlias(['isCustom' => true])]; $spiAliasList = [new SPIUrlAlias(['isCustom' => true])]; $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess')->with( - $this->equalTo('content'), - $this->equalTo('urltranslator') + self::equalTo('content'), + self::equalTo('urltranslator') )->willReturn(true); $repositoryMock = $this->getRepositoryMock(); @@ -240,17 +240,17 @@ public function testRemoveAliasesWithRollback() $urlAliasHandlerMock = $this->getPersistenceMock()->urlAliasHandler(); $repositoryMock - ->expects($this->once()) + ->expects(self::once()) ->method('beginTransaction'); $repositoryMock - ->expects($this->once()) + ->expects(self::once()) ->method('rollback'); $urlAliasHandlerMock - ->expects($this->once()) + ->expects(self::once()) ->method('removeURLAliases') ->with($spiAliasList) - ->will($this->throwException(new Exception('Handler threw an exception'))); + ->will(self::throwException(new Exception('Handler threw an exception'))); $this->expectException(Exception::class); $this->expectExceptionMessage('Handler threw an exception'); @@ -744,11 +744,11 @@ public function testListLocationAliasesWithShowAllTranslations() ); $this->urlAliasHandler - ->expects($this->once()) + ->expects(self::once()) ->method('listURLAliasesForLocation') ->with( - $this->equalTo(42), - $this->equalTo(false) + self::equalTo(42), + self::equalTo(false) ) ->willReturn([$spiUrlAlias]); @@ -800,11 +800,11 @@ public function testListLocationAliasesWithShowAllTranslationsCustomConfiguratio ); $this->urlAliasHandler - ->expects($this->once()) + ->expects(self::once()) ->method('listURLAliasesForLocation') ->with( - $this->equalTo(42), - $this->equalTo(false) + self::equalTo(42), + self::equalTo(false) ) ->willReturn([$spiUrlAlias]); @@ -2391,13 +2391,13 @@ public function testListGlobalAliases() ); $this->urlAliasHandler->expects( - $this->once() + self::once() )->method( 'listGlobalURLAliases' )->with( - $this->equalTo(null), - $this->equalTo(0), - $this->equalTo(-1) + self::equalTo(null), + self::equalTo(0), + self::equalTo(-1) )->willReturn( [ new SPIUrlAlias( @@ -2431,13 +2431,13 @@ public function testListGlobalAliasesEmpty() $urlAliasService = $this->getPartlyMockedURLAliasServiceService(); $this->urlAliasHandler->expects( - $this->once() + self::once() )->method( 'listGlobalURLAliases' )->with( - $this->equalTo(null), - $this->equalTo(0), - $this->equalTo(-1) + self::equalTo(null), + self::equalTo(0), + self::equalTo(-1) )->willReturn( [ new SPIUrlAlias( @@ -2470,13 +2470,13 @@ public function testListGlobalAliasesWithParameters() $urlAliasService = $this->getPartlyMockedURLAliasServiceService(); $this->urlAliasHandler->expects( - $this->once() + self::once() )->method( 'listGlobalURLAliases' )->with( - $this->equalTo(self::EXAMPLE_LANGUAGE_CODE), - $this->equalTo(self::EXAMPLE_OFFSET), - $this->equalTo(self::EXAMPLE_LIMIT) + self::equalTo(self::EXAMPLE_LANGUAGE_CODE), + self::equalTo(self::EXAMPLE_OFFSET), + self::equalTo(self::EXAMPLE_LIMIT) )->willReturn( [] ); @@ -2500,13 +2500,13 @@ public function testLookupThrowsNotFoundException() $urlAliasService = $this->getPartlyMockedURLAliasServiceService(); $this->urlAliasHandler->expects( - $this->once() + self::once() )->method( 'lookup' )->with( - $this->equalTo('url') + self::equalTo('url') )->will( - $this->throwException(new NotFoundException('UrlAlias', 'url')) + self::throwException(new NotFoundException('UrlAlias', 'url')) ); $urlAliasService->lookup('url'); @@ -2541,11 +2541,11 @@ public function testLookupThrowsNotFoundExceptionPathNotMatchedOrNotLoadable($ur ); $this->urlAliasHandler->expects( - $this->once() + self::once() )->method( 'lookup' )->with( - $this->equalTo($url) + self::equalTo($url) )->willReturn( new SPIUrlAlias( [ @@ -2597,11 +2597,11 @@ public function testLookup($prioritizedLanguageList, $showAllTranslations, $alwa ); $this->urlAliasHandler->expects( - $this->once() + self::once() )->method( 'lookup' )->with( - $this->equalTo('jedan/dva') + self::equalTo('jedan/dva') )->willReturn( new SPIUrlAlias( [ @@ -2671,11 +2671,11 @@ public function testLookupWithSharedTranslation( ); $this->urlAliasHandler->expects( - $this->once() + self::once() )->method( 'lookup' )->with( - $this->equalTo('jedan/two') + self::equalTo('jedan/two') )->willReturn( new SPIUrlAlias( [ @@ -2716,15 +2716,15 @@ public function testReverseLookupCustomConfiguration() $mockedService = $this->getPartlyMockedURLAliasServiceService(['listLocationAliases']); $location = $this->getLocationStub(); $mockedService->expects( - $this->once() + self::once() )->method( 'listLocationAliases' )->with( - $this->equalTo($location), - $this->equalTo(false), - $this->equalTo(null), - $this->equalTo($showAllTranslations = true), - $this->equalTo($prioritizedLanguageList = ['LANGUAGES!']) + self::equalTo($location), + self::equalTo(false), + self::equalTo(null), + self::equalTo($showAllTranslations = true), + self::equalTo($prioritizedLanguageList = ['LANGUAGES!']) )->willReturn( [] ); @@ -2748,13 +2748,13 @@ public function testReverseLookupThrowsNotFoundException() $location = $this->getLocationStub(); $urlAliasService->expects( - $this->once() + self::once() )->method( 'listLocationAliases' )->with( - $this->equalTo($location), - $this->equalTo(false), - $this->equalTo($languageCode) + self::equalTo($location), + self::equalTo(false), + self::equalTo($languageCode) )->willReturn( [ new UrlAlias( @@ -2856,11 +2856,11 @@ public function testCreateUrlAlias() { $location = $this->getLocationStub(); $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('canUser')->with( - $this->equalTo('content'), - $this->equalTo('urltranslator'), - $this->equalTo($location) + self::equalTo('content'), + self::equalTo('urltranslator'), + self::equalTo($location) ) ->willReturn(true); @@ -2871,22 +2871,22 @@ public function testCreateUrlAlias() $urlAliasHandlerMock = $this->getPersistenceMock()->urlAliasHandler(); $repositoryMock - ->expects($this->once()) + ->expects(self::once()) ->method('beginTransaction'); $repositoryMock - ->expects($this->once()) + ->expects(self::once()) ->method('commit'); $urlAliasHandlerMock->expects( - $this->once() + self::once() )->method( 'createCustomUrlAlias' )->with( - $this->equalTo($location->id), - $this->equalTo(self::EXAMPLE_PATH), - $this->equalTo(true), - $this->equalTo(self::EXAMPLE_LANGUAGE_CODE), - $this->equalTo(true) + self::equalTo($location->id), + self::equalTo(self::EXAMPLE_PATH), + self::equalTo(true), + self::equalTo(self::EXAMPLE_LANGUAGE_CODE), + self::equalTo(true) )->willReturn( new SPIUrlAlias() ); @@ -2913,12 +2913,12 @@ public function testCreateUrlAliasWithRollback() $location = $this->getLocationStub(); $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('content'), - $this->equalTo('urltranslator'), - $this->equalTo($location) + self::equalTo('content'), + self::equalTo('urltranslator'), + self::equalTo($location) ) ->willReturn(true); @@ -2929,24 +2929,24 @@ public function testCreateUrlAliasWithRollback() $urlAliasHandlerMock = $this->getPersistenceMock()->urlAliasHandler(); $repositoryMock - ->expects($this->once()) + ->expects(self::once()) ->method('beginTransaction'); $repositoryMock - ->expects($this->once()) + ->expects(self::once()) ->method('rollback'); $urlAliasHandlerMock->expects( - $this->once() + self::once() )->method( 'createCustomUrlAlias' )->with( - $this->equalTo($location->id), - $this->equalTo(self::EXAMPLE_PATH), - $this->equalTo(true), - $this->equalTo(self::EXAMPLE_LANGUAGE_CODE), - $this->equalTo(true) + self::equalTo($location->id), + self::equalTo(self::EXAMPLE_PATH), + self::equalTo(true), + self::equalTo(self::EXAMPLE_LANGUAGE_CODE), + self::equalTo(true) )->will( - $this->throwException(new Exception('Handler threw an exception')) + self::throwException(new Exception('Handler threw an exception')) ); $mockedService->createUrlAlias( @@ -2972,27 +2972,27 @@ public function testCreateUrlAliasThrowsInvalidArgumentException() $handlerMock = $this->getPersistenceMock()->urlAliasHandler(); $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('content'), - $this->equalTo('urltranslator'), - $this->equalTo($location) + self::equalTo('content'), + self::equalTo('urltranslator'), + self::equalTo($location) ) ->willReturn(true); $handlerMock->expects( - $this->once() + self::once() )->method( 'createCustomUrlAlias' )->with( - $this->equalTo($location->id), - $this->equalTo(self::EXAMPLE_PATH), - $this->equalTo(true), - $this->equalTo(self::EXAMPLE_LANGUAGE_CODE), - $this->equalTo(true) + self::equalTo($location->id), + self::equalTo(self::EXAMPLE_PATH), + self::equalTo(true), + self::equalTo(self::EXAMPLE_LANGUAGE_CODE), + self::equalTo(true) )->will( - $this->throwException(new ForbiddenException('Forbidden!')) + self::throwException(new ForbiddenException('Forbidden!')) ); $mockedService->createUrlAlias( @@ -3012,11 +3012,11 @@ public function testCreateGlobalUrlAlias() $resource = 'module:content/search'; $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess') ->with( - $this->equalTo('content'), - $this->equalTo('urltranslator') + self::equalTo('content'), + self::equalTo('urltranslator') ) ->willReturn(true); @@ -3027,22 +3027,22 @@ public function testCreateGlobalUrlAlias() $urlAliasHandlerMock = $this->getPersistenceMock()->urlAliasHandler(); $repositoryMock - ->expects($this->once()) + ->expects(self::once()) ->method('beginTransaction'); $repositoryMock - ->expects($this->once()) + ->expects(self::once()) ->method('commit'); $urlAliasHandlerMock->expects( - $this->once() + self::once() )->method( 'createGlobalUrlAlias' )->with( - $this->equalTo($resource), - $this->equalTo(self::EXAMPLE_PATH), - $this->equalTo(true), - $this->equalTo(self::EXAMPLE_LANGUAGE_CODE), - $this->equalTo(true) + self::equalTo($resource), + self::equalTo(self::EXAMPLE_PATH), + self::equalTo(true), + self::equalTo(self::EXAMPLE_LANGUAGE_CODE), + self::equalTo(true) )->willReturn( new SPIUrlAlias() ); @@ -3069,11 +3069,11 @@ public function testCreateGlobalUrlAliasWithRollback() $resource = 'module:content/search'; $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess') ->with( - $this->equalTo('content'), - $this->equalTo('urltranslator') + self::equalTo('content'), + self::equalTo('urltranslator') ) ->willReturn(true); @@ -3084,24 +3084,24 @@ public function testCreateGlobalUrlAliasWithRollback() $urlAliasHandlerMock = $this->getPersistenceMock()->urlAliasHandler(); $repositoryMock - ->expects($this->once()) + ->expects(self::once()) ->method('beginTransaction'); $repositoryMock - ->expects($this->once()) + ->expects(self::once()) ->method('rollback'); $urlAliasHandlerMock->expects( - $this->once() + self::once() )->method( 'createGlobalUrlAlias' )->with( - $this->equalTo($resource), - $this->equalTo(self::EXAMPLE_PATH), - $this->equalTo(true), - $this->equalTo(self::EXAMPLE_LANGUAGE_CODE), - $this->equalTo(true) + self::equalTo($resource), + self::equalTo(self::EXAMPLE_PATH), + self::equalTo(true), + self::equalTo(self::EXAMPLE_LANGUAGE_CODE), + self::equalTo(true) )->will( - $this->throwException(new Exception('Handler threw an exception')) + self::throwException(new Exception('Handler threw an exception')) ); $mockedService->createGlobalUrlAlias( @@ -3122,10 +3122,10 @@ public function testCreateGlobalUrlAliasThrowsInvalidArgumentExceptionResource() $mockedService = $this->getPartlyMockedURLAliasServiceService(); $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess')->with( - $this->equalTo('content'), - $this->equalTo('urltranslator') + self::equalTo('content'), + self::equalTo('urltranslator') ) ->willReturn(true); @@ -3149,26 +3149,26 @@ public function testCreateGlobalUrlAliasThrowsInvalidArgumentExceptionPath() $mockedService = $this->getPartlyMockedURLAliasServiceService(); $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess') ->with( - $this->equalTo('content'), - $this->equalTo('urltranslator') + self::equalTo('content'), + self::equalTo('urltranslator') ) ->willReturn(true); $this->urlAliasHandler->expects( - $this->once() + self::once() )->method( 'createGlobalUrlAlias' )->with( - $this->equalTo($resource), - $this->equalTo(self::EXAMPLE_PATH), - $this->equalTo(true), - $this->equalTo(self::EXAMPLE_LANGUAGE_CODE), - $this->equalTo(true) + self::equalTo($resource), + self::equalTo(self::EXAMPLE_PATH), + self::equalTo(true), + self::equalTo(self::EXAMPLE_LANGUAGE_CODE), + self::equalTo(true) )->will( - $this->throwException(new ForbiddenException('Forbidden!')) + self::throwException(new ForbiddenException('Forbidden!')) ); $mockedService->createGlobalUrlAlias( @@ -3195,17 +3195,17 @@ public function testCreateGlobalUrlAliasForLocation() $locationServiceMock = $this->createMock(LocationService::class); $locationServiceMock->expects( - $this->exactly(2) + self::exactly(2) )->method( 'loadLocation' )->with( - $this->equalTo(42) + self::equalTo(42) )->willReturn( $location ); $repositoryMock->expects( - $this->exactly(2) + self::exactly(2) )->method( 'getLocationService' )->willReturn( @@ -3213,24 +3213,24 @@ public function testCreateGlobalUrlAliasForLocation() ); $this->permissionResolver - ->expects($this->exactly(2)) + ->expects(self::exactly(2)) ->method('canUser')->with( - $this->equalTo('content'), - $this->equalTo('urltranslator'), - $this->equalTo($location) + self::equalTo('content'), + self::equalTo('urltranslator'), + self::equalTo($location) ) ->willReturn(true); $mockedService->expects( - $this->exactly(2) + self::exactly(2) )->method( 'createUrlAlias' )->with( - $this->equalTo($location), - $this->equalTo(self::EXAMPLE_PATH), - $this->equalTo(self::EXAMPLE_LANGUAGE_CODE), - $this->equalTo(true), - $this->equalTo(true) + self::equalTo($location), + self::equalTo(self::EXAMPLE_PATH), + self::equalTo(self::EXAMPLE_LANGUAGE_CODE), + self::equalTo(true), + self::equalTo(true) ); $mockedService->createGlobalUrlAlias( @@ -3324,11 +3324,11 @@ public function testCreateUrlAliasThrowsUnauthorizedException() $mockedService = $this->getPartlyMockedURLAliasServiceService(); $location = $this->getLocationStub(); $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('canUser')->with( - $this->equalTo('content'), - $this->equalTo('urltranslator'), - $this->equalTo($location) + self::equalTo('content'), + self::equalTo('urltranslator'), + self::equalTo($location) ) ->willReturn(false); @@ -3351,10 +3351,10 @@ public function testCreateGlobalUrlAliasThrowsUnauthorizedException() $mockedService = $this->getPartlyMockedURLAliasServiceService(); $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess')->with( - $this->equalTo('content'), - $this->equalTo('urltranslator') + self::equalTo('content'), + self::equalTo('urltranslator') ) ->willReturn(false); @@ -3379,10 +3379,10 @@ public function testRemoveAliasesThrowsUnauthorizedException() $aliasList = [new URLAlias(['isCustom' => true])]; $mockedService = $this->getPartlyMockedURLAliasServiceService(); $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess')->with( - $this->equalTo('content'), - $this->equalTo('urltranslator') + self::equalTo('content'), + self::equalTo('urltranslator') ) ->willReturn(false); @@ -3403,11 +3403,11 @@ protected function getNameSchemaServiceMock() private function configureListURLAliasesForLocation(array $spiUrlAliases): void { $this->urlAliasHandler - ->expects($this->once()) + ->expects(self::once()) ->method('listURLAliasesForLocation') ->with( - $this->equalTo(42), - $this->equalTo(false) + self::equalTo(42), + self::equalTo(false) ) ->willReturn($spiUrlAliases); } diff --git a/tests/lib/Repository/Service/Mock/UrlTest.php b/tests/lib/Repository/Service/Mock/UrlTest.php index d43089ef67..b5b87cb364 100644 --- a/tests/lib/Repository/Service/Mock/UrlTest.php +++ b/tests/lib/Repository/Service/Mock/UrlTest.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\Core\Repository\Service\Mock; use DateTime; @@ -93,12 +94,12 @@ public function testFindUrls() ]); $this->urlHandler - ->expects($this->once()) + ->expects(self::once()) ->method('find') ->with($query) ->willReturn($results); - $this->assertEquals($expected, $this->createUrlService()->findUrls($query)); + self::assertEquals($expected, $this->createUrlService()->findUrls($query)); } public function testUpdateUrlUnauthorized() @@ -126,7 +127,7 @@ public function testUpdateUrlNonUnique() $urlService = $this->createUrlService(['isUnique']); $urlService - ->expects($this->once()) + ->expects(self::once()) ->method('isUnique') ->with($url->id, $struct->url) ->willReturn(false); @@ -151,13 +152,13 @@ public function testUpdateUrl() $urlService = $this->createUrlService(['isUnique']); $urlService - ->expects($this->once()) + ->expects(self::once()) ->method('isUnique') ->with($apiUrl->id, $apiStruct->url) ->willReturn(true); $this->urlHandler - ->expects($this->once()) + ->expects(self::once()) ->method('updateUrl') ->willReturnCallback(function ($id, $struct) use ($apiUrl, $apiStruct) { $this->assertEquals($apiUrl->id, $id); @@ -185,7 +186,7 @@ public function testUpdateUrl() ]) ); - $this->assertEquals(new URL([ + self::assertEquals(new URL([ 'id' => $apiUrl->id, 'url' => $apiStruct->url, 'isValid' => true, @@ -217,7 +218,7 @@ public function testUpdateUrlStatus() $urlService = $this->createUrlService(['isUnique']); $this->urlHandler - ->expects($this->once()) + ->expects(self::once()) ->method('updateUrl') ->willReturnCallback(function ($id, $struct) use ($apiUrl, $apiStruct) { $this->assertEquals($apiUrl->id, $id); @@ -245,7 +246,7 @@ public function testUpdateUrlStatus() ]) ); - $this->assertEquals(new URL([ + self::assertEquals(new URL([ 'id' => $apiUrl->id, 'url' => $apiUrl->url, 'isValid' => $apiStruct->isValid, @@ -265,7 +266,7 @@ public function testLoadByIdUnauthorized() ); $this->urlHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadById') ->with(self::URL_ID) ->willReturn(new SpiUrl([ @@ -284,14 +285,14 @@ public function testLoadById() $this->configureUrlViewPermission($url, true); $this->urlHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadById') ->with(self::URL_ID) ->willReturn(new SpiUrl([ 'id' => self::URL_ID, ])); - $this->assertEquals($url, $this->createUrlService()->loadById(self::URL_ID)); + self::assertEquals($url, $this->createUrlService()->loadById(self::URL_ID)); } public function testLoadByUrlUnauthorized() @@ -308,7 +309,7 @@ public function testLoadByUrlUnauthorized() ); $this->urlHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadByUrl') ->with($url) ->willReturn(new SpiUrl([ @@ -329,14 +330,14 @@ public function testLoadByUrl() $this->configureUrlViewPermission($apiUrl, true); $this->urlHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadByUrl') ->with($url) ->willReturn(new SpiUrl([ 'url' => $url, ])); - $this->assertEquals($apiUrl, $this->createUrlService()->loadByUrl($url)); + self::assertEquals($apiUrl, $this->createUrlService()->loadByUrl($url)); } /** @@ -349,7 +350,7 @@ public function testFindUsages($offset, $limit, ContentQuery $expectedQuery, arr if (!empty($usages)) { $searchService = $this->createMock(SearchService::class); $searchService - ->expects($this->once()) + ->expects(self::once()) ->method('findContentInfo') ->willReturnCallback(function ($query) use ($expectedQuery, $usages) { $this->assertEquals($expectedQuery, $query); @@ -367,23 +368,23 @@ public function testFindUsages($offset, $limit, ContentQuery $expectedQuery, arr }); $this->getRepositoryMock() - ->expects($this->once()) + ->expects(self::once()) ->method('getSearchService') ->willReturn($searchService); } $this->urlHandler - ->expects($this->once()) + ->expects(self::once()) ->method('findUsages') ->with($url->id) ->willReturn($usages); $usageSearchResult = $this->createUrlService()->findUsages($url, $offset, $limit); - $this->assertInstanceOf(UsageSearchResult::class, $usageSearchResult); - $this->assertEquals(count($usages), $usageSearchResult->totalCount); + self::assertInstanceOf(UsageSearchResult::class, $usageSearchResult); + self::assertEquals(count($usages), $usageSearchResult->totalCount); foreach ($usageSearchResult as $contentInfo) { - $this->assertContains($contentInfo->id, $usages); + self::assertContains($contentInfo->id, $usages); } } @@ -420,13 +421,13 @@ public function dateProviderForFindUsages() public function testCreateUpdateStruct() { - $this->assertEquals(new URLUpdateStruct(), $this->createUrlService()->createUpdateStruct()); + self::assertEquals(new URLUpdateStruct(), $this->createUrlService()->createUpdateStruct()); } protected function configureUrlViewPermissionForHasAccess($hasAccess = false) { $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('hasAccess') ->with('url', 'view') ->willReturn($hasAccess); @@ -435,33 +436,33 @@ protected function configureUrlViewPermissionForHasAccess($hasAccess = false) protected function configureUrlViewPermission($object, $hasAccess = false) { $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('url'), - $this->equalTo('view'), - $this->equalTo($object) + self::equalTo('url'), + self::equalTo('view'), + self::equalTo($object) ) - ->will($this->returnValue($hasAccess)); + ->will(self::returnValue($hasAccess)); } protected function configureUrlUpdatePermission($object, $hasAccess = false) { $this->permissionResolver - ->expects($this->once()) + ->expects(self::once()) ->method('canUser') ->with( - $this->equalTo('url'), - $this->equalTo('update'), - $this->equalTo($object) + self::equalTo('url'), + self::equalTo('update'), + self::equalTo($object) ) - ->will($this->returnValue($hasAccess)); + ->will(self::returnValue($hasAccess)); } protected function configurePermissions(array $permissions) { $this->permissionResolver - ->expects($this->exactly(count($permissions))) + ->expects(self::exactly(count($permissions))) ->method('canUser') ->withConsecutive(...$permissions) ->willReturn(true); diff --git a/tests/lib/Repository/Service/Mock/UrlWildcardTest.php b/tests/lib/Repository/Service/Mock/UrlWildcardTest.php index 48f75f9f0b..ef46806168 100644 --- a/tests/lib/Repository/Service/Mock/UrlWildcardTest.php +++ b/tests/lib/Repository/Service/Mock/UrlWildcardTest.php @@ -52,14 +52,14 @@ public function testCreateThrowsUnauthorizedException() $mockedService = $this->getPartlyMockedURLWildcardService(); $this->permissionResolver->expects( - $this->once() + self::once() )->method( 'hasAccess' )->with( - $this->equalTo('content'), - $this->equalTo('urltranslator') + self::equalTo('content'), + self::equalTo('urltranslator') )->will( - $this->returnValue(false) + self::returnValue(false) ); $this->expectException(UnauthorizedException::class); @@ -79,18 +79,18 @@ public function testCreateThrowsInvalidArgumentException() $mockedService = $this->getPartlyMockedURLWildcardService(); $this->permissionResolver->expects( - $this->once() + self::once() )->method( 'hasAccess' )->with( - $this->equalTo('content'), - $this->equalTo('urltranslator') + self::equalTo('content'), + self::equalTo('urltranslator') )->will( - $this->returnValue(true) + self::returnValue(true) ); $this->urlWildcardHandler->expects( - $this->once() + self::once() )->method( 'exactSourceUrlExists' )->willReturn(true); @@ -113,6 +113,7 @@ public function providerForTestCreateThrowsContentValidationException() * Test for the create() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::create + * * @dataProvider providerForTestCreateThrowsContentValidationException */ public function testCreateThrowsContentValidationException($sourceUrl, $destinationUrl, $forward) @@ -122,18 +123,18 @@ public function testCreateThrowsContentValidationException($sourceUrl, $destinat $mockedService = $this->getPartlyMockedURLWildcardService(); $this->permissionResolver->expects( - $this->once() + self::once() )->method( 'hasAccess' )->with( - $this->equalTo('content'), - $this->equalTo('urltranslator') + self::equalTo('content'), + self::equalTo('urltranslator') )->will( - $this->returnValue(true) + self::returnValue(true) ); $this->urlWildcardHandler->expects( - $this->once() + self::once() )->method( 'exactSourceUrlExists' )->willReturn(false); @@ -160,6 +161,7 @@ public function providerForTestCreate() * Test for the create() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::create + * * @dataProvider providerForTestCreate */ public function testCreate($sourceUrl, $destinationUrl, $forward) @@ -170,36 +172,36 @@ public function testCreate($sourceUrl, $destinationUrl, $forward) $destinationUrl = '/' . trim($destinationUrl, '/ '); $this->permissionResolver->expects( - $this->once() + self::once() )->method( 'hasAccess' )->with( - $this->equalTo('content'), - $this->equalTo('urltranslator') + self::equalTo('content'), + self::equalTo('urltranslator') )->will( - $this->returnValue(true) + self::returnValue(true) ); $repositoryMock = $this->getRepositoryMock(); - $repositoryMock->expects($this->once())->method('beginTransaction'); - $repositoryMock->expects($this->once())->method('commit'); + $repositoryMock->expects(self::once())->method('beginTransaction'); + $repositoryMock->expects(self::once())->method('commit'); $this->urlWildcardHandler->expects( - $this->once() + self::once() )->method( 'exactSourceUrlExists' )->willReturn(false); $this->urlWildcardHandler->expects( - $this->once() + self::once() )->method( 'create' )->with( - $this->equalTo($sourceUrl), - $this->equalTo($destinationUrl), - $this->equalTo($forward) + self::equalTo($sourceUrl), + self::equalTo($destinationUrl), + self::equalTo($forward) )->will( - $this->returnValue( + self::returnValue( new SPIURLWildcard( [ 'id' => 123456, @@ -213,7 +215,7 @@ public function testCreate($sourceUrl, $destinationUrl, $forward) $urlWildCard = $mockedService->create($sourceUrl, $destinationUrl, $forward); - $this->assertEquals( + self::assertEquals( new URLWildcard( [ 'id' => 123456, @@ -238,40 +240,40 @@ public function testCreateWithRollback() $mockedService = $this->getPartlyMockedURLWildcardService(); $this->permissionResolver->expects( - $this->once() + self::once() )->method( 'hasAccess' )->with( - $this->equalTo('content'), - $this->equalTo('urltranslator') + self::equalTo('content'), + self::equalTo('urltranslator') )->will( - $this->returnValue(true) + self::returnValue(true) ); $repositoryMock = $this->getRepositoryMock(); - $repositoryMock->expects($this->once())->method('beginTransaction'); - $repositoryMock->expects($this->once())->method('rollback'); + $repositoryMock->expects(self::once())->method('beginTransaction'); + $repositoryMock->expects(self::once())->method('rollback'); $sourceUrl = '/lorem'; $destinationUrl = '/ipsum'; $forward = true; $this->urlWildcardHandler->expects( - $this->once() + self::once() )->method( 'exactSourceUrlExists' )->willReturn(false); $this->urlWildcardHandler->expects( - $this->once() + self::once() )->method( 'create' )->with( - $this->equalTo($sourceUrl), - $this->equalTo($destinationUrl), - $this->equalTo($forward) + self::equalTo($sourceUrl), + self::equalTo($destinationUrl), + self::equalTo($forward) )->will( - $this->throwException(new Exception()) + self::throwException(new Exception()) ); $this->expectException(Exception::class); @@ -293,19 +295,19 @@ public function testRemoveThrowsUnauthorizedException() $mockedService = $this->getPartlyMockedURLWildcardService(); $this->permissionResolver->expects( - $this->once() + self::once() )->method( 'canUser' )->with( - $this->equalTo('content'), - $this->equalTo('urltranslator'), - $this->equalTo($wildcard) + self::equalTo('content'), + self::equalTo('urltranslator'), + self::equalTo($wildcard) )->will( - $this->returnValue(false) + self::returnValue(false) ); $repositoryMock = $this->getRepositoryMock(); - $repositoryMock->expects($this->never())->method('beginTransaction'); + $repositoryMock->expects(self::never())->method('beginTransaction'); $this->expectException(UnauthorizedException::class); @@ -324,27 +326,27 @@ public function testRemove() $mockedService = $this->getPartlyMockedURLWildcardService(); $this->permissionResolver->expects( - $this->once() + self::once() )->method( 'canUser' )->with( - $this->equalTo('content'), - $this->equalTo('urltranslator'), - $this->equalTo($wildcard) + self::equalTo('content'), + self::equalTo('urltranslator'), + self::equalTo($wildcard) )->will( - $this->returnValue(true) + self::returnValue(true) ); $repositoryMock = $this->getRepositoryMock(); - $repositoryMock->expects($this->once())->method('beginTransaction'); - $repositoryMock->expects($this->once())->method('commit'); + $repositoryMock->expects(self::once())->method('beginTransaction'); + $repositoryMock->expects(self::once())->method('commit'); $this->urlWildcardHandler->expects( - $this->once() + self::once() )->method( 'remove' )->with( - $this->equalTo('McBomb') + self::equalTo('McBomb') ); $mockedService->remove($wildcard); @@ -364,29 +366,29 @@ public function testRemoveWithRollback() $mockedService = $this->getPartlyMockedURLWildcardService(); $this->permissionResolver->expects( - $this->once() + self::once() )->method( 'canUser' )->with( - $this->equalTo('content'), - $this->equalTo('urltranslator'), - $this->equalTo($wildcard) + self::equalTo('content'), + self::equalTo('urltranslator'), + self::equalTo($wildcard) )->will( - $this->returnValue(true) + self::returnValue(true) ); $repositoryMock = $this->getRepositoryMock(); - $repositoryMock->expects($this->once())->method('beginTransaction'); - $repositoryMock->expects($this->once())->method('rollback'); + $repositoryMock->expects(self::once())->method('beginTransaction'); + $repositoryMock->expects(self::once())->method('rollback'); $this->urlWildcardHandler->expects( - $this->once() + self::once() )->method( 'remove' )->with( - $this->equalTo('McBoo') + self::equalTo('McBoo') )->will( - $this->throwException(new Exception()) + self::throwException(new Exception()) ); $this->expectException(Exception::class); @@ -406,13 +408,13 @@ public function testLoadThrowsException() $mockedService = $this->getPartlyMockedURLWildcardService(); $this->urlWildcardHandler->expects( - $this->once() + self::once() )->method( 'load' )->with( - $this->equalTo(self::EXAMPLE_URL_WILDCARD_ID) + self::equalTo(self::EXAMPLE_URL_WILDCARD_ID) )->will( - $this->throwException(new Exception()) + self::throwException(new Exception()) ); $this->expectException(Exception::class); @@ -430,13 +432,13 @@ public function testLoad() $mockedService = $this->getPartlyMockedURLWildcardService(); $this->urlWildcardHandler->expects( - $this->once() + self::once() )->method( 'load' )->with( - $this->equalTo(self::EXAMPLE_URL_WILDCARD_ID) + self::equalTo(self::EXAMPLE_URL_WILDCARD_ID) )->will( - $this->returnValue( + self::returnValue( new SPIURLWildcard( [ 'id' => self::EXAMPLE_URL_WILDCARD_ID, @@ -450,7 +452,7 @@ public function testLoad() $urlWildcard = $mockedService->load(self::EXAMPLE_URL_WILDCARD_ID); - $this->assertEquals( + self::assertEquals( new URLWildcard( [ 'id' => self::EXAMPLE_URL_WILDCARD_ID, @@ -473,14 +475,14 @@ public function testLoadAll() $mockedService = $this->getPartlyMockedURLWildcardService(); $this->urlWildcardHandler->expects( - $this->once() + self::once() )->method( 'loadAll' )->with( - $this->equalTo(0), - $this->equalTo(-1) + self::equalTo(0), + self::equalTo(-1) )->will( - $this->returnValue([]) + self::returnValue([]) ); $mockedService->loadAll(); @@ -496,14 +498,14 @@ public function testLoadAllWithLimitAndOffset() $mockedService = $this->getPartlyMockedURLWildcardService(); $this->urlWildcardHandler->expects( - $this->once() + self::once() )->method( 'loadAll' )->with( - $this->equalTo(12), - $this->equalTo(34) + self::equalTo(12), + self::equalTo(34) )->will( - $this->returnValue( + self::returnValue( [ new SPIURLWildcard( [ @@ -519,7 +521,7 @@ public function testLoadAllWithLimitAndOffset() $urlWildcards = $mockedService->loadAll(12, 34); - $this->assertEquals( + self::assertEquals( [ new URLWildcard( [ @@ -579,6 +581,7 @@ public function providerForTestTranslateThrowsNotFoundException() * Test for the translate() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::translate + * * @dataProvider providerForTestTranslateThrowsNotFoundException */ public function testTranslateThrowsNotFoundException($createArray, $url) @@ -590,7 +593,7 @@ public function testTranslateThrowsNotFoundException($createArray, $url) $trimmedUrl = trim($url, '/ '); $this->urlWildcardHandler - ->expects($this->once()) + ->expects(self::once()) ->method('translate') ->with($trimmedUrl) ->willThrowException(new APINotFoundException('UrlWildcard', $trimmedUrl)); @@ -685,6 +688,7 @@ public function providerForTestTranslate() * Test for the translate() method. * * @covers \Ibexa\Contracts\Core\Repository\URLWildcardService::translate + * * @dataProvider providerForTestTranslate */ public function testTranslate($createArray, $url, $uri) @@ -694,7 +698,7 @@ public function testTranslate($createArray, $url, $uri) $trimmedUrl = trim($url, '/ '); $this->urlWildcardHandler - ->expects($this->once()) + ->expects(self::once()) ->method('translate') ->with($trimmedUrl) @@ -706,7 +710,7 @@ public function testTranslate($createArray, $url, $uri) $translationResult = $mockedService->translate($url); - $this->assertEquals( + self::assertEquals( new URLWildcardTranslationResult( [ 'uri' => $uri, @@ -730,7 +734,7 @@ public function testTranslateUsesLongestMatchingWildcard() $trimmedUrl = trim($url, '/ '); $this->urlWildcardHandler - ->expects($this->once()) + ->expects(self::once()) ->method('translate') ->with($trimmedUrl) ->willReturn(new SPIURLWildcard([ @@ -740,7 +744,7 @@ public function testTranslateUsesLongestMatchingWildcard() $translationResult = $mockedService->translate($url); - $this->assertEquals( + self::assertEquals( new URLWildcardTranslationResult( [ 'uri' => '/long', diff --git a/tests/lib/Repository/Service/Mock/UserPasswordValidatorTest.php b/tests/lib/Repository/Service/Mock/UserPasswordValidatorTest.php index 486e22529e..38ae43b240 100644 --- a/tests/lib/Repository/Service/Mock/UserPasswordValidatorTest.php +++ b/tests/lib/Repository/Service/Mock/UserPasswordValidatorTest.php @@ -24,7 +24,7 @@ public function testValidate(array $constraints, string $password, array $expect { $validator = new UserPasswordValidator($constraints); - $this->assertEqualsCanonicalizing($expectedErrors, $validator->validate($password), ''); + self::assertEqualsCanonicalizing($expectedErrors, $validator->validate($password), ''); } public function dateProviderForValidate(): array diff --git a/tests/lib/Repository/Service/Mock/UserPreferenceTest.php b/tests/lib/Repository/Service/Mock/UserPreferenceTest.php index 56048e5476..be32a21bec 100644 --- a/tests/lib/Repository/Service/Mock/UserPreferenceTest.php +++ b/tests/lib/Repository/Service/Mock/UserPreferenceTest.php @@ -117,7 +117,7 @@ public function testGetUserPreference() $userPreferenceValue = 'value'; $this->userSPIPreferenceHandler - ->expects($this->once()) + ->expects(self::once()) ->method('getUserPreferenceByUserIdAndName') ->with(self::CURRENT_USER_ID, $userPreferenceName) ->willReturn(new UserPreference([ @@ -131,7 +131,7 @@ public function testGetUserPreference() 'name' => $userPreferenceName, 'value' => $userPreferenceValue, ]); - $this->assertEquals($expected, $APIUserPreference); + self::assertEquals($expected, $APIUserPreference); } /** @@ -148,13 +148,13 @@ public function testLoadUserPreferences() }, range(1, $expectedTotalCount)); $this->userSPIPreferenceHandler - ->expects($this->once()) + ->expects(self::once()) ->method('countUserPreferences') ->with(self::CURRENT_USER_ID) ->willReturn($expectedTotalCount); $this->userSPIPreferenceHandler - ->expects($this->once()) + ->expects(self::once()) ->method('loadUserPreferences') ->with(self::CURRENT_USER_ID, $offset, $limit) ->willReturn(array_map(static function ($locationId) { @@ -166,8 +166,8 @@ public function testLoadUserPreferences() $userPreferences = $this->createAPIUserPreferenceService()->loadUserPreferences($offset, $limit); - $this->assertEquals($expectedTotalCount, $userPreferences->totalCount); - $this->assertEquals($expectedItems, $userPreferences->items); + self::assertEquals($expectedTotalCount, $userPreferences->totalCount); + self::assertEquals($expectedItems, $userPreferences->items); } /** @@ -178,14 +178,14 @@ public function testGetUserPreferenceCount() $expectedTotalCount = 10; $this->userSPIPreferenceHandler - ->expects($this->once()) + ->expects(self::once()) ->method('countUserPreferences') ->with(self::CURRENT_USER_ID) ->willReturn($expectedTotalCount); $APIUserPreference = $this->createAPIUserPreferenceService()->getUserPreferenceCount(); - $this->assertEquals($expectedTotalCount, $APIUserPreference); + self::assertEquals($expectedTotalCount, $APIUserPreference); } /** @@ -203,28 +203,28 @@ private function createAPIUserPreferenceService(array $methods = null) private function assertTransactionIsCommitted(callable $operation): void { $repository = $this->getRepositoryMock(); - $repository->expects($this->once())->method('beginTransaction'); + $repository->expects(self::once())->method('beginTransaction'); $operation(); - $repository->expects($this->once())->method('commit'); - $repository->expects($this->never())->method('rollback'); + $repository->expects(self::once())->method('commit'); + $repository->expects(self::never())->method('rollback'); } private function assertTransactionIsNotStarted(callable $operation): void { $repository = $this->getRepositoryMock(); - $repository->expects($this->never())->method('beginTransaction'); + $repository->expects(self::never())->method('beginTransaction'); $operation(); - $repository->expects($this->never())->method('commit'); - $repository->expects($this->never())->method('rollback'); + $repository->expects(self::never())->method('commit'); + $repository->expects(self::never())->method('rollback'); } private function assertTransactionIsRollback(callable $operation): void { $repository = $this->getRepositoryMock(); - $repository->expects($this->once())->method('beginTransaction'); + $repository->expects(self::once())->method('beginTransaction'); $operation(); - $repository->expects($this->never())->method('commit'); - $repository->expects($this->once())->method('rollback'); + $repository->expects(self::never())->method('commit'); + $repository->expects(self::once())->method('rollback'); } private function createAPIUserPreference(): APIUserPreference diff --git a/tests/lib/Repository/Service/Mock/UserTest.php b/tests/lib/Repository/Service/Mock/UserTest.php index fc38331218..26236bd476 100644 --- a/tests/lib/Repository/Service/Mock/UserTest.php +++ b/tests/lib/Repository/Service/Mock/UserTest.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\Core\Repository\Service\Mock; use Exception; diff --git a/tests/lib/Repository/Service/Mock/ValueStub.php b/tests/lib/Repository/Service/Mock/ValueStub.php index 0a3393e434..420b38e352 100644 --- a/tests/lib/Repository/Service/Mock/ValueStub.php +++ b/tests/lib/Repository/Service/Mock/ValueStub.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\Core\Repository\Service\Mock; use Ibexa\Core\FieldType\Value as BaseValue; diff --git a/tests/lib/Repository/SiteAccessAware/AbstractServiceTest.php b/tests/lib/Repository/SiteAccessAware/AbstractServiceTest.php index 0635a5106c..2f2c901844 100644 --- a/tests/lib/Repository/SiteAccessAware/AbstractServiceTest.php +++ b/tests/lib/Repository/SiteAccessAware/AbstractServiceTest.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\Core\Repository\SiteAccessAware; use Closure; @@ -86,13 +87,13 @@ final public function testForPassTrough($method, array $arguments, $return = tru { if ($return) { $this->innerApiServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method($method) ->with(...$arguments) ->willReturn($return); } else { $this->innerApiServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method($method) ->with(...$arguments); } @@ -100,7 +101,7 @@ final public function testForPassTrough($method, array $arguments, $return = tru $actualReturn = $this->service->$method(...$arguments); if ($return) { - $this->assertEquals($return, $actualReturn); + self::assertEquals($return, $actualReturn); } } @@ -160,7 +161,7 @@ final public function testForLanguagesLookup($method, array $arguments, $return, $expectedArguments = $this->setLanguagesLookupExpectedArguments($arguments, $languageArgumentIndex, $languages); $this->languageResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('getPrioritizedLanguages') ->with([]) ->willReturn($languages); @@ -169,14 +170,14 @@ final public function testForLanguagesLookup($method, array $arguments, $return, $arguments[$alwaysAvailableArgumentIndex] = null; $expectedArguments[$alwaysAvailableArgumentIndex] = true; $this->languageResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('getUseAlwaysAvailable') ->with(null) ->willReturn(true); } $this->innerApiServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method($method) ->with(...$expectedArguments) ->willReturn($return); @@ -188,7 +189,7 @@ final public function testForLanguagesLookup($method, array $arguments, $return, $actualReturn = $this->service->$method(...$arguments); if ($return) { - $this->assertEquals($return, $actualReturn); + self::assertEquals($return, $actualReturn); } } @@ -224,21 +225,21 @@ final public function testForLanguagesPassTrough($method, array $arguments, $ret $arguments = $this->setLanguagesPassTroughArguments($arguments, $languageArgumentIndex, $languages); $this->languageResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('getPrioritizedLanguages') ->with($languages) ->willReturn($languages); if ($alwaysAvailableArgumentIndex) { $this->languageResolverMock - ->expects($this->once()) + ->expects(self::once()) ->method('getUseAlwaysAvailable') ->with($arguments[$alwaysAvailableArgumentIndex]) ->willReturn($arguments[$alwaysAvailableArgumentIndex]); } $this->innerApiServiceMock - ->expects($this->once()) + ->expects(self::once()) ->method($method) ->with(...$arguments) ->willReturn($return); @@ -250,7 +251,7 @@ final public function testForLanguagesPassTrough($method, array $arguments, $ret $actualReturn = $this->service->$method(...$arguments); if ($return) { - $this->assertEquals($return, $actualReturn); + self::assertEquals($return, $actualReturn); } } diff --git a/tests/lib/Repository/SiteAccessAware/ContentServiceTest.php b/tests/lib/Repository/SiteAccessAware/ContentServiceTest.php index ee0f691163..38e53e60ea 100644 --- a/tests/lib/Repository/SiteAccessAware/ContentServiceTest.php +++ b/tests/lib/Repository/SiteAccessAware/ContentServiceTest.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\Core\Repository\SiteAccessAware; use Ibexa\Contracts\Core\Repository\ContentService as APIService; diff --git a/tests/lib/Repository/SiteAccessAware/ContentTypeServiceTest.php b/tests/lib/Repository/SiteAccessAware/ContentTypeServiceTest.php index 5701ffb0db..f1afb259b9 100644 --- a/tests/lib/Repository/SiteAccessAware/ContentTypeServiceTest.php +++ b/tests/lib/Repository/SiteAccessAware/ContentTypeServiceTest.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\Core\Repository\SiteAccessAware; use Ibexa\Contracts\Core\Repository\ContentTypeService as APIService; diff --git a/tests/lib/Repository/SiteAccessAware/LanguageServiceTest.php b/tests/lib/Repository/SiteAccessAware/LanguageServiceTest.php index defce7d2f1..135573109a 100644 --- a/tests/lib/Repository/SiteAccessAware/LanguageServiceTest.php +++ b/tests/lib/Repository/SiteAccessAware/LanguageServiceTest.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\Core\Repository\SiteAccessAware; use Ibexa\Contracts\Core\Repository\LanguageService as APIService; diff --git a/tests/lib/Repository/SiteAccessAware/LocationServiceTest.php b/tests/lib/Repository/SiteAccessAware/LocationServiceTest.php index 532cd536f8..2b807cf012 100644 --- a/tests/lib/Repository/SiteAccessAware/LocationServiceTest.php +++ b/tests/lib/Repository/SiteAccessAware/LocationServiceTest.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\Core\Repository\SiteAccessAware; use Ibexa\Contracts\Core\Repository\LocationService as APIService; diff --git a/tests/lib/Repository/SiteAccessAware/ObjectStateServiceTest.php b/tests/lib/Repository/SiteAccessAware/ObjectStateServiceTest.php index 8720c0b73f..dd2dff20dd 100644 --- a/tests/lib/Repository/SiteAccessAware/ObjectStateServiceTest.php +++ b/tests/lib/Repository/SiteAccessAware/ObjectStateServiceTest.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\Core\Repository\SiteAccessAware; use Ibexa\Contracts\Core\Repository\ObjectStateService as APIService; diff --git a/tests/lib/Repository/SiteAccessAware/SearchServiceTest.php b/tests/lib/Repository/SiteAccessAware/SearchServiceTest.php index a5342a4f37..9ff8ce4c2d 100644 --- a/tests/lib/Repository/SiteAccessAware/SearchServiceTest.php +++ b/tests/lib/Repository/SiteAccessAware/SearchServiceTest.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\Core\Repository\SiteAccessAware; use Ibexa\Contracts\Core\Repository\SearchService as APIService; diff --git a/tests/lib/Repository/SiteAccessAware/TrashServiceTest.php b/tests/lib/Repository/SiteAccessAware/TrashServiceTest.php index 2e6c172821..af2ba0b25e 100644 --- a/tests/lib/Repository/SiteAccessAware/TrashServiceTest.php +++ b/tests/lib/Repository/SiteAccessAware/TrashServiceTest.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\Core\Repository\SiteAccessAware; use Ibexa\Contracts\Core\Repository\TrashService as APIService; diff --git a/tests/lib/Repository/SiteAccessAware/UrlAliasServiceTest.php b/tests/lib/Repository/SiteAccessAware/UrlAliasServiceTest.php index 0714f10703..ba172fabc0 100644 --- a/tests/lib/Repository/SiteAccessAware/UrlAliasServiceTest.php +++ b/tests/lib/Repository/SiteAccessAware/UrlAliasServiceTest.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\Core\Repository\SiteAccessAware; use Ibexa\Contracts\Core\Repository\URLAliasService as APIService; diff --git a/tests/lib/Repository/SiteAccessAware/UserServiceTest.php b/tests/lib/Repository/SiteAccessAware/UserServiceTest.php index fc1c3260ed..d336d87ba3 100644 --- a/tests/lib/Repository/SiteAccessAware/UserServiceTest.php +++ b/tests/lib/Repository/SiteAccessAware/UserServiceTest.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\Core\Repository\SiteAccessAware; use DateInterval; diff --git a/tests/lib/Repository/User/PasswordHashServiceTest.php b/tests/lib/Repository/User/PasswordHashServiceTest.php index 35c303c3c1..2a0247b31e 100644 --- a/tests/lib/Repository/User/PasswordHashServiceTest.php +++ b/tests/lib/Repository/User/PasswordHashServiceTest.php @@ -27,7 +27,7 @@ protected function setUp(): void public function testGetSupportedHashTypes(): void { - $this->assertEquals( + self::assertEquals( [ User::PASSWORD_HASH_BCRYPT, User::PASSWORD_HASH_PHP_DEFAULT, @@ -38,8 +38,8 @@ public function testGetSupportedHashTypes(): void public function testIsHashTypeSupported(): void { - $this->assertTrue($this->passwordHashService->isHashTypeSupported(User::DEFAULT_PASSWORD_HASH)); - $this->assertFalse($this->passwordHashService->isHashTypeSupported(self::NON_EXISTING_PASSWORD_HASH)); + self::assertTrue($this->passwordHashService->isHashTypeSupported(User::DEFAULT_PASSWORD_HASH)); + self::assertFalse($this->passwordHashService->isHashTypeSupported(self::NON_EXISTING_PASSWORD_HASH)); } public function testCreatePasswordHashExceptionHidesSensitiveParameter(): void @@ -67,12 +67,7 @@ public function testCreatePasswordHashExceptionHidesSensitiveParameter(): void self::assertArrayHasKey('args', $stackTrace[0]); // SensitiveParameter was introduced in PHP 8.2, in older versions it is ignored - if (\PHP_VERSION_ID < 80200) { - self::assertEquals($password, $stackTrace[0]['args'][0]); - } else { - // @phpstan-ignore-next-line This class is PHP 8.2+ only, but older PHP never reaches this else-block. - self::assertInstanceOf(\SensitiveParameterValue::class, $stackTrace[0]['args'][0]); - } + self::assertInstanceOf(\SensitiveParameterValue::class, $stackTrace[0]['args'][0]); } ini_set('zend.exception_ignore_args', (string)$ignoreArgs); diff --git a/tests/lib/Repository/Values/Content/ContentInfoTest.php b/tests/lib/Repository/Values/Content/ContentInfoTest.php index 18fecfb249..b12171638a 100644 --- a/tests/lib/Repository/Values/Content/ContentInfoTest.php +++ b/tests/lib/Repository/Values/Content/ContentInfoTest.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\Core\Repository\Values\Content; use DateTimeImmutable; diff --git a/tests/lib/Repository/Values/Content/ContentTest.php b/tests/lib/Repository/Values/Content/ContentTest.php index 70cf04b3eb..85ef593eab 100644 --- a/tests/lib/Repository/Values/Content/ContentTest.php +++ b/tests/lib/Repository/Values/Content/ContentTest.php @@ -116,13 +116,13 @@ public function testGetName(): void { $name = 'Translated name'; $versionInfoMock = $this->createMock(VersionInfo::class); - $versionInfoMock->expects($this->once()) + $versionInfoMock->expects(self::once()) ->method('getName') ->willReturn($name); $object = new Content(['versionInfo' => $versionInfoMock]); - $this->assertEquals($name, $object->getName()); + self::assertEquals($name, $object->getName()); } } diff --git a/tests/lib/Repository/Values/Content/LanguageTest.php b/tests/lib/Repository/Values/Content/LanguageTest.php index cc023cc16e..afe92a8bd9 100644 --- a/tests/lib/Repository/Values/Content/LanguageTest.php +++ b/tests/lib/Repository/Values/Content/LanguageTest.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\Core\Repository\Values\Content; use Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException; diff --git a/tests/lib/Repository/Values/Content/LocationTest.php b/tests/lib/Repository/Values/Content/LocationTest.php index 5634a8578e..27dac08201 100644 --- a/tests/lib/Repository/Values/Content/LocationTest.php +++ b/tests/lib/Repository/Values/Content/LocationTest.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\Core\Repository\Values\Content; use Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException; diff --git a/tests/lib/Repository/Values/Content/Query/Aggregation/Location/SubtreeTermAggregationTest.php b/tests/lib/Repository/Values/Content/Query/Aggregation/Location/SubtreeTermAggregationTest.php index 35e39e6c48..c5fd5da007 100644 --- a/tests/lib/Repository/Values/Content/Query/Aggregation/Location/SubtreeTermAggregationTest.php +++ b/tests/lib/Repository/Values/Content/Query/Aggregation/Location/SubtreeTermAggregationTest.php @@ -25,8 +25,8 @@ public function testConstruct(): void self::EXAMPLE_PATH_STRING ); - $this->assertEquals(self::EXAMPLE_AGGREGATION_NAME, $aggregation->getName()); - $this->assertEquals(self::EXAMPLE_PATH_STRING, $aggregation->getPathString()); + self::assertEquals(self::EXAMPLE_AGGREGATION_NAME, $aggregation->getName()); + self::assertEquals(self::EXAMPLE_PATH_STRING, $aggregation->getPathString()); } public function testConstructThrowsInvalidArgumentExceptionOnInvalidPathString(): void @@ -44,8 +44,8 @@ public function testFromLocation(): void $aggregation = SubtreeTermAggregation::fromLocation(self::EXAMPLE_AGGREGATION_NAME, $location); - $this->assertEquals(self::EXAMPLE_AGGREGATION_NAME, $aggregation->getName()); - $this->assertEquals(self::EXAMPLE_PATH_STRING, $aggregation->getPathString()); + self::assertEquals(self::EXAMPLE_AGGREGATION_NAME, $aggregation->getName()); + self::assertEquals(self::EXAMPLE_PATH_STRING, $aggregation->getPathString()); } } diff --git a/tests/lib/Repository/Values/Content/Query/Aggregation/RangeTest.php b/tests/lib/Repository/Values/Content/Query/Aggregation/RangeTest.php index 7cffc94f41..b59a82a992 100644 --- a/tests/lib/Repository/Values/Content/Query/Aggregation/RangeTest.php +++ b/tests/lib/Repository/Values/Content/Query/Aggregation/RangeTest.php @@ -19,7 +19,7 @@ final class RangeTest extends TestCase */ public function testToString(Range $range, string $expected): void { - $this->assertEquals($expected, (string)$range); + self::assertEquals($expected, (string)$range); } public function dataProviderForTestToString(): iterable @@ -50,16 +50,16 @@ public function dataProviderForTestToString(): iterable public function testOfInt(): void { - $this->assertEquals(new Range(null, 10), Range::ofInt(null, 10)); - $this->assertEquals(new Range(1, 10), Range::ofInt(1, 10)); - $this->assertEquals(new Range(1, null), Range::ofInt(1, null)); + self::assertEquals(new Range(null, 10), Range::ofInt(null, 10)); + self::assertEquals(new Range(1, 10), Range::ofInt(1, 10)); + self::assertEquals(new Range(1, null), Range::ofInt(1, null)); } public function testOfFloat(): void { - $this->assertEquals(new Range(null, 10.0), Range::ofFloat(null, 10.0)); - $this->assertEquals(new Range(1.0, 10.0), Range::ofFloat(1.0, 10.0)); - $this->assertEquals(new Range(1.0, null), Range::ofFloat(1.0, null)); + self::assertEquals(new Range(null, 10.0), Range::ofFloat(null, 10.0)); + self::assertEquals(new Range(1.0, 10.0), Range::ofFloat(1.0, 10.0)); + self::assertEquals(new Range(1.0, null), Range::ofFloat(1.0, null)); } public function testOfDateTime(): void @@ -67,9 +67,9 @@ public function testOfDateTime(): void $a = new DateTimeImmutable('2020-01-01T00:00:00+0000'); $b = new DateTimeImmutable('2020-12-31T23:59:59+0000'); - $this->assertEquals(new Range(null, $b), Range::ofDateTime(null, $b)); - $this->assertEquals(new Range($a, $b), Range::ofDateTime($a, $b)); - $this->assertEquals(new Range($a, null), Range::ofDateTime($a, null)); + self::assertEquals(new Range(null, $b), Range::ofDateTime(null, $b)); + self::assertEquals(new Range($a, $b), Range::ofDateTime($a, $b)); + self::assertEquals(new Range($a, null), Range::ofDateTime($a, null)); } /** diff --git a/tests/lib/Repository/Values/Content/Query/Criterion/DateMetadataTest.php b/tests/lib/Repository/Values/Content/Query/Criterion/DateMetadataTest.php index 9279b95cd6..ccf8f75215 100644 --- a/tests/lib/Repository/Values/Content/Query/Criterion/DateMetadataTest.php +++ b/tests/lib/Repository/Values/Content/Query/Criterion/DateMetadataTest.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\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\DateMetadata; @@ -21,7 +22,7 @@ public function testConstruction(string $target, string $operator, $value): void } /** - * @return iterable<array{non-empty-string, string, integer}> + * @return iterable<array{non-empty-string, string, int}> */ public static function provideValidConstructorArguments(): iterable { diff --git a/tests/lib/Repository/Values/Content/SectionTest.php b/tests/lib/Repository/Values/Content/SectionTest.php index f4cd626170..4ac51c7498 100644 --- a/tests/lib/Repository/Values/Content/SectionTest.php +++ b/tests/lib/Repository/Values/Content/SectionTest.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\Core\Repository\Values\Content; use Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException; diff --git a/tests/lib/Repository/Values/Content/TrashItemTest.php b/tests/lib/Repository/Values/Content/TrashItemTest.php index d9b6013d7d..37abcd1cc8 100644 --- a/tests/lib/Repository/Values/Content/TrashItemTest.php +++ b/tests/lib/Repository/Values/Content/TrashItemTest.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\Core\Repository\Values\Content; use Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException; diff --git a/tests/lib/Repository/Values/Content/VersionInfoTest.php b/tests/lib/Repository/Values/Content/VersionInfoTest.php index aca3d13e9c..19e8a8cd6c 100644 --- a/tests/lib/Repository/Values/Content/VersionInfoTest.php +++ b/tests/lib/Repository/Values/Content/VersionInfoTest.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\Core\Repository\Values\Content; use Ibexa\Core\Repository\Values\Content\VersionInfo; diff --git a/tests/lib/Repository/Values/ContentType/ContentTypeDraftTest.php b/tests/lib/Repository/Values/ContentType/ContentTypeDraftTest.php index 3e0cbe4f95..d3a378880f 100644 --- a/tests/lib/Repository/Values/ContentType/ContentTypeDraftTest.php +++ b/tests/lib/Repository/Values/ContentType/ContentTypeDraftTest.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\Core\Repository\Values\ContentType; use Ibexa\Core\Repository\Values\ContentType\ContentType; diff --git a/tests/lib/Repository/Values/ContentType/ContentTypeTest.php b/tests/lib/Repository/Values/ContentType/ContentTypeTest.php index a1b8a7ac6f..b450c7ca9f 100644 --- a/tests/lib/Repository/Values/ContentType/ContentTypeTest.php +++ b/tests/lib/Repository/Values/ContentType/ContentTypeTest.php @@ -68,13 +68,13 @@ public function testGetFieldDefinition(): void $fieldDefinitionCollection = $this->createMock(APIFieldDefinitionCollection::class); $fieldDefinitionCollection - ->expects($this->once()) + ->expects(self::once()) ->method('has') ->with(self::EXAMPLE_FIELD_DEFINITION_IDENTIFIER) ->willReturn(true); $fieldDefinitionCollection - ->expects($this->once()) + ->expects(self::once()) ->method('get') ->with(self::EXAMPLE_FIELD_DEFINITION_IDENTIFIER) ->willReturn($fieldDefinition); @@ -83,7 +83,7 @@ public function testGetFieldDefinition(): void 'fieldDefinitions' => $fieldDefinitionCollection, ]); - $this->assertEquals( + self::assertEquals( $fieldDefinition, $contentType->getFieldDefinition(self::EXAMPLE_FIELD_DEFINITION_IDENTIFIER) ); @@ -93,7 +93,7 @@ public function testHasFieldDefinition(): void { $fieldDefinitionCollection = $this->createMock(APIFieldDefinitionCollection::class); $fieldDefinitionCollection - ->expects($this->once()) + ->expects(self::once()) ->method('has') ->with(self::EXAMPLE_FIELD_DEFINITION_IDENTIFIER) ->willReturn(true); @@ -102,7 +102,7 @@ public function testHasFieldDefinition(): void 'fieldDefinitions' => $fieldDefinitionCollection, ]); - $this->assertTrue( + self::assertTrue( $contentType->hasFieldDefinition(self::EXAMPLE_FIELD_DEFINITION_IDENTIFIER) ); } @@ -111,7 +111,7 @@ public function testHasFieldDefinitionOfType(): void { $fieldDefinitionCollection = $this->createMock(APIFieldDefinitionCollection::class); $fieldDefinitionCollection - ->expects($this->once()) + ->expects(self::once()) ->method('anyOfType') ->with(self::EXAMPLE_FIELD_TYPE_IDENTIFIER) ->willReturn(true); @@ -120,7 +120,7 @@ public function testHasFieldDefinitionOfType(): void 'fieldDefinitions' => $fieldDefinitionCollection, ]); - $this->assertTrue( + self::assertTrue( $contentType->hasFieldDefinitionOfType(self::EXAMPLE_FIELD_TYPE_IDENTIFIER) ); } @@ -131,7 +131,7 @@ public function testGetFieldDefinitionsOfType(): void $fieldDefinitionCollection = $this->createMock(APIFieldDefinitionCollection::class); $fieldDefinitionCollection - ->expects($this->once()) + ->expects(self::once()) ->method('filterByType') ->with(self::EXAMPLE_FIELD_TYPE_IDENTIFIER) ->willReturn($expectedFieldDefinitionCollection); @@ -140,7 +140,7 @@ public function testGetFieldDefinitionsOfType(): void 'fieldDefinitions' => $fieldDefinitionCollection, ]); - $this->assertEquals( + self::assertEquals( $expectedFieldDefinitionCollection, $contentType->getFieldDefinitionsOfType(self::EXAMPLE_FIELD_TYPE_IDENTIFIER) ); @@ -157,7 +157,7 @@ public function testGetFirstFieldDefinitionOfType(): void $fieldDefinitionCollection = $this->createMock(APIFieldDefinitionCollection::class); $fieldDefinitionCollection - ->expects($this->once()) + ->expects(self::once()) ->method('filterByType') ->with(self::EXAMPLE_FIELD_TYPE_IDENTIFIER) ->willReturn($filteredFieldDefinitionCollection); @@ -166,7 +166,7 @@ public function testGetFirstFieldDefinitionOfType(): void 'fieldDefinitions' => $fieldDefinitionCollection, ]); - $this->assertEquals( + self::assertEquals( $expectedFieldDefinition, $contentType->getFirstFieldDefinitionOfType(self::EXAMPLE_FIELD_TYPE_IDENTIFIER) ); diff --git a/tests/lib/Repository/Values/ContentType/FieldDefinitionCollectionTest.php b/tests/lib/Repository/Values/ContentType/FieldDefinitionCollectionTest.php index eb883b32a4..0f687d181d 100644 --- a/tests/lib/Repository/Values/ContentType/FieldDefinitionCollectionTest.php +++ b/tests/lib/Repository/Values/ContentType/FieldDefinitionCollectionTest.php @@ -26,9 +26,9 @@ public function testGet(): void $collection = new FieldDefinitionCollection([$a, $b, $c]); - $this->assertEquals($a, $collection->get('A')); - $this->assertEquals($b, $collection->get('B')); - $this->assertEquals($c, $collection->get('C')); + self::assertEquals($a, $collection->get('A')); + self::assertEquals($b, $collection->get('B')); + self::assertEquals($c, $collection->get('C')); } public function testGetThrowsOutOfBoundsExceptionForNonExistingFieldDefinition(): void @@ -49,9 +49,9 @@ public function testHasReturnTrueForExistingFieldDefinition(): void $this->createFieldDefinitions('A', 'B', 'C') ); - $this->assertTrue($collection->has('A')); - $this->assertTrue($collection->has('B')); - $this->assertTrue($collection->has('C')); + self::assertTrue($collection->has('A')); + self::assertTrue($collection->has('B')); + self::assertTrue($collection->has('C')); } public function testHasReturnFalseForNonExistingFieldDefinition(): void @@ -60,14 +60,14 @@ public function testHasReturnFalseForNonExistingFieldDefinition(): void $this->createFieldDefinitions('A', 'B', 'C') ); - $this->assertFalse($collection->has('Z')); + self::assertFalse($collection->has('Z')); } public function testIsEmptyReturnsTrueForEmptyCollection(): void { $collection = new FieldDefinitionCollection(); - $this->assertTrue($collection->isEmpty()); + self::assertTrue($collection->isEmpty()); } public function testIsEmptyReturnsFalseForNonEmptyCollection(): void @@ -76,7 +76,7 @@ public function testIsEmptyReturnsFalseForNonEmptyCollection(): void $this->createFieldDefinition('Example'), ]); - $this->assertFalse($collection->isEmpty()); + self::assertFalse($collection->isEmpty()); } public function testFirstThrowsOutOfBoundsExceptionForEmptyCollection(): void @@ -94,7 +94,7 @@ public function testFirstReturnsFieldDefinitionForNonEmptyCollection(): void $collection = new FieldDefinitionCollection([$a, $b, $c]); - $this->assertEquals($a, $collection->first()); + self::assertEquals($a, $collection->first()); } public function testLastReturnsFieldDefinitionForNonEmptyCollection(): void @@ -103,7 +103,7 @@ public function testLastReturnsFieldDefinitionForNonEmptyCollection(): void $collection = new FieldDefinitionCollection([$a, $b, $c]); - $this->assertEquals($c, $collection->last()); + self::assertEquals($c, $collection->last()); } public function testLastThrowsOutOfBoundsExceptionForEmptyCollection(): void @@ -121,8 +121,8 @@ public function testFirstAndLastAreEqualForCollectionWithOneElement(): void $collection = new FieldDefinitionCollection([$fieldDefinition]); - $this->assertEquals($fieldDefinition, $collection->first()); - $this->assertEquals($fieldDefinition, $collection->last()); + self::assertEquals($fieldDefinition, $collection->first()); + self::assertEquals($fieldDefinition, $collection->last()); } public function testCountForNonEmptyCollection(): void @@ -131,14 +131,14 @@ public function testCountForNonEmptyCollection(): void $collection = new FieldDefinitionCollection([$a, $b, $c]); - $this->assertEquals(3, $collection->count()); + self::assertEquals(3, $collection->count()); } public function testCountReturnsZeroForEmptyCollection(): void { $collection = new FieldDefinitionCollection(); - $this->assertEquals(0, $collection->count()); + self::assertEquals(0, $collection->count()); } public function testMap(): void @@ -149,7 +149,7 @@ public function testMap(): void return strtolower($fieldDefinition->identifier); }; - $this->assertEquals(['a', 'b', 'c'], $collection->map($closure)); + self::assertEquals(['a', 'b', 'c'], $collection->map($closure)); } public function testFilter(): void @@ -158,17 +158,17 @@ public function testFilter(): void $collection = new FieldDefinitionCollection([$a, $b, $c]); - $this->assertEquals( + self::assertEquals( new FieldDefinitionCollection([$a, $c]), $collection->filter($this->getIdentifierIsEqualPredicate('A', 'C')) ); - $this->assertEquals( + self::assertEquals( new FieldDefinitionCollection(), $collection->filter($this->getContraction()) ); - $this->assertEquals( + self::assertEquals( new FieldDefinitionCollection([$a, $b, $c]), $collection->filter($this->getTautology()) ); @@ -180,7 +180,7 @@ public function testFilterByType(): void $collection = new FieldDefinitionCollection([$a, $b, $c]); - $this->assertEquals( + self::assertEquals( new FieldDefinitionCollection([$a, $b]), $collection->filterByType('ezstring') ); @@ -192,7 +192,7 @@ public function filterByGroup(): void $collection = new FieldDefinitionCollection([$a, $b, $c]); - $this->assertEquals( + self::assertEquals( new FieldDefinitionCollection([$c]), $collection->filterByType('seo') ); @@ -202,22 +202,22 @@ public function testAll(): void { $collection = new FieldDefinitionCollection($this->createFieldDefinitions('A', 'B', 'C')); - $this->assertTrue($collection->all($this->getIdentifierIsEqualPredicate('A', 'B', 'C'))); - $this->assertFalse($collection->all($this->getIdentifierIsEqualPredicate('A'))); + self::assertTrue($collection->all($this->getIdentifierIsEqualPredicate('A', 'B', 'C'))); + self::assertFalse($collection->all($this->getIdentifierIsEqualPredicate('A'))); - $this->assertTrue($collection->all($this->getTautology())); - $this->assertFalse($collection->all($this->getContraction())); + self::assertTrue($collection->all($this->getTautology())); + self::assertFalse($collection->all($this->getContraction())); } public function testAny(): void { $collection = new FieldDefinitionCollection($this->createFieldDefinitions('A', 'B', 'C')); - $this->assertTrue($collection->any($this->getIdentifierIsEqualPredicate('A'))); - $this->assertFalse($collection->any($this->getIdentifierIsEqualPredicate('Z'))); + self::assertTrue($collection->any($this->getIdentifierIsEqualPredicate('A'))); + self::assertFalse($collection->any($this->getIdentifierIsEqualPredicate('Z'))); - $this->assertTrue($collection->any($this->getTautology())); - $this->assertFalse($collection->any($this->getContraction())); + self::assertTrue($collection->any($this->getTautology())); + self::assertFalse($collection->any($this->getContraction())); } public function testAnyOfType(): void @@ -226,8 +226,8 @@ public function testAnyOfType(): void $this->createFieldDefinitionsWith('fieldTypeIdentifier', ['ezstring', 'ezstring', 'ezimage']) ); - $this->assertTrue($collection->anyOfType('ezstring')); - $this->assertFalse($collection->anyOfType('ezrichtext')); + self::assertTrue($collection->anyOfType('ezstring')); + self::assertFalse($collection->anyOfType('ezrichtext')); } public function testAnyInGroup(): void @@ -236,8 +236,8 @@ public function testAnyInGroup(): void $this->createFieldDefinitionsWith('fieldGroup', ['default', 'default', 'seo']) ); - $this->assertTrue($collection->anyInGroup('default')); - $this->assertFalse($collection->anyInGroup('comments')); + self::assertTrue($collection->anyInGroup('default')); + self::assertFalse($collection->anyInGroup('comments')); } public function testPartition(): void @@ -246,7 +246,7 @@ public function testPartition(): void $collection = new FieldDefinitionCollection([$a, $b, $c]); - $this->assertEquals( + self::assertEquals( [ new FieldDefinitionCollection([$a, $c]), new FieldDefinitionCollection([$b]), @@ -254,7 +254,7 @@ public function testPartition(): void $collection->partition($this->getIdentifierIsEqualPredicate('A', 'C')) ); - $this->assertEquals( + self::assertEquals( [ new FieldDefinitionCollection([$a, $b, $c]), new FieldDefinitionCollection(), @@ -262,7 +262,7 @@ public function testPartition(): void $collection->partition($this->getTautology()) ); - $this->assertEquals( + self::assertEquals( [ new FieldDefinitionCollection(), new FieldDefinitionCollection([$a, $b, $c]), @@ -277,7 +277,7 @@ public function testToArray(): void $collection = new FieldDefinitionCollection($fieldDefinitions); - $this->assertEquals($fieldDefinitions, $collection->toArray()); + self::assertEquals($fieldDefinitions, $collection->toArray()); } private function createFieldDefinitions(string ...$identifiers): array diff --git a/tests/lib/Repository/Values/MultiLanguageTestTrait.php b/tests/lib/Repository/Values/MultiLanguageTestTrait.php index 3b6a11e629..b30090d90f 100644 --- a/tests/lib/Repository/Values/MultiLanguageTestTrait.php +++ b/tests/lib/Repository/Values/MultiLanguageTestTrait.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\Core\Repository\Values; use Ibexa\Contracts\Core\Repository\Values\MultiLanguageDescription; diff --git a/tests/lib/Repository/Values/ObjectState/ObjectStateGroupTest.php b/tests/lib/Repository/Values/ObjectState/ObjectStateGroupTest.php index dbbc8f2952..fc10165b1e 100644 --- a/tests/lib/Repository/Values/ObjectState/ObjectStateGroupTest.php +++ b/tests/lib/Repository/Values/ObjectState/ObjectStateGroupTest.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\Core\Repository\Values\ObjectState; use Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException; @@ -82,7 +83,7 @@ public function testMissingProperty() $objectStateGroup = new ObjectStateGroup(); $value = $objectStateGroup->notDefined; - $this->fail('Succeeded getting non existing property'); + self::fail('Succeeded getting non existing property'); } /** @@ -96,7 +97,7 @@ public function testReadOnlyProperty() $objectStateGroup = new ObjectStateGroup(); $objectStateGroup->id = 42; - $this->fail('Succeeded setting read only property'); + self::fail('Succeeded setting read only property'); } /** @@ -106,10 +107,10 @@ public function testIsPropertySet() { $objectStateGroup = new ObjectStateGroup(); $value = isset($objectStateGroup->notDefined); - $this->assertFalse($value); + self::assertFalse($value); $value = isset($objectStateGroup->id); - $this->assertTrue($value); + self::assertTrue($value); } /** @@ -123,7 +124,7 @@ public function testUnsetProperty() $objectStateGroup = new ObjectStateGroup(['id' => 2]); unset($objectStateGroup->id); - $this->fail('Unsetting read-only property succeeded'); + self::fail('Unsetting read-only property succeeded'); } } diff --git a/tests/lib/Repository/Values/ObjectState/ObjectStateTest.php b/tests/lib/Repository/Values/ObjectState/ObjectStateTest.php index 41255bfb60..88c03fc148 100644 --- a/tests/lib/Repository/Values/ObjectState/ObjectStateTest.php +++ b/tests/lib/Repository/Values/ObjectState/ObjectStateTest.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\Core\Repository\Values\ObjectState; use Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException; @@ -84,7 +85,7 @@ public function testMissingProperty() $objectState = new ObjectState(); $value = $objectState->notDefined; - $this->fail('Succeeded getting non existing property'); + self::fail('Succeeded getting non existing property'); } /** @@ -99,7 +100,7 @@ public function testReadOnlyProperty() $objectState = new ObjectState(); $objectState->id = 42; - $this->fail('Succeeded setting read only property'); + self::fail('Succeeded setting read only property'); } /** @@ -109,10 +110,10 @@ public function testIsPropertySet() { $objectState = new ObjectState(); $value = isset($objectState->notDefined); - $this->assertFalse($value); + self::assertFalse($value); $value = isset($objectState->id); - $this->assertTrue($value); + self::assertTrue($value); } /** @@ -127,7 +128,7 @@ public function testUnsetProperty() $objectState = new ObjectState(['id' => 2]); unset($objectState->id); - $this->fail('Unsetting read-only property succeeded'); + self::fail('Unsetting read-only property succeeded'); } } diff --git a/tests/lib/Repository/Values/User/PolicyTest.php b/tests/lib/Repository/Values/User/PolicyTest.php index 4b82889e59..107ae7f6f6 100644 --- a/tests/lib/Repository/Values/User/PolicyTest.php +++ b/tests/lib/Repository/Values/User/PolicyTest.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\Core\Repository\Values\User; use Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException; diff --git a/tests/lib/Repository/Values/User/RoleTest.php b/tests/lib/Repository/Values/User/RoleTest.php index e506323d13..554131e99b 100644 --- a/tests/lib/Repository/Values/User/RoleTest.php +++ b/tests/lib/Repository/Values/User/RoleTest.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\Core\Repository\Values\User; use Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException; diff --git a/tests/lib/Repository/Values/User/UserGroupTest.php b/tests/lib/Repository/Values/User/UserGroupTest.php index 755dac342f..3b2e9a43f2 100644 --- a/tests/lib/Repository/Values/User/UserGroupTest.php +++ b/tests/lib/Repository/Values/User/UserGroupTest.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\Core\Repository\Values\User; use Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException; @@ -43,17 +44,17 @@ public function testGetName() $contentMock = $this->createMock(Content::class); $versionInfoMock = $this->createMock(VersionInfo::class); - $contentMock->expects($this->once()) + $contentMock->expects(self::once()) ->method('getVersionInfo') ->willReturn($versionInfoMock); - $versionInfoMock->expects($this->once()) + $versionInfoMock->expects(self::once()) ->method('getName') ->willReturn($name); $object = new UserGroup(['content' => $contentMock]); - $this->assertEquals($name, $object->getName()); + self::assertEquals($name, $object->getName()); } /** diff --git a/tests/lib/Repository/Values/User/UserTest.php b/tests/lib/Repository/Values/User/UserTest.php index 24b2cf13f3..0920e9e2c3 100644 --- a/tests/lib/Repository/Values/User/UserTest.php +++ b/tests/lib/Repository/Values/User/UserTest.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\Core\Repository\Values\User; use Ibexa\Contracts\Core\Repository\Exceptions\PropertyNotFoundException; @@ -50,17 +51,17 @@ public function testGetName() $contentMock = $this->createMock(Content::class); $versionInfoMock = $this->createMock(VersionInfo::class); - $contentMock->expects($this->once()) + $contentMock->expects(self::once()) ->method('getVersionInfo') ->willReturn($versionInfoMock); - $versionInfoMock->expects($this->once()) + $versionInfoMock->expects(self::once()) ->method('getName') ->willReturn($name); $object = new User(['content' => $contentMock]); - $this->assertEquals($name, $object->getName()); + self::assertEquals($name, $object->getName()); } /** diff --git a/tests/lib/Repository/Values/ValueObjectTestTrait.php b/tests/lib/Repository/Values/ValueObjectTestTrait.php index d92dd19d37..1747fc6597 100644 --- a/tests/lib/Repository/Values/ValueObjectTestTrait.php +++ b/tests/lib/Repository/Values/ValueObjectTestTrait.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\Core\Repository\Values; use Ibexa\Contracts\Core\Repository\Values\ValueObject; diff --git a/tests/lib/Search/Common/LocationEventSubscriber/LocationEventSubscriberTest.php b/tests/lib/Search/Common/LocationEventSubscriber/LocationEventSubscriberTest.php index c7fbb1a9a7..4ceed30bb0 100644 --- a/tests/lib/Search/Common/LocationEventSubscriber/LocationEventSubscriberTest.php +++ b/tests/lib/Search/Common/LocationEventSubscriber/LocationEventSubscriberTest.php @@ -56,8 +56,8 @@ public function testOnCreateLocation(): void $this->configurePersistenceHandler($spiContent, $spiLocation); - $this->searchHandler->expects($this->atLeastOnce())->method('indexContent')->with($spiContent); - $this->searchHandler->expects($this->atLeastOnce())->method('indexLocation')->with($spiLocation); + $this->searchHandler->expects(self::atLeastOnce())->method('indexContent')->with($spiContent); + $this->searchHandler->expects(self::atLeastOnce())->method('indexLocation')->with($spiLocation); $this->subscriber->onCreateLocation( new CreateLocationEvent( diff --git a/tests/lib/Search/FieldNameResolverTest.php b/tests/lib/Search/FieldNameResolverTest.php index 03b898e244..3fd6c5b9ab 100644 --- a/tests/lib/Search/FieldNameResolverTest.php +++ b/tests/lib/Search/FieldNameResolverTest.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\Core\Search; use ArrayObject; @@ -28,10 +29,10 @@ public function testGetFieldNamesReturnsEmptyArray() $criterionMock = $this->getCriterionMock(); $mockedFieldNameResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getSearchableFieldMap') ->will( - $this->returnValue( + self::returnValue( [ 'content_type_identifier_1' => [ 'field_definition_identifier_1' => [ @@ -56,8 +57,8 @@ public function testGetFieldNamesReturnsEmptyArray() 'field_name' ); - $this->assertIsArray($fieldNames); - $this->assertEmpty($fieldNames); + self::assertIsArray($fieldNames); + self::assertEmpty($fieldNames); } public function testGetFieldNames() @@ -66,10 +67,10 @@ public function testGetFieldNames() $criterionMock = $this->getCriterionMock(); $mockedFieldNameResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getSearchableFieldMap') ->will( - $this->returnValue( + self::returnValue( [ 'content_type_identifier_1' => [ 'field_definition_identifier_1' => [ @@ -92,10 +93,10 @@ public function testGetFieldNames() ); $mockedFieldNameResolver - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('getIndexFieldName') ->with( - $this->isInstanceOf( + self::isInstanceOf( APICriterion::class ), 'content_type_identifier_1', @@ -103,13 +104,13 @@ public function testGetFieldNames() 'field_type_identifier_1', null ) - ->will($this->returnValue(['index_field_name_1' => null])); + ->will(self::returnValue(['index_field_name_1' => null])); $mockedFieldNameResolver - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('getIndexFieldName') ->with( - $this->isInstanceOf( + self::isInstanceOf( APICriterion::class ), 'content_type_identifier_2', @@ -117,15 +118,15 @@ public function testGetFieldNames() 'field_type_identifier_2', null ) - ->will($this->returnValue(['index_field_name_2' => null])); + ->will(self::returnValue(['index_field_name_2' => null])); $fieldNames = $mockedFieldNameResolver->getFieldNames( $criterionMock, 'field_definition_identifier_1' ); - $this->assertIsArray($fieldNames); - $this->assertEquals( + self::assertIsArray($fieldNames); + self::assertEquals( [ 'index_field_name_1', 'index_field_name_2', @@ -140,10 +141,10 @@ public function testGetFieldNamesWithNamedField() $criterionMock = $this->getCriterionMock(); $mockedFieldNameResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getSearchableFieldMap') ->will( - $this->returnValue( + self::returnValue( [ 'content_type_identifier_1' => [ 'field_definition_identifier_1' => [ @@ -166,10 +167,10 @@ public function testGetFieldNamesWithNamedField() ); $mockedFieldNameResolver - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('getIndexFieldName') ->with( - $this->isInstanceOf( + self::isInstanceOf( APICriterion::class ), 'content_type_identifier_1', @@ -177,13 +178,13 @@ public function testGetFieldNamesWithNamedField() 'field_type_identifier_1', 'field_name' ) - ->will($this->returnValue(['index_field_name_1' => null])); + ->will(self::returnValue(['index_field_name_1' => null])); $mockedFieldNameResolver - ->expects($this->at(2)) + ->expects(self::at(2)) ->method('getIndexFieldName') ->with( - $this->isInstanceOf( + self::isInstanceOf( APICriterion::class ), 'content_type_identifier_2', @@ -191,7 +192,7 @@ public function testGetFieldNamesWithNamedField() 'field_type_identifier_2', 'field_name' ) - ->will($this->returnValue(['index_field_name_2' => null])); + ->will(self::returnValue(['index_field_name_2' => null])); $fieldNames = $mockedFieldNameResolver->getFieldNames( $criterionMock, @@ -200,8 +201,8 @@ public function testGetFieldNamesWithNamedField() 'field_name' ); - $this->assertIsArray($fieldNames); - $this->assertEquals( + self::assertIsArray($fieldNames); + self::assertEquals( [ 'index_field_name_1', 'index_field_name_2', @@ -216,10 +217,10 @@ public function testGetFieldNamesWithTypedField() $criterionMock = $this->getCriterionMock(); $mockedFieldNameResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getSearchableFieldMap') ->will( - $this->returnValue( + self::returnValue( [ 'content_type_identifier_1' => [ 'field_definition_identifier_1' => [ @@ -242,10 +243,10 @@ public function testGetFieldNamesWithTypedField() ); $mockedFieldNameResolver - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('getIndexFieldName') ->with( - $this->isInstanceOf( + self::isInstanceOf( APICriterion::class ), 'content_type_identifier_2', @@ -253,7 +254,7 @@ public function testGetFieldNamesWithTypedField() 'field_type_identifier_2', null ) - ->will($this->returnValue(['index_field_name_1' => null])); + ->will(self::returnValue(['index_field_name_1' => null])); $fieldNames = $mockedFieldNameResolver->getFieldNames( $criterionMock, @@ -262,8 +263,8 @@ public function testGetFieldNamesWithTypedField() null ); - $this->assertIsArray($fieldNames); - $this->assertEquals( + self::assertIsArray($fieldNames); + self::assertEquals( [ 'index_field_name_1', ], @@ -277,10 +278,10 @@ public function testGetFieldNamesWithTypedAndNamedField() $criterionMock = $this->getCriterionMock(); $mockedFieldNameResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getSearchableFieldMap') ->will( - $this->returnValue( + self::returnValue( [ 'content_type_identifier_1' => [ 'field_definition_identifier_1' => [ @@ -303,10 +304,10 @@ public function testGetFieldNamesWithTypedAndNamedField() ); $mockedFieldNameResolver - ->expects($this->at(1)) + ->expects(self::at(1)) ->method('getIndexFieldName') ->with( - $this->isInstanceOf( + self::isInstanceOf( APICriterion::class ), 'content_type_identifier_2', @@ -314,7 +315,7 @@ public function testGetFieldNamesWithTypedAndNamedField() 'field_type_identifier_2', 'field_name' ) - ->will($this->returnValue(['index_field_name_1' => null])); + ->will(self::returnValue(['index_field_name_1' => null])); $fieldNames = $mockedFieldNameResolver->getFieldNames( $criterionMock, @@ -323,8 +324,8 @@ public function testGetFieldNamesWithTypedAndNamedField() 'field_name' ); - $this->assertIsArray($fieldNames); - $this->assertEquals( + self::assertIsArray($fieldNames); + self::assertEquals( [ 'index_field_name_1', ], @@ -338,10 +339,10 @@ public function testGetSortFieldName() $sortClauseMock = $this->getSortClauseMock(); $mockedFieldNameResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getSearchableFieldMap') ->will( - $this->returnValue( + self::returnValue( [ 'content_type_identifier' => [ 'field_definition_identifier' => [ @@ -354,10 +355,10 @@ public function testGetSortFieldName() ); $mockedFieldNameResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getIndexFieldName') ->with( - $this->isInstanceOf( + self::isInstanceOf( APISortClause::class ), 'content_type_identifier', @@ -365,7 +366,7 @@ public function testGetSortFieldName() 'field_type_identifier', 'field_name' ) - ->will($this->returnValue(['index_field_name' => null])); + ->will(self::returnValue(['index_field_name' => null])); $fieldName = $mockedFieldNameResolver->getSortFieldName( $sortClauseMock, @@ -374,7 +375,7 @@ public function testGetSortFieldName() 'field_name' ); - $this->assertEquals('index_field_name', $fieldName); + self::assertEquals('index_field_name', $fieldName); } public function testGetSortFieldNameReturnsNull() @@ -383,10 +384,10 @@ public function testGetSortFieldNameReturnsNull() $sortClauseMock = $this->getSortClauseMock(); $mockedFieldNameResolver - ->expects($this->once()) + ->expects(self::once()) ->method('getSearchableFieldMap') ->will( - $this->returnValue( + self::returnValue( [ 'content_type_identifier' => [ 'field_definition_identifier' => [ @@ -405,7 +406,7 @@ public function testGetSortFieldNameReturnsNull() 'field_name' ); - $this->assertNull($fieldName); + self::assertNull($fieldName); } public function testGetIndexFieldNameCustomField() @@ -414,14 +415,14 @@ public function testGetIndexFieldNameCustomField() $customFieldMock = $this->createMock(CustomFieldInterface::class); $customFieldMock - ->expects($this->once()) + ->expects(self::once()) ->method('getCustomField') ->with( 'content_type_identifier', 'field_definition_identifier' ) ->will( - $this->returnValue('custom_field_name') + self::returnValue('custom_field_name') ); $customFieldName = $mockedFieldNameResolver->getIndexFieldName( @@ -433,7 +434,7 @@ public function testGetIndexFieldNameCustomField() false ); - $this->assertEquals('custom_field_name', key($customFieldName)); + self::assertEquals('custom_field_name', key($customFieldName)); } public function testGetIndexFieldNameNamedField() @@ -443,28 +444,28 @@ public function testGetIndexFieldNameNamedField() $searchFieldTypeMock = $this->getSearchFieldTypeMock(); $this->fieldRegistryMock - ->expects($this->once()) + ->expects(self::once()) ->method('getType') ->with('field_type_identifier') ->will( - $this->returnValue($indexFieldType) + self::returnValue($indexFieldType) ); $indexFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('getIndexDefinition') ->will( - $this->returnValue( + self::returnValue( [ 'field_name' => $searchFieldTypeMock, ] ) ); - $indexFieldType->expects($this->never())->method('getDefaultSortField'); + $indexFieldType->expects(self::never())->method('getDefaultSortField'); $this->fieldNameGeneratorMock - ->expects($this->once()) + ->expects(self::once()) ->method('getName') ->with( 'field_name', @@ -472,18 +473,18 @@ public function testGetIndexFieldNameNamedField() 'content_type_identifier' ) ->will( - $this->returnValue('generated_field_name') + self::returnValue('generated_field_name') ); $this->fieldNameGeneratorMock - ->expects($this->once()) + ->expects(self::once()) ->method('getTypedName') ->with( 'generated_field_name', - $this->isInstanceOf(SPIFieldType::class) + self::isInstanceOf(SPIFieldType::class) ) ->will( - $this->returnValue('generated_typed_field_name') + self::returnValue('generated_typed_field_name') ); $fieldName = $mockedFieldNameResolver->getIndexFieldName( @@ -495,7 +496,7 @@ public function testGetIndexFieldNameNamedField() true ); - $this->assertEquals('generated_typed_field_name', key($fieldName)); + self::assertEquals('generated_typed_field_name', key($fieldName)); } public function testGetIndexFieldNameDefaultMatchField() @@ -505,25 +506,25 @@ public function testGetIndexFieldNameDefaultMatchField() $searchFieldTypeMock = $this->getSearchFieldTypeMock(); $this->fieldRegistryMock - ->expects($this->once()) + ->expects(self::once()) ->method('getType') ->with('field_type_identifier') ->will( - $this->returnValue($indexFieldType) + self::returnValue($indexFieldType) ); $indexFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('getDefaultMatchField') ->will( - $this->returnValue('field_name') + self::returnValue('field_name') ); $indexFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('getIndexDefinition') ->will( - $this->returnValue( + self::returnValue( [ 'field_name' => $searchFieldTypeMock, ] @@ -531,7 +532,7 @@ public function testGetIndexFieldNameDefaultMatchField() ); $this->fieldNameGeneratorMock - ->expects($this->once()) + ->expects(self::once()) ->method('getName') ->with( 'field_name', @@ -539,18 +540,18 @@ public function testGetIndexFieldNameDefaultMatchField() 'content_type_identifier' ) ->will( - $this->returnValue('generated_field_name') + self::returnValue('generated_field_name') ); $this->fieldNameGeneratorMock - ->expects($this->once()) + ->expects(self::once()) ->method('getTypedName') ->with( 'generated_field_name', - $this->isInstanceOf(SPIFieldType::class) + self::isInstanceOf(SPIFieldType::class) ) ->will( - $this->returnValue('generated_typed_field_name') + self::returnValue('generated_typed_field_name') ); $fieldName = $mockedFieldNameResolver->getIndexFieldName( @@ -562,7 +563,7 @@ public function testGetIndexFieldNameDefaultMatchField() false ); - $this->assertEquals('generated_typed_field_name', key($fieldName)); + self::assertEquals('generated_typed_field_name', key($fieldName)); } public function testGetIndexFieldNameDefaultSortField() @@ -572,25 +573,25 @@ public function testGetIndexFieldNameDefaultSortField() $searchFieldTypeMock = $this->getSearchFieldTypeMock(); $this->fieldRegistryMock - ->expects($this->once()) + ->expects(self::once()) ->method('getType') ->with('field_type_identifier') ->will( - $this->returnValue($indexFieldType) + self::returnValue($indexFieldType) ); $indexFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('getDefaultSortField') ->will( - $this->returnValue('field_name') + self::returnValue('field_name') ); $indexFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('getIndexDefinition') ->will( - $this->returnValue( + self::returnValue( [ 'field_name' => $searchFieldTypeMock, ] @@ -598,7 +599,7 @@ public function testGetIndexFieldNameDefaultSortField() ); $this->fieldNameGeneratorMock - ->expects($this->once()) + ->expects(self::once()) ->method('getName') ->with( 'field_name', @@ -606,18 +607,18 @@ public function testGetIndexFieldNameDefaultSortField() 'content_type_identifier' ) ->will( - $this->returnValue('generated_field_name') + self::returnValue('generated_field_name') ); $this->fieldNameGeneratorMock - ->expects($this->once()) + ->expects(self::once()) ->method('getTypedName') ->with( 'generated_field_name', - $this->isInstanceOf(SPIFieldType::class) + self::isInstanceOf(SPIFieldType::class) ) ->will( - $this->returnValue('generated_typed_field_name') + self::returnValue('generated_typed_field_name') ); $fieldName = $mockedFieldNameResolver->getIndexFieldName( @@ -629,7 +630,7 @@ public function testGetIndexFieldNameDefaultSortField() true ); - $this->assertEquals('generated_typed_field_name', key($fieldName)); + self::assertEquals('generated_typed_field_name', key($fieldName)); } public function testGetIndexFieldNameDefaultMatchFieldThrowsRuntimeException() @@ -641,25 +642,25 @@ public function testGetIndexFieldNameDefaultMatchFieldThrowsRuntimeException() $searchFieldTypeMock = $this->getSearchFieldTypeMock(); $this->fieldRegistryMock - ->expects($this->once()) + ->expects(self::once()) ->method('getType') ->with('field_type_identifier') ->will( - $this->returnValue($indexFieldType) + self::returnValue($indexFieldType) ); $indexFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('getDefaultMatchField') ->will( - $this->returnValue('non_existent_field_name') + self::returnValue('non_existent_field_name') ); $indexFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('getIndexDefinition') ->will( - $this->returnValue( + self::returnValue( [ 'field_name' => $searchFieldTypeMock, ] @@ -685,25 +686,25 @@ public function testGetIndexFieldNameDefaultSortFieldThrowsRuntimeException() $searchFieldTypeMock = $this->getSearchFieldTypeMock(); $this->fieldRegistryMock - ->expects($this->once()) + ->expects(self::once()) ->method('getType') ->with('field_type_identifier') ->will( - $this->returnValue($indexFieldType) + self::returnValue($indexFieldType) ); $indexFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('getDefaultSortField') ->will( - $this->returnValue('non_existent_field_name') + self::returnValue('non_existent_field_name') ); $indexFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('getIndexDefinition') ->will( - $this->returnValue( + self::returnValue( [ 'field_name' => $searchFieldTypeMock, ] @@ -731,20 +732,20 @@ public function testGetIndexFieldNameNamedFieldThrowsRuntimeException() $searchFieldTypeMock = $this->getSearchFieldTypeMock(); $this->fieldRegistryMock - ->expects($this->once()) + ->expects(self::once()) ->method('getType') ->with('field_type_identifier') ->will( - $this->returnValue($indexFieldType) + self::returnValue($indexFieldType) ); - $indexFieldType->expects($this->never())->method('getDefaultField'); + $indexFieldType->expects(self::never())->method('getDefaultField'); $indexFieldType - ->expects($this->once()) + ->expects(self::once()) ->method('getIndexDefinition') ->will( - $this->returnValue( + self::returnValue( [ 'field_name' => $searchFieldTypeMock, ] diff --git a/tests/lib/Search/Legacy/Content/AbstractTestCase.php b/tests/lib/Search/Legacy/Content/AbstractTestCase.php index ca282f7768..10c4389843 100644 --- a/tests/lib/Search/Legacy/Content/AbstractTestCase.php +++ b/tests/lib/Search/Legacy/Content/AbstractTestCase.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\Core\Search\Legacy\Content; use Ibexa\Contracts\Core\Persistence\Content\Type\Handler as SPIContentTypeHandler; @@ -56,7 +57,7 @@ protected function setUp(): void protected function assertSearchResults($expectedIds, $searchResult) { $ids = $this->getIds($searchResult); - $this->assertEquals($expectedIds, $ids); + self::assertEquals($expectedIds, $ids); } protected function getIds($searchResult) diff --git a/tests/lib/Search/Legacy/Content/HandlerContentSortTest.php b/tests/lib/Search/Legacy/Content/HandlerContentSortTest.php index 1194ceb488..66940c0971 100644 --- a/tests/lib/Search/Legacy/Content/HandlerContentSortTest.php +++ b/tests/lib/Search/Legacy/Content/HandlerContentSortTest.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\Core\Search\Legacy\Content; use Ibexa\Contracts\Core\Persistence\Content\ContentInfo; @@ -105,11 +106,11 @@ protected function getContentMapperMock() ) ->setMethods(['extractContentInfoFromRows']) ->getMock(); - $mapperMock->expects($this->any()) + $mapperMock->expects(self::any()) ->method('extractContentInfoFromRows') - ->with($this->isType('array')) + ->with(self::isType('array')) ->will( - $this->returnCallback( + self::returnCallback( static function ($rows) { $contentInfoObjs = []; foreach ($rows as $row) { @@ -179,7 +180,7 @@ static function ($hit) { }, $result->searchHits ); - $this->assertEqualsCanonicalizing( + self::assertEqualsCanonicalizing( [4, 10, 11, 12, 13, 14, 42, 226], $ids ); @@ -202,7 +203,7 @@ public function testSortDateModified() ) ); - $this->assertEquals( + self::assertEquals( [4, 12, 13, 42, 10, 14, 11, 226], array_map( static function ($hit) { @@ -230,7 +231,7 @@ public function testSortDatePublished() ) ); - $this->assertEquals( + self::assertEquals( [4, 10, 11, 12, 13, 14, 226, 42], array_map( static function ($hit) { @@ -279,7 +280,7 @@ static function ($hit) { foreach ($idMapSet as $idSet) { $contentIdsSubset = array_slice($contentIds, $index, $count = count($idSet)); $index += $count; - $this->assertEqualsCanonicalizing( + self::assertEqualsCanonicalizing( $idSet, $contentIdsSubset ); @@ -326,13 +327,13 @@ static function ($hit) { $expectedCount += count($set); } - $this->assertEquals($expectedCount, $result->totalCount); + self::assertEquals($expectedCount, $result->totalCount); $index = 0; foreach ($idMapSet as $idSet) { $contentIdsSubset = array_slice($contentIds, $index, $count = count($idSet)); $index += $count; - $this->assertEqualsCanonicalizing( + self::assertEqualsCanonicalizing( $idSet, $contentIdsSubset ); @@ -356,7 +357,7 @@ public function testSortContentName() ) ); - $this->assertEquals( + self::assertEquals( [226, 14, 12, 10, 42, 57, 13, 50, 49, 41, 11, 51, 62, 4, 58, 59, 61, 60, 64, 63, 200, 66, 201], array_map( static function ($hit) { @@ -429,7 +430,7 @@ static function ($hit) { foreach ($idMapSet as $idSet) { $contentIdsSubset = array_slice($contentIds, $index, $count = count($idSet)); $index += $count; - $this->assertEqualsCanonicalizing( + self::assertEqualsCanonicalizing( $idSet, $contentIdsSubset ); @@ -458,7 +459,7 @@ public function testSortFieldNumeric() ) ); - $this->assertEquals( + self::assertEquals( [73, 71, 72, 69], array_map( static function ($hit) { diff --git a/tests/lib/Search/Legacy/Content/HandlerContentTest.php b/tests/lib/Search/Legacy/Content/HandlerContentTest.php index b5166e9a09..49eca7a47f 100644 --- a/tests/lib/Search/Legacy/Content/HandlerContentTest.php +++ b/tests/lib/Search/Legacy/Content/HandlerContentTest.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\Core\Search\Legacy\Content; use Ibexa\Contracts\Core\Persistence\Content\ContentInfo; @@ -204,11 +205,11 @@ protected function getContentMapperMock() ) ->setMethods(['extractContentInfoFromRows']) ->getMock(); - $mapperMock->expects($this->any()) + $mapperMock->expects(self::any()) ->method('extractContentInfoFromRows') - ->with($this->isType('array')) + ->with(self::isType('array')) ->will( - $this->returnCallback( + self::returnCallback( static function ($rows) { $contentInfoObjs = []; foreach ($rows as $row) { @@ -255,7 +256,7 @@ public function testFindWithoutOffsetLimit() ) ); - $this->assertEquals( + self::assertEquals( 1, $result->totalCount ); @@ -278,11 +279,11 @@ public function testFindWithZeroLimit() ) ); - $this->assertEquals( + self::assertEquals( 1, $result->totalCount ); - $this->assertEquals( + self::assertEquals( [], $result->searchHits ); @@ -305,11 +306,11 @@ public function testFindWithNullLimit() ) ); - $this->assertEquals( + self::assertEquals( 1, $result->totalCount ); - $this->assertCount( + self::assertCount( 1, $result->searchHits ); @@ -332,11 +333,11 @@ public function testFindWithOffsetToNonexistent() ) ); - $this->assertEquals( + self::assertEquals( 1, $result->totalCount ); - $this->assertCount( + self::assertCount( 0, $result->searchHits ); @@ -348,7 +349,7 @@ public function testFindSingle() $contentInfo = $locator->findSingle(new Criterion\ContentId(10)); - $this->assertEquals(10, $contentInfo->id); + self::assertEquals(10, $contentInfo->id); } public function testFindSingleWithNonSearchableField() @@ -432,7 +433,7 @@ public function testContentIdFilterCount() ) ); - $this->assertSame(2, $result->totalCount); + self::assertSame(2, $result->totalCount); } public function testContentAndCombinatorFilter() @@ -483,12 +484,12 @@ public function testContentOrCombinatorFilter() $expectedContentIds = [4, 10, 12]; - $this->assertEquals( + self::assertEquals( count($expectedContentIds), count($result->searchHits) ); foreach ($result->searchHits as $hit) { - $this->assertContains( + self::assertContains( $hit->valueObject->id, $expectedContentIds ); @@ -793,7 +794,7 @@ public function testStatusFilter() ) ); - $this->assertEquals( + self::assertEquals( 185, $searchResult->totalCount ); @@ -1028,7 +1029,7 @@ public function testFullTextFilterNoStopwordRemoval() ) ); - $this->assertCount( + self::assertCount( 10, array_map( static function ($hit) { diff --git a/tests/lib/Search/Legacy/Content/HandlerLocationSortTest.php b/tests/lib/Search/Legacy/Content/HandlerLocationSortTest.php index 29299760a2..5f9c438efc 100644 --- a/tests/lib/Search/Legacy/Content/HandlerLocationSortTest.php +++ b/tests/lib/Search/Legacy/Content/HandlerLocationSortTest.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\Core\Search\Legacy\Content; use Ibexa\Contracts\Core\Persistence\Content\Location as SPILocation; @@ -115,11 +116,11 @@ protected function getLocationMapperMock() ->setMethods(['createLocationsFromRows']) ->getMock(); $mapperMock - ->expects($this->any()) + ->expects(self::any()) ->method('createLocationsFromRows') - ->with($this->isType('array')) + ->with(self::isType('array')) ->will( - $this->returnCallback( + self::returnCallback( static function ($rows) { $locations = []; foreach ($rows as $row) { @@ -154,7 +155,7 @@ public function testNoSorting() ); $ids = $this->getIds($locations); - $this->assertEqualsCanonicalizing( + self::assertEqualsCanonicalizing( [179, 180, 181, 182, 183], $ids ); @@ -330,7 +331,7 @@ public function testSortSectionIdentifier() foreach ($idMapSet as $idSet) { $locationIdsSubset = array_slice($locationIds, $index, $count = count($idSet)); $index += $count; - $this->assertEqualsCanonicalizing( + self::assertEqualsCanonicalizing( $idSet, $locationIdsSubset ); @@ -492,13 +493,13 @@ static function ($hit) { $expectedCount += count($set); } - $this->assertEquals($expectedCount, $result->totalCount); + self::assertEquals($expectedCount, $result->totalCount); $index = 0; foreach ($idMapSet as $idSet) { $locationIdsSubset = array_slice($locationIds, $index, $count = count($idSet)); $index += $count; - $this->assertEqualsCanonicalizing( + self::assertEqualsCanonicalizing( $idSet, $locationIdsSubset ); @@ -567,7 +568,7 @@ static function ($hit) { foreach ($idMapSet as $idSet) { $locationIdsSubset = array_slice($locationIds, $index, $count = count($idSet)); $index += $count; - $this->assertEqualsCanonicalizing( + self::assertEqualsCanonicalizing( $idSet, $locationIdsSubset ); @@ -596,7 +597,7 @@ public function testSortFieldNumeric() ) ); - $this->assertEquals( + self::assertEquals( [75, 73, 74, 71], array_map( static function ($hit) { diff --git a/tests/lib/Search/Legacy/Content/HandlerLocationTest.php b/tests/lib/Search/Legacy/Content/HandlerLocationTest.php index ce1010cfd2..2dd446db8c 100644 --- a/tests/lib/Search/Legacy/Content/HandlerLocationTest.php +++ b/tests/lib/Search/Legacy/Content/HandlerLocationTest.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\Core\Search\Legacy\Content; use Ibexa\Contracts\Core\Persistence\Content\Location as SPILocation; @@ -176,11 +177,11 @@ protected function getLocationMapperMock() ->setMethods(['createLocationsFromRows']) ->getMock(); $mapperMock - ->expects($this->any()) + ->expects(self::any()) ->method('createLocationsFromRows') - ->with($this->isType('array')) + ->with(self::isType('array')) ->will( - $this->returnCallback( + self::returnCallback( static function ($rows) { $locations = []; foreach ($rows as $row) { @@ -211,8 +212,8 @@ public function testFindWithoutOffsetLimit() ) ); - $this->assertEquals(1, $searchResult->totalCount); - $this->assertCount(1, $searchResult->searchHits); + self::assertEquals(1, $searchResult->totalCount); + self::assertCount(1, $searchResult->searchHits); } public function testFindWithZeroLimit() @@ -229,8 +230,8 @@ public function testFindWithZeroLimit() ) ); - $this->assertEquals(1, $searchResult->totalCount); - $this->assertEquals([], $searchResult->searchHits); + self::assertEquals(1, $searchResult->totalCount); + self::assertEquals([], $searchResult->searchHits); } /** @@ -250,8 +251,8 @@ public function testFindWithNullLimit() ) ); - $this->assertEquals(1, $searchResult->totalCount); - $this->assertCount(1, $searchResult->searchHits); + self::assertEquals(1, $searchResult->totalCount); + self::assertCount(1, $searchResult->searchHits); } /** @@ -271,8 +272,8 @@ public function testFindWithOffsetToNonexistent() ) ); - $this->assertEquals(1, $searchResult->totalCount); - $this->assertEquals([], $searchResult->searchHits); + self::assertEquals(1, $searchResult->totalCount); + self::assertEquals([], $searchResult->searchHits); } public function testLocationIdFilter() @@ -1055,8 +1056,8 @@ public function testMatchAllFilter() ) ); - $this->assertCount(10, $result->searchHits); - $this->assertEquals(186, $result->totalCount); + self::assertCount(10, $result->searchHits); + self::assertEquals(186, $result->totalCount); $this->assertSearchResults( [2, 5, 12, 13, 14, 15, 43, 44, 45, 48], $result @@ -1147,9 +1148,9 @@ public function testFullTextFilterNoStopwordRemoval() ) ); - $this->assertEquals(26, $result->totalCount); - $this->assertCount(10, $result->searchHits); - $this->assertCount( + self::assertEquals(26, $result->totalCount); + self::assertCount(10, $result->searchHits); + self::assertCount( 10, array_map( static function ($hit) { diff --git a/tests/lib/Search/TestCase.php b/tests/lib/Search/TestCase.php index 7539c6e5c8..4a3e0c8bb8 100644 --- a/tests/lib/Search/TestCase.php +++ b/tests/lib/Search/TestCase.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\Core\Search; use PHPUnit\Framework\TestCase as BaseTestCase; diff --git a/tests/lib/Specification/AndSpecificationTest.php b/tests/lib/Specification/AndSpecificationTest.php index 417e30ede8..0cd89cfce2 100644 --- a/tests/lib/Specification/AndSpecificationTest.php +++ b/tests/lib/Specification/AndSpecificationTest.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\Core\Specification; use Ibexa\Contracts\Core\Specification\AndSpecification; diff --git a/tests/lib/Specification/BaseSpecificationTest.php b/tests/lib/Specification/BaseSpecificationTest.php index e67f1e99d9..f52e687d8a 100644 --- a/tests/lib/Specification/BaseSpecificationTest.php +++ b/tests/lib/Specification/BaseSpecificationTest.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\Core\Specification; use Ibexa\Contracts\Core\Specification\AbstractSpecification; diff --git a/tests/lib/Specification/Content/ContentContainerSpecificationTest.php b/tests/lib/Specification/Content/ContentContainerSpecificationTest.php index 686bb488ce..b11d383ae5 100644 --- a/tests/lib/Specification/Content/ContentContainerSpecificationTest.php +++ b/tests/lib/Specification/Content/ContentContainerSpecificationTest.php @@ -23,7 +23,7 @@ public function testConstructor(): void { $contentTypeSpecification = new ContentContainerSpecification(); - $this->assertInstanceOf(ContentSpecification::class, $contentTypeSpecification); + self::assertInstanceOf(ContentSpecification::class, $contentTypeSpecification); } /** @@ -42,11 +42,11 @@ public function testIsSatisfiedBy( ->getMockForAbstractClass(); $contentMock = $this->createMock(Content::class); - $contentMock->expects($this->once()) + $contentMock->expects(self::once()) ->method('getContentType') ->willReturn($contentTypeMock); - $this->assertEquals( + self::assertEquals( $contentContainerSpecification->isSatisfiedBy($contentMock), $shouldBeSatisfied ); diff --git a/tests/lib/Specification/Content/ContentTypeSpecificationTest.php b/tests/lib/Specification/Content/ContentTypeSpecificationTest.php index 6f077be26c..5f947daeb8 100644 --- a/tests/lib/Specification/Content/ContentTypeSpecificationTest.php +++ b/tests/lib/Specification/Content/ContentTypeSpecificationTest.php @@ -28,7 +28,7 @@ public function testConstructorWithExistingContentTypeIdentifier(): void self::EXISTING_CONTENT_TYPE_IDENTIFIER ); - $this->assertInstanceOf(ContentSpecification::class, $contentTypeSpecification); + self::assertInstanceOf(ContentSpecification::class, $contentTypeSpecification); } public function testConstructorWithNotExistingContentTypeIdentifier(): void @@ -37,7 +37,7 @@ public function testConstructorWithNotExistingContentTypeIdentifier(): void self::NOT_EXISTING_CONTENT_TYPE_IDENTIFIER ); - $this->assertInstanceOf(ContentSpecification::class, $contentTypeSpecification); + self::assertInstanceOf(ContentSpecification::class, $contentTypeSpecification); } /** @@ -59,11 +59,11 @@ public function testIsSatisfiedBy( ->getMockForAbstractClass(); $contentMock = $this->createMock(Content::class); - $contentMock->expects($this->once()) + $contentMock->expects(self::once()) ->method('getContentType') ->willReturn($contentTypeMock); - $this->assertEquals( + self::assertEquals( $contentTypeSpecification->isSatisfiedBy($contentMock), $shouldBeSatisfied ); diff --git a/tests/lib/Specification/NotSpecificationTest.php b/tests/lib/Specification/NotSpecificationTest.php index 43f395c665..747b354ffe 100644 --- a/tests/lib/Specification/NotSpecificationTest.php +++ b/tests/lib/Specification/NotSpecificationTest.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\Core\Specification; use Ibexa\Contracts\Core\Specification\NotSpecification; diff --git a/tests/lib/Specification/OrSpecificationTest.php b/tests/lib/Specification/OrSpecificationTest.php index dd2615b532..2c6d03b973 100644 --- a/tests/lib/Specification/OrSpecificationTest.php +++ b/tests/lib/Specification/OrSpecificationTest.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\Core\Specification; use Ibexa\Contracts\Core\Specification\OrSpecification;