|
@@ -61,6 +61,15 @@ class ResponseTest extends \PHPUnit_Framework_TestCase
|
|
$this->assertNull($response->getMaxAge(), '->getMaxAge() returns null if no freshness information available');
|
|
$this->assertNull($response->getMaxAge(), '->getMaxAge() returns null if no freshness information available');
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function testSetSharedMaxAge()
|
|
|
|
+ {
|
|
|
|
+ $response = new Response();
|
|
|
|
+ $response->setSharedMaxAge(20);
|
|
|
|
+
|
|
|
|
+ $cacheControl = $response->headers->get('Cache-Control');
|
|
|
|
+ $this->assertEquals('public, s-maxage=20', $cacheControl);
|
|
|
|
+ }
|
|
|
|
+
|
|
public function testIsPrivate()
|
|
public function testIsPrivate()
|
|
{
|
|
{
|
|
$response = new Response();
|
|
$response = new Response();
|
|
@@ -207,7 +216,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase
|
|
$response->setCache($options);
|
|
$response->setCache($options);
|
|
$this->assertEquals($response->getMaxAge(), 200);
|
|
$this->assertEquals($response->getMaxAge(), 200);
|
|
|
|
|
|
- $this->assertFalse($response->headers->hasCacheControlDirective('public'));
|
|
|
|
|
|
+ $this->assertTrue($response->headers->hasCacheControlDirective('public'));
|
|
$this->assertFalse($response->headers->hasCacheControlDirective('private'));
|
|
$this->assertFalse($response->headers->hasCacheControlDirective('private'));
|
|
|
|
|
|
$response->setCache(array('public' => true));
|
|
$response->setCache(array('public' => true));
|