Skip to content

Commit f9b262c

Browse files
Add tests
1 parent 1af7377 commit f9b262c

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

tests/PHPStan/Analyser/data/bug-8803.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ public function sayHello(): void
1111
$from = new \DateTimeImmutable('2023-01-30');
1212
for ($offset = 1; $offset <= 14; $offset++) {
1313
$value = $from->format('N') + $offset;
14+
if ($value > 7) {
15+
}
16+
1417
$value2 = $offset + $from->format('N');
1518
$value3 = '1e3' + $offset;
1619
$value4 = $offset + '1e3';

tests/PHPStan/Rules/Comparison/NumberComparisonOperatorsConstantConditionRuleTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ public function testBug7075(): void
207207
$this->analyse([__DIR__ . '/data/bug-7075.php'], []);
208208
}
209209

210+
public function testBug8803(): void
211+
{
212+
$this->treatPhpDocTypesAsCertain = true;
213+
$this->analyse([__DIR__ . '/../../Analyser/data/bug-8803.php'], []);
214+
}
215+
210216
public function testBug8938(): void
211217
{
212218
$this->treatPhpDocTypesAsCertain = true;

tests/PHPStan/Rules/Operators/InvalidBinaryOperationRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ public function testBug3515(): void
259259
$this->analyse([__DIR__ . '/data/bug-3515.php'], []);
260260
}
261261

262+
public function testBug8827(): void
263+
{
264+
$this->analyse([__DIR__ . '/../../Analyser/data/bug-8827.php'], []);
265+
}
266+
262267
public function testRuleWithNullsafeVariant(): void
263268
{
264269
if (PHP_VERSION_ID < 80000) {

0 commit comments

Comments
 (0)