From bd95c0fe1364b9d4b16acb9d29d9bdfa423c3ee2 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Mon, 10 Mar 2014 19:21:30 +0100 Subject: [PATCH] Avoiding mocking the method funcition in some tests to avoid PHPUnit 4.0 fatals --- .../Component/RequestHandlerComponentTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php b/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php index 5838ba4d809..653c08749b6 100644 --- a/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php +++ b/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php @@ -272,7 +272,7 @@ public function testInitializeContentTypeAndExtensionMismatch() { $extensions = Router::extensions(); Router::parseExtensions('xml'); - $this->Controller->request = $this->getMock('Cake\Network\Request'); + $this->Controller->request = $this->getMock('Cake\Network\Request', ['accepts']); $this->Controller->request->expects($this->any()) ->method('accepts') ->will($this->returnValue(array('application/json'))); @@ -465,7 +465,7 @@ public function testRenderAs() { * @return void */ public function testRenderAsWithAttachment() { - $this->RequestHandler->request = $this->getMock('Cake\Network\Request'); + $this->RequestHandler->request = $this->getMock('Cake\Network\Request', ['parseAccept']); $this->RequestHandler->request->expects($this->any()) ->method('parseAccept') ->will($this->returnValue(array('1.0' => array('application/xml')))); @@ -516,7 +516,7 @@ public function testRespondAsWithAttachment() { array(&$this->Controller->Components) ); $this->RequestHandler->response = $this->getMock('Cake\Network\Response', array('type', 'download')); - $this->RequestHandler->request = $this->getMock('Cake\Network\Request'); + $this->RequestHandler->request = $this->getMock('Cake\Network\Request', ['parseAccept']); $this->RequestHandler->request->expects($this->once()) ->method('parseAccept') @@ -625,7 +625,7 @@ public function testResponseContentType() { * @return void */ public function testMobileDeviceDetection() { - $request = $this->getMock('Cake\Network\Request'); + $request = $this->getMock('Cake\Network\Request', ['mobile']); $request->expects($this->once())->method('is') ->with('mobile') ->will($this->returnValue(true)); @@ -715,7 +715,7 @@ public function testAjaxRedirectAsRequestAction() { array('_stop'), array(&$this->Controller->Components) ); - $this->Controller->request = $this->getMock('Cake\Network\Request'); + $this->Controller->request = $this->getMock('Cake\Network\Request', ['is']); $this->Controller->response = $this->getMock('Cake\Network\Response', array('_sendHeader')); $this->Controller->RequestHandler->request = $this->Controller->request; $this->Controller->RequestHandler->response = $this->Controller->response; @@ -748,7 +748,7 @@ public function testAjaxRedirectAsRequestActionStillRenderingLayout() { array('_stop'), array(&$this->Controller->Components) ); - $this->Controller->request = $this->getMock('Cake\Network\Request'); + $this->Controller->request = $this->getMock('Cake\Network\Request', ['is']); $this->Controller->response = $this->getMock('Cake\Network\Response', array('_sendHeader')); $this->Controller->RequestHandler->request = $this->Controller->request; $this->Controller->RequestHandler->response = $this->Controller->response;