Skip to content

Commit cf293a9

Browse files
Add test
1 parent c6709b6 commit cf293a9

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

tests/PHPStan/Rules/PhpDoc/RequireImplementsDefinitionTraitRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ public function testRule(): void
6262
'PHPDoc tag @phpstan-require-implements contains non-object type *NEVER*.',
6363
34,
6464
],
65+
[
66+
'PHPDoc tag @phpstan-require-implements contains unknown class IncompatibleRequireImplements\TypeDoesNotExist.',
67+
175,
68+
'Learn more at https://phpstan.org/user-guide/discovering-symbols',
69+
],
6570
];
6671

6772
$this->analyse([__DIR__ . '/data/incompatible-require-implements.php'], $expectedErrors);

tests/PHPStan/Rules/PhpDoc/data/incompatible-require-implements.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,8 @@ trait ValidPsalmTrait {}
168168
new class {
169169
use ValidPsalmTrait;
170170
};
171+
172+
/**
173+
* @phpstan-require-implements RequiredInterface|TypeDoesNotExist
174+
*/
175+
trait InvalidTraitWithUnknown {}

0 commit comments

Comments
 (0)