Skip to content

Commit cb2b3de

Browse files
committed
Add test case
1 parent 2a10ba7 commit cb2b3de

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

test/VariableParserTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function testParseAssignOperator(): void
107107
$functions = $result->functions;
108108
$this->assertCount(1, $functions);
109109
$this->assertSame('assignFunction', $functions[0]->name);
110-
$this->assertCount(14, $functions[0]->getVariables());
110+
$this->assertCount(15, $functions[0]->getVariables());
111111

112112
$vars = $functions[0]->getVariables();
113113
$this->assertSame('num', $vars[0]->name);
@@ -152,6 +152,9 @@ public function testParseAssignOperator(): void
152152
$this->assertSame('num', $vars[13]->name);
153153
$this->assertSame(18, $vars[13]->lineNumber);
154154
$this->assertSame(true, $vars[13]->assigned);
155+
$this->assertSame('num', $vars[14]->name);
156+
$this->assertSame(19, $vars[14]->lineNumber);
157+
$this->assertSame(true, $vars[14]->assigned);
155158
}
156159

157160
public function testInterpolatedStringFunction(): void

test/fixtures/assign_operator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ function assignFunction(): void
1616
$num >>= 1; // 16行目
1717
$num .= 1; // 17行目
1818
$num ??= 1; // 18行目
19+
$num =& f(); // 19行目
1920
}

0 commit comments

Comments
 (0)