now the tests are working

Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
This commit is contained in:
Jakob Röhrl
2019-02-20 14:15:31 +01:00
committed by Julius Härtl
parent ee20841ad6
commit d11917e4ff

View File

@@ -93,14 +93,15 @@ class LabelService {
$this->permissionService->checkPermission(null, $boardId, Acl::PERMISSION_MANAGE);
//$this->checkDuplicateTitle($boardId, $title);
$boardLabels = array();
$boardLabels = $this->labelMapper->findAll($boardId);
if (is_array($boardLabels) || is_object($boardLabels)) {
foreach($boardLabels as $boardLabel) {
if ($boardLabel->getTitle() === $title) {
throw new BadRequestException('title must be unique');
break;
}
}
}
if ($this->boardService->isArchived(null, $boardId)) {
throw new StatusException('Operation not allowed. This board is archived.');
@@ -169,6 +170,7 @@ class LabelService {
$boardLabels = array();
$boardLabels = $this->labelMapper->findAll($label->getBoardId());
if (is_array($boardLabels) || is_object($boardLabels)) {
foreach($boardLabels as $boardLabel) {
if ($boardLabel->getId() === $label->getId()) {
continue;
@@ -178,6 +180,7 @@ class LabelService {
break;
}
}
}
if ($this->boardService->isArchived($this->labelMapper, $id)) {
throw new StatusException('Operation not allowed. This board is archived.');