PhpParser\NodeAbstractTest::testChange PHP Method

testChange() public method

public testChange ( array $attributes, phpparser\Node $node )
$attributes array
$node phpparser\Node
    public function testChange(array $attributes, Node $node)
    {
        // change of line
        $node->setLine(15);
        $this->assertSame(15, $node->getLine());
        // direct modification
        $node->subNode = 'newValue';
        $this->assertSame('newValue', $node->subNode);
        // indirect modification
        $subNode =& $node->subNode;
        $subNode = 'newNewValue';
        $this->assertSame('newNewValue', $node->subNode);
        // removal
        unset($node->subNode);
        $this->assertFalse(isset($node->subNode));
    }