$response->setCache(array('private' => false));
$this->assertTrue($response->headers->hasCacheControlDirective('public'));
$this->assertFalse($response->headers->hasCacheControlDirective('private'));
+
+ $response->setCache(array('immutable' => true));
+ $this->assertTrue($response->headers->hasCacheControlDirective('immutable'));
+
+ $response->setCache(array('immutable' => false));
+ $this->assertFalse($response->headers->hasCacheControlDirective('immutable'));
}
public function testSendContent()
$this->assertFalse($response->headers->hasCacheControlDirective('private'));
}
+ public function testSetImmutable()
+ {
+ $response = new Response();
+ $response->setImmutable();
+
+ $this->assertTrue($response->headers->hasCacheControlDirective('immutable'));
+ }
+
+ public function testIsImmutable()
+ {
+ $response = new Response();
+ $response->setImmutable();
+
+ $this->assertTrue($response->isImmutable());
+ }
+
public function testSetExpires()
{
$response = new Response();
$this->addToAssertionCount(1);
}
- /**
- * @group legacy
- * @expectedDeprecation Extending Symfony\Component\HttpFoundation\Response::getDate() in Symfony\Component\HttpFoundation\Tests\ExtendedResponse is deprecated %s.
- * @expectedDeprecation Extending Symfony\Component\HttpFoundation\Response::setLastModified() in Symfony\Component\HttpFoundation\Tests\ExtendedResponse is deprecated %s.
- */
- public function testDeprecations()
- {
- new ExtendedResponse();
-
- // Deprecations should not be triggered twice
- new ExtendedResponse();
- }
-
public function validContentProvider()
{
return array(
$ianaCodesReasonPhrases = array();
- $xpath = new \DomXPath($ianaHttpStatusCodes);
+ $xpath = new \DOMXPath($ianaHttpStatusCodes);
$xpath->registerNamespace('ns', 'http://www.iana.org/assignments');
$records = $xpath->query('//ns:record');