Skip to content

Commit c54fa59

Browse files
committed
Fix tests
1 parent 3380dc5 commit c54fa59

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/PHPStan/Rules/Methods/CallToStaticMethodStatementWithoutSideEffectsRuleTest.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use PHPStan\Rules\RuleLevelHelper;
77
use PHPStan\Testing\RuleTestCase;
88
use PHPUnit\Framework\Attributes\RequiresPhp;
9+
use const PHP_VERSION_ID;
910

1011
/**
1112
* @extends RuleTestCase<CallToStaticMethodStatementWithoutSideEffectsRule>
@@ -103,7 +104,16 @@ public function testFirstClassCallables(): void
103104

104105
public function testBug10819(): void
105106
{
106-
$this->analyse([__DIR__ . '/data/bug-10819.php'], []);
107+
$errors = [];
108+
if (PHP_VERSION_ID < 80000) {
109+
$errors = [
110+
[
111+
'Call to static method DateTime::createFromFormat() on a separate line has no effect.',
112+
13,
113+
],
114+
];
115+
}
116+
$this->analyse([__DIR__ . '/data/bug-10819.php'], $errors);
107117
}
108118

109119
}

0 commit comments

Comments
 (0)