You are here

public function StoreTest::testRemovesEntriesForKeyWithPurge in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Tests/HttpCache/StoreTest.php \Symfony\Component\HttpKernel\Tests\HttpCache\StoreTest::testRemovesEntriesForKeyWithPurge()

File

vendor/symfony/http-kernel/Tests/HttpCache/StoreTest.php, line 61

Class

StoreTest

Namespace

Symfony\Component\HttpKernel\Tests\HttpCache

Code

public function testRemovesEntriesForKeyWithPurge() {
  $request = Request::create('/foo');
  $this->store
    ->write($request, new Response('foo'));
  $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'));
}