Skip to content

Commit

Permalink
Updated bundle notation to accomodate symfony 4.1 deprecations and ch…
Browse files Browse the repository at this point in the history
…anged

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
  - symfony/symfony#26085
  - symfony/symfony#22890

Signed-off-by: Rob Frawley 2nd <rmf@src.run>
  • Loading branch information
robfrawley committed May 7, 2018
1 parent 66959e1 commit e0f7288
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 20 deletions.
5 changes: 3 additions & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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')
Expand Down
4 changes: 3 additions & 1 deletion Resources/config/imagine.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@

<!-- Controller -->

<service id="liip_imagine.controller" class="Liip\ImagineBundle\Controller\ImagineController" public="true">
<service id="Liip\ImagineBundle\Controller\ImagineController" public="true">
<argument type="service" id="liip_imagine.service.filter" />
<argument type="service" id="liip_imagine.data.manager" />
<argument type="service" id="liip_imagine.cache.signer" />
</service>

<service id="liip_imagine.controller" alias="Liip\ImagineBundle\Controller\ImagineController" public="true" />

<service id="liip_imagine.meta_data.reader" class="Imagine\Image\Metadata\ExifMetadataReader" public="false" />

<!-- ImagineInterface instances -->
Expand Down
3 changes: 2 additions & 1 deletion Tests/DependencyInjection/LiipImagineExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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'),
Expand Down
1 change: 1 addition & 0 deletions Tests/Functional/AbstractSetupWebTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Controller/ImagineControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
30 changes: 15 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand All @@ -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": {
Expand Down

0 comments on commit e0f7288

Please sign in to comment.