From cf962eebc2a1fe39e939321c4efa136411875939 Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Tue, 4 Jan 2022 11:40:55 +0200 Subject: [PATCH] Promote conditional tests to always-running --- tests/ClosureTest.php | 16 ++++++++-------- tests/FunctionCallTest.php | 12 ++++++------ tests/Traits/InvalidCodeAnalysisTestTrait.php | 6 +----- tests/Traits/ValidCodeAnalysisTestTrait.php | 14 +------------- tests/TypeReconciliation/ConditionalTest.php | 2 +- 5 files changed, 17 insertions(+), 33 deletions(-) diff --git a/tests/ClosureTest.php b/tests/ClosureTest.php index 64a17a53d..a9291d889 100644 --- a/tests/ClosureTest.php +++ b/tests/ClosureTest.php @@ -330,7 +330,7 @@ class ClosureTest extends TestCase } }', ], - 'PHP71-mirrorCallableParams' => [ + 'mirrorCallableParams' => [ ' [ + 'closureFromCallableInvokableNamedClass' => [ ' [ + 'closureFromCallableInvokableAnonymousClass' => [ ' [ + 'publicCallableFromInside' => [ ' [ + 'protectedCallableFromInside' => [ ' [ + 'closureFromCallableNamedFunction' => [ ' 'TypeDoesNotContainType', ], - 'PHP71-closureFromCallableInvokableNamedClassWrongArgs' => [ + 'closureFromCallableInvokableNamedClassWrongArgs' => [ ' 'DuplicateParam', ], - 'PHP71-privateCallable' => [ + 'privateCallable' => [ ' 'int', ], ], - 'PHP73-hrtime' => [ + 'hrtime' => [ ' 'array{0: int, 1: int}', ], ], - 'PHP73-hrtimeCanBeFloat' => [ + 'hrtimeCanBeFloat' => [ ' [ + 'allowIsCountableToInformType' => [ ' 'array', ], ], - 'PHP72-pregMatchWithFlagUnmatchedAsNull' => [ + 'pregMatchWithFlagUnmatchedAsNull' => [ ' [ @@ -1353,7 +1353,7 @@ class FunctionCallTest extends TestCase '$matches===' => 'array', ], ], - 'PHP72-pregMatchWithFlagOffsetCaptureAndUnmatchedAsNull' => [ + 'pregMatchWithFlagOffsetCaptureAndUnmatchedAsNull' => [ ' [ @@ -1399,7 +1399,7 @@ class FunctionCallTest extends TestCase return compact("a", "b", "c"); }', ], - 'PHP73-setCookiePhp73' => [ + 'setCookiePhp73' => [ 'getTestName(); - if (strpos($test_name, 'PHP71-') !== false) { - if (version_compare(PHP_VERSION, '7.1.0', '<')) { - $this->markTestSkipped('Test case requires PHP 7.1.'); - } - } elseif (strpos($test_name, 'PHP80-') !== false) { + if (strpos($test_name, 'PHP80-') !== false) { if (version_compare(PHP_VERSION, '8.0.0', '<')) { $this->markTestSkipped('Test case requires PHP 8.0.'); } diff --git a/tests/Traits/ValidCodeAnalysisTestTrait.php b/tests/Traits/ValidCodeAnalysisTestTrait.php index 46a57ac4a..0bef93d31 100644 --- a/tests/Traits/ValidCodeAnalysisTestTrait.php +++ b/tests/Traits/ValidCodeAnalysisTestTrait.php @@ -39,19 +39,7 @@ trait ValidCodeAnalysisTestTrait string $php_version = '7.3' ): void { $test_name = $this->getTestName(); - if (strpos($test_name, 'PHP71-') !== false) { - if (version_compare(PHP_VERSION, '7.1.0', '<')) { - $this->markTestSkipped('Test case requires PHP 7.1.'); - } - } elseif (strpos($test_name, 'PHP72-') !== false) { - if (version_compare(PHP_VERSION, '7.2.0', '<')) { - $this->markTestSkipped('Test case requires PHP 7.2.'); - } - } elseif (strpos($test_name, 'PHP73-') !== false) { - if (version_compare(PHP_VERSION, '7.3.0', '<')) { - $this->markTestSkipped('Test case requires PHP 7.3.'); - } - } elseif (strpos($test_name, 'PHP80-') !== false) { + if (strpos($test_name, 'PHP80-') !== false) { if (version_compare(PHP_VERSION, '8.0.0', '<')) { $this->markTestSkipped('Test case requires PHP 8.0.'); } diff --git a/tests/TypeReconciliation/ConditionalTest.php b/tests/TypeReconciliation/ConditionalTest.php index 670c3bb13..a786b2ca6 100644 --- a/tests/TypeReconciliation/ConditionalTest.php +++ b/tests/TypeReconciliation/ConditionalTest.php @@ -1006,7 +1006,7 @@ class ConditionalTest extends TestCase atan($a); atan($b);', ], - 'PHP71-removeNonCallable' => [ + 'removeNonCallable' => [ '