Permalink
Browse files

Avoiding mocking the method funcition in some tests to avoid PHPUnit 4.0

fatals
  • Loading branch information...
1 parent e54ffbc commit bd95c0fe1364b9d4b16acb9d29d9bdfa423c3ee2 @lorenzo lorenzo committed Mar 10, 2014
Showing with 6 additions and 6 deletions.
  1. +6 −6 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;

0 comments on commit bd95c0f

Please sign in to comment.