VarPropertyCommentSniffTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testDetection() 0 11 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Zenify\CodingStandard\Tests\Sniffs\Commenting\VarPropertyComment;
6
7
use PHPUnit\Framework\TestCase;
8
use Zenify\CodingStandard\Tests\CodeSnifferRunner;
9
use ZenifyCodingStandard\Sniffs\Commenting\VarPropertyCommentSniff;
10
11
12
final class VarPropertyCommentSniffTest extends TestCase
13
{
14
15
	public function testDetection()
16
	{
17
		$codeSnifferRunner = new CodeSnifferRunner(VarPropertyCommentSniff::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(1, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/wrong4.php'));
23
		$this->assertSame(0, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/correct.php'));
24
		$this->assertSame(0, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/correct2.php'));
25
	}
26
27
}
28