8000 [HttpKernel] harden test to not depend on the system's configured default timezone by xabbuh · Pull Request #58476 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpKernel] harden test to not depend on the system's configured default timezone #58476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function testMaxAgeUpdatedFromExpiresHeader()
$cacheStrategy = new ResponseCacheStrategy();

$response1 = new Response();
$response1->setExpires(new \DateTime('+ 1 hour'));
$response1->setExpires(new \DateTime('+ 1 hour', new \DateTimeZone('UTC')));
$response1->setPublic();
$cacheStrategy->add($response1);

Expand All @@ -112,15 +112,15 @@ public function testMaxAgeUpdatedFromExpiresHeader()

$this->assertSame('3600', $response->headers->getCacheControlDirective('max-age'));
$this->assertNull($response->headers->getCacheControlDirective('s-maxage'));
$this->assertSame((new \DateTime('+ 1 hour'))->format('D, d M Y H:i:s').' GMT', $response->headers->get('Expires'));
$this->assertSame((new \DateTime('+ 1 hour', new \DateTimeZone('UTC')))->format('D, d M Y H:i:s').' GMT', $response->headers->get('Expires'));
}

public function testMaxAgeAndSharedMaxAgeUpdatedFromExpiresHeader()
{
$cacheStrategy = new ResponseCacheStrategy();

$response1 = new Response();
$response1->setExpires(new \DateTime('+ 1 day'));
$response1->setExpires(new \DateTime('+ 1 day', new \DateTimeZone('UTC')));
$response1->setPublic();
$cacheStrategy->add($response1);

Expand All @@ -131,7 +131,7 @@ public function testMaxAgeAndSharedMaxAgeUpdatedFromExpiresHeader()

$this->assertSame('3600', $response->headers->getCacheControlDirective('max-age'));
$this->assertSame('86400', $response->headers->getCacheControlDirective('s-maxage'));
$this->assertSame((new \DateTime('+ 1 hour'))->format('D, d M Y H:i:s').' GMT', $response->headers->get('Expires'));
$this->assertSame((new \DateTime('+ 1 hour', new \DateTimeZone('UTC')))->format('D, d M Y H:i:s').' GMT', $response->headers->get('Expires'));
}

public function testMainResponseNotCacheableWhenEmbeddedResponseRequiresValidation()
Expand Down
Loading
0