diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index da92b9680..b599b02cb 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -992,6 +992,27 @@ class DispatcherTest extends UnitTestCase { $this->assertEqual($result, $expected); $filename = CACHE . 'views' . DS . Inflector::slug($dispatcher->here) . '.php'; unlink($filename); + + $url = 'TestCachedPages/index'; + + restore_error_handler(); + ob_start(); + $dispatcher->dispatch($url); + $out = ob_get_clean(); + + ob_start(); + $dispatcher->cached($url); + $cached = ob_get_clean(); + + set_error_handler('simpleTestErrorHandler'); + + $result = str_replace(array("\t", "\r\n", "\n"), "", $out); + $cached = preg_replace('//', '', $cached); + $expected = str_replace(array("\t", "\r\n", "\n"), "", $cached); + + $this->assertEqual($result, $expected); + $filename = CACHE . 'views' . DS . Inflector::slug($dispatcher->here) . '.php'; + unlink($filename); } function testHttpMethodOverrides() {