Skip to content

ProcessRuleShouldProcessElementTest: test changing Internal codes #818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public function testShouldProcessSeverityCsonly()
$key = 'severity';

// Verify that the non-selective severity directive IS applied.
$sniffCode = 'Internal.NoCodeFound';
$this->assertRulesetPropertySame(0, $sniffCode, $key);

$sniffCode = 'PSR1.Files.SideEffects';
$this->assertRulesetPropertySame(3, $sniffCode, $key);

Expand Down Expand Up @@ -215,6 +218,9 @@ public function testShouldProcessMessageCbfonly()
$key = 'message';

// Verify that the non-selective message directive IS applied.
$sniffCode = 'Internal.NoCodeFound';
$this->assertRulesetPropertySame("We don't to be notified if files don't contain code", $sniffCode, $key);

$sniffCode = 'PSR1.Files.SideEffects';
$this->assertRulesetPropertySame('A different warning message', $sniffCode, $key);

Expand Down
5 changes: 5 additions & 0 deletions tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
# Neither set. #
################
-->
<rule ref="Internal.NoCodeFound">
<severity>0</severity>
<message>We don't to be notified if files don't contain code</message>
</rule>

<rule ref="PSR1.Files.SideEffects">
<severity>3</severity>
<type>warning</type>
Expand Down
Loading