Skip to content

Commit d4cb98a

Browse files
committed
Fix typo in property name
This test was working on a dynamic "subNode" property, rather than an actual subnode (either subNode1 or subNode2). This test is generally not very valuable, I think it dates back to a time where __get()/__set() were used.
1 parent 68d2a52 commit d4cb98a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/PhpParser/NodeAbstractTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,19 @@ public function testSetDocComment() {
121121
/**
122122
* @dataProvider provideNodes
123123
*/
124-
public function testChange(array $attributes, Node $node) {
124+
public function testChange(array $attributes, DummyNode $node) {
125125
// direct modification
126-
$node->subNode = 'newValue';
127-
$this->assertSame('newValue', $node->subNode);
126+
$node->subNode1 = 'newValue';
127+
$this->assertSame('newValue', $node->subNode1);
128128

129129
// indirect modification
130-
$subNode =& $node->subNode;
130+
$subNode =& $node->subNode1;
131131
$subNode = 'newNewValue';
132-
$this->assertSame('newNewValue', $node->subNode);
132+
$this->assertSame('newNewValue', $node->subNode1);
133133

134134
// removal
135-
unset($node->subNode);
136-
$this->assertObjectNotHasAttribute('subNode', $node);
135+
unset($node->subNode1);
136+
$this->assertFalse(isset($node->subNode1));
137137
}
138138

139139
/**

0 commit comments

Comments
 (0)