cs: Fix code style (safe rules only).

This commit is contained in:
Pol Dellaiera
2021-11-23 14:06:38 +01:00
parent 149d7ce991
commit 8f96a1121d
1223 changed files with 65199 additions and 64625 deletions

View File

@@ -1,13 +1,42 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\PersonBundle\Tests\Entity\SocialWork;
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
use Doctrine\Common\Collections\ArrayCollection;
use PHPUnit\Framework\TestCase;
/**
* @internal
* @coversNothing
*/
class SocialIssueTest extends TestCase
{
public function testFindSocialIssuesAncestors()
{
$socialIssues = new ArrayCollection([
$parent = new SocialIssue(),
$child = (new SocialIssue())->setParent($parent),
$grandChild = (new SocialIssue())->setParent($child),
$grandGrandChild = (new SocialIssue())->setParent($grandChild),
$unrelated = new SocialIssue(),
]);
$ancestors = SocialIssue::findAncestorSocialIssues($socialIssues);
$this->assertCount(3, $ancestors);
$this->assertContains($parent, $ancestors);
$this->assertContains($child, $ancestors);
$this->assertContains($grandChild, $ancestors);
}
public function testIsDescendantOf()
{
$parent = new SocialIssue();
@@ -30,22 +59,4 @@ class SocialIssueTest extends TestCase
$this->assertFalse($child->isDescendantOf($grandChild));
}
public function testFindSocialIssuesAncestors()
{
$socialIssues = new ArrayCollection([
$parent = new SocialIssue(),
$child = (new SocialIssue())->setParent($parent),
$grandChild = (new SocialIssue())->setParent($child),
$grandGrandChild = (new SocialIssue())->setParent($grandChild),
$unrelated = new SocialIssue(),
]);
$ancestors = SocialIssue::findAncestorSocialIssues($socialIssues);
$this->assertCount(3, $ancestors);
$this->assertContains($parent, $ancestors);
$this->assertContains($child, $ancestors);
$this->assertContains($grandChild, $ancestors);
}
}