Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Dec 20, 2024
1 parent fa95faf commit c5df243
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/PHPStan/Rules/Traits/TraitAttributesRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace PHPStan\Rules\Traits;

use PHPStan\Php\PhpVersion;
use PHPStan\Rules\AttributesCheck;
use PHPStan\Rules\ClassCaseSensitivityCheck;
use PHPStan\Rules\ClassForbiddenNameCheck;
Expand Down Expand Up @@ -35,7 +34,6 @@ protected function getRule(): Rule
new FunctionCallParametersCheck(
new RuleLevelHelper($reflectionProvider, true, false, true, $this->checkExplicitMixed, $this->checkImplicitMixed, false),
new NullsafeCheck(),
new PhpVersion(80000),
new UnresolvableTypeHelper(),
new PropertyReflectionFinder(),
true,
Expand All @@ -54,6 +52,10 @@ protected function getRule(): Rule

public function testRule(): void
{
if (PHP_VERSION_ID < 80000) {
$this->markTestSkipped('Test requires PHP 8.0.');
}

$this->analyse([__DIR__ . '/data/trait-attributes.php'], [
[
'Attribute class TraitAttributes\AbstractAttribute is abstract.',
Expand Down Expand Up @@ -85,6 +87,10 @@ public function testBug12011(): void

public function testBug12281(): void
{
if (PHP_VERSION_ID < 80100) {
$this->markTestSkipped('Test requires PHP 8.1.');
}

$this->analyse([__DIR__ . '/data/bug-12281.php'], [
[
'Attribute class AllowDynamicProperties cannot be used with trait.',
Expand Down

0 comments on commit c5df243

Please sign in to comment.