Skip to content

Commit d08a686

Browse files
committed
A few more tests
1 parent 81cd1ba commit d08a686

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,16 +2096,13 @@ public function testBug3546(): void
20962096
$this->analyse([__DIR__ . '/data/bug-3546.php'], []);
20972097
}
20982098

2099+
#[RequiresPhp('>= 8.0')]
20992100
public function testBug4800(): void
21002101
{
21012102
$this->checkThisOnly = false;
21022103
$this->checkNullables = true;
21032104
$this->checkUnionTypes = true;
21042105

2105-
if (PHP_VERSION_ID < 80000) {
2106-
$this->markTestSkipped('Test requires PHP 8.0');
2107-
}
2108-
21092106
$this->analyse([__DIR__ . '/data/bug-4800.php'], [
21102107
[
21112108
'Missing parameter $bar (string) in call to method Bug4800\HelloWorld2::a().',

tests/PHPStan/Rules/Methods/CallStaticMethodsRuleTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use PHPUnit\Framework\Attributes\RequiresPhp;
1616
use function array_merge;
1717
use function usort;
18-
use const PHP_VERSION_ID;
1918

2019
/**
2120
* @extends RuleTestCase<CallStaticMethodsRule>
@@ -412,14 +411,11 @@ public function testBug2164(): void
412411
]);
413412
}
414413

414+
#[RequiresPhp('>= 8.0')]
415415
public function testNamedArguments(): void
416416
{
417417
$this->checkThisOnly = false;
418418

419-
if (PHP_VERSION_ID < 80000) {
420-
$this->markTestSkipped('Test requires PHP 8.0');
421-
}
422-
423419
$this->analyse([__DIR__ . '/data/static-method-named-arguments.php'], [
424420
[
425421
'Missing parameter $j (int) in call to static method StaticMethodNamedArguments\Foo::doFoo().',

tests/PHPStan/Rules/Properties/UninitializedPropertyRuleTest.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
use PHPStan\Reflection\PropertyReflection;
77
use PHPStan\Rules\Rule;
88
use PHPStan\Testing\RuleTestCase;
9+
use PHPUnit\Framework\Attributes\RequiresPhp;
910
use function strpos;
10-
use const PHP_VERSION_ID;
1111

1212
/**
1313
* @extends RuleTestCase<UninitializedPropertyRule>
@@ -217,21 +217,15 @@ public function testRedeclareReadonlyProperties(): void
217217
]);
218218
}
219219

220+
#[RequiresPhp('>= 8.4')]
220221
public function testBug12336(): void
221222
{
222-
if (PHP_VERSION_ID < 80400) {
223-
$this->markTestSkipped('Test requires PHP 8.4.');
224-
}
225-
226223
$this->analyse([__DIR__ . '/data/bug-12336.php'], []);
227224
}
228225

226+
#[RequiresPhp('>= 8.4')]
229227
public function testBug12547(): void
230228
{
231-
if (PHP_VERSION_ID < 80400) {
232-
$this->markTestSkipped('Test requires PHP 8.4.');
233-
}
234-
235229
$this->analyse([__DIR__ . '/data/bug-12547.php'], []);
236230
}
237231

0 commit comments

Comments
 (0)