Fix constant accessor
This commit is contained in:
parent
2d6327ff9d
commit
633ff5b214
@ -949,7 +949,7 @@ class Response
|
||||
*/
|
||||
public function setCache(array $options): object
|
||||
{
|
||||
if ($diff = array_diff(array_keys($options), array_keys(static::HTTP_RESPONSE_CACHE_CONTROL_DIRECTIVES))) {
|
||||
if ($diff = array_diff(array_keys($options), array_keys(self::HTTP_RESPONSE_CACHE_CONTROL_DIRECTIVES))) {
|
||||
throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', $diff)));
|
||||
}
|
||||
|
||||
|
@ -672,6 +672,12 @@ class ResponseTest extends ResponseTestCase
|
||||
|
||||
$this->assertFalse($response->headers->hasCacheControlDirective(str_replace('_', '-', $directive)));
|
||||
}
|
||||
|
||||
$response = new DefaultResponse();
|
||||
|
||||
$options = ['etag' => '"whatever"'];
|
||||
$response->setCache($options);
|
||||
$this->assertSame($response->getEtag(), '"whatever"');
|
||||
}
|
||||
|
||||
public function testSendContent()
|
||||
|
Reference in New Issue
Block a user