Skip to content

Commit

Permalink
[HttpFoundation] fixed exception message (closes #3123)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jan 16, 2012
1 parent 33170ae commit 733ac9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/Response.php
Expand Up @@ -672,7 +672,7 @@ public function setEtag($etag = null, $weak = false)
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'])) {
Expand Down
Expand Up @@ -219,6 +219,7 @@ public function testSetCache()
$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"');
Expand Down

0 comments on commit 733ac9d

Please sign in to comment.