mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
DX: fix tests to find ancestor to all SocialAction and SocialIssue
This commit is contained in:
parent
32ddc5465c
commit
531e05fc3a
@ -389,6 +389,8 @@ class SocialAction
|
|||||||
{
|
{
|
||||||
$this->parent = $parent;
|
$this->parent = $parent;
|
||||||
|
|
||||||
|
$parent->addChild($this);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,11 +71,15 @@ class SocialIssue
|
|||||||
$this->socialActions = new ArrayCollection();
|
$this->socialActions = new ArrayCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal use @see{SocialIssue::setParent} instead
|
||||||
|
* @param SocialIssue $child
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
public function addChild(self $child): self
|
public function addChild(self $child): self
|
||||||
{
|
{
|
||||||
if (!$this->children->contains($child)) {
|
if (!$this->children->contains($child)) {
|
||||||
$this->children[] = $child;
|
$this->children[] = $child;
|
||||||
$child->setParent($this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -216,10 +220,10 @@ class SocialIssue
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Collection|SocialIssue[] $socialIssues
|
* @param array|SocialIssue[] $socialIssues
|
||||||
* @return Collection
|
* @return Collection
|
||||||
*/
|
*/
|
||||||
public static function getDescendantsWithThisForIssues(Collection $socialIssues): Collection
|
public static function getDescendantsWithThisForIssues(array $socialIssues): Collection
|
||||||
{
|
{
|
||||||
$unique = [];
|
$unique = [];
|
||||||
|
|
||||||
@ -351,6 +355,8 @@ class SocialIssue
|
|||||||
{
|
{
|
||||||
$this->parent = $parent;
|
$this->parent = $parent;
|
||||||
|
|
||||||
|
$parent->addChild($this);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,4 +50,4 @@ final class SocialActionTest extends TestCase
|
|||||||
$this->assertNotContains($unrelatedB, $actual);
|
$this->assertNotContains($unrelatedB, $actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user