1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00
psalm/tests/TraceTest.php

46 lines
1.2 KiB
PHP
Raw Normal View History

<?php
namespace Psalm\Tests;
2021-12-04 21:55:53 +01:00
use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait;
class TraceTest extends TestCase
{
2021-12-04 21:55:53 +01:00
use InvalidCodeAnalysisTestTrait;
public function providerInvalidCodeParse(): iterable
{
return [
'traceVariable' => [
'code' => '<?php
/** @psalm-trace $a */
$a = getmypid();',
'error_message' => 'Trace',
],
2021-11-15 03:09:37 +01:00
'traceVariables' => [
'code' => '<?php
2021-11-15 03:09:37 +01:00
/** @psalm-trace $a $b */
$a = getmypid();
$b = getmypid();',
'error_message' => 'Trace',
],
'traceVariablesComma' => [
'code' => '<?php
2021-11-15 03:09:37 +01:00
/** @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',
],
2022-12-18 17:15:15 +01:00
],
];
}
}