From ec3de84c4e1357b1b80ee760b51d729d9afbb1a9 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Tue, 19 Jul 2011 22:51:49 -0400 Subject: [PATCH] Removing getResponse, its not used and it doesn't serve much purpose. --- lib/Cake/Controller/Controller.php | 9 ----- lib/Cake/Controller/Scaffold.php | 2 +- .../Case/Console/Command/ApiShellTest.php | 33 +++++++++---------- .../Case/Controller/PagesControllerTest.php | 4 +-- 4 files changed, 19 insertions(+), 29 deletions(-) diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php index c9742662e..0b7050d71 100644 --- a/lib/Cake/Controller/Controller.php +++ b/lib/Cake/Controller/Controller.php @@ -580,15 +580,6 @@ class Controller extends Object { return true; } -/** - * Gets the response object for this controller. Will construct the response if it has not already been built. - * - * @return CakeResponse - */ - public function getResponse() { - return $this->response; - } - /** * Perform the startup process for this controller. * Fire the Components and Controller callbacks in the correct order. diff --git a/lib/Cake/Controller/Scaffold.php b/lib/Cake/Controller/Scaffold.php index f1add0a3f..c3d7d05f6 100644 --- a/lib/Cake/Controller/Scaffold.php +++ b/lib/Cake/Controller/Scaffold.php @@ -159,7 +159,7 @@ class Scaffold { */ protected function _output() { $this->controller->afterFilter(); - $this->controller->getResponse()->send(); + $this->controller->response->send(); } /** diff --git a/lib/Cake/Test/Case/Console/Command/ApiShellTest.php b/lib/Cake/Test/Case/Console/Command/ApiShellTest.php index 87e92441d..8fd07ed4d 100644 --- a/lib/Cake/Test/Case/Console/Command/ApiShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/ApiShellTest.php @@ -62,23 +62,22 @@ class ApiShellTest extends CakeTestCase { '5. constructClasses()', '6. disableCache()', '7. flash($message, $url, $pause = 1, $layout = \'flash\')', - '8. getResponse()', - '9. header($status)', - '10. httpCodes($code = NULL)', - '11. invokeAction($request)', - '12. loadModel($modelClass = NULL, $id = NULL)', - '13. paginate($object = NULL, $scope = array (), $whitelist = array ())', - '14. postConditions($data = array (), $op = NULL, $bool = \'AND\', $exclusive = false)', - '15. redirect($url, $status = NULL, $exit = true)', - '16. referer($default = NULL, $local = false)', - '17. render($view = NULL, $layout = NULL)', - '18. set($one, $two = NULL)', - '19. setAction($action)', - '20. setRequest($request)', - '21. shutdownProcess()', - '22. startupProcess()', - '23. validate()', - '24. validateErrors()' + '8. header($status)', + '9. httpCodes($code = NULL)', + '10. invokeAction($request)', + '11. loadModel($modelClass = NULL, $id = NULL)', + '12. paginate($object = NULL, $scope = array (), $whitelist = array ())', + '13. postConditions($data = array (), $op = NULL, $bool = \'AND\', $exclusive = false)', + '14. redirect($url, $status = NULL, $exit = true)', + '15. referer($default = NULL, $local = false)', + '16. render($view = NULL, $layout = NULL)', + '17. set($one, $two = NULL)', + '18. setAction($action)', + '19. setRequest($request)', + '20. shutdownProcess()', + '21. startupProcess()', + '22. validate()', + '23. validateErrors()' ); $this->Shell->expects($this->at(2))->method('out')->with($expected); diff --git a/lib/Cake/Test/Case/Controller/PagesControllerTest.php b/lib/Cake/Test/Case/Controller/PagesControllerTest.php index c83e95c92..d4815174c 100644 --- a/lib/Cake/Test/Case/Controller/PagesControllerTest.php +++ b/lib/Cake/Test/Case/Controller/PagesControllerTest.php @@ -52,12 +52,12 @@ class PagesControllerTest extends CakeTestCase { $Pages->viewPath = 'Posts'; $Pages->display('index'); - $this->assertPattern('/posts index/', $Pages->getResponse()->body()); + $this->assertPattern('/posts index/', $Pages->response->body()); $this->assertEqual($Pages->viewVars['page'], 'index'); $Pages->viewPath = 'Themed'; $Pages->display('TestTheme', 'Posts', 'index'); - $this->assertPattern('/posts index themed view/', $Pages->getResponse()->body()); + $this->assertPattern('/posts index themed view/', $Pages->response->body()); $this->assertEqual($Pages->viewVars['page'], 'TestTheme'); $this->assertEqual($Pages->viewVars['subpage'], 'Posts'); }