mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Psalm\Tests;
|
|
|
|
use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait;
|
|
|
|
class TraceTest extends TestCase
|
|
{
|
|
use InvalidCodeAnalysisTestTrait;
|
|
|
|
public function providerInvalidCodeParse(): iterable
|
|
{
|
|
return [
|
|
'traceVariable' => [
|
|
'code' => '<?php
|
|
/** @psalm-trace $a */
|
|
$a = getmypid();',
|
|
'error_message' => 'Trace',
|
|
],
|
|
'traceVariables' => [
|
|
'code' => '<?php
|
|
/** @psalm-trace $a $b */
|
|
$a = getmypid();
|
|
$b = getmypid();',
|
|
'error_message' => 'Trace',
|
|
],
|
|
'traceVariablesComma' => [
|
|
'code' => '<?php
|
|
/** @psalm-trace $a, $b */
|
|
$a = getmypid();
|
|
$b = getmypid();',
|
|
'error_message' => 'Trace',
|
|
],
|
|
'undefinedTraceVariable' => [
|
|
'code' => '<?php
|
|
/** @psalm-trace $b */
|
|
echo 1;',
|
|
'error_message' => 'UndefinedTrace',
|
|
'ignored_issues' => [
|
|
'MixedAssignment',
|
|
],
|
|
],
|
|
];
|
|
}
|
|
}
|