mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 22:17:26 +01:00
Implemented branch test for treesourceservice
This commit is contained in:
parent
b6cecd0010
commit
c5adb81d5d
@ -21,9 +21,10 @@ class TreeSourceServiceTest extends TestCase
|
|||||||
$tree1 = new TreeCollectionSource();
|
$tree1 = new TreeCollectionSource();
|
||||||
$tree2 = new TreeCollectionSource();
|
$tree2 = new TreeCollectionSource();
|
||||||
$tree3 = new TreeCollectionSource();
|
$tree3 = new TreeCollectionSource();
|
||||||
|
$tree4 = new TreeCollectionSource();
|
||||||
$leave1 = $this->createMock(SourceInterface::class);
|
$leave1 = $this->createMock(SourceInterface::class);
|
||||||
$leave2 = $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);
|
$tree1->setCollection($collection);
|
||||||
$this->treeService = new TreeSourceService($tree1);
|
$this->treeService = new TreeSourceService($tree1);
|
||||||
}
|
}
|
||||||
@ -31,5 +32,9 @@ class TreeSourceServiceTest extends TestCase
|
|||||||
public function testGetLeaves():void{
|
public function testGetLeaves():void{
|
||||||
$this->assertEquals(2, $this->treeService->getLeaves()->count());
|
$this->assertEquals(2, $this->treeService->getLeaves()->count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testGetBranches():void{
|
||||||
|
$this->assertEquals(3, $this->treeService->getBranches()->count());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user