From 0cc55d8f45aa0ee1497d98b5086c2e4478615936 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 9 Mar 2011 22:27:19 -0500 Subject: [PATCH] Removing calls to Dispatcher::_stop(). Updating tests. Fixes #1578 --- cake/libs/dispatcher.php | 6 ++-- cake/tests/cases/libs/dispatcher.test.php | 35 +++++------------------ 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/cake/libs/dispatcher.php b/cake/libs/dispatcher.php index 387eac89c..c7cce1188 100644 --- a/cake/libs/dispatcher.php +++ b/cake/libs/dispatcher.php @@ -302,13 +302,13 @@ class Dispatcher { if (($isCss && empty($filters['css'])) || ($isJs && empty($filters['js']))) { $this->response->statusCode(404); $this->response->send(); - return $this->_stop(); + return true; } elseif ($isCss) { include WWW_ROOT . DS . $filters['css']; - $this->_stop(); + return true; } elseif ($isJs) { include WWW_ROOT . DS . $filters['js']; - $this->_stop(); + return true; } $controller = null; $pathSegments = explode('.', $url); diff --git a/cake/tests/cases/libs/dispatcher.test.php b/cake/tests/cases/libs/dispatcher.test.php index e7e3ae8b9..07823552a 100644 --- a/cake/tests/cases/libs/dispatcher.test.php +++ b/cake/tests/cases/libs/dispatcher.test.php @@ -59,15 +59,6 @@ class TestDispatcher extends Dispatcher { return $controller; } -/** - * _stop method - * - * @return void - */ - protected function _stop() { - $this->stopped = true; - return true; - } } /** @@ -1356,9 +1347,8 @@ class DispatcherTest extends CakeTestCase { )); ob_start(); - $Dispatcher->asset('ccss/cake.generic.css'); + $this->assertTrue($Dispatcher->asset('ccss/cake.generic.css')); $result = ob_get_clean(); - $this->assertTrue($Dispatcher->stopped); } /** @@ -1373,28 +1363,17 @@ class DispatcherTest extends CakeTestCase { 'js' => '', 'css' => '' )); - $Dispatcher->asset('theme/test_theme/ccss/cake.generic.css'); - $this->assertTrue($Dispatcher->stopped); + $this->assertTrue($Dispatcher->asset('theme/test_theme/ccss/cake.generic.css')); - $Dispatcher->stopped = false; - $Dispatcher->asset('theme/test_theme/cjs/debug_kit.js'); - $this->assertTrue($Dispatcher->stopped); + $this->assertTrue($Dispatcher->asset('theme/test_theme/cjs/debug_kit.js')); - $Dispatcher->stopped = false; - $Dispatcher->asset('test_plugin/ccss/cake.generic.css'); - $this->assertTrue($Dispatcher->stopped); + $this->assertTrue($Dispatcher->asset('test_plugin/ccss/cake.generic.css')); - $Dispatcher->stopped = false; - $Dispatcher->asset('test_plugin/cjs/debug_kit.js'); - $this->assertTrue($Dispatcher->stopped); + $this->assertTrue($Dispatcher->asset('test_plugin/cjs/debug_kit.js')); - $Dispatcher->stopped = false; - $Dispatcher->asset('css/ccss/debug_kit.css'); - $this->assertFalse($Dispatcher->stopped); + $this->assertFalse($Dispatcher->asset('css/ccss/debug_kit.css')); - $Dispatcher->stopped = false; - $Dispatcher->asset('js/cjs/debug_kit.js'); - $this->assertFalse($Dispatcher->stopped); + $this->assertFalse($Dispatcher->asset('js/cjs/debug_kit.js')); } /** * testFullPageCachingDispatch method