[HttpFoundation] fixed exception message (closes #3123)
This commit is contained in:
parent
33170ae572
commit
733ac9de7a
@ -672,7 +672,7 @@ class Response
|
||||
public function setCache(array $options)
|
||||
{
|
||||
if ($diff = array_diff(array_keys($options), array('etag', 'last_modified', 'max_age', 's_maxage', 'private', 'public'))) {
|
||||
throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', array_keys($diff))));
|
||||
throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', array_values($diff))));
|
||||
}
|
||||
|
||||
if (isset($options['etag'])) {
|
||||
|
@ -219,6 +219,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase
|
||||
$this->fail('->setCache() throws an InvalidArgumentException if an option is not supported');
|
||||
} catch (\Exception $e) {
|
||||
$this->assertInstanceOf('InvalidArgumentException', $e, '->setCache() throws an InvalidArgumentException if an option is not supported');
|
||||
$this->assertContains('"wrong option"', $e->getMessage());
|
||||
}
|
||||
|
||||
$options = array('etag' => '"whatever"');
|
||||
|
Reference in New Issue
Block a user