mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 14:07:25 +01:00
Formated code
This commit is contained in:
parent
9137c55b17
commit
9076505656
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\SourceManagement;
|
||||
|
||||
use App\Entity\Source\Collection\TreeCollectionSourceInterface;
|
||||
@ -16,9 +17,7 @@ use App\Entity\Source\SourceInterface;
|
||||
*/
|
||||
final class TreeSourceService extends AbstractSourceService implements TreeSourceServiceInterface
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @var TreeCollectionSourceInterface
|
||||
*/
|
||||
private $source;
|
||||
@ -67,7 +66,6 @@ final class TreeSourceService extends AbstractSourceService implements TreeSourc
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @todo Remove the optional parameter and put the logic in a private funtion.
|
||||
* @todo Remove the getAllBranches use inside the function.
|
||||
* {@inheritdoc}
|
||||
@ -111,6 +109,7 @@ final class TreeSourceService extends AbstractSourceService implements TreeSourc
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $leaves;
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Domain;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use App\Entity\Source\Collection\TreeCollectionSourceInterface;
|
||||
use App\Entity\Source\Collection\TreeCollectionSource;
|
||||
use App\Entity\Source\SourceInterface;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
@ -12,12 +12,12 @@ use App\Domain\SourceManagement\TreeSourceService;
|
||||
class TreeSourceServiceTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var TreeSourceServiceInterface
|
||||
*/
|
||||
protected $treeService;
|
||||
|
||||
public function setUp():void {
|
||||
public function setUp(): void
|
||||
{
|
||||
$tree1 = new TreeCollectionSource();
|
||||
$tree2 = new TreeCollectionSource();
|
||||
$tree3 = new TreeCollectionSource();
|
||||
@ -34,20 +34,23 @@ class TreeSourceServiceTest extends TestCase
|
||||
$this->treeService = new TreeSourceService($tree1);
|
||||
}
|
||||
|
||||
public function testGetLeaves():void{
|
||||
public function testGetLeaves(): void
|
||||
{
|
||||
$this->assertEquals(2, $this->treeService->getLeaves()->count());
|
||||
}
|
||||
|
||||
public function testGetBranches():void{
|
||||
public function testGetBranches(): void
|
||||
{
|
||||
$this->assertEquals(4, $this->treeService->getBranches()->count());
|
||||
}
|
||||
|
||||
public function testGetAllBranches():void{
|
||||
public function testGetAllBranches(): void
|
||||
{
|
||||
$this->assertEquals(5, $this->treeService->getAllBranches()->count());
|
||||
}
|
||||
|
||||
public function testGetAllLeaves():void{
|
||||
public function testGetAllLeaves(): void
|
||||
{
|
||||
$this->assertEquals(5, $this->treeService->getAllLeaves()->count());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user