File tree Expand file tree Collapse file tree 1 file changed +39
-3
lines changed Expand file tree Collapse file tree 1 file changed +39
-3
lines changed Original file line number Diff line number Diff line change 10
10
use App \Value \Violation ;
11
11
use PHPUnit \Framework \TestCase ;
12
12
use Symfony \Component \Filesystem \Filesystem ;
13
+ use Traversable ;
13
14
14
15
/** @covers \App\SniffFinder\FilesystemSniffFinder */
15
16
class FilesystemSniffFinderTest extends TestCase
@@ -27,6 +28,12 @@ public function getSniffs()
27
28
$ this ->writeSniffXml ();
28
29
$ this ->writeViolationXml ();
29
30
31
+ /** @var Traversable $sniffs */
32
+ $ sniffs = $ this ->finder ->getSniffs (
33
+ new Folder (
34
+ 'var/tests/src/Standard/ '
35
+ )
36
+ );
30
37
self ::assertEquals (
31
38
[
32
39
new Sniff (
@@ -46,11 +53,40 @@ public function getSniffs()
46
53
]
47
54
)
48
55
],
49
- iterator_to_array ($ this ->finder ->getSniffs (
56
+ iterator_to_array ($ sniffs )
57
+ );
58
+ }
59
+
60
+ /** @test */
61
+ public function getSniff ()
62
+ {
63
+ $ this ->writeSniffPhp ();
64
+ $ this ->writeSniffXml ();
65
+ $ this ->writeViolationXml ();
66
+
67
+ self ::assertEquals (
68
+ new Sniff (
69
+ 'Standard.Category.My ' ,
70
+ '' ,
71
+ [],
72
+ new Urls ([]),
73
+ 'Description ' ,
74
+ [],
75
+ [
76
+ new Violation (
77
+ 'Standard.Category.My.ErrorCode ' ,
78
+ 'Description ' ,
79
+ [],
80
+ new Urls ([])
81
+ )
82
+ ]
83
+ ),
84
+ $ this ->finder ->getSniff (
50
85
new Folder (
51
86
'var/tests/src/Standard/ '
52
- )
53
- ))
87
+ ),
88
+ self ::PHP_SNIFF_PATH
89
+ )
54
90
);
55
91
}
56
92
You can’t perform that action at this time.
0 commit comments