return array(
array(
array('fOo' => 'BAR'),
- array('fOo' => array('BAR'), 'Cache-Control' => array('no-cache')),
+ array('fOo' => array('BAR'), 'Cache-Control' => array('no-cache, private')),
),
array(
array('ETag' => 'xyzzy'),
),
array(
array('Content-MD5' => 'Q2hlY2sgSW50ZWdyaXR5IQ=='),
- array('Content-MD5' => array('Q2hlY2sgSW50ZWdyaXR5IQ=='), 'Cache-Control' => array('no-cache')),
+ array('Content-MD5' => array('Q2hlY2sgSW50ZWdyaXR5IQ=='), 'Cache-Control' => array('no-cache, private')),
),
array(
array('P3P' => 'CP="CAO PSA OUR"'),
- array('P3P' => array('CP="CAO PSA OUR"'), 'Cache-Control' => array('no-cache')),
+ array('P3P' => array('CP="CAO PSA OUR"'), 'Cache-Control' => array('no-cache, private')),
),
array(
array('WWW-Authenticate' => 'Basic realm="WallyWorld"'),
- array('WWW-Authenticate' => array('Basic realm="WallyWorld"'), 'Cache-Control' => array('no-cache')),
+ array('WWW-Authenticate' => array('Basic realm="WallyWorld"'), 'Cache-Control' => array('no-cache, private')),
),
array(
array('X-UA-Compatible' => 'IE=edge,chrome=1'),
- array('X-UA-Compatible' => array('IE=edge,chrome=1'), 'Cache-Control' => array('no-cache')),
+ array('X-UA-Compatible' => array('IE=edge,chrome=1'), 'Cache-Control' => array('no-cache, private')),
),
array(
array('X-XSS-Protection' => '1; mode=block'),
- array('X-XSS-Protection' => array('1; mode=block'), 'Cache-Control' => array('no-cache')),
+ array('X-XSS-Protection' => array('1; mode=block'), 'Cache-Control' => array('no-cache, private')),
),
);
}
public function testCacheControlHeader()
{
$bag = new ResponseHeaderBag(array());
- $this->assertEquals('no-cache', $bag->get('Cache-Control'));
+ $this->assertEquals('no-cache, private', $bag->get('Cache-Control'));
$this->assertTrue($bag->hasCacheControlDirective('no-cache'));
$bag = new ResponseHeaderBag(array('Cache-Control' => 'public'));
$this->assertEquals('private, must-revalidate', $bag->get('Cache-Control'));
}
+ public function testCacheControlClone()
+ {
+ $headers = array('foo' => 'bar');
+ $bag1 = new ResponseHeaderBag($headers);
+ $bag2 = new ResponseHeaderBag($bag1->allPreserveCase());
+ $this->assertEquals($bag1->allPreserveCase(), $bag2->allPreserveCase());
+ }
+
public function testToStringIncludesCookieHeaders()
{
$bag = new ResponseHeaderBag(array());
public function testReplace()
{
$bag = new ResponseHeaderBag(array());
- $this->assertEquals('no-cache', $bag->get('Cache-Control'));
+ $this->assertEquals('no-cache, private', $bag->get('Cache-Control'));
$this->assertTrue($bag->hasCacheControlDirective('no-cache'));
$bag->replace(array('Cache-Control' => 'public'));
public function testReplaceWithRemove()
{
$bag = new ResponseHeaderBag(array());
- $this->assertEquals('no-cache', $bag->get('Cache-Control'));
+ $this->assertEquals('no-cache, private', $bag->get('Cache-Control'));
$this->assertTrue($bag->hasCacheControlDirective('no-cache'));
$bag->remove('Cache-Control');
$bag->replace(array());
- $this->assertEquals('no-cache', $bag->get('Cache-Control'));
+ $this->assertEquals('no-cache, private', $bag->get('Cache-Control'));
$this->assertTrue($bag->hasCacheControlDirective('no-cache'));
}