@@ 12-26 (lines=15) @@ | ||
9 | use ZenifyCodingStandard\Sniffs\Commenting\ComponentFactoryCommentSniff; |
|
10 | ||
11 | ||
12 | final class ComponentFactoryCommentSniffTest extends TestCase |
|
13 | { |
|
14 | ||
15 | public function testDetection() |
|
16 | { |
|
17 | $codeSnifferRunner = new CodeSnifferRunner(ComponentFactoryCommentSniff::NAME); |
|
18 | ||
19 | $this->assertSame(1, $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 | $this->assertSame(0, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/correct2.php')); |
|
24 | } |
|
25 | ||
26 | } |
|
27 |
@@ 12-26 (lines=15) @@ | ||
9 | use ZenifyCodingStandard\Sniffs\Namespaces\UseDeclarationSniff; |
|
10 | ||
11 | ||
12 | final class UseDeclarationSniffTest extends TestCase |
|
13 | { |
|
14 | ||
15 | public function testDetection() |
|
16 | { |
|
17 | $codeSnifferRunner = new CodeSnifferRunner(UseDeclarationSniff::NAME); |
|
18 | ||
19 | $this->assertSame(1, $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 | $this->assertSame(0, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/correct2.php')); |
|
24 | } |
|
25 | ||
26 | } |
|
27 |