From b9eeaa97580dd394afa4f293732fbec6361cf2f9 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Wed, 31 Oct 2018 19:31:55 +0100 Subject: [PATCH] Implemented test for loop continuing --- .../Unit/Entity/Attribut/MembersAttributTest.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/application/tests/Unit/Entity/Attribut/MembersAttributTest.php b/application/tests/Unit/Entity/Attribut/MembersAttributTest.php index 06e64d6..a51a910 100644 --- a/application/tests/Unit/Entity/Attribut/MembersAttributTest.php +++ b/application/tests/Unit/Entity/Attribut/MembersAttributTest.php @@ -8,6 +8,7 @@ use Doctrine\Common\Collections\ArrayCollection; use App\Entity\Source\AbstractSource; use App\Entity\Source\GroupSource; use App\Tests\AbstractTestCase; +use phpDocumentor\Reflection\Types\Boolean; class MembersAttributTest extends AbstractTestCase { @@ -30,11 +31,16 @@ class MembersAttributTest extends AbstractTestCase $this->membersAttribut->getMembersInclusiveChildren(); } + private function getContinueIncludeMemberLoopResult($dimension):bool{ + return $this->invokeMethod($this->membersAttribut, 'continueIncludeMembersLoop', [$dimension]); + } + public function testContinueIncludeMemberLoop(){ - $reflection = new \ReflectionClass($this->membersAttribut); - $method = $reflection->getMethod('continueIncludeMembersLoop'); - $method->setAccessible(true); - + $this->assertTrue($this->getContinueIncludeMemberLoopResult(null)); + $this->assertTrue($this->getContinueIncludeMemberLoopResult(1)); + $this->assertTrue($this->getContinueIncludeMemberLoopResult(2)); + $this->assertFalse($this->getContinueIncludeMemberLoopResult(0)); + $this->assertFalse($this->getContinueIncludeMemberLoopResult(-1)); } public function testMembersAccessors()