/**
  * @param MutationTester $tester
  * @param MutationGenerator $generator
  */
 public function iterate(MutationTester $tester, MutationGenerator $generator)
 {
     $commands = $generator->getMutationStack();
     $lineToTest = $commands[0];
     $lineToTest->execute();
     $rest = array_slice($commands, 1);
     $this->findWorkingPermutations($rest, $tester);
     if (!$tester->isValid()) {
         foreach ($commands as $command) {
             $command->undo();
         }
     }
 }
 public function testMutatorThrowsExceptionAfterLastStack()
 {
     $this->line2->disable();
     $this->line3->disable();
     $this->mutator->getMutationStack();
     try {
         $this->mutator->getMutationStack();
     } catch (NoMoreMutationsException $e) {
     }
 }