8000 Set Date header in Response constructor already by mpdude · Pull Request #22036 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Set Date header in Response constructor already #22036

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Tweak test
  • Loading branch information
mpdude committed Mar 17, 2017
commit f967c964d65d0be4601c6473d5b44a4d6b03b15f
4 changes: 3 additions & 1 deletion src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,10 @@ public function testGetDate()
$this->assertEquals($now->getTimestamp(), $date->getTimestamp(), '->getDate() returns the date when the header has been modified');

$response = new Response('', 200);
$now = $this->createDateTimeNow();
$response->headers->remove('Date');
$this->assertInstanceOf('\DateTime', $response->getDate());
$date = $response->getDate();
$this->assertEquals($now->getTimestamp(), $date->getTimestamp(), '->getDate() returns the current Date when the header has previously been removed');
}

public function testGetMaxAge()
Expand Down
0