Skip to content

Commit

Permalink
Avoiding mocking the method funcition in some tests to avoid PHPUnit 4.0
Browse files Browse the repository at this point in the history
fatals
  • Loading branch information
lorenzo committed Mar 10, 2014
1 parent e54ffbc commit bd95c0f
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -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')));
Expand Down Expand Up @@ -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'))));
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit bd95c0f

Please sign in to comment.