diff --git a/src/Sylius/Bundle/AdminBundle/Tests/EventListener/AdminSectionCacheControlSubscriberTest.php b/src/Sylius/Bundle/AdminBundle/Tests/EventListener/AdminSectionCacheControlSubscriberTest.php new file mode 100644 index 00000000000..40201426a2d --- /dev/null +++ b/src/Sylius/Bundle/AdminBundle/Tests/EventListener/AdminSectionCacheControlSubscriberTest.php @@ -0,0 +1,43 @@ +request('GET', '/admin/'); + + $this->assertResponseHeaderSame('Cache-Control', 'max-age=0, must-revalidate, no-cache, no-store, private'); + } + + /** + * @test + */ + public function it_returns_normal_headers_otherwise(): void + { + $client = static::createClient(); + + $client->request('GET', '/en_US/'); + + $this->assertResponseHeaderSame('Cache-Control', 'max-age=0, must-revalidate, private'); + } +} diff --git a/src/Sylius/Bundle/ShopBundle/Tests/EventListener/AdminSectionCacheControlSubscriberTest.php b/src/Sylius/Bundle/ShopBundle/Tests/EventListener/AdminSectionCacheControlSubscriberTest.php new file mode 100644 index 00000000000..f1b53199059 --- /dev/null +++ b/src/Sylius/Bundle/ShopBundle/Tests/EventListener/AdminSectionCacheControlSubscriberTest.php @@ -0,0 +1,43 @@ +request('GET', '/en_US/account/'); + + $this->assertResponseHeaderSame('Cache-Control', 'max-age=0, must-revalidate, no-cache, no-store, private'); + } + + /** + * @test + */ + public function it_returns_normal_headers_otherwise(): void + { + $client = static::createClient(); + + $client->request('GET', '/en_US/'); + + $this->assertResponseHeaderSame('Cache-Control', 'max-age=0, must-revalidate, private'); + } +}