@@ 12-25 (lines=14) @@ | ||
9 | use ZenifyCodingStandard\Sniffs\Commenting\MethodCommentSniff; |
|
10 | ||
11 | ||
12 | final class MethodCommentSniffTest extends TestCase |
|
13 | { |
|
14 | ||
15 | public function testDetection() |
|
16 | { |
|
17 | $codeSnifferRunner = new CodeSnifferRunner(MethodCommentSniff::NAME); |
|
18 | ||
19 | $this->assertSame(1, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/wrong.php')); |
|
20 | $this->assertSame(0, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/correct.php')); |
|
21 | $this->assertSame(0, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/correct2.php')); |
|
22 | $this->assertSame(0, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/correct3.php')); |
|
23 | } |
|
24 | ||
25 | } |
|
26 |
@@ 12-25 (lines=14) @@ | ||
9 | use ZenifyCodingStandard\Sniffs\ControlStructures\SwitchDeclarationSniff; |
|
10 | ||
11 | ||
12 | final class SwitchDeclarationSniffTest extends TestCase |
|
13 | { |
|
14 | ||
15 | public function testDetection() |
|
16 | { |
|
17 | $codeSnifferRunner = new CodeSnifferRunner(SwitchDeclarationSniff::NAME); |
|
18 | ||
19 | $this->assertSame(4, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/wrong.php')); |
|
20 | $this->assertSame(1, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/wrong2.php')); |
|
21 | $this->assertSame(1, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/wrong3.php')); |
|
22 | $this->assertSame(0, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/correct.php')); |
|
23 | } |
|
24 | ||
25 | } |
|
26 |
@@ 12-27 (lines=16) @@ | ||
9 | use ZenifyCodingStandard\Sniffs\WhiteSpace\DocBlockSniff; |
|
10 | ||
11 | ||
12 | final class DocBlockSniffTest extends TestCase |
|
13 | { |
|
14 | ||
15 | public function testDetection() |
|
16 | { |
|
17 | $codeSnifferRunner = new CodeSnifferRunner(DocBlockSniff::NAME); |
|
18 | ||
19 | $this->assertSame(4, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/wrong.php')); |
|
20 | $this->assertSame(0, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/correct.php')); |
|
21 | ||
22 | // Testing indentation inside DocBlock |
|
23 | $this->assertSame(1, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/wrong-inside.php')); |
|
24 | $this->assertSame(0, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/correct-inside.php')); |
|
25 | } |
|
26 | ||
27 | } |
|
28 |