8000 [FrameworkBundle] Remove cache clearer default value in config by nicolas-grekas · Pull Request #19893 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] Remove cache clearer default value in config #19893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ private function addCacheSection(ArrayNodeDefinition $rootNode)
->scalarNode('provider')
->info('The service name to use as provider when the specified adapter needs one.')
->end()
->scalarNode('clearer')->defaultValue('cache.default_clearer')->end()
->scalarNode('clearer')->end()
->end()
->end()
->validate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,28 @@ public function doTestCachePools($options, $adapterClass)
static::bootKernel($options);
$container = static::$kernel->getContainer();

$pool = $container->get('cache.test');
$this->assertInstanceOf($adapterClass, $pool);
$pool1 = $container->get('cache.pool1');
$this->assertInstanceOf($adapterClass, $pool1);

$key = 'foobar';
$pool->deleteItem($key);
$item = $pool->getItem($key);
$pool1->deleteItem($key);
$item = $pool1->getItem($key);
$this->assertFalse($item->isHit());

$item->set('baz');
$pool->save($item);
$item = $pool->getItem($key);
$pool1->save($item);
$item = $pool1->getItem($key);
$this->assertTrue($item->isHit());

$pool2 = $container->get('cache.pool2');
$pool2->save($item);

$container->get('cache_clearer')->clear($container->getParameter('kernel.cache_dir'));
$item = $pool->getItem($key);
$item = $pool1->getItem($key);
$this->assertFalse($item->isHit());

$item = $pool2->getItem($key);
$this->assertTrue($item->isHit());
}

protected static function createKernel(array $options = array())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@ imports:
framework:
cache:
pools:
cache.test:
cache.pool1:
public: true
cache.pool2:
public: true
adapter: cache.pool3
cache.pool3:
clearer: ~
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ framework:
cache:
app: cache.adapter.redis
pools:
cache.test:
cache.pool1:
public: true
cache.pool2:
public: true
clearer: ~
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ services:
framework:
cache:
pools:
cache.test:
cache.pool1:
public: true
cache.pool2:
public: true
clearer: ~
0