Skip to content

Commit 3897dca

Browse files
committed
Update DefinedVariableRuleTest.php
1 parent 501709a commit 3897dca

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/PHPStan/Rules/Variables/DefinedVariableRuleTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,4 +1430,19 @@ public function testBug14117(): void
14301430
]);
14311431
}
14321432

1433+
public function testBug6799c(): void
1434+
{
1435+
$this->cliArgumentsVariablesRegistered = true;
1436+
$this->polluteScopeWithLoopInitialAssignments = false;
1437+
$this->checkMaybeUndefinedVariables = true;
1438+
$this->polluteScopeWithAlwaysIterableForeach = true;
1439+
1440+
$this->analyse([__DIR__ . '/../../Analyser/nsrt/bug-6799c.php'], [
1441+
[
1442+
'Variable $x might not be defined.',
1443+
9
1444+
]
1445+
]);
1446+
}
1447+
14331448
}

0 commit comments

Comments
 (0)