BoardApiControllerTest wrote get() tests.

Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
This commit is contained in:
Ryan Fletcher
2018-07-14 21:57:16 -04:00
committed by Julius Härtl
parent fad579c4d3
commit bd254fd261
2 changed files with 40 additions and 11 deletions

View File

@@ -75,16 +75,16 @@ class BoardApiController extends ApiController {
*
* Return the board specified by $this->request->params['boardId'].
*/
public function get() {
public function get() {
if (is_numeric($this->request->params['boardId']) === false) {
if (is_numeric($this->request->getParam('boardId')) === false) {
return new DataResponse('board id must be a number', HTTP::STATUS_BAD_REQUEST);
}
$board = $this->service->find($this->request->params['boardId']);
$board = $this->service->find($this->request->getParam('boardId'));
if ($board === false || $board === null) {
return new DataResponse('Board not found', HTTP::STATUS_NOT_FOUND);
return new DataResponse('board not found', HTTP::STATUS_NOT_FOUND);
}
return new DataResponse($board, HTTP::STATUS_OK);