1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 12:24:49 +01:00
psalm/tests/TraceTest.php
orklah db45ff1ba4
More return types (#4173)
* add native return types

* redundant phpdoc
2021-01-29 11:38:57 +01:00

32 lines
819 B
PHP

<?php
namespace Psalm\Tests;
class TraceTest extends TestCase
{
use Traits\InvalidCodeAnalysisTestTrait;
/**
* @return iterable<string,array{string,error_message:string,2?:string[],3?:bool,4?:string}>
*/
public function providerInvalidCodeParse(): iterable
{
return [
'traceVariable' => [
'<?php
/** @psalm-trace $a */
$a = getmypid();',
'error_message' => 'Trace',
],
'undefinedTraceVariable' => [
'<?php
/** @psalm-trace $b */
echo 1;',
'error_message' => 'UndefinedTrace',
'error_levels' => [
'MixedAssignment',
],
]
];
}
}