From 54609b9dae4993c44decd2b5203abd492fa95db0 Mon Sep 17 00:00:00 2001 From: Bilal Amarni Date: Sun, 17 Mar 2013 14:48:26 +0100 Subject: [PATCH] [HttpCache] added a test (cached content should be kept after purging) --- .../Component/HttpKernel/Tests/HttpCache/StoreTest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php index fa879ce931f8c..68c9c2729ad35 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php @@ -66,11 +66,17 @@ public function testRemovesEntriesForKeyWithPurge() { $request = Request::create('/foo'); $this->store->write($request, new Response('foo')); - $this->assertNotEmpty($this->getStoreMetadata($request)); + + $metadata = $this->getStoreMetadata($request); + $this->assertNotEmpty($metadata); $this->assertTrue($this->store->purge('/foo')); $this->assertEmpty($this->getStoreMetadata($request)); + // cached content should be kept after purging + $path = $this->store->getPath($metadata[0][1]['x-content-digest'][0]); + $this->assertTrue(is_file($path)); + $this->assertFalse($this->store->purge('/bar')); }