From 691b700a11b6688d7296a1693efb47bbef6141cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Chru=C5=9Bciel?= Date: Tue, 21 Sep 2021 14:40:20 +0200 Subject: [PATCH] [Maintenace] Test existence of new cache headers --- ...AdminSectionCacheControlSubscriberTest.php | 43 +++++++++++++++++++ ...AdminSectionCacheControlSubscriberTest.php | 43 +++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 src/Sylius/Bundle/AdminBundle/Tests/EventListener/AdminSectionCacheControlSubscriberTest.php create mode 100644 src/Sylius/Bundle/ShopBundle/Tests/EventListener/AdminSectionCacheControlSubscriberTest.php 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'); + } +}