Implemented test for loop continuing

This commit is contained in:
Kevin Frantz 2018-10-31 19:31:55 +01:00
parent c9a8a8ea30
commit b9eeaa9758

View File

@ -8,6 +8,7 @@ use Doctrine\Common\Collections\ArrayCollection;
use App\Entity\Source\AbstractSource; use App\Entity\Source\AbstractSource;
use App\Entity\Source\GroupSource; use App\Entity\Source\GroupSource;
use App\Tests\AbstractTestCase; use App\Tests\AbstractTestCase;
use phpDocumentor\Reflection\Types\Boolean;
class MembersAttributTest extends AbstractTestCase class MembersAttributTest extends AbstractTestCase
{ {
@ -30,11 +31,16 @@ class MembersAttributTest extends AbstractTestCase
$this->membersAttribut->getMembersInclusiveChildren(); $this->membersAttribut->getMembersInclusiveChildren();
} }
private function getContinueIncludeMemberLoopResult($dimension):bool{
return $this->invokeMethod($this->membersAttribut, 'continueIncludeMembersLoop', [$dimension]);
}
public function testContinueIncludeMemberLoop(){ public function testContinueIncludeMemberLoop(){
$reflection = new \ReflectionClass($this->membersAttribut); $this->assertTrue($this->getContinueIncludeMemberLoopResult(null));
$method = $reflection->getMethod('continueIncludeMembersLoop'); $this->assertTrue($this->getContinueIncludeMemberLoopResult(1));
$method->setAccessible(true); $this->assertTrue($this->getContinueIncludeMemberLoopResult(2));
$this->assertFalse($this->getContinueIncludeMemberLoopResult(0));
$this->assertFalse($this->getContinueIncludeMemberLoopResult(-1));
} }
public function testMembersAccessors() public function testMembersAccessors()