Updating testcase and fixing small bug in last commit

This commit is contained in:
José Lorenzo Rodríguez 2010-10-03 16:48:07 -04:30
parent 6f5ce8a81d
commit 0ba5023f3a
3 changed files with 7 additions and 9 deletions

View file

@ -616,7 +616,7 @@ class CakeResponse {
$this->header(array(
'Date' => gmdate("D, j M Y G:i:s ", $since) . 'GMT',
'Expires' => gmdate("D, j M Y H:i:s", $time) . " GMT",
'Cache-Control' => 'public, max-age=' . $time - time(),
'Cache-Control' => 'public, max-age=' . ($time - time()),
'Pragma' => 'cache'
));
}

View file

@ -21,8 +21,6 @@ App::import('View', 'View', false);
class MediaView extends View {
/**
* Constructor
*

View file

@ -229,9 +229,9 @@ class CakeResponseTestCase extends CakeTestCase {
$since = time();
$time = '+1 day';
$expected = array(
'Date' => date("D, j M Y G:i:s ", $since) . 'GMT',
'Date' => gmdate("D, j M Y G:i:s ", $since) . 'GMT',
'Expires' => gmdate("D, j M Y H:i:s", strtotime($time)) . " GMT",
'Cache-Control' => 'cache',
'Cache-Control' => 'public, max-age=' . (strtotime($time) - time()),
'Pragma' => 'cache'
);
$response->cache($since);
@ -241,9 +241,9 @@ class CakeResponseTestCase extends CakeTestCase {
$since = time();
$time = '+5 day';
$expected = array(
'Date' => date("D, j M Y G:i:s ", $since) . 'GMT',
'Date' => gmdate("D, j M Y G:i:s ", $since) . 'GMT',
'Expires' => gmdate("D, j M Y H:i:s", strtotime($time)) . " GMT",
'Cache-Control' => 'cache',
'Cache-Control' => 'public, max-age=' . (strtotime($time) - time()),
'Pragma' => 'cache'
);
$response->cache($since, $time);
@ -253,9 +253,9 @@ class CakeResponseTestCase extends CakeTestCase {
$since = time();
$time = time();
$expected = array(
'Date' => date("D, j M Y G:i:s ", $since) . 'GMT',
'Date' => gmdate("D, j M Y G:i:s ", $since) . 'GMT',
'Expires' => gmdate("D, j M Y H:i:s", $time) . " GMT",
'Cache-Control' => 'cache',
'Cache-Control' => 'public, max-age=0',
'Pragma' => 'cache'
);
$response->cache($since, $time);