Consider this case:
<?php
use PHPUnit\Framework\TestCase;
final class JsonDecodeTest extends TestCase
{
public function testThrowsOnInvalidJson(): void
{
$this->expectException(\JsonException::class);
// UnusedFunctionCall is thrown here
json_decode('', flags: JSON_THROW_ON_ERROR);
}
}
I am not sure that this is doable or worth the effort, so feel free to close the issue. For now we just suppressed UnusedFunctionCall and UnusedMethodCall in psalm.xml for the whole tests directory.