From e0f728858a458f11a4572e412c24f84275058734 Mon Sep 17 00:00:00 2001 From: Rob Frawley 2nd Date: Mon, 7 May 2018 18:26:27 -0400 Subject: [PATCH] Updated bundle notation to accomodate symfony 4.1 deprecations and changed browser kit client to not catch exceptions to fix our test suite. References: - https://symfony.com/blog/new-in-symfony-4-1-deprecated-the-bundle-notation - https://github.com/symfony/symfony/pull/26085 - https://github.com/symfony/symfony/pull/22890 Signed-off-by: Rob Frawley 2nd --- DependencyInjection/Configuration.php | 5 ++-- Resources/config/imagine.xml | 4 ++- .../LiipImagineExtensionTest.php | 3 +- Tests/Functional/AbstractSetupWebTestCase.php | 1 + .../Controller/ImagineControllerTest.php | 2 +- composer.json | 30 +++++++++---------- 6 files changed, 25 insertions(+), 20 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 9b627d9f4..0bfa4fc4f 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -11,6 +11,7 @@ namespace Liip\ImagineBundle\DependencyInjection; +use Liip\ImagineBundle\Controller\ImagineController; use Liip\ImagineBundle\DependencyInjection\Factory\Loader\LoaderFactoryInterface; use Liip\ImagineBundle\DependencyInjection\Factory\Resolver\ResolverFactoryInterface; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; @@ -118,8 +119,8 @@ public function getConfigTreeBuilder() ->arrayNode('controller') ->addDefaultsIfNotSet() ->children() - ->scalarNode('filter_action')->defaultValue('liip_imagine.controller:filterAction')->end() - ->scalarNode('filter_runtime_action')->defaultValue('liip_imagine.controller:filterRuntimeAction')->end() + ->scalarNode('filter_action')->defaultValue(sprintf('%s::filterAction', ImagineController::class))->end() + ->scalarNode('filter_runtime_action')->defaultValue(sprintf('%s::filterRuntimeAction', ImagineController::class))->end() ->end() ->end() ->arrayNode('filter_sets') diff --git a/Resources/config/imagine.xml b/Resources/config/imagine.xml index fca60a134..b260e0d1a 100644 --- a/Resources/config/imagine.xml +++ b/Resources/config/imagine.xml @@ -69,12 +69,14 @@ - + + + diff --git a/Tests/DependencyInjection/LiipImagineExtensionTest.php b/Tests/DependencyInjection/LiipImagineExtensionTest.php index bbc7d104d..3eb1f06d7 100644 --- a/Tests/DependencyInjection/LiipImagineExtensionTest.php +++ b/Tests/DependencyInjection/LiipImagineExtensionTest.php @@ -11,6 +11,7 @@ namespace Liip\ImagineBundle\Tests\DependencyInjection; +use Liip\ImagineBundle\Controller\ImagineController; use Liip\ImagineBundle\DependencyInjection\Factory\Loader\FileSystemLoaderFactory; use Liip\ImagineBundle\DependencyInjection\Factory\Resolver\WebPathResolverFactory; use Liip\ImagineBundle\DependencyInjection\LiipImagineExtension; @@ -49,7 +50,7 @@ public function testLoadWithDefaults() $this->assertAlias('liip_imagine.gd', 'liip_imagine'); $this->assertHasDefinition('liip_imagine.controller'); $this->assertDICConstructorArguments( - $this->containerBuilder->getDefinition('liip_imagine.controller'), + $this->containerBuilder->getDefinition(ImagineController::class), [ new Reference('liip_imagine.service.filter'), new Reference('liip_imagine.data.manager'), diff --git a/Tests/Functional/AbstractSetupWebTestCase.php b/Tests/Functional/AbstractSetupWebTestCase.php index d6c81cde1..449ad36ef 100644 --- a/Tests/Functional/AbstractSetupWebTestCase.php +++ b/Tests/Functional/AbstractSetupWebTestCase.php @@ -44,6 +44,7 @@ public function setUp() parent::setUp(); $this->client = $this->createClient(); + $this->client->catchExceptions(false); $this->webRoot = sprintf('%s/public', self::$kernel->getContainer()->getParameter('kernel.root_dir')); $this->cacheRoot = $this->webRoot.'/media/cache'; $this->filesystem = new Filesystem(); diff --git a/Tests/Functional/Controller/ImagineControllerTest.php b/Tests/Functional/Controller/ImagineControllerTest.php index 140b60f04..12434b4aa 100644 --- a/Tests/Functional/Controller/ImagineControllerTest.php +++ b/Tests/Functional/Controller/ImagineControllerTest.php @@ -23,7 +23,7 @@ class ImagineControllerTest extends AbstractSetupWebTestCase { public function testCouldBeGetFromContainer() { - $this->assertInstanceOf(ImagineController::class, self::$kernel->getContainer()->get('liip_imagine.controller')); + $this->assertInstanceOf(ImagineController::class, self::$kernel->getContainer()->get(ImagineController::class)); } public function testShouldResolvePopulatingCacheFirst() diff --git a/composer.json b/composer.json index e5ab885de..e7ffde6c9 100644 --- a/composer.json +++ b/composer.json @@ -20,14 +20,14 @@ "require": { "php": "^7.1", "imagine/Imagine": "^0.7.1,<0.8", - "symfony/asset": "^3.0|^4.0", - "symfony/filesystem": "^3.0|^4.0", - "symfony/finder": "^3.0|^4.0", - "symfony/framework-bundle": "^3.0|^4.0", - "symfony/options-resolver": "^3.0|^4.0", - "symfony/process": "^3.0|^4.0", - "symfony/templating": "^3.0|^4.0", - "symfony/translation": "^3.0|^4.0" + "symfony/asset": "^3.4|^4.0", + "symfony/filesystem": "^3.4|^4.0", + "symfony/finder": "^3.4|^4.0", + "symfony/framework-bundle": "^3.4|^4.0", + "symfony/options-resolver": "^3.4|^4.0", + "symfony/process": "^3.4|^4.0", + "symfony/templating": "^3.4|^4.0", + "symfony/translation": "^3.4|^4.0" }, "require-dev": { "ext-gd": "*", @@ -39,13 +39,13 @@ "friendsofphp/php-cs-fixer": "^2.10", "league/flysystem": "^1.0", "psr/log": "^1.0", - "symfony/browser-kit": "^3.0|^4.0", - "symfony/console": "^3.0|^4.0", - "symfony/dependency-injection": "^3.0|^4.0", - "symfony/form": "^3.0|^4.0", - "symfony/phpunit-bridge": "^3.0|^4.0", - "symfony/validator": "^3.0|^4.0", - "symfony/yaml": "^3.0|^4.0", + "symfony/browser-kit": "^3.4|^4.0", + "symfony/console": "^3.4|^4.0", + "symfony/dependency-injection": "^3.4|^4.0", + "symfony/form": "^3.4|^4.0", + "symfony/phpunit-bridge": "^3.4|^4.0", + "symfony/validator": "^3.4|^4.0", + "symfony/yaml": "^3.4|^4.0", "twig/twig": "^1.12|^2.0" }, "suggest": {