Skip to content

Commit e84d732

Browse files
committed
Generic/InterfaceNameSuffix: improve code coverage
- Add a separate test case file with a live coding/parse error test. - Add a new test with comments and new lines in unexpected places and parent interfaces.
1 parent ceef93e commit e84d732

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ interface SomeNameInterface {}
55
interface MissingInterfaceSuffix {} // Error.
66

77
interface CaseOfSuffixIsNotEnforced_interFACE {}
8+
9+
interface
10+
/*comment*/
11+
InterfaceAnotherInvalidName
12+
extends
13+
AnotherInterface, \Countable {} // 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 interface name).
4+
// This should be the only test in this file.
5+
// Testing that the sniff is *not* triggered.
6+
7+
interface

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ public function getErrorList($testFile='')
3333
{
3434
switch ($testFile) {
3535
case 'InterfaceNameSuffixUnitTest.1.inc':
36-
return [5 => 1];
36+
return [
37+
5 => 1,
38+
9 => 1,
39+
];
3740
default:
3841
return [];
3942
}

0 commit comments

Comments
 (0)