Implemented branch test for treesourceservice

This commit is contained in:
Kevin Frantz 2018-11-18 10:53:48 +01:00
parent b6cecd0010
commit c5adb81d5d

View File

@ -21,9 +21,10 @@ class TreeSourceServiceTest extends TestCase
$tree1 = new TreeCollectionSource();
$tree2 = new TreeCollectionSource();
$tree3 = new TreeCollectionSource();
$tree4 = new TreeCollectionSource();
$leave1 = $this->createMock(SourceInterface::class);
$leave2 = $this->createMock(SourceInterface::class);
$collection = new ArrayCollection([$tree2,$tree3,$leave1,$leave2]);
$collection = new ArrayCollection([$tree2,$tree3,$leave1,$leave2,$tree4]);
$tree1->setCollection($collection);
$this->treeService = new TreeSourceService($tree1);
}
@ -31,5 +32,9 @@ class TreeSourceServiceTest extends TestCase
public function testGetLeaves():void{
$this->assertEquals(2, $this->treeService->getLeaves()->count());
}
public function testGetBranches():void{
$this->assertEquals(3, $this->treeService->getBranches()->count());
}
}