public function testShouldRevertToOriginalStaticMethodBodyWhenRequested() { $mutation = array('file' => $this->root . '/runkit/Math2.php', 'class' => 'RunkitTest_Math2', 'method' => 'add', 'args' => '$op1,$op2', 'tokens' => array(array(335, 'return', 7), array(309, '$op1', 7), '+', array(309, '$op2', 7), ';'), 'index' => 2, 'mutation' => new \Mutagenesis\Mutation\OperatorAddition($this->root . '/runkit/Math2.php')); $runkit = new \Mutagenesis\Utility\Runkit(); $runkit->applyMutation($mutation); $runkit->reverseMutation($mutation); $this->assertEquals(2, RunkitTest_Math2::add(1, 1)); }
public function testShouldRevertToOriginalStaticMethodBodyWhenRequested() { $mutationInstance = new OperatorAddition(2); $testeeInstance = new Testee(); $testeeInstance->setFileName($this->root . '/runkit/Math2.php')->setClassName('RunkitTest_Math2')->setMethodName('add')->setArguments('$op1,$op2')->setTokens(array(array(335, 'return', 7), array(309, '$op1', 7), '+', array(309, '$op2', 7), ';')); $mutant = new Mutant($testeeInstance, $mutationInstance); $runkit = new Runkit(); $runkit->applyMutation($mutant); $runkit->reverseMutation($mutant); $this->assertEquals(2, \RunkitTest_Math2::add(1, 1)); }