ComponentFactoryCommentSniffTest::testDetection()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 10
loc 10
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Zenify\CodingStandard\Tests\Sniffs\Commenting\ComponentFactoryComment;
6
7
use PHPUnit\Framework\TestCase;
8
use Zenify\CodingStandard\Tests\CodeSnifferRunner;
9
use ZenifyCodingStandard\Sniffs\Commenting\ComponentFactoryCommentSniff;
10
11
12 View Code Duplication
final class ComponentFactoryCommentSniffTest extends TestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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