Removing getResponse, its not used and it doesn't serve much purpose.

This commit is contained in:
Mark Story 2011-07-19 22:51:49 -04:00 committed by mark_story
parent 4101388069
commit ec3de84c4e
4 changed files with 19 additions and 29 deletions

View file

@ -580,15 +580,6 @@ class Controller extends Object {
return true; 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. * Perform the startup process for this controller.
* Fire the Components and Controller callbacks in the correct order. * Fire the Components and Controller callbacks in the correct order.

View file

@ -159,7 +159,7 @@ class Scaffold {
*/ */
protected function _output() { protected function _output() {
$this->controller->afterFilter(); $this->controller->afterFilter();
$this->controller->getResponse()->send(); $this->controller->response->send();
} }
/** /**

View file

@ -62,23 +62,22 @@ class ApiShellTest extends CakeTestCase {
'5. constructClasses()', '5. constructClasses()',
'6. disableCache()', '6. disableCache()',
'7. flash($message, $url, $pause = 1, $layout = \'flash\')', '7. flash($message, $url, $pause = 1, $layout = \'flash\')',
'8. getResponse()', '8. header($status)',
'9. header($status)', '9. httpCodes($code = NULL)',
'10. httpCodes($code = NULL)', '10. invokeAction($request)',
'11. invokeAction($request)', '11. loadModel($modelClass = NULL, $id = NULL)',
'12. loadModel($modelClass = NULL, $id = NULL)', '12. paginate($object = NULL, $scope = array (), $whitelist = array ())',
'13. paginate($object = NULL, $scope = array (), $whitelist = array ())', '13. postConditions($data = array (), $op = NULL, $bool = \'AND\', $exclusive = false)',
'14. postConditions($data = array (), $op = NULL, $bool = \'AND\', $exclusive = false)', '14. redirect($url, $status = NULL, $exit = true)',
'15. redirect($url, $status = NULL, $exit = true)', '15. referer($default = NULL, $local = false)',
'16. referer($default = NULL, $local = false)', '16. render($view = NULL, $layout = NULL)',
'17. render($view = NULL, $layout = NULL)', '17. set($one, $two = NULL)',
'18. set($one, $two = NULL)', '18. setAction($action)',
'19. setAction($action)', '19. setRequest($request)',
'20. setRequest($request)', '20. shutdownProcess()',
'21. shutdownProcess()', '21. startupProcess()',
'22. startupProcess()', '22. validate()',
'23. validate()', '23. validateErrors()'
'24. validateErrors()'
); );
$this->Shell->expects($this->at(2))->method('out')->with($expected); $this->Shell->expects($this->at(2))->method('out')->with($expected);

View file

@ -52,12 +52,12 @@ class PagesControllerTest extends CakeTestCase {
$Pages->viewPath = 'Posts'; $Pages->viewPath = 'Posts';
$Pages->display('index'); $Pages->display('index');
$this->assertPattern('/posts index/', $Pages->getResponse()->body()); $this->assertPattern('/posts index/', $Pages->response->body());
$this->assertEqual($Pages->viewVars['page'], 'index'); $this->assertEqual($Pages->viewVars['page'], 'index');
$Pages->viewPath = 'Themed'; $Pages->viewPath = 'Themed';
$Pages->display('TestTheme', 'Posts', 'index'); $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['page'], 'TestTheme');
$this->assertEqual($Pages->viewVars['subpage'], 'Posts'); $this->assertEqual($Pages->viewVars['subpage'], 'Posts');
} }