From 3062c820830807fa83ec6c01fa5b8bbc2b18558e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 29 May 2017 01:23:21 +0200 Subject: [PATCH] Allow force delete to have a clean test env after creating boards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- .drone.yml | 2 +- lib/Service/BoardService.php | 6 ++++++ tests/integration/database/BoardDatabaseTest.php | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 537397709..32e80c476 100644 --- a/.drone.yml +++ b/.drone.yml @@ -170,4 +170,4 @@ matrix: - TESTS: jsbuild - TESTS: integration -branches: [ master, stable* ] + diff --git a/lib/Service/BoardService.php b/lib/Service/BoardService.php index 4387ab9eb..3c07025b9 100644 --- a/lib/Service/BoardService.php +++ b/lib/Service/BoardService.php @@ -176,6 +176,12 @@ class BoardService { $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) { $this->permissionService->checkPermission($this->boardMapper, $id, Acl::PERMISSION_MANAGE); $board = $this->find($id); diff --git a/tests/integration/database/BoardDatabaseTest.php b/tests/integration/database/BoardDatabaseTest.php index f812aef11..f534055bb 100644 --- a/tests/integration/database/BoardDatabaseTest.php +++ b/tests/integration/database/BoardDatabaseTest.php @@ -77,7 +77,7 @@ class BoardDatabaseTest extends \Test\TestCase $this->assertEquals($actual->getTitle(), $board->getTitle()); $this->assertEquals($actual->getColor(), $board->getColor()); $this->assertEquals($actual->getOwner(), $board->getOwner()); - $this->boardService->delete($id); + $this->boardService->deleteForce($id); } public function tearDown() {