-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClassSniffTest.php
65 lines (55 loc) · 1.65 KB
/
ClassSniffTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php declare(strict_types=1);
namespace Tests\Integration\CustomRules\Sniffs\Commenting;
use Bruha\CodingStandard\CustomRules\Sniffs\Commenting\ClassSniff;
use Tests\AbstractTestCase;
/**
* Class ClassSniffTest
*
* @package Tests\Integration\CustomRules\Sniffs\Commenting
*/
final class ClassSniffTest extends AbstractTestCase
{
/**
* @var string
*/
private $sniff = ClassSniff::class;
/**
* @covers ClassSniff::register
* @covers ClassSniff::process
* @covers ClassSniff::processCommenting
* @covers ClassSniff::replacePlaceholders
*/
public function testSuccess(): void
{
$result = $this->processFile(__DIR__ . '/Data/ClassSniffSuccess.php', $this->sniff);
self::assertSuccess($result);
}
/**
* @covers ClassSniff::register
* @covers ClassSniff::process
* @covers ClassSniff::processCommenting
* @covers ClassSniff::replacePlaceholders
*/
public function testMissing(): void
{
$result = $this->processFile(__DIR__ . '/Data/ClassSniffMissing.php', $this->sniff);
self::assertNotSuccess(
$result,
5,
8,
0,
$this->sniff,
'CustomRules.Commenting.Class.Comment',
"Usage of class comment without 'Class ClassSniffMissing' is not allowed."
);
self::assertNotSuccess(
$result,
5,
8,
1,
$this->sniff,
'CustomRules.Commenting.Class.Comment',
"Usage of class comment without '@package Tests\Integration\CustomRules\Sniffs\Commenting\Data' is not allowed."
);
}
}