Skip to content

Commit d9b1b6e

Browse files
committed
Generic/TraitNameSuffix: improve code coverage
- Add a separate test case file with a live coding/parse error test. - Add a new test with a comment and whitespaces in unexpected places.
1 parent 7ee8321 commit d9b1b6e

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/Standards/Generic/Tests/NamingConventions/TraitNameSuffixUnitTest.1.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ trait MissingTraitSuffix {} // Error.
55
trait GoodTrait {}
66

77
trait SuffixCaseIsNotEnforced_tRaIt {}
8+
9+
trait
10+
/*comment*/
11+
AnotherInvalidTraitName {} // Error.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
// Intentional parse error (no trait name).
4+
// This should be the only test in this file.
5+
// Testing that the sniff is *not* triggered.
6+
7+
trait

src/Standards/Generic/Tests/NamingConventions/TraitNameSuffixUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function getErrorList($testFile='')
3535
case 'TraitNameSuffixUnitTest.1.inc':
3636
return [
3737
3 => 1,
38+
9 => 1,
3839
];
3940

4041
default:

0 commit comments

Comments
 (0)