From 79512b7b0b01e9c2fe71043035ac601a3cf176c5 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 26 Oct 2024 11:55:17 +0200 Subject: [PATCH] Removed dead test-code after min-phpversion raise --- ...esenterInjectedPropertiesExtensionTest.php | 5 -- .../RegularExpressionPatternRuleTest.php | 57 ------------------- ...ngsMatchDynamicReturnTypeExtensionTest.php | 6 -- 3 files changed, 68 deletions(-) diff --git a/tests/Rule/Nette/PresenterInjectedPropertiesExtensionTest.php b/tests/Rule/Nette/PresenterInjectedPropertiesExtensionTest.php index 5ccd35f..f9059b7 100644 --- a/tests/Rule/Nette/PresenterInjectedPropertiesExtensionTest.php +++ b/tests/Rule/Nette/PresenterInjectedPropertiesExtensionTest.php @@ -3,17 +3,12 @@ namespace PHPStan\Rule\Nette; use PHPStan\Testing\LevelsTestCase; -use const PHP_VERSION_ID; class PresenterInjectedPropertiesExtensionTest extends LevelsTestCase { public static function dataTopics(): array { - if (PHP_VERSION_ID < 70400) { - self::markTestSkipped('Only for PHP 7.4+'); - } - return [ ['presenterInject'], ]; diff --git a/tests/Rule/Nette/RegularExpressionPatternRuleTest.php b/tests/Rule/Nette/RegularExpressionPatternRuleTest.php index b1f1cac..86ae8bd 100644 --- a/tests/Rule/Nette/RegularExpressionPatternRuleTest.php +++ b/tests/Rule/Nette/RegularExpressionPatternRuleTest.php @@ -18,65 +18,8 @@ protected function getRule(): Rule return new RegularExpressionPatternRule(); } - public function testValidRegexPatternBefore73(): void - { - if (PHP_VERSION_ID >= 70300) { - self::markTestSkipped('This test requires PHP < 7.3.0'); - } - - $this->analyse( - [__DIR__ . '/data/valid-regex-pattern.php'], - [ - [ - 'Regex pattern is invalid: Delimiter must not be alphanumeric or backslash in pattern: nok', - 6, - ], - [ - 'Regex pattern is invalid: Compilation failed: missing ) at offset 1 in pattern: ~(~', - 7, - ], - [ - 'Regex pattern is invalid: Delimiter must not be alphanumeric or backslash in pattern: nok', - 11, - ], - [ - 'Regex pattern is invalid: Compilation failed: missing ) at offset 1 in pattern: ~(~', - 12, - ], - [ - 'Regex pattern is invalid: Delimiter must not be alphanumeric or backslash in pattern: nok', - 16, - ], - [ - 'Regex pattern is invalid: Compilation failed: missing ) at offset 1 in pattern: ~(~', - 17, - ], - [ - 'Regex pattern is invalid: Delimiter must not be alphanumeric or backslash in pattern: nok', - 21, - ], - [ - 'Regex pattern is invalid: Compilation failed: missing ) at offset 1 in pattern: ~(~', - 22, - ], - [ - 'Regex pattern is invalid: Delimiter must not be alphanumeric or backslash in pattern: nok', - 26, - ], - [ - 'Regex pattern is invalid: Compilation failed: missing ) at offset 1 in pattern: ~(~', - 26, - ], - ], - ); - } - public function testValidRegexPatternAfter73(): void { - if (PHP_VERSION_ID < 70300) { - self::markTestSkipped('This test requires PHP >= 7.3.0'); - } - $messagePart = 'alphanumeric or backslash'; if (PHP_VERSION_ID >= 80200) { $messagePart = 'alphanumeric, backslash, or NUL'; diff --git a/tests/Type/Nette/StringsMatchDynamicReturnTypeExtensionTest.php b/tests/Type/Nette/StringsMatchDynamicReturnTypeExtensionTest.php index 1b5d47b..a503824 100644 --- a/tests/Type/Nette/StringsMatchDynamicReturnTypeExtensionTest.php +++ b/tests/Type/Nette/StringsMatchDynamicReturnTypeExtensionTest.php @@ -3,7 +3,6 @@ namespace PHPStan\Type\Nette; use PHPStan\Testing\TypeInferenceTestCase; -use const PHP_VERSION_ID; class StringsMatchDynamicReturnTypeExtensionTest extends TypeInferenceTestCase { @@ -14,11 +13,6 @@ class StringsMatchDynamicReturnTypeExtensionTest extends TypeInferenceTestCase public function dataFileAsserts(): iterable { yield from self::gatherAssertTypes(__DIR__ . '/data/strings-match.php'); - - if (PHP_VERSION_ID < 70400) { - return; - } - yield from self::gatherAssertTypes(__DIR__ . '/data/strings-match-74.php'); }