Skip to content

Commit 456275f

Browse files
committed
Final LegacyNodeScopeResolverTest cleanup
1 parent 27d2abd commit 456275f

17 files changed

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

0 commit comments

Comments
 (0)