Created index tests for StackApiTestController

Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
This commit is contained in:
Ryan Fletcher
2018-07-15 15:35:48 -04:00
committed by Julius Härtl
parent 54f110f7c6
commit 891fa7b7d5
5 changed files with 125 additions and 42 deletions

View File

@@ -119,32 +119,6 @@ class BoardApiControllerTest extends \Test\TestCase {
$this->assertEquals($expected, $actual);
}
public function testGetNoPermission() {
$board = new Board();
$board->setId($this->deniedBoard['id']);
$board->setOwner($this->deniedBoard['owner']);
$this->boardService->expects($this->once())
->method('find')
->willReturn($board);
// permission service check.
// ------ there be dragons here -----
// $this->permissionsService->expect($this->once())
// ->method('matchPermissions')
// ->with($board)
// ->will($this->)
$this->request->expects($this->any())
->method('getParam')
->with('boardId')
->will($this->returnValue('999'));
$expected = new DataResponse("Access Denied: User has no access rights to board", HTTP::STATUS_FORBIDDEN);
$actual = $this->controller->get();
$this->assertEquals($expected, $actual);
}
public function testCreate() {
$board = new Board();