diff --git a/lib/Db/Board.php b/lib/Db/Board.php index 9125c2ca7..6cf3c3206 100644 --- a/lib/Db/Board.php +++ b/lib/Db/Board.php @@ -74,18 +74,14 @@ class Board extends RelationalEntity { * @param Label[] $labels */ public function setLabels($labels) { - foreach ($labels as $l) { - $this->labels[] = $l; - } + $this->labels = $labels; } /** * @param Acl[] $acl */ public function setAcl($acl) { - foreach ($acl as $a) { - $this->acl[] = $a; - } + $this->acl = $acl; } public function getETag() { diff --git a/tests/unit/Db/BoardMapperTest.php b/tests/unit/Db/BoardMapperTest.php index 78cc0cccc..43060db79 100644 --- a/tests/unit/Db/BoardMapperTest.php +++ b/tests/unit/Db/BoardMapperTest.php @@ -161,6 +161,7 @@ class BoardMapperTest extends MapperTestUtility { $actual = $this->boardMapper->find($this->boards[0]->getId(), true, false); /** @var Board $expected */ $expected = $this->boards[0]; + $expected->setLabels([]); $this->assertEquals($expected->getLabels(), $actual->getLabels()); }