File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace mglaman \PHPStanDrupal \Tests ;
6
+
7
+ use PHPStan \Analyser \Error ;
8
+ use PHPStan \PhpDoc \StubFilesProvider ;
9
+ use PHPStan \PhpDoc \StubValidator ;
10
+ use PHPStan \Testing \PHPStanTestCase ;
11
+
12
+ final class StubTest extends PHPStanTestCase
13
+ {
14
+ use AdditionalConfigFilesTrait;
15
+
16
+ public function testValid (): void {
17
+ $ projectStubFiles = self ::getContainer ()
18
+ ->getByType (StubFilesProvider::class)
19
+ ->getProjectStubFiles ();
20
+ $ stubErrors = self ::getContainer ()
21
+ ->getByType (StubValidator::class)
22
+ ->validate ($ projectStubFiles , true );
23
+ $ errorsAsArrays = array_map (
24
+ static fn (Error $ error ) => $ error ->jsonSerialize (),
25
+ $ stubErrors
26
+ );
27
+ self ::assertEquals (
28
+ [],
29
+ $ errorsAsArrays ,
30
+ var_export ($ errorsAsArrays , true )
31
+ );
32
+ }
33
+
34
+ }
You can’t perform that action at this time.
0 commit comments