/opt/cpanel/ea-wappspector/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset
NameSizeModeActions
Fixtures/-0755rm
AbstractRulesetTestCase.php39220644editdlrm
ConstructorNoSniffsTest.xml2170644editdlrm
ConstructorTest.php113810644editdlrm
DisplayCachedMessagesTest.php110860644editdlrm
ExpandRulesetReferenceCaseMismatch1Test.xml5120644editdlrm
ExpandRulesetReferenceCaseMismatch2Test.xml5470644editdlrm
ExpandRulesetReferenceHomePathFailTest.xml4250644editdlrm
ExpandRulesetReferenceHomePathTest.php35590644editdlrm
ExpandRulesetReferenceHomePathTest.xml3370644editdlrm
ExpandRulesetReferenceInternalIgnoreTest.xml6430644editdlrm
ExpandRulesetReferenceInternalStandardTest.xml3300644editdlrm
ExpandRulesetReferenceInternalTest.php25730644editdlrm
ExpandRulesetReferenceInvalidErrorCode1Test.xml3320644editdlrm
ExpandRulesetReferenceInvalidErrorCode2Test.xml3330644editdlrm
ExpandRulesetReferenceInvalidErrorCode3Test.xml3250644editdlrm
ExpandRulesetReferenceInvalidHomePathRefTest.xml4340644editdlrm
ExpandRulesetReferenceMissingFileTest.xml3640644editdlrm
ExpandRulesetReferenceTest.php54810644editdlrm
ExpandRulesetReferenceTest.xml6210644editdlrm
ExpandRulesetReferenceUnknownCategoryTest.xml5080644editdlrm
ExpandRulesetReferenceUnknownSniffTest.xml5150644editdlrm
ExpandRulesetReferenceUnknownStandardTest.xml4690644editdlrm
ExpandSniffDirectoryTest.php25450644editdlrm
ExpandSniffDirectoryTest.xml3490644editdlrm
ExplainCustomRulesetTest.xml3740644editdlrm
ExplainSingleSniffTest.xml2470644editdlrm
ExplainTest.php83570644editdlrm
GetIgnorePatternsTest.php35020644editdlrm
GetIgnorePatternsTest.xml7420644editdlrm
GetIncludePatternsTest.php33060644editdlrm
GetIncludePatternsTest.xml5560644editdlrm
PopulateTokenListenersNamingConventionsTest.php47770644editdlrm
PopulateTokenListenersNamingConventionsTest.xml15900644editdlrm
PopulateTokenListenersRegisterNoArrayTest.xml4650644editdlrm
PopulateTokenListenersSupportedTokenizersTest.php42340644editdlrm
PopulateTokenListenersSupportedTokenizersTest.xml3690644editdlrm
PopulateTokenListenersTest.php215690644editdlrm
PopulateTokenListenersTest.xml20340644editdlrm
ProcessRuleInvalidTypeTest.php12060644editdlrm
ProcessRuleInvalidTypeTest.xml3450644editdlrm
ProcessRulesetAutoExpandSniffsDirectoryTest.xml5920644editdlrm
ProcessRulesetAutoloadFileNotFoundTest.xml3940644editdlrm
ProcessRulesetAutoloadTest.php62680644editdlrm
ProcessRulesetAutoloadTest.xml14190644editdlrm
ProcessRulesetBrokenRulesetEmptyFileTest.xml00644editdlrm
ProcessRulesetBrokenRulesetMultiErrorTest.xml4200644editdlrm
ProcessRulesetBrokenRulesetSingleErrorTest.xml2010644editdlrm
ProcessRulesetBrokenRulesetTest.php32070644editdlrm
ProcessRulesetExcludeSniffGroupTest.xml3620644editdlrm
ProcessRulesetInvalidNoSniffsDirTest.xml4390644editdlrm
ProcessRulesetMiscTest.xml9970644editdlrm
ProcessRulesetShouldProcessElementTest.php127270644editdlrm
ProcessRulesetShouldProcessElementTest.xml17100644editdlrm
ProcessRulesetTest.php115090644editdlrm
ProcessRuleShouldProcessElementTest.php253070644editdlrm
ProcessRuleShouldProcessElementTest.xml33920644editdlrm
PropertyTypeHandlingInlineTest.xml3170644editdlrm
PropertyTypeHandlingTest.php123240644editdlrm
PropertyTypeHandlingTest.xml39010644editdlrm
RegisterSniffsMissingInterfaceInvalidTest.xml3550644editdlrm
RegisterSniffsMissingInterfaceTest.php21350644editdlrm
RegisterSniffsMissingInterfaceValidTest.xml4460644editdlrm
RegisterSniffsRejectsInvalidSniffNoImplementsNoProcessTest.xml4440644editdlrm
RegisterSniffsRejectsInvalidSniffNoImplementsNoRegisterOrProcessTest.xml4540644editdlrm
RegisterSniffsRejectsInvalidSniffNoImplementsNoRegisterTest.xml4450644editdlrm
RegisterSniffsRejectsInvalidSniffTest.php27760644editdlrm
RegisterSniffsTest.php105190644editdlrm
RuleInclusionAbsoluteLinuxTest.php33580644editdlrm
RuleInclusionAbsoluteLinuxTest.xml4820644editdlrm
RuleInclusionAbsoluteWindowsTest.php32700644editdlrm
RuleInclusionAbsoluteWindowsTest.xml4790644editdlrm
RuleInclusionTest-include.xml3640644editdlrm
RuleInclusionTest.php190010644editdlrm
RuleInclusionTest.xml18830644editdlrm
SetPropertyAllowedAsDeclaredTest.xml7280644editdlrm
SetPropertyAllowedViaMagicMethodTest.xml7320644editdlrm
SetPropertyAllowedViaStdClassTest.xml7290644editdlrm
SetPropertyAppliesPropertyToMultipleSniffsInCategoryTest.xml3380644editdlrm
SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategoryTest.xml3430644editdlrm
SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForStandardTest.xml3760644editdlrm
SetPropertyNotAllowedViaAttributeTest.xml4390644editdlrm
SetPropertyThrowsErrorOnInvalidPropertyTest.xml3540644editdlrm
SetSniffPropertyTest.php171280644editdlrm
ShowSniffDeprecationsEmptyDeprecationVersionTest.xml3710644editdlrm
ShowSniffDeprecationsEmptyRemovalVersionTest.xml3670644editdlrm
ShowSniffDeprecationsInvalidDeprecationMessageTest.xml3730644editdlrm
ShowSniffDeprecationsInvalidDeprecationVersionTest.xml3730644editdlrm
ShowSniffDeprecationsInvalidRemovalVersionTest.xml3690644editdlrm
ShowSniffDeprecationsOrderTest.xml5130644editdlrm
ShowSniffDeprecationsReportWidthTest.xml3600644editdlrm
ShowSniffDeprecationsTest.php262220644editdlrm
ShowSniffDeprecationsTest.xml6220644editdlrm
Edit: /opt/cpanel/ea-wappspector/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainTest.php (8357B)
* @copyright 2023 Juliette Reinders Folmer. All rights reserved. * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/HEAD/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Ruleset; use PHP_CodeSniffer\Ruleset; use PHP_CodeSniffer\Tests\ConfigDouble; use PHPUnit\Framework\TestCase; /** * Test the Ruleset::explain() function. * * @covers \PHP_CodeSniffer\Ruleset::explain */ final class ExplainTest extends TestCase { /** * Test the output of the "explain" command. * * @return void */ public function testExplain() { // Set up the ruleset. $config = new ConfigDouble(['--standard=PSR1', '-e']); $ruleset = new Ruleset($config); $expected = PHP_EOL; $expected .= 'The PSR1 standard contains 8 sniffs'.PHP_EOL.PHP_EOL; $expected .= 'Generic (4 sniffs)'.PHP_EOL; $expected .= '------------------'.PHP_EOL; $expected .= ' Generic.Files.ByteOrderMark'.PHP_EOL; $expected .= ' Generic.NamingConventions.UpperCaseConstantName'.PHP_EOL; $expected .= ' Generic.PHP.DisallowAlternativePHPTags'.PHP_EOL; $expected .= ' Generic.PHP.DisallowShortOpenTag'.PHP_EOL.PHP_EOL; $expected .= 'PSR1 (3 sniffs)'.PHP_EOL; $expected .= '---------------'.PHP_EOL; $expected .= ' PSR1.Classes.ClassDeclaration'.PHP_EOL; $expected .= ' PSR1.Files.SideEffects'.PHP_EOL; $expected .= ' PSR1.Methods.CamelCapsMethodName'.PHP_EOL.PHP_EOL; $expected .= 'Squiz (1 sniff)'.PHP_EOL; $expected .= '---------------'.PHP_EOL; $expected .= ' Squiz.Classes.ValidClassName'.PHP_EOL; $this->expectOutputString($expected); $ruleset->explain(); }//end testExplain() /** * Test the output of the "explain" command is not influenced by a user set report width. * * @return void */ public function testExplainAlwaysDisplaysCompleteSniffName() { // Set up the ruleset. $config = new ConfigDouble(['--standard=PSR1', '-e', '--report-width=30']); $ruleset = new Ruleset($config); $expected = PHP_EOL; $expected .= 'The PSR1 standard contains 8 sniffs'.PHP_EOL.PHP_EOL; $expected .= 'Generic (4 sniffs)'.PHP_EOL; $expected .= '------------------'.PHP_EOL; $expected .= ' Generic.Files.ByteOrderMark'.PHP_EOL; $expected .= ' Generic.NamingConventions.UpperCaseConstantName'.PHP_EOL; $expected .= ' Generic.PHP.DisallowAlternativePHPTags'.PHP_EOL; $expected .= ' Generic.PHP.DisallowShortOpenTag'.PHP_EOL.PHP_EOL; $expected .= 'PSR1 (3 sniffs)'.PHP_EOL; $expected .= '---------------'.PHP_EOL; $expected .= ' PSR1.Classes.ClassDeclaration'.PHP_EOL; $expected .= ' PSR1.Files.SideEffects'.PHP_EOL; $expected .= ' PSR1.Methods.CamelCapsMethodName'.PHP_EOL.PHP_EOL; $expected .= 'Squiz (1 sniff)'.PHP_EOL; $expected .= '---------------'.PHP_EOL; $expected .= ' Squiz.Classes.ValidClassName'.PHP_EOL; $this->expectOutputString($expected); $ruleset->explain(); }//end testExplainAlwaysDisplaysCompleteSniffName() /** * Test the output of the "explain" command when a ruleset only contains a single sniff. * * This is mostly about making sure that the summary line uses the correct grammar. * * @return void */ public function testExplainSingleSniff() { // Set up the ruleset. $standard = __DIR__.'/ExplainSingleSniffTest.xml'; $config = new ConfigDouble(["--standard=$standard", '-e']); $ruleset = new Ruleset($config); $expected = PHP_EOL; $expected .= 'The ExplainSingleSniffTest standard contains 1 sniff'.PHP_EOL.PHP_EOL; $expected .= 'Squiz (1 sniff)'.PHP_EOL; $expected .= '---------------'.PHP_EOL; $expected .= ' Squiz.Scope.MethodScope'.PHP_EOL; $this->expectOutputString($expected); $ruleset->explain(); }//end testExplainSingleSniff() /** * Test that "explain" works correctly with custom rulesets. * * Verifies that: * - The "standard" name is taken from the custom ruleset. * - Any and all sniff additions and exclusions in the ruleset are taken into account correctly. * - That the displayed list will have both the standards as well as the sniff names * ordered alphabetically. * * @return void */ public function testExplainCustomRuleset() { // Set up the ruleset. $standard = __DIR__.'/ExplainCustomRulesetTest.xml'; $config = new ConfigDouble(["--standard=$standard", '-e']); $ruleset = new Ruleset($config); $expected = PHP_EOL; $expected .= 'The ExplainCustomRulesetTest standard contains 10 sniffs'.PHP_EOL.PHP_EOL; $expected .= 'Generic (4 sniffs)'.PHP_EOL; $expected .= '------------------'.PHP_EOL; $expected .= ' Generic.Files.ByteOrderMark'.PHP_EOL; $expected .= ' Generic.NamingConventions.UpperCaseConstantName'.PHP_EOL; $expected .= ' Generic.PHP.DisallowAlternativePHPTags'.PHP_EOL; $expected .= ' Generic.PHP.DisallowShortOpenTag'.PHP_EOL.PHP_EOL; $expected .= 'PSR1 (2 sniffs)'.PHP_EOL; $expected .= '---------------'.PHP_EOL; $expected .= ' PSR1.Classes.ClassDeclaration'.PHP_EOL; $expected .= ' PSR1.Methods.CamelCapsMethodName'.PHP_EOL.PHP_EOL; $expected .= 'PSR12 (2 sniffs)'.PHP_EOL; $expected .= '----------------'.PHP_EOL; $expected .= ' PSR12.ControlStructures.BooleanOperatorPlacement'.PHP_EOL; $expected .= ' PSR12.ControlStructures.ControlStructureSpacing'.PHP_EOL.PHP_EOL; $expected .= 'Squiz (2 sniffs)'.PHP_EOL; $expected .= '----------------'.PHP_EOL; $expected .= ' Squiz.Classes.ValidClassName'.PHP_EOL; $expected .= ' Squiz.Scope.MethodScope'.PHP_EOL; $this->expectOutputString($expected); $ruleset->explain(); }//end testExplainCustomRuleset() /** * Test the output of the "explain" command for a standard containing both deprecated * and non-deprecated sniffs. * * Tests that: * - Deprecated sniffs are marked with an asterix in the list. * - A footnote is displayed explaining the asterix. * - And that the "standard uses # deprecated sniffs" listing is **not** displayed. * * @return void */ public function testExplainWithDeprecatedSniffs() { // Set up the ruleset. $standard = __DIR__."/ShowSniffDeprecationsTest.xml"; $config = new ConfigDouble(["--standard=$standard", '-e']); $ruleset = new Ruleset($config); $expected = PHP_EOL; $expected .= 'The ShowSniffDeprecationsTest standard contains 11 sniffs'.PHP_EOL.PHP_EOL; $expected .= 'TestStandard (11 sniffs)'.PHP_EOL; $expected .= '------------------------'.PHP_EOL; $expected .= ' TestStandard.Deprecated.WithLongReplacement *'.PHP_EOL; $expected .= ' TestStandard.Deprecated.WithoutReplacement *'.PHP_EOL; $expected .= ' TestStandard.Deprecated.WithReplacement *'.PHP_EOL; $expected .= ' TestStandard.Deprecated.WithReplacementContainingLinuxNewlines *'.PHP_EOL; $expected .= ' TestStandard.Deprecated.WithReplacementContainingNewlines *'.PHP_EOL; $expected .= ' TestStandard.SetProperty.AllowedAsDeclared'.PHP_EOL; $expected .= ' TestStandard.SetProperty.AllowedViaMagicMethod'.PHP_EOL; $expected .= ' TestStandard.SetProperty.AllowedViaStdClass'.PHP_EOL; $expected .= ' TestStandard.SetProperty.NotAllowedViaAttribute'.PHP_EOL; $expected .= ' TestStandard.SetProperty.PropertyTypeHandling'.PHP_EOL; $expected .= ' TestStandard.ValidSniffs.RegisterEmptyArray'.PHP_EOL.PHP_EOL; $expected .= '* Sniffs marked with an asterisk are deprecated.'.PHP_EOL; $this->expectOutputString($expected); $ruleset->explain(); }//end testExplainWithDeprecatedSniffs() }//end class