From c5adb81d5dea83e5b3f135a5edd8a1550e959fe4 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 18 Nov 2018 10:53:48 +0100 Subject: [PATCH] Implemented branch test for treesourceservice --- application/tests/Unit/Domain/TreeSourceServiceTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application/tests/Unit/Domain/TreeSourceServiceTest.php b/application/tests/Unit/Domain/TreeSourceServiceTest.php index 1638f33..2efc6e9 100644 --- a/application/tests/Unit/Domain/TreeSourceServiceTest.php +++ b/application/tests/Unit/Domain/TreeSourceServiceTest.php @@ -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()); + } }