[FrameworkBundle] Remove cache clearer default value in config
This commit is contained in:
parent
86f8d74ba1
commit
193542f84f
@ -585,7 +585,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->scalarNode('provider')
|
->scalarNode('provider')
|
||||||
->info('The service name to use as provider when the specified adapter needs one.')
|
->info('The service name to use as provider when the specified adapter needs one.')
|
||||||
->end()
|
->end()
|
||||||
->scalarNode('clearer')->defaultValue('cache.default_clearer')->end()
|
->scalarNode('clearer')->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->validate()
|
->validate()
|
||||||
|
@ -62,22 +62,28 @@ class CachePoolsTest extends WebTestCase
|
|||||||
static::bootKernel($options);
|
static::bootKernel($options);
|
||||||
$container = static::$kernel->getContainer();
|
$container = static::$kernel->getContainer();
|
||||||
|
|
||||||
$pool = $container->get('cache.test');
|
$pool1 = $container->get('cache.pool1');
|
||||||
$this->assertInstanceOf($adapterClass, $pool);
|
$this->assertInstanceOf($adapterClass, $pool1);
|
||||||
|
|
||||||
$key = 'foobar';
|
$key = 'foobar';
|
||||||
$pool->deleteItem($key);
|
$pool1->deleteItem($key);
|
||||||
$item = $pool->getItem($key);
|
$item = $pool1->getItem($key);
|
||||||
$this->assertFalse($item->isHit());
|
$this->assertFalse($item->isHit());
|
||||||
|
|
||||||
$item->set('baz');
|
$item->set('baz');
|
||||||
$pool->save($item);
|
$pool1->save($item);
|
||||||
$item = $pool->getItem($key);
|
$item = $pool1->getItem($key);
|
||||||
$this->assertTrue($item->isHit());
|
$this->assertTrue($item->isHit());
|
||||||
|
|
||||||
|
$pool2 = $container->get('cache.pool2');
|
||||||
|
$pool2->save($item);
|
||||||
|
|
||||||
$container->get('cache_clearer')->clear($container->getParameter('kernel.cache_dir'));
|
$container->get('cache_clearer')->clear($container->getParameter('kernel.cache_dir'));
|
||||||
$item = $pool->getItem($key);
|
$item = $pool1->getItem($key);
|
||||||
$this->assertFalse($item->isHit());
|
$this->assertFalse($item->isHit());
|
||||||
|
|
||||||
|
$item = $pool2->getItem($key);
|
||||||
|
$this->assertTrue($item->isHit());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function createKernel(array $options = array())
|
protected static function createKernel(array $options = array())
|
||||||
|
@ -4,5 +4,10 @@ imports:
|
|||||||
framework:
|
framework:
|
||||||
cache:
|
cache:
|
||||||
pools:
|
pools:
|
||||||
cache.test:
|
cache.pool1:
|
||||||
public: true
|
public: true
|
||||||
|
cache.pool2:
|
||||||
|
public: true
|
||||||
|
adapter: cache.pool3
|
||||||
|
cache.pool3:
|
||||||
|
clearer: ~
|
||||||
|
@ -5,5 +5,8 @@ framework:
|
|||||||
cache:
|
cache:
|
||||||
app: cache.adapter.redis
|
app: cache.adapter.redis
|
||||||
pools:
|
pools:
|
||||||
cache.test:
|
cache.pool1:
|
||||||
public: true
|
public: true
|
||||||
|
cache.pool2:
|
||||||
|
public: true
|
||||||
|
clearer: ~
|
||||||
|
@ -17,5 +17,8 @@ services:
|
|||||||
framework:
|
framework:
|
||||||
cache:
|
cache:
|
||||||
pools:
|
pools:
|
||||||
cache.test:
|
cache.pool1:
|
||||||
public: true
|
public: true
|
||||||
|
cache.pool2:
|
||||||
|
public: true
|
||||||
|
clearer: ~
|
||||||
|
Reference in New Issue
Block a user