Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Feb 29, 2016
1 parent 4a830ea commit 89ae2c1
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions tests/TestCase/Action/AddActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,24 +339,16 @@ public function apiGetHttpMethodProvider()
*/
public function testApiGet($method)
{
$this->_eventManager->on(
'Dispatcher.beforeDispatch',
['priority' => 1000],
function ($event) {
$this->_controller->Crud->addListener('api', 'Crud.Api');
}
);

Router::extensions(['json']);
Router::scope('/', function ($routes) {
$routes->extensions(['json']);
$routes->fallbacks();
});

$this->{$method}('/blogs/add.json');
$this->{$method}('/Blogs/add.json');

$this->assertResponseError();
$this->assertResponseContains($this->_response->body(), 'Wrong request method');
$this->assertResponseContains('Wrong request method');
}

/**
Expand Down Expand Up @@ -463,7 +455,7 @@ function ($event) {
]);

$this->assertResponseCode(412);
$this->assertResponseContains($this->_response->body(), 'A validation error occurred');
$this->assertResponseContains('A validation error occurred');
}

/**
Expand Down

0 comments on commit 89ae2c1

Please sign in to comment.