Files
pterodactyl-panel/tools/phpstan/rules/tests/Rules/NoChainedAssertionsRuleTest.php
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

33 lines
823 B
PHP

<?php
declare(strict_types=1);
namespace Rules\Tests\Rules;
use Rules\Rules\NoChainedAssertionsRule;
use Rules\Support\AssertionForms;
use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
/**
* @extends RuleTestCase<NoChainedAssertionsRule>
*/
final class NoChainedAssertionsRuleTest extends RuleTestCase
{
protected function getRule(): Rule
{
return new NoChainedAssertionsRule(new AssertionForms);
}
public function testRule(): void
{
$message = 'This assertion chain discards type evidence and fabricates a new type. Keep the original precise type, or parse untrusted input once at its boundary.';
$this->analyse([__DIR__.'/data/no-chained-assertions.php'], [
[$message, 9],
[$message, 11],
[$message, 11],
]);
}
}