Skip to content

Commit 971db70

Browse files
committed
deduplicate test fixtures
1 parent a53db1f commit 971db70

File tree

3 files changed

+5
-27
lines changed

3 files changed

+5
-27
lines changed

tests/PHPStan/Analyser/NodeScopeResolverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ private static function findTestFiles(): iterable
207207
yield __DIR__ . '/../Rules/Classes/data/bug-11591-property-tag.php';
208208
yield __DIR__ . '/../Rules/Classes/data/mixin-trait-use.php';
209209

210-
yield __DIR__ . '/data/bug-4801.php';
210+
yield __DIR__ . '/../Rules/Methods/data/bug-4801.php';
211211
yield __DIR__ . '/data/template-default.php';
212212
}
213213

tests/PHPStan/Analyser/data/bug-4801.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

tests/PHPStan/Rules/Methods/data/bug-4801.php

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

33
namespace Bug4801;
44

5+
use function PHPStan\Testing\assertType;
6+
57
/**
68
* @template T
79
*/
@@ -18,5 +20,6 @@ public function work(callable|null $a): I;
1820
* @param I<string> $i
1921
*/
2022
function x(I $i) {
21-
$i->work(null);
23+
assertType('Bug4801\\I<string>', $i->work(null));
24+
assertType('Bug4801\\I<int>', $i->work(fn(string $a) => (int) $a));
2225
}

0 commit comments

Comments
 (0)