Solved branch test

This commit is contained in:
Kevin Frantz
2018-11-18 11:13:36 +01:00
parent c5adb81d5d
commit 00c6ba1f9d
2 changed files with 22 additions and 6 deletions

View File

@@ -22,8 +22,12 @@ class TreeSourceServiceTest extends TestCase
$tree2 = new TreeCollectionSource();
$tree3 = new TreeCollectionSource();
$tree4 = new TreeCollectionSource();
$tree5 = new TreeCollectionSource();
$leave1 = $this->createMock(SourceInterface::class);
$leave2 = $this->createMock(SourceInterface::class);
$leave3 = $this->createMock(SourceInterface::class);
$leave4 = $this->createMock(SourceInterface::class);
$tree2->setCollection(new ArrayCollection([$leave3,$leave4,$tree5]));
$collection = new ArrayCollection([$tree2,$tree3,$leave1,$leave2,$tree4]);
$tree1->setCollection($collection);
$this->treeService = new TreeSourceService($tree1);
@@ -36,5 +40,13 @@ class TreeSourceServiceTest extends TestCase
public function testGetBranches():void{
$this->assertEquals(3, $this->treeService->getBranches()->count());
}
public function testGetAllBranches():void{
$this->assertEquals(4, $this->treeService->getAllBranches()->count());
}
public function testGetAllLeaves():void{
$this->assertEquals(4, $this->treeService->getAllLeaves()->count());
}
}