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
|
* @param Label[] $labels
|
||||||
*/
|
*/
|
||||||
public function setLabels($labels) {
|
public function setLabels($labels) {
|
||||||
foreach ($labels as $l) {
|
$this->labels = $labels;
|
||||||
$this->labels[] = $l;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Acl[] $acl
|
* @param Acl[] $acl
|
||||||
*/
|
*/
|
||||||
public function setAcl($acl) {
|
public function setAcl($acl) {
|
||||||
foreach ($acl as $a) {
|
$this->acl = $acl;
|
||||||
$this->acl[] = $a;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getETag() {
|
public function getETag() {
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ class BoardMapperTest extends MapperTestUtility {
|
|||||||
$actual = $this->boardMapper->find($this->boards[0]->getId(), true, false);
|
$actual = $this->boardMapper->find($this->boards[0]->getId(), true, false);
|
||||||
/** @var Board $expected */
|
/** @var Board $expected */
|
||||||
$expected = $this->boards[0];
|
$expected = $this->boards[0];
|
||||||
|
$expected->setLabels([]);
|
||||||
$this->assertEquals($expected->getLabels(), $actual->getLabels());
|
$this->assertEquals($expected->getLabels(), $actual->getLabels());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user