bug #27135 [FrameworkBundle] Use the correct service id for CachePoolPruneCommand in its compiler pass (DemonTPx)
This PR was squashed before being merged into the 3.4 branch (closes #27135).
Discussion
----------
[FrameworkBundle] Use the correct service id for CachePoolPruneCommand in its compiler pass
… CachePoolPruneCommand in its compiler pass
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27134 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
- Bug fixes must be submitted against the lowest branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the master branch.
-->
Commits
-------
32c7ee35be
[FrameworkBundle] Use the correct service id for CachePoolPruneCommand in its compiler pass
This commit is contained in:
commit
100348a8e9
@ -11,7 +11,6 @@
|
||||
|
||||
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Command\CachePoolPruneCommand;
|
||||
use Symfony\Component\Cache\PruneableInterface;
|
||||
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
@ -27,7 +26,7 @@ class CachePoolPrunerPass implements CompilerPassInterface
|
||||
private $cacheCommandServiceId;
|
||||
private $cachePoolTag;
|
||||
|
||||
public function __construct($cacheCommandServiceId = CachePoolPruneCommand::class, $cachePoolTag = 'cache.pool')
|
||||
public function __construct($cacheCommandServiceId = 'console.command.cache_pool_prune', $cachePoolTag = 'cache.pool')
|
||||
{
|
||||
$this->cacheCommandServiceId = $cacheCommandServiceId;
|
||||
$this->cachePoolTag = $cachePoolTag;
|
||||
|
@ -12,7 +12,6 @@
|
||||
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Bundle\FrameworkBundle\Command\CachePoolPruneCommand;
|
||||
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPrunerPass;
|
||||
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
|
||||
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;
|
||||
@ -25,7 +24,7 @@ class CachePoolPrunerPassTest extends TestCase
|
||||
public function testCompilerPassReplacesCommandArgument()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
$container->register(CachePoolPruneCommand::class)->addArgument(array());
|
||||
$container->register('console.command.cache_pool_prune')->addArgument(array());
|
||||
$container->register('pool.foo', FilesystemAdapter::class)->addTag('cache.pool');
|
||||
$container->register('pool.bar', PhpFilesAdapter::class)->addTag('cache.pool');
|
||||
|
||||
@ -36,7 +35,7 @@ class CachePoolPrunerPassTest extends TestCase
|
||||
'pool.foo' => new Reference('pool.foo'),
|
||||
'pool.bar' => new Reference('pool.bar'),
|
||||
);
|
||||
$argument = $container->getDefinition(CachePoolPruneCommand::class)->getArgument(0);
|
||||
$argument = $container->getDefinition('console.command.cache_pool_prune')->getArgument(0);
|
||||
|
||||
$this->assertInstanceOf(IteratorArgument::class, $argument);
|
||||
$this->assertEquals($expected, $argument->getValues());
|
||||
@ -64,7 +63,7 @@ class CachePoolPrunerPassTest extends TestCase
|
||||
public function testCompilerPassThrowsOnInvalidDefinitionClass()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
$container->register(CachePoolPruneCommand::class)->addArgument(array());
|
||||
$container->register('console.command.cache_pool_prune')->addArgument(array());
|
||||
$container->register('pool.not-found', NotFound::class)->addTag('cache.pool');
|
||||
|
||||
$pass = new CachePoolPrunerPass();
|
||||
|
Reference in New Issue
Block a user