Skip to content

Commit b0019e9

Browse files
committed
Rework LegacyNodeScopeResolverTest
1 parent 4e27e79 commit b0019e9

2 files changed

Lines changed: 3 additions & 24 deletions

File tree

‎tests/PHPStan/Analyser/LegacyNodeScopeResolverTest.php‎

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -80,29 +80,6 @@ private static function getFileScope(string $filename): Scope
8080
return $testScope;
8181
}
8282

83-
public static function dataUnionInCatch(): array
84-
{
85-
return [
86-
[
87-
'CatchUnion\BarException|CatchUnion\FooException',
88-
'$e',
89-
],
90-
];
91-
}
92-
93-
#[DataProvider('dataUnionInCatch')]
94-
public function testUnionInCatch(
95-
string $description,
96-
string $expression,
97-
): void
98-
{
99-
$this->assertTypes(
100-
__DIR__ . '/data/catch-union.php',
101-
$description,
102-
$expression,
103-
);
104-
}
105-
10683
public static function dataUnionAndIntersection(): array
10784
{
10885
return [

tests/PHPStan/Analyser/data/catch-union.php renamed to tests/PHPStan/Analyser/nsrt/catch-union.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace CatchUnion;
44

5+
use function PHPStan\Testing\assertType;
6+
57
class FooException extends \Exception
68
{
79

@@ -16,6 +18,6 @@ function () {
1618
try {
1719
maybeThrows();
1820
} catch (FooException | BarException $e) {
19-
die;
21+
assertType('CatchUnion\BarException|CatchUnion\FooException', $e);
2022
}
2123
};

0 commit comments

Comments
 (0)