File tree Expand file tree Collapse file tree 4 files changed +24
-17
lines changed Expand file tree Collapse file tree 4 files changed +24
-17
lines changed Original file line number Diff line number Diff line change 1
1
parameters:
2
2
# TODO increase to max
3
- level: 3
3
+ level: 4
4
4
5
5
inferPrivatePropertyTypeFromConstructor: true
6
6
@@ -37,6 +37,10 @@ parameters:
37
37
# TODO convert to less magical code
38
38
- "~Variable method call on static\\(GraphQL\\\\Server\\\\ServerConfig\\)~"
39
39
40
+ # PHPStan does not play nicely with markTestSkipped()
41
+ - message: "~Unreachable statement - code above always terminates~"
42
+ path: tests
43
+
40
44
includes:
41
45
- phpstan-baseline.neon
42
46
Original file line number Diff line number Diff line change 12
12
13
13
use function uniqid ;
14
14
15
- class SyncPromiseTest extends TestCaseBase
15
+ class SyncPromiseTestTestCaseBase extends TestCaseBase
16
16
{
17
17
public function getFulfilledPromiseResolveData ()
18
18
{
Original file line number Diff line number Diff line change 11
11
use GraphQL \Language \AST \Node ;
12
12
use GraphQL \Language \AST \NodeKind ;
13
13
use GraphQL \Language \AST \NodeList ;
14
- use GraphQL \Language \AST \ObjectTypeDefinitionNode ;
15
14
use GraphQL \Language \AST \OperationDefinitionNode ;
16
15
use GraphQL \Language \AST \SelectionSetNode ;
17
16
use GraphQL \Language \AST \StringValueNode ;
@@ -729,38 +728,38 @@ public function testParsesNestedTypes(): void
729
728
730
729
public function testPartiallyParsesSource (): void
731
730
{
732
- self ::assertInstanceOf (
733
- NameNode::class ,
734
- Parser::name ('Foo ' )
731
+ self ::assertSame (
732
+ ' Foo ' ,
733
+ Parser::name ('Foo ' )-> value
735
734
);
736
735
737
- self ::assertInstanceOf (
738
- ObjectTypeDefinitionNode::class ,
739
- Parser::objectTypeDefinition ('type Foo { name: String } ' )
736
+ self ::assertSame (
737
+ ' Foo ' ,
738
+ Parser::objectTypeDefinition ('type Foo { name: String } ' )-> name -> value
740
739
);
741
740
742
741
self ::assertInstanceOf (
743
742
VariableNode::class,
744
743
Parser::valueLiteral ('$foo ' )
745
744
);
746
745
747
- self ::assertInstanceOf (
748
- NodeList::class ,
746
+ self ::assertCount (
747
+ 1 ,
749
748
Parser::argumentsDefinition ('(foo: Int!) ' )
750
749
);
751
750
752
- self ::assertInstanceOf (
753
- NodeList::class ,
751
+ self ::assertCount (
752
+ 2 ,
754
753
Parser::directiveLocations ('| INPUT_OBJECT | OBJECT ' )
755
754
);
756
755
757
- self ::assertInstanceOf (
758
- NodeList::class ,
756
+ self ::assertCount (
757
+ 2 ,
759
758
Parser::implementsInterfaces ('implements Foo & Bar ' )
760
759
);
761
760
762
- self ::assertInstanceOf (
763
- NodeList::class ,
761
+ self ::assertCount (
762
+ 2 ,
764
763
Parser::unionMemberTypes ('= | Foo | Bar ' )
765
764
);
766
765
Original file line number Diff line number Diff line change 8
8
9
9
abstract class TestCaseBase extends TestCase
10
10
{
11
+ /**
12
+ * Useful to test code with no observable behaviour other than not crashing.
13
+ */
11
14
public static function assertDidNotCrash (): void
12
15
{
16
+ // @phpstan-ignore-next-line this truism is required to prevent a PHPUnit warning
13
17
self ::assertTrue (true );
14
18
}
15
19
}
You can’t perform that action at this time.
0 commit comments