Skip to content

Commit

Permalink
Expand test for toHeaderValue()
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Mar 19, 2017
1 parent 76cd3d8 commit 30e6685
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/TestCase/Http/Cookie/CookieTest.php
Expand Up @@ -97,11 +97,13 @@ public function testToHeaderValue()
$date = Chronos::createFromFormat('m/d/Y h:m:s', '12/1/2027 12:00:00');

$cookie = new Cookie('cakephp', 'cakephp-rocks');
$cookie = $cookie->withDomain('cakephp.org');
$cookie = $cookie->withDomain('cakephp.org')
->withHttpOnly(true)
->withSecure(true);
$cookie->expiresAt($date);
$result = $cookie->toHeaderValue();

$expected = 'cakephp=cakephp-rocks; expires=Tue, 01-Dec-2026 12:00:00 GMT; domain=cakephp.org';
$expected = 'cakephp=cakephp-rocks; expires=Tue, 01-Dec-2026 12:00:00 GMT; domain=cakephp.org; secure; httponly';
$this->assertEquals($expected, $result);
}

Expand Down

0 comments on commit 30e6685

Please sign in to comment.