Skip to content

Commit 589e826

Browse files
authored
Merge pull request #818 from PHPCSStandards/feature/ruleset-shouldprocess-element-internal-severity
ProcessRuleShouldProcessElementTest: test changing `Internal` codes
2 parents 7acc4aa + 333a70c commit 589e826

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public function testShouldProcessSeverityCsonly()
6464
$key = 'severity';
6565

6666
// Verify that the non-selective severity directive IS applied.
67+
$sniffCode = 'Internal.NoCodeFound';
68+
$this->assertRulesetPropertySame(0, $sniffCode, $key);
69+
6770
$sniffCode = 'PSR1.Files.SideEffects';
6871
$this->assertRulesetPropertySame(3, $sniffCode, $key);
6972

@@ -215,6 +218,9 @@ public function testShouldProcessMessageCbfonly()
215218
$key = 'message';
216219

217220
// Verify that the non-selective message directive IS applied.
221+
$sniffCode = 'Internal.NoCodeFound';
222+
$this->assertRulesetPropertySame("We don't to be notified if files don't contain code", $sniffCode, $key);
223+
218224
$sniffCode = 'PSR1.Files.SideEffects';
219225
$this->assertRulesetPropertySame('A different warning message', $sniffCode, $key);
220226

tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
# Neither set. #
77
################
88
-->
9+
<rule ref="Internal.NoCodeFound">
10+
<severity>0</severity>
11+
<message>We don't to be notified if files don't contain code</message>
12+
</rule>
13+
914
<rule ref="PSR1.Files.SideEffects">
1015
<severity>3</severity>
1116
<type>warning</type>

0 commit comments

Comments
 (0)