Skip to content

Commit 5149f21

Browse files
committed
Fix tests
1 parent 37e68a9 commit 5149f21

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/PHPStan/Rules/Properties/PropertiesInInterfaceRuleTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ protected function getRule(): Rule
2222
#[RequiresPhp('< 8.4')]
2323
public function testPhp83AndPropertiesInInterface(): void
2424
{
25+
// @phpstan-ignore phpstan.skipTestsRequiresPhp
26+
if (PHP_VERSION_ID < 80000) {
27+
$this->markTestSkipped('Property hooks cause syntax error on PHP 7.4');
28+
}
2529
$this->analyse([__DIR__ . '/data/properties-in-interface.php'], [
2630
[
2731
'Interfaces can include properties only on PHP 8.4 and later.',
@@ -45,6 +49,10 @@ public function testPhp83AndPropertiesInInterface(): void
4549
#[RequiresPhp('< 8.4')]
4650
public function testPhp83AndPropertyHooksInInterface(): void
4751
{
52+
// @phpstan-ignore phpstan.skipTestsRequiresPhp
53+
if (PHP_VERSION_ID < 80000) {
54+
$this->markTestSkipped('Property hooks cause syntax error on PHP 7.4');
55+
}
4856
$this->analyse([__DIR__ . '/data/property-hooks-in-interface.php'], [
4957
[
5058
'Interfaces can include properties only on PHP 8.4 and later.',

tests/PHPStan/Rules/Properties/PropertyInClassRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ public function testPhpLessThan84AndHookedPropertiesInClass(): void
3333
#[RequiresPhp('>= 8.4')]
3434
public function testPhp84AndHookedPropertiesWithoutBodiesInClass(): void
3535
{
36+
// @phpstan-ignore phpstan.skipTestsRequiresPhp
37+
if (PHP_VERSION_ID < 80000) {
38+
$this->markTestSkipped('Property hooks cause syntax error on PHP 7.4');
39+
}
40+
3641
$this->analyse([__DIR__ . '/data/hooked-properties-without-bodies-in-class.php'], [
3742
[
3843
'Non-abstract properties cannot include hooks without bodies.',

0 commit comments

Comments
 (0)