Changeset 3098
- Timestamp:
- 12/19/06 23:09:30 (2 years ago)
- Files:
-
- trunk/lib/filter/sfCacheFilter.class.php (modified) (1 diff)
- trunk/test/functional/cacheTest.php (modified) (2 diffs)
- trunk/test/functional/fixtures/project/apps/cache/modules/cache/actions/actions.class.php (modified) (1 diff)
- trunk/test/functional/fixtures/project/apps/cache/modules/cache/config/cache.yml (modified) (1 diff)
- trunk/test/functional/fixtures/project/apps/cache/modules/cache/templates/imageSuccess.php (added)
- trunk/test/functional/fixtures/project/apps/cache/templates/image.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/filter/sfCacheFilter.class.php
r2971 r3098 247 247 if ($retval && sfConfig::get('sf_web_debug')) 248 248 { 249 $tmp = unserialize($retval); 250 $tmp['content'] = sfWebDebug::getInstance()->decorateContentWithDebug($uri, $tmp['content'], false); 251 $retval = serialize($tmp); 249 $cache = unserialize($retval); 250 $this->response->mergeProperties($cache['response']); 251 $cache['content'] = sfWebDebug::getInstance()->decorateContentWithDebug($uri, $cache['content'], false); 252 $retval = serialize($cache); 252 253 } 253 254 trunk/test/functional/cacheTest.php
r2935 r3098 17 17 class myTestBrowser extends sfTestBrowser 18 18 { 19 function checkResponseContent($content, $message) 20 { 21 $this->test()->ok($this->getResponse()->getContent() == $content, $message); 22 23 return $this; 24 } 25 19 26 function getMultiAction($parameter = null) 20 27 { … … 263 270 } 264 271 265 // test with sfFileCache class (default)266 272 $b = new myTestBrowser(); 267 273 $b->initialize(); 274 275 // non HTML cache 276 $image = file_get_contents($sf_symfony_data_dir.'/web/sf/sf_default/images/icons/ok48.png'); 277 sfConfig::set('sf_web_debug', true); 278 $b-> 279 get('/cache/imageWithLayoutCacheWithLayout')-> 280 isCached(true, true)-> 281 checkResponseContent($image, 'image (with layout/page cache) in cache is not decorated when web_debug is on')-> 282 get('/cache/imageWithLayoutCacheWithLayout')-> 283 isCached(true, true)-> 284 checkResponseContent($image, 'image (with layout/page cache) in cache is not decorated when web_debug is on')-> 285 get('/cache/imageWithLayoutCacheNoLayout')-> 286 isCached(true)-> 287 checkResponseContent($image, 'image (with layout/action cache) in cache is not decorated when web_debug is on')-> 288 get('/cache/imageWithLayoutCacheNoLayout')-> 289 isCached(true)-> 290 checkResponseContent($image, 'image (with layout/action cache) in cache is not decorated when web_debug is on')-> 291 get('/cache/imageNoLayoutCacheWithLayout')-> 292 isCached(true, true)-> 293 checkResponseContent($image, 'image (no layout/page cache) in cache is not decorated when web_debug is on')-> 294 get('/cache/imageNoLayoutCacheWithLayout')-> 295 isCached(true, true)-> 296 checkResponseContent($image, 'image (no layout/page cache) in cache is not decorated when web_debug is on')-> 297 get('/cache/imageNoLayoutCacheNoLayout')-> 298 isCached(true)-> 299 checkResponseContent($image, 'image (no layout/action cache) in cache is not decorated when web_debug is on')-> 300 get('/cache/imageNoLayoutCacheNoLayout')-> 301 isCached(true)-> 302 checkResponseContent($image, 'image (no layout/action cache) in cache is not decorated when web_debug is on') 303 ; 304 sfConfig::set('sf_web_debug', false); 305 306 // test with sfFileCache class (default) 268 307 $b->launch(); 269 308 trunk/test/functional/fixtures/project/apps/cache/modules/cache/actions/actions.class.php
r2558 r3098 47 47 sfConfig::set('ACTION_EXECUTED', true); 48 48 } 49 50 public function executeImageWithLayoutCacheWithLayout() 51 { 52 $this->prepareImage(); 53 $this->setLayout('image'); 54 } 55 56 public function executeImageWithLayoutCacheNoLayout() 57 { 58 $this->prepareImage(); 59 $this->setLayout('image'); 60 } 61 62 public function executeImageNoLayoutCacheWithLayout() 63 { 64 $this->prepareImage(); 65 $this->setLayout(false); 66 } 67 68 public function executeImageNoLayoutCacheNoLayout() 69 { 70 $this->prepareImage(); 71 $this->setLayout(false); 72 } 73 74 protected function prepareImage() 75 { 76 $this->getResponse()->setContentType('image/png'); 77 $this->image = file_get_contents(sfConfig::get('sf_symfony_data_dir').'/web/sf/sf_default/images/icons/ok48.png'); 78 $this->setTemplate('image'); 79 } 49 80 } trunk/test/functional/fixtures/project/apps/cache/modules/cache/config/cache.yml
r2794 r3098 42 42 page: 43 43 with_layout: true 44 45 imageWithLayoutCacheWithLayout: 46 with_layout: true 47 48 imageWithLayoutCacheNoLayout: 49 with_layout: false 50 51 imageNoLayoutCacheWithLayout: 52 with_layout: true 53 54 imageNoLayoutCacheNoLayout: 55 with_layout: false