public function StoreTest::testStoresMultipleResponsesForEachVaryCombination in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-kernel/Tests/HttpCache/StoreTest.php \Symfony\Component\HttpKernel\Tests\HttpCache\StoreTest::testStoresMultipleResponsesForEachVaryCombination()
File
- vendor/
symfony/ http-kernel/ Tests/ HttpCache/ StoreTest.php, line 181
Class
Namespace
Symfony\Component\HttpKernel\Tests\HttpCacheCode
public function testStoresMultipleResponsesForEachVaryCombination() {
$req1 = Request::create('/test', 'get', array(), array(), array(), array(
'HTTP_FOO' => 'Foo',
'HTTP_BAR' => 'Bar',
));
$res1 = new Response('test 1', 200, array(
'Vary' => 'Foo Bar',
));
$key = $this->store
->write($req1, $res1);
$req2 = Request::create('/test', 'get', array(), array(), array(), array(
'HTTP_FOO' => 'Bling',
'HTTP_BAR' => 'Bam',
));
$res2 = new Response('test 2', 200, array(
'Vary' => 'Foo Bar',
));
$this->store
->write($req2, $res2);
$req3 = Request::create('/test', 'get', array(), array(), array(), array(
'HTTP_FOO' => 'Baz',
'HTTP_BAR' => 'Boom',
));
$res3 = new Response('test 3', 200, array(
'Vary' => 'Foo Bar',
));
$this->store
->write($req3, $res3);
$this
->assertEquals($this
->getStorePath('en' . hash('sha256', 'test 3')), $this->store
->lookup($req3)
->getContent());
$this
->assertEquals($this
->getStorePath('en' . hash('sha256', 'test 2')), $this->store
->lookup($req2)
->getContent());
$this
->assertEquals($this
->getStorePath('en' . hash('sha256', 'test 1')), $this->store
->lookup($req1)
->getContent());
$this
->assertCount(3, $this
->getStoreMetadata($key));
}