forked from Sylius/Sylius
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Maintenace] Test existence of new cache headers
- Loading branch information
1 parent
4b6a77a
commit 691b700
Showing
2 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
src/Sylius/Bundle/AdminBundle/Tests/EventListener/AdminSectionCacheControlSubscriberTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Paweł Jędrzejewski | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sylius\Bundle\AdminBundle\Tests\EventListener; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
|
||
final class AdminSectionCacheControlSubscriberTest extends WebTestCase | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function it_returns_proper_cache_headers_for_admin_endpoints(): void | ||
{ | ||
$client = static::createClient(); | ||
|
||
$client->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'); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/Sylius/Bundle/ShopBundle/Tests/EventListener/AdminSectionCacheControlSubscriberTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Paweł Jędrzejewski | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sylius\Bundle\AdminBundle\Tests\EventListener; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
|
||
final class AdminSectionCacheControlSubscriberTest extends WebTestCase | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function it_returns_proper_cache_headers_for_customer_account_endpoints(): void | ||
{ | ||
$client = static::createClient(); | ||
|
||
$client->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'); | ||
} | ||
} |