forked from FiveLab/CiRules
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInheritdocSniffTest.php
More file actions
67 lines (58 loc) · 2.22 KB
/
Copy pathInheritdocSniffTest.php
File metadata and controls
67 lines (58 loc) · 2.22 KB
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
66
67
<?php
/*
* This file is part of the FiveLab CiRules package
*
* (c) FiveLab
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code
*/
declare(strict_types = 1);
namespace FiveLab\Component\CiRules\Tests\PhpCs\FiveLab\Sniffs\Commenting;
use FiveLab\Component\CiRules\PhpCs\FiveLab\Sniffs\Commenting\InheritdocSniff;
use FiveLab\Component\CiRules\Tests\PhpCs\FiveLab\Sniffs\AbstractSniffTestCase;
class InheritdocSniffTest extends AbstractSniffTestCase
{
protected function getSniffClass(): string
{
return InheritdocSniff::class;
}
protected function isShouldIncludeFile(): bool
{
return true;
}
public static function provideDataSet(): array
{
return [
'success' => [
__DIR__.'/Resources/inheritdoc/success.php',
],
'wrong' => [
__DIR__.'/Resources/inheritdoc/wrong.php',
[
'message' => 'The notation {@inheritdoc} must be in lower case.',
'source' => 'FiveLab.Commenting.Inheritdoc.WrongFormat',
],
[
'message' => 'Must be one blank line before {@inheritdoc} notation.',
'source' => 'FiveLab.Commenting.Inheritdoc.MissedLineBefore',
],
[
'message' => 'Must be one blank line after {@inheritdoc} notation.',
'source' => 'FiveLab.Commenting.Inheritdoc.MissedLineAfter',
],
[
'message' => 'The notation {@inheritdoc} presented, but method "bar" does not declared in extended classes/interfaces.',
'source' => 'FiveLab.Commenting.Inheritdoc.Missed',
],
],
'wrong: without class' => [
__DIR__.'/Resources/inheritdoc/wrong-without-class.php',
[
'message' => 'The notation {@inheritdoc} presented for function "someMyFunction", but it not a method in class/interface.',
'source' => 'FiveLab.Commenting.Inheritdoc.Missed',
],
],
];
}
}