Skip to content

Commit 68d2a52

Browse files
committed
Avoid creation of dynamic property in test
This test requires a property that is not a subnode -- but it does not need to be dynamic, a declared property works just as well.
1 parent 63f8699 commit 68d2a52

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/PhpParser/NodeAbstractTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ class DummyNode extends NodeAbstract
66
{
77
public $subNode1;
88
public $subNode2;
9+
public $notSubNode;
910

10-
public function __construct($subNode1, $subNode2, $attributes) {
11+
public function __construct($subNode1, $subNode2, $notSubNode, $attributes) {
1112
parent::__construct($attributes);
1213
$this->subNode1 = $subNode1;
1314
$this->subNode2 = $subNode2;
15+
$this->notSubNode = $notSubNode;
1416
}
1517

1618
public function getSubNodeNames() : array {
@@ -40,8 +42,7 @@ public function provideNodes() {
4042
],
4143
];
4244

43-
$node = new DummyNode('value1', 'value2', $attributes);
44-
$node->notSubNode = 'value3';
45+
$node = new DummyNode('value1', 'value2', 'value3', $attributes);
4546

4647
return [
4748
[$attributes, $node],
@@ -90,7 +91,7 @@ public function testGetDocComment(array $attributes, Node $node) {
9091
}
9192

9293
public function testSetDocComment() {
93-
$node = new DummyNode(null, null, []);
94+
$node = new DummyNode(null, null, null, []);
9495

9596
// Add doc comment to node without comments
9697
$docComment = new Comment\Doc('/** doc */');

0 commit comments

Comments
 (0)