コード例 #1
0
ファイル: Mutable.php プロジェクト: judgedim/mutagenesis
 /**
  * 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);
                 }
             }
         }
     }
 }
コード例 #2
0
 /**
  * @dataProvider createProvider
  */
 public function testCreateMutationEquivalentToExpected($token, $index, $expected)
 {
     $result = MutationFactory::create($token, $index);
     $this->assertEquals($expected, $result);
 }