Skip to content

Commit 4c85ff6

Browse files
committed
SignatureMapParserTest - check for ErrorType
1 parent af21e23 commit 4c85ff6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/PHPStan/Reflection/SignatureMap/SignatureMapParserTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use PHPStan\Type\ArrayType;
77
use PHPStan\Type\BooleanType;
88
use PHPStan\Type\CallableType;
9+
use PHPStan\Type\ErrorType;
910
use PHPStan\Type\IntegerType;
1011
use PHPStan\Type\MixedType;
1112
use PHPStan\Type\NullType;
@@ -395,11 +396,16 @@ public function testParseAll(): void
395396
}
396397

397398
try {
398-
$parser->getFunctionSignature($map, $className);
399+
$signature = $parser->getFunctionSignature($map, $className);
399400
$count++;
400401
} catch (\PHPStan\PhpDocParser\Parser\ParserException $e) {
401402
$this->fail(sprintf('Could not parse %s.', $functionName));
402403
}
404+
405+
self::assertNotInstanceOf(ErrorType::class, $signature->getReturnType(), $functionName);
406+
foreach ($signature->getParameters() as $parameter) {
407+
self::assertNotInstanceOf(ErrorType::class, $parameter->getType(), sprintf('%s (parameter %s)', $functionName, $parameter->getName()));
408+
}
403409
}
404410

405411
$this->assertGreaterThan(0, $count);

0 commit comments

Comments
 (0)