Skip to content

Commit add2dc3

Browse files
Rename
1 parent 1c2bb50 commit add2dc3

File tree

4 files changed

+80
-6
lines changed

4 files changed

+80
-6
lines changed

tests/PHPStan/Analyser/NodeScopeResolverPhp7Test.php renamed to tests/PHPStan/Analyser/LooseConstComparisonPhp7Test.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use PHPStan\Testing\TypeInferenceTestCase;
66
use PHPUnit\Framework\Attributes\DataProvider;
77

8-
class NodeScopeResolverPhp7Test extends TypeInferenceTestCase
8+
class LooseConstComparisonPhp7Test extends TypeInferenceTestCase
99
{
1010

1111
/**
@@ -16,8 +16,6 @@ public static function dataFileAsserts(): iterable
1616
// compares constants according to the php-version phpstan configuration,
1717
// _NOT_ the current php runtime version
1818
yield from self::gatherAssertTypes(__DIR__ . '/data/loose-const-comparison-php7.php');
19-
20-
yield from self::gatherAssertTypes(__DIR__ . '/data/bug-13129-php7.php');
2119
}
2220

2321
/**

tests/PHPStan/Analyser/NodeScopeResolverPhp8Test.php renamed to tests/PHPStan/Analyser/LooseConstComparisonPhp8Test.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use PHPStan\Testing\TypeInferenceTestCase;
66
use PHPUnit\Framework\Attributes\DataProvider;
77

8-
class NodeScopeResolverPhp8Test extends TypeInferenceTestCase
8+
class LooseConstComparisonPhp8Test extends TypeInferenceTestCase
99
{
1010

1111
/**
@@ -16,8 +16,6 @@ public static function dataFileAsserts(): iterable
1616
// compares constants according to the php-version phpstan configuration,
1717
// _NOT_ the current php runtime version
1818
yield from self::gatherAssertTypes(__DIR__ . '/data/loose-const-comparison-php8.php');
19-
20-
yield from self::gatherAssertTypes(__DIR__ . '/data/bug-13129-php8.php');
2119
}
2220

2321
/**
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace PHPStan\Analyser;
4+
5+
use PHPStan\Testing\TypeInferenceTestCase;
6+
use PHPUnit\Framework\Attributes\DataProvider;
7+
8+
class SubstrPhp7Test extends TypeInferenceTestCase
9+
{
10+
11+
/**
12+
* @return iterable<array<string, mixed[]>>
13+
*/
14+
public static function dataFileAsserts(): iterable
15+
{
16+
yield from self::gatherAssertTypes(__DIR__ . '/data/bug-13129-php7.php');
17+
}
18+
19+
/**
20+
* @param mixed ...$args
21+
*/
22+
#[DataProvider('dataFileAsserts')]
23+
public function testFileAsserts(
24+
string $assertType,
25+
string $file,
26+
...$args,
27+
): void
28+
{
29+
$this->assertFileAsserts($assertType, $file, ...$args);
30+
}
31+
32+
public static function getAdditionalConfigFiles(): array
33+
{
34+
return [
35+
__DIR__ . '/nodeScopeResolverPhp7.neon',
36+
];
37+
}
38+
39+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace PHPStan\Analyser;
4+
5+
use PHPStan\Testing\TypeInferenceTestCase;
6+
use PHPUnit\Framework\Attributes\DataProvider;
7+
8+
class SubstrPhp8Test extends TypeInferenceTestCase
9+
{
10+
11+
/**
12+
* @return iterable<array<string, mixed[]>>
13+
*/
14+
public static function dataFileAsserts(): iterable
15+
{
16+
yield from self::gatherAssertTypes(__DIR__ . '/data/bug-13129-php8.php');
17+
}
18+
19+
/**
20+
* @param mixed ...$args
21+
*/
22+
#[DataProvider('dataFileAsserts')]
23+
public function testFileAsserts(
24+
string $assertType,
25+
string $file,
26+
...$args,
27+
): void
28+
{
29+
$this->assertFileAsserts($assertType, $file, ...$args);
30+
}
31+
32+
public static function getAdditionalConfigFiles(): array
33+
{
34+
return [
35+
__DIR__ . '/nodeScopeResolverPhp8.neon',
36+
];
37+
}
38+
39+
}

0 commit comments

Comments
 (0)