Allow force delete to have a clean test env after creating boards

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2017-05-29 01:23:21 +02:00
parent 4623688852
commit 3062c82083
3 changed files with 8 additions and 2 deletions

View File

@@ -170,4 +170,4 @@ matrix:
- TESTS: jsbuild - TESTS: jsbuild
- TESTS: integration - TESTS: integration
branches: [ master, stable* ]

View File

@@ -176,6 +176,12 @@ class BoardService {
$this->boardMapper->update($board); $this->boardMapper->update($board);
} }
public function deleteForce($id) {
$this->permissionService->checkPermission($this->boardMapper, $id, Acl::PERMISSION_READ);
$board = $this->find($id);
return $this->boardMapper->delete($board);
}
public function update($id, $title, $color, $archived) { public function update($id, $title, $color, $archived) {
$this->permissionService->checkPermission($this->boardMapper, $id, Acl::PERMISSION_MANAGE); $this->permissionService->checkPermission($this->boardMapper, $id, Acl::PERMISSION_MANAGE);
$board = $this->find($id); $board = $this->find($id);

View File

@@ -77,7 +77,7 @@ class BoardDatabaseTest extends \Test\TestCase
$this->assertEquals($actual->getTitle(), $board->getTitle()); $this->assertEquals($actual->getTitle(), $board->getTitle());
$this->assertEquals($actual->getColor(), $board->getColor()); $this->assertEquals($actual->getColor(), $board->getColor());
$this->assertEquals($actual->getOwner(), $board->getOwner()); $this->assertEquals($actual->getOwner(), $board->getOwner());
$this->boardService->delete($id); $this->boardService->deleteForce($id);
} }
public function tearDown() { public function tearDown() {