Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 46341e1

Browse files
committed
merged branch bamarni/issue-6830 (PR #7408)
This PR was merged into the 2.1 branch. Commits ------- 54609b9 [HttpCache] added a test (cached content should be kept after purging) Discussion ---------- [HttpCache] added a test (cached content should be kept after purging) closes #6830
2 parents 7b76392 + 54609b9 commit 46341e1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,17 @@ public function testRemovesEntriesForKeyWithPurge()
6666
{
6767
$request = Request::create('/foo');
6868
$this->store->write($request, new Response('foo'));
69-
$this->assertNotEmpty($this->getStoreMetadata($request));
69+
70+
$metadata = $this->getStoreMetadata($request);
71+
$this->assertNotEmpty($metadata);
7072

7173
$this->assertTrue($this->store->purge('/foo'));
7274
$this->assertEmpty($this->getStoreMetadata($request));
7375

76+
// cached content should be kept after purging
77+
$path = $this->store->getPath($metadata[0][1]['x-content-digest'][0]);
78+
$this->assertTrue(is_file($path));
79+
7480
$this->assertFalse($this->store->purge('/bar'));
7581
}
7682

0 commit comments

Comments
 (0)