mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 11:25:52 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
33 lines
823 B
PHP
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],
|
|
]);
|
|
}
|
|
}
|