Skip to content

Commit ba4ba94

Browse files
committed
skip named-arguments tests for php7
1 parent 502e2ae commit ba4ba94

11 files changed

+35
-12
lines changed

tests/PHPStan/Rules/Classes/InstantiationRuleTest.php

+8
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ public function testBug4056(): void
289289

290290
public function testNamedArguments(): void
291291
{
292+
if (PHP_VERSION_ID < 80000) {
293+
$this->markTestSkipped('Test requires PHP 8.0');
294+
}
295+
292296
$this->analyse([__DIR__ . '/data/instantiation-named-arguments.php'], [
293297
[
294298
'Missing parameter $j (int) in call to InstantiationNamedArguments\Foo constructor.',
@@ -500,6 +504,10 @@ public function testBug10248(): void
500504

501505
public function testBug11815(): void
502506
{
507+
if (PHP_VERSION_ID < 80000) {
508+
$this->markTestSkipped('Test requires PHP 8.0');
509+
}
510+
503511
$this->analyse([__DIR__ . '/data/bug-11815.php'], []);
504512
}
505513

tests/PHPStan/Rules/Classes/data/instantiation-named-arguments.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php // lint >= 8.0
22

33
namespace InstantiationNamedArguments;
4-
if (PHP_VERSION_ID < 80000) return;
4+
55
class Foo
66
{
77

tests/PHPStan/Rules/Functions/CallCallablesRuleTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ public function testRule(): void
156156

157157
public function testNamedArguments(): void
158158
{
159+
if (PHP_VERSION_ID < 80000) {
160+
$this->markTestSkipped('Test requires PHP 8.0');
161+
}
162+
159163
$this->analyse([__DIR__ . '/data/callables-named-arguments.php'], [
160164
[
161165
'Missing parameter $j (int) in call to closure.',

tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,10 @@ public function testGenericFunction(): void
476476

477477
public function testNamedArguments(): void
478478
{
479+
if (PHP_VERSION_ID < 80000) {
480+
$this->markTestSkipped('Test requires PHP 8.0');
481+
}
482+
479483
$errors = [
480484
[
481485
'Missing parameter $j (int) in call to function FunctionNamedArguments\foo.',
@@ -490,12 +494,6 @@ public function testNamedArguments(): void
490494
14,
491495
],
492496
];
493-
if (PHP_VERSION_ID < 80000) {
494-
$errors[] = [
495-
'Missing parameter $arr1 (array) in call to function array_merge.',
496-
14,
497-
];
498-
}
499497

500498
require_once __DIR__ . '/data/named-arguments-define.php';
501499
$this->analyse([__DIR__ . '/data/named-arguments.php'], $errors);

tests/PHPStan/Rules/Functions/data/callables-named-arguments.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
namespace CallablesNamedArguments;
4-
if (PHP_VERSION_ID < 80000) return;
4+
55
class Foo
66
{
77

tests/PHPStan/Rules/Functions/data/named-arguments.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
namespace FunctionNamedArguments;
4-
if (PHP_VERSION_ID < 80000) return;
4+
55
function bar(): void
66
{
77
foo(i: 1);

tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php

+9
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,10 @@ public function testDisallowNamedArgumentsInPhpVersionScope(): void
18351835

18361836
public function testNamedArguments(): void
18371837
{
1838+
if (PHP_VERSION_ID < 80000) {
1839+
$this->markTestSkipped('Test requires PHP 8.0');
1840+
}
1841+
18381842
$this->checkThisOnly = false;
18391843
$this->checkNullables = true;
18401844
$this->checkUnionTypes = true;
@@ -2114,6 +2118,11 @@ public function testBug4800(): void
21142118
$this->checkThisOnly = false;
21152119
$this->checkNullables = true;
21162120
$this->checkUnionTypes = true;
2121+
2122+
if (PHP_VERSION_ID < 80000) {
2123+
$this->markTestSkipped('Test requires PHP 8.0');
2124+
}
2125+
21172126
$this->analyse([__DIR__ . '/data/bug-4800.php'], [
21182127
[
21192128
'Missing parameter $bar (string) in call to method Bug4800\HelloWorld2::a().',

tests/PHPStan/Rules/Methods/CallStaticMethodsRuleTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,10 @@ public function testNamedArguments(): void
412412
{
413413
$this->checkThisOnly = false;
414414

415+
if (PHP_VERSION_ID < 80000) {
416+
$this->markTestSkipped('Test requires PHP 8.0');
417+
}
418+
415419
$this->analyse([__DIR__ . '/data/static-method-named-arguments.php'], [
416420
[
417421
'Missing parameter $j (int) in call to static method StaticMethodNamedArguments\Foo::doFoo().',

tests/PHPStan/Rules/Methods/data/bug-4800.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php // lint >= 8.0
22

33
namespace Bug4800;
4-
if (PHP_VERSION_ID < 80000) return;
4+
55
class HelloWorld
66
{
77
/**

tests/PHPStan/Rules/Methods/data/named-arguments.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
namespace NamedArgumentsMethod;
4-
if (PHP_VERSION_ID < 80000) return;
4+
55
class Foo
66
{
77

tests/PHPStan/Rules/Methods/data/static-method-named-arguments.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
namespace StaticMethodNamedArguments;
4-
if (PHP_VERSION_ID < 80000) return;
4+
55
class Foo
66
{
77

0 commit comments

Comments
 (0)