Skip to content

Commit 2307dec

Browse files
committed
Merge pull request #47 from nicolas-grekas/fix-hhvm
Fix calling destructors on hhvm
2 parents 6ea8e12 + 9b530a9 commit 2307dec

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/CachePoolTest.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -447,17 +447,23 @@ public function testDeferredSaveWithoutCommit()
447447
return;
448448
}
449449

450-
$item = $this->cache->getItem('key');
451-
$item->set('4711');
452-
$this->cache->saveDeferred($item);
453-
454-
$this->cache = null;
450+
$this->prepareDeferredSaveWithoutCommit();
455451
gc_collect_cycles();
456452

457453
$cache = $this->createCachePool();
458454
$this->assertTrue($cache->getItem('key')->isHit(), 'A deferred item should automatically be committed on CachePool::__destruct().');
459455
}
460456

457+
private function prepareDeferredSaveWithoutCommit()
458+
{
459+
$cache = $this->cache;
460+
$this->cache = null;
461+
462+
$item = $cache->getItem('key');
463+
$item->set('4711');
464+
$cache->saveDeferred($item);
465+
}
466+
461467
public function testCommit()
462468
{
463469
if (isset($this->skippedTests[__FUNCTION__])) {

0 commit comments

Comments
 (0)