/** * Based on the internal array of mutable methods, generate another * internal array of supported mutations accessible using getMutants(). * * @param array $testees * * @return void */ protected function parseTokensToMutations(array $testees) { /** * @var \Mutagenesis\Testee\TesteeInterface $testee */ foreach ($testees as $testee) { if (!$testee->hasTokens()) { continue; } foreach ($testee->getTokens() as $index => $token) { $mutation = MutationFactory::create($token, $index); if ($mutation !== false) { $mutant = new Mutant($testee, $mutation); $mutant->mutate(); if ($mutant->checkDiff()) { $this->mutants->push($mutant); } } } } }
/** * @dataProvider createProvider */ public function testCreateMutationEquivalentToExpected($token, $index, $expected) { $result = MutationFactory::create($token, $index); $this->assertEquals($expected, $result); }