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>
38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Rules\Tests\Rules;
|
|
|
|
use Rules\Rules\NoForbiddenTermsInSymbolNamesRule;
|
|
use PHPStan\Rules\Rule;
|
|
use PHPStan\Testing\RuleTestCase;
|
|
|
|
/**
|
|
* @extends RuleTestCase<NoForbiddenTermsInSymbolNamesRule>
|
|
*/
|
|
final class NoForbiddenTermsInSymbolNamesRuleTest extends RuleTestCase
|
|
{
|
|
protected function getRule(): Rule
|
|
{
|
|
return new NoForbiddenTermsInSymbolNamesRule(['shape']);
|
|
}
|
|
|
|
public function testRule(): void
|
|
{
|
|
$message = 'Rename symbol `%s` for its domain role; `shape` describes structure rather than ownership.';
|
|
|
|
$this->analyse([__DIR__.'/data/no-forbidden-terms-in-symbol-names.php'], [
|
|
[sprintf($message, 'ResponseShape'), 10],
|
|
[sprintf($message, 'UserShape'), 10],
|
|
[sprintf($message, 'SHAPE_VERSION'), 12],
|
|
[sprintf($message, 'payloadShape'), 15],
|
|
[sprintf($message, 'shapeOf'), 17],
|
|
[sprintf($message, 'shaped'), 17],
|
|
[sprintf($message, 'resultShape'), 19],
|
|
[sprintf($message, 'shaped'), 19],
|
|
[sprintf($message, 'resultShape'), 21],
|
|
]);
|
|
}
|
|
}
|