1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Fixed ExceptionCodeTest provider to emit array keys

This commit is contained in:
Bruce Weirdan 2022-01-31 00:26:23 +02:00
parent a2977a5ca9
commit 0cbcd0fcf9
No known key found for this signature in database
GPG Key ID: CFC3AAB181751B0D

View File

@ -39,23 +39,23 @@ class ExceptionCodeTest extends TestCase
'assertions' => [],
];
yield 'CustomThrowable' => [
'<?php
'code' => '<?php
interface CustomThrowable extends \Throwable {}
/** @var CustomThrowable $e */
$code = $e->getCode();
',
['$code' => 'int'],
'assertions' => ['$code' => 'int'],
];
yield 'Throwable' => [
'<?php
'code' => '<?php
/** @var \Throwable $e */
$code = $e->getCode();
',
'assertions' => ['$code' => 'int|string'],
];
yield 'Exception' => [
'<?php
'code' => '<?php
/** @var \Exception $e */
$code = $e->getCode();
',