public function testMutatorDetectsPermutationsWithWholes()
 {
     //arrange
     $line1 = new DefaultMutatableLine();
     $line2 = new DefaultMutatableLine();
     //neccessary
     $line3 = new DefaultMutatableLine();
     $line4 = new DefaultMutatableLine();
     $class = $this->getMockForAbstractClass('PHPRealCoverage\\Mutator\\MutatableClass');
     $class->expects($this->any())->method('getMutatableLines')->will($this->returnValue(array($line1, $line2, $line3, $line4)));
     $generator = new MutationGenerator($class);
     //tester will only validate if everything is enabled or line1 AND line3 are disabled
     $validatorCallback = function () use($line1, $line2, $line3, $line4) {
         if ($line1->isEnabled() && $line2->isEnabled() && $line3->isEnabled() && $line4->isEnabled()) {
             return true;
         }
         return !$line1->isEnabled() && $line2->isEnabled() && !$line3->isEnabled() && !$line4->isEnabled();
     };
     $tester = $this->getMockForAbstractClass('PHPRealCoverage\\Mutator\\MutationTester');
     $tester->expects($this->any())->method('isValid')->will($this->returnCallback($validatorCallback));
     //act
     $mutator = new Mutator();
     $mutator->iterate($tester, $generator);
     //assert
     $this->assertTrue($line1->isEnabled());
     $this->assertTrue($line2->isEnabled());
     $this->assertTrue($line3->isEnabled());
     $this->assertTrue($line4->isEnabled());
     //act
     $mutator->iterate($tester, $generator);
     //assert
     $this->assertTrue($line1->isEnabled());
     $this->assertTrue($line2->isEnabled());
     $this->assertTrue($line3->isEnabled());
     $this->assertTrue($line4->isEnabled());
     //act
     $mutator->iterate($tester, $generator);
     //assert
     $this->assertTrue($line1->isEnabled());
     $this->assertTrue($line2->isEnabled());
     $this->assertTrue($line3->isEnabled());
     $this->assertTrue($line4->isEnabled());
     //act
     $mutator->iterate($tester, $generator);
     //assert
     $this->assertFalse($line1->isEnabled());
     $this->assertTrue($line2->isEnabled());
     $this->assertFalse($line3->isEnabled());
     $this->assertFalse($line4->isEnabled());
 }
 public function testMutatorThrowsExceptionAfterLastStack()
 {
     $this->line2->disable();
     $this->line3->disable();
     $this->mutator->getMutationStack();
     try {
         $this->mutator->getMutationStack();
     } catch (NoMoreMutationsException $e) {
     }
 }