8000 [Cache] Minor cleanup by nicolas-grekas · Pull Request #19540 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Cache] Minor cleanup #19540

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
Aug 5, 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
3 changes: 0 additions & 3 deletions src/Symfony/Component/Cache/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,6 @@ public function save(CacheItemInterface $item)
if (!$item instanceof CacheItem) {
return false;
}
if ($this->deferred) {
$this->commit();
}
$this->deferred[$item->getKey()] = $item;

return $this->commit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ abstract class AbstractRedisAdapterTest extends AdapterTestCase

public function createCachePool($defaultLifetime = 0)
{
if (defined('HHVM_VERSION')) {
$this->skippedTests['testDeferredSaveWithoutCommit'] = 'Fails on HHVM';
}

return new RedisAdapter(self::$redis, str_replace('\\', '.', __CLASS__), $defaultLifetime);
}

Expand Down
9 changes: 9 additions & 0 deletions src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@

abstract class AdapterTestCase extends CachePoolTest
{
protected function setUp()
{
parent::setUp();

if (!array_key_exists('testDeferredSaveWithoutCommit', $this->skippedTests) && defined('HHVM_VERSION')) {
$this->skippedTests['testDeferredSaveWithoutCommit'] = 'Destructors are called late on HHVM.';
}
}

public function testDefaultLifeTime()
{
if (isset($this->skippedTests[__FUNCTION__])) {
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Cache/Tests/Adapter/ApcuAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ class ApcuAdapterTest extends AdapterTestCase
{
public function createCachePool($defaultLifetime = 0)
{
if (defined('HHVM_VERSION')) {
$this->skippedTests['testDeferredSaveWithoutCommit'] = 'Fails on HHVM';
}
if (!function_exists('apcu_fetch') || !ini_get('apc.enabled') || ('cli' === PHP_SAPI && !ini_get('apc.enable_cli'))) {
$this->markTestSkipped('APCu extension is required.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ class ChainAdapterTest extends AdapterTestCase
{
public function createCachePool($defaultLifetime = 0)
{
if (defined('HHVM_VERSION')) {
$this->skippedTests['testDeferredSaveWithoutCommit'] = 'Fails on HHVM';
}

return new ChainAdapter(array(new ArrayAdapter($defaultLifetime), new ExternalAdapter(), new FilesystemAdapter('', $defaultLifetime)), $defaultLifetime);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ class FilesystemAdapterTest extends AdapterTestCase
{
public function createCachePool($defaultLifetime = 0)
{
if (defined('HHVM_VERSION')) {
$this->skippedTests['testDeferredSaveWithoutCommit'] = 'Fails on HHVM';
}

return new FilesystemAdapter('', $defaultLifetime);
}

Expand Down
0