diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index 917f42ad8..6418ab3d5 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -392,10 +392,9 @@ class RequestHandlerComponent extends Component { * types the client accepts. If a string is passed, returns true * if the client accepts it. If an array is passed, returns true * if the client accepts one or more elements in the array. - * @access public * @see RequestHandlerComponent::setContent() */ - function accepts($type = null) { + public function accepts($type = null) { $accepted = $this->request->accepts(); if ($type == null) { @@ -455,10 +454,9 @@ class RequestHandlerComponent extends Component { * 'html', 'xml', 'js', etc. * @return mixed If $type is null or not provided, the first content-type in the * list, based on preference, is returned. - * @access public * @see RequestHandlerComponent::setContent() */ - function prefers($type = null) { + public function prefers($type = null) { $accepts = $this->accepts(); if ($type == null) { @@ -480,7 +478,6 @@ class RequestHandlerComponent extends Component { return ($types[0] == $accepts[0]); } - $intersect = array_values(array_intersect($accepts, $types)); if (empty($intersect)) { return false; @@ -494,11 +491,10 @@ class RequestHandlerComponent extends Component { * @param object $controller A reference to a controller object * @param string $type Type of response to send (e.g: 'ajax') * @return void - * @access public * @see RequestHandlerComponent::setContent() * @see RequestHandlerComponent::respondAs() */ - function renderAs(&$controller, $type) { + public function renderAs(&$controller, $type) { $options = array('charset' => 'UTF-8'); if (Configure::read('App.encoding') !== null) { @@ -548,10 +544,9 @@ class RequestHandlerComponent extends Component { * @return boolean Returns false if the friendly type name given in $type does * not exist in the type map, or if the Content-type header has * already been set by this method. - * @access public * @see RequestHandlerComponent::setContent() */ - function respondAs($type, $options = array()) { + public function respondAs($type, $options = array()) { $defaults = array('index' => null, 'charset' => null, 'attachment' => false); $options = $options + $defaults; @@ -629,5 +624,4 @@ class RequestHandlerComponent extends Component { } return null; } - } diff --git a/cake/tests/cases/libs/controller/pages_controller.test.php b/cake/tests/cases/libs/controller/pages_controller.test.php index c913192d4..e61ba2018 100644 --- a/cake/tests/cases/libs/controller/pages_controller.test.php +++ b/cake/tests/cases/libs/controller/pages_controller.test.php @@ -60,12 +60,12 @@ class PagesControllerTest extends CakeTestCase { $Pages->viewPath = 'posts'; $Pages->display('index'); - $this->assertPattern('/posts index/', $Pages->output); + $this->assertPattern('/posts index/', $Pages->getResponse()->body()); $this->assertEqual($Pages->viewVars['page'], 'index'); $Pages->viewPath = 'themed'; $Pages->display('test_theme', 'posts', 'index'); - $this->assertPattern('/posts index themed view/', $Pages->output); + $this->assertPattern('/posts index themed view/', $Pages->getResponse()->body()); $this->assertEqual($Pages->viewVars['page'], 'test_theme'); $this->assertEqual($Pages->viewVars['subpage'], 'posts'); } diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index 100ed67b8..1d08a91de 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -789,7 +789,7 @@ class ScaffoldTest extends CakeTestCase { $this->Controller->theme = 'test_theme'; $this->Controller->view = 'Theme'; $this->Controller->constructClasses(); - $Scaffold =& new TestScaffoldMock($this->Controller, array()); + $Scaffold =& new TestScaffoldMock($this->Controller, new CakeRequest()); $this->assertEqual($this->Controller->view, 'Scaffold'); }