public function testCreatesLeavesClosuresIntact() { $file = new Mutable(dirname(__FILE__) . '/_files/Closure.php'); $file->generate(); $mutants = $file->getMutants()->all(); $mutants->rewind(); $mutant = $mutants->current(); $this->assertEquals(dirname(__FILE__) . '/_files/Closure.php', $mutant->getFileName()); $this->assertEquals('Some_Class_With_Closure', $mutant->getClassName()); $this->assertEquals('setSession', $mutant->getMethodName()); $this->assertEquals('$session = null', $mutant->getArguments()); $block = <<<BLOCK if (\$session === null) { \$dave = function(Closure \$func, array \$d) use (\$session) { \$d = \$session; }; return true; } return false; BLOCK; $this->assertEquals($block, $this->_reconstructFromTokens($mutant->getTokens())); }