/** * {@inheritdoc} */ public function __toString() { $cookies = ''; foreach ($this->getCookies() as $cookie) { $cookies .= 'Set-Cookie: ' . $cookie . "\r\n"; } return parent::__toString() . $cookies; }
public function testToStringNotNull() { $bag = new HeaderBag(array('foo' => 'bar')); $this->assertEquals("Foo: bar\r\n", $bag->__toString()); }