From 11b48f865d5b858afdaa977b1f248fafc48adcac Mon Sep 17 00:00:00 2001 From: gwoo Date: Sun, 9 Mar 2008 22:39:29 +0000 Subject: [PATCH] adding dispatcher test for cached pages with camel cased names, closes #4086 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6545 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/tests/cases/dispatcher.test.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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() {