public function testGeneratorKnowsItsProgress() { $this->assertEquals(0.0 / 3.0, $this->mutator->getProgress()); $this->mutator->getMutationStack(); $this->assertEquals(1.0 / 3.0, $this->mutator->getProgress()); $this->mutator->getMutationStack(); $this->assertEquals(2.0 / 3.0, $this->mutator->getProgress()); $this->mutator->getMutationStack(); $this->assertEquals(3.0 / 3.0, $this->mutator->getProgress()); }
public function testMutations(MutationTester $tester, MutationGenerator $generator) { try { while (true) { $progress = $generator->getProgress(); if (!is_null($progress)) { echo "Mutation Progress: " . (int) (100 * $progress) . "%\r"; } $this->iterate($tester, $generator); } } catch (NoMoreMutationsException $e) { // stop when all permutations have been tested } }