Skip to content

Commit

Permalink
Removed dead test-code after min-phpversion raise
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored and ondrejmirtes committed Oct 26, 2024
1 parent 46c7243 commit cacb698
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 68 deletions.
5 changes: 0 additions & 5 deletions tests/Rule/Nette/PresenterInjectedPropertiesExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
];
Expand Down
57 changes: 0 additions & 57 deletions tests/Rule/Nette/RegularExpressionPatternRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace PHPStan\Type\Nette;

use PHPStan\Testing\TypeInferenceTestCase;
use const PHP_VERSION_ID;

class StringsMatchDynamicReturnTypeExtensionTest extends TypeInferenceTestCase
{
Expand All @@ -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');
}

Expand Down

0 comments on commit cacb698

Please sign in to comment.