Properly handle setters now that there is a default value of null with unset acl/labels
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
committed by
backportbot[bot]
parent
e4db5e4d28
commit
9a7bcafa6c
@@ -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() {
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user