Beispiel #1
0
 /**
  * @depends testConstruct
  */
 public function testChange(PHPParser_Node $node)
 {
     // change of line
     $node->setLine(15);
     $this->assertEquals(15, $node->getLine());
     // change of doc comment
     $node->setDocComment('/** other doc comment */');
     $this->assertEquals('/** other doc comment */', $node->getDocComment());
     // direct modification
     $node->subNode = 'newValue';
     $this->assertEquals('newValue', $node->subNode);
     // indirect modification
     $subNode =& $node->subNode;
     $subNode = 'newNewValue';
     $this->assertEquals('newNewValue', $node->subNode);
     // removal
     unset($node->subNode);
     $this->assertFalse(isset($node->subNode));
 }