Skip to content

Commit 9714524

Browse files
committed
fixed a unit test and CS
1 parent fd6c254 commit 9714524

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/Symfony/Component/HttpFoundation/Cookie.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ public function __construct($name, $value = null, $expire = 0, $path = '/', $dom
6060
$this->secure = (Boolean) $secure;
6161
$this->httpOnly = (Boolean) $httpOnly;
6262
}
63-
63+
6464
public function __toString()
6565
{
6666
$str = urlencode($this->getName()).'=';
6767

6868
if ('' === (string) $this->getValue()) {
69-
$str .= 'deleted; expires='.gmdate("D, d-M-Y H:i:s T", time()-31536001);
69+
$str .= 'deleted; expires='.gmdate("D, d-M-Y H:i:s T", time() - 31536001);
7070
} else {
7171
$str .= urlencode($this->getValue());
7272

src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ public function __toString()
4444
$cookies .= 'Set-Cookie: '.$cookie."\r\n";
4545
}
4646

47-
return
48-
parent::__toString().
49-
$cookies;
47+
return parent::__toString().$cookies;
5048
}
5149

5250
/**

tests/Symfony/Tests/Component/HttpFoundation/ResponseHeaderBagTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ public function testCacheControlHeader()
6363
$bag->set('Last-Modified', 'abcde');
6464
$this->assertEquals('private, must-revalidate', $bag->get('Cache-Control'));
6565
}
66-
66+
6767
public function testToStringIncludesCookieHeaders()
6868
{
6969
$bag = new ResponseHeaderBag(array());
7070
$bag->setCookie(new Cookie('foo', 'bar'));
71-
71+
7272
$this->assertContains("Set-Cookie: foo=bar; path=/; httponly", explode("\r\n", $bag->__toString()));
73-
73+
7474
$bag->clearCookie('foo');
7575

76-
$this->assertContains("Set-Cookie: foo=deleted; expires=Thu, 01 Jan 1970 00:00:00 GMT; httponly", explode("\r\n", $bag->__toString()));
76+
$this->assertContains("Set-Cookie: foo=deleted; expires=".gmdate("D, d-M-Y H:i:s T", time() - 31536001)."; httponly", explode("\r\n", $bag->__toString()));
7777
}
7878
}

0 commit comments

Comments
 (0)