Skip to content

Commit 9aca5db

Browse files
committed
expectations are version dependent
1 parent 14e2d9e commit 9aca5db

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

tests/Rules/Deprecations/FetchingDeprecatedConstRuleTest.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use PHPStan\Rules\Rule;
66
use PHPStan\Testing\RuleTestCase;
77
use function defined;
8+
use const PHP_VERSION_ID;
89

910
/**
1011
* @extends RuleTestCase<FetchingDeprecatedConstRule>
@@ -61,10 +62,14 @@ public function testFetchingDeprecatedConst(): void
6162

6263
public function testEstrictWithVersionGuard(): void
6364
{
64-
require_once __DIR__ . '/data/bug-162.php';
65-
$this->analyse(
66-
[__DIR__ . '/data/bug-162.php'],
65+
$errors = [
6766
[
67+
'Use of constant E_STRICT is deprecated.',
68+
7,
69+
],
70+
];
71+
if (PHP_VERSION_ID >= 80400) {
72+
$errors = [
6873
[
6974
'Use of constant E_STRICT is deprecated.',
7075
7,
@@ -73,7 +78,13 @@ public function testEstrictWithVersionGuard(): void
7378
'Use of constant E_STRICT is deprecated.',
7479
18,
7580
],
76-
],
81+
];
82+
}
83+
84+
require_once __DIR__ . '/data/bug-162.php';
85+
$this->analyse(
86+
[__DIR__ . '/data/bug-162.php'],
87+
$errors,
7788
);
7889
}
7990

0 commit comments

Comments
 (0)