mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 14:25:00 +00:00
cs fixer
This commit is contained in:
@@ -55,29 +55,6 @@ final class SocialIssueTest extends TestCase
|
||||
$this->assertCount(0, $unrelated->getAncestors(false));
|
||||
}
|
||||
|
||||
public function testIsDescendantOf()
|
||||
{
|
||||
$parent = new SocialIssue();
|
||||
$child = (new SocialIssue())->setParent($parent);
|
||||
$grandChild = (new SocialIssue())->setParent($child);
|
||||
$grandGrandChild = (new SocialIssue())->setParent($grandChild);
|
||||
$unrelated = new SocialIssue();
|
||||
|
||||
$this->assertTrue($grandGrandChild->isDescendantOf($parent));
|
||||
$this->assertTrue($grandGrandChild->isDescendantOf($grandChild));
|
||||
$this->assertTrue($grandGrandChild->isDescendantOf($child));
|
||||
$this->assertFalse($grandGrandChild->isDescendantOf($unrelated));
|
||||
|
||||
$this->assertTrue($grandChild->isDescendantOf($parent));
|
||||
$this->assertTrue($grandChild->isDescendantOf($child));
|
||||
$this->assertFalse($grandChild->isDescendantOf($unrelated));
|
||||
$this->assertFalse($grandChild->isDescendantOf($grandChild));
|
||||
|
||||
$this->assertFalse($unrelated->isDescendantOf($parent));
|
||||
|
||||
$this->assertFalse($child->isDescendantOf($grandChild));
|
||||
}
|
||||
|
||||
public function testGetDescendantsWithThisForIssues()
|
||||
{
|
||||
$parentA = new SocialIssue();
|
||||
@@ -106,4 +83,27 @@ final class SocialIssueTest extends TestCase
|
||||
$this->assertNotContains($unrelatedA, $actual);
|
||||
$this->assertNotContains($unrelatedB, $actual);
|
||||
}
|
||||
|
||||
public function testIsDescendantOf()
|
||||
{
|
||||
$parent = new SocialIssue();
|
||||
$child = (new SocialIssue())->setParent($parent);
|
||||
$grandChild = (new SocialIssue())->setParent($child);
|
||||
$grandGrandChild = (new SocialIssue())->setParent($grandChild);
|
||||
$unrelated = new SocialIssue();
|
||||
|
||||
$this->assertTrue($grandGrandChild->isDescendantOf($parent));
|
||||
$this->assertTrue($grandGrandChild->isDescendantOf($grandChild));
|
||||
$this->assertTrue($grandGrandChild->isDescendantOf($child));
|
||||
$this->assertFalse($grandGrandChild->isDescendantOf($unrelated));
|
||||
|
||||
$this->assertTrue($grandChild->isDescendantOf($parent));
|
||||
$this->assertTrue($grandChild->isDescendantOf($child));
|
||||
$this->assertFalse($grandChild->isDescendantOf($unrelated));
|
||||
$this->assertFalse($grandChild->isDescendantOf($grandChild));
|
||||
|
||||
$this->assertFalse($unrelated->isDescendantOf($parent));
|
||||
|
||||
$this->assertFalse($child->isDescendantOf($grandChild));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user