public function testWithTraverser()
 {
     $file = new \Trismegiste\Mondrian\Parser\PhpFile('/I/Am/Victory.php', array(new \PHPParser_Node_Stmt_Class('Victory', array(), array('comments' => array(new \PHPParser_Comment('@mondrian contractor SomeNewContract'))))));
     $traverser = new \PHPParser_NodeTraverser();
     $traverser->addVisitor($this->visitor);
     $this->assertFalse($file->isModified());
     $traverser->traverse(array($file));
     $this->assertTrue($file->isModified());
 }
 public function testWithTraverser()
 {
     $classNode = new \PHPParser_Node_Stmt_Class('Victory', array('stmts' => array(new \PHPParser_Node_Stmt_ClassMethod('holy', array('stmts' => array(new \PHPParser_Node_Expr_New(new \PHPParser_Node_Name('Holy\\War')), new \PHPParser_Node_Expr_New(new \PHPParser_Node_Name('\\Hangar18'))))))));
     $file = new \Trismegiste\Mondrian\Parser\PhpFile('/I/Am/Victory.php', array($classNode));
     $traverser = new \PHPParser_NodeTraverser();
     $traverser->addVisitor($this->visitor);
     $this->assertFalse($file->isModified());
     $traverser->traverse(array($file));
     $this->assertTrue($file->isModified());
     $this->assertCount(3, $classNode->stmts);
     $pp = new \PHPParser_PrettyPrinter_Default();
     $flat = $pp->prettyPrint(iterator_to_array($file->getIterator()));
     eval($flat);
 }