Permalink
Browse files

Using same serialization strategy for request object in cached views,…

… this prevents some failing tests in environments

with different charsets
  • Loading branch information...
lorenzo committed Mar 27, 2012
1 parent 6b04531 commit 4f6f041730177a1cd39555b06f962d3254a49c80
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/Cake/Test/Case/Routing/DispatcherTest.php
  2. +1 −1 lib/Cake/View/Helper/CacheHelper.php
@@ -1423,7 +1423,7 @@ public function testFullPageCachingDispatch($url) {
$cached = preg_replace('/<!--+[^<>]+-->/', '', $cached);
- $this->assertTextEquals($cached, $out);
+ $this->assertTextEquals($out, $cached);
$filename = $this->__cachePath($request->here());
unlink($filename);
@@ -291,7 +291,7 @@ protected function _writeFile($content, $timestamp, $useCallbacks = false) {
}
$file .= '
- $request = unserialize(\'' . str_replace("'", "\\'", serialize($this->request)) . '\');
+ $request = unserialize(base64_decode(\'' . base64_encode(serialize($this->request)) . '\'));
$response = new CakeResponse(array("charset" => Configure::read("App.encoding")));
$controller = new ' . $this->_View->name . 'Controller($request, $response);
$controller->plugin = $this->plugin = \'' . $this->_View->plugin . '\';

0 comments on commit 4f6f041

Please sign in to comment.