|
13 | 13 |
|
14 | 14 | use PHPUnit\Framework\TestCase;
|
15 | 15 | use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPass;
|
| 16 | +use Symfony\Component\Cache\Adapter\ArrayAdapter; |
16 | 17 | use Symfony\Component\DependencyInjection\ContainerBuilder;
|
17 | 18 | use Symfony\Component\DependencyInjection\Definition;
|
18 | 19 | use Symfony\Component\DependencyInjection\DefinitionDecorator;
|
@@ -49,6 +50,24 @@ public function testNamespaceArgumentIsReplaced()
|
49 | 50 | $this->assertSame('D07rhFx97S', $cachePool->getArgument(0));
|
50 | 51 | }
|
51 | 52 |
|
| 53 | + public function testNamespaceArgumentIsNotReplacedIfArrayAdapterIsUsed() |
| 54 | + { |
| 55 | + $container = new ContainerBuilder(); |
| 56 | + $container->setParameter('kernel.environment', 'prod'); |
| 57 | + $container->setParameter('kernel.name', 'app'); |
| 58 | + $container->setParameter('kernel.root_dir', 'foo'); |
| 59 | + |
| 60 | + $container->register('cache.adapter.array', ArrayAdapter::class)->addArgument(0); |
| 61 | + |
| 62 | + $cachePool = new DefinitionDecorator('cache.adapter.array'); |
| 63 | + $cachePool->addTag('cache.pool'); |
| 64 | + $container->setDefinition('app.cache_pool', $cachePool); |
| 65 | + |
| 66 | + $this->cachePoolPass->process($container); |
| 67 | + |
| 68 | + $this->assertCount(0, $container->getDefinition('app.cache_pool')->getArguments()); |
| 69 | + } |
| 70 | + |
52 | 71 | public function testArgsAreReplaced()
|
53 | 72 | {
|
54 | 73 | $container = new ContainerBuilder();
|
|
0 commit comments