@@ -33,7 +33,7 @@ public function testGlobTypeMapper()
33
33
34
34
$ cache = new ArrayCache ();
35
35
36
- $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Types ' , $ typeGenerator , $ inputTypeGenerator , $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ cache );
36
+ $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Types ' , $ typeGenerator , $ inputTypeGenerator , $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ this -> getLockFactory (), $ cache );
37
37
38
38
$ this ->assertSame ([TestObject::class], $ mapper ->getSupportedClasses ());
39
39
$ this ->assertTrue ($ mapper ->canMapClassToType (TestObject::class));
@@ -43,7 +43,7 @@ public function testGlobTypeMapper()
43
43
$ this ->assertFalse ($ mapper ->canMapNameToType ('NotExists ' ));
44
44
45
45
// Again to test cache
46
- $ anotherMapperSameCache = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Types ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ cache );
46
+ $ anotherMapperSameCache = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Types ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ this -> getLockFactory (), $ cache );
47
47
$ this ->assertTrue ($ anotherMapperSameCache ->canMapClassToType (TestObject::class));
48
48
$ this ->assertTrue ($ anotherMapperSameCache ->canMapNameToType ('Foo ' ));
49
49
@@ -61,7 +61,7 @@ public function testGlobTypeMapperDuplicateTypesException()
61
61
62
62
$ typeGenerator = $ this ->getTypeGenerator ();
63
63
64
- $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\DuplicateTypes ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), new NullCache ());
64
+ $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\DuplicateTypes ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ this -> getLockFactory (), new NullCache ());
65
65
66
66
$ this ->expectException (DuplicateMappingException::class);
67
67
$ mapper ->canMapClassToType (TestType::class);
@@ -77,7 +77,7 @@ public function testGlobTypeMapperDuplicateInputTypesException()
77
77
78
78
$ typeGenerator = $ this ->getTypeGenerator ();
79
79
80
- $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\DuplicateInputTypes ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), new NullCache ());
80
+ $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\DuplicateInputTypes ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ this -> getLockFactory (), new NullCache ());
81
81
82
82
$ this ->expectException (DuplicateMappingException::class);
83
83
$ this ->expectExceptionMessage ('The class \'TheCodingMachine\GraphQLite\Fixtures\TestObject \' should be mapped to only one GraphQL Input type. Two methods are pointing via the @Factory annotation to this class: \'TheCodingMachine\GraphQLite\Fixtures\DuplicateInputTypes\TestFactory::myFactory \' and \'TheCodingMachine\GraphQLite\Fixtures\DuplicateInputTypes\TestFactory2::myFactory \'' );
@@ -94,7 +94,7 @@ public function testGlobTypeMapperClassNotFoundException()
94
94
95
95
$ typeGenerator = $ this ->getTypeGenerator ();
96
96
97
- $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\BadClassType ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), new NullCache ());
97
+ $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\BadClassType ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ this -> getLockFactory (), new NullCache ());
98
98
99
99
$ this ->expectException (ClassNotFoundException::class);
100
100
$ this ->expectExceptionMessage ("Could not autoload class 'Foobar' defined in @Type annotation of class 'TheCodingMachine \\GraphQLite \\Fixtures \\BadClassType \\TestType' " );
@@ -111,7 +111,7 @@ public function testGlobTypeMapperNameNotFoundException()
111
111
112
112
$ typeGenerator = $ this ->getTypeGenerator ();
113
113
114
- $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Types ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), new NullCache ());
114
+ $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Types ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ this -> getLockFactory (), new NullCache ());
115
115
116
116
$ this ->expectException (CannotMapTypeException::class);
117
117
$ mapper ->mapNameToType ('NotExists ' , $ this ->getTypeMapper ());
@@ -132,7 +132,7 @@ public function testGlobTypeMapperInputType()
132
132
133
133
$ cache = new ArrayCache ();
134
134
135
- $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Types ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ cache );
135
+ $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Types ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ this -> getLockFactory (), $ cache );
136
136
137
137
$ this ->assertTrue ($ mapper ->canMapClassToInputType (TestObject::class));
138
138
@@ -141,7 +141,7 @@ public function testGlobTypeMapperInputType()
141
141
$ this ->assertSame ('TestObjectInput ' , $ inputType ->name );
142
142
143
143
// Again to test cache
144
- $ anotherMapperSameCache = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Types ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ cache );
144
+ $ anotherMapperSameCache = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Types ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ this -> getLockFactory (), $ cache );
145
145
146
146
$ this ->assertTrue ($ anotherMapperSameCache ->canMapClassToInputType (TestObject::class));
147
147
$ this ->assertSame ('TestObjectInput ' , $ anotherMapperSameCache ->mapClassToInputType (TestObject::class, $ this ->getTypeMapper ())->name );
@@ -167,7 +167,7 @@ public function testGlobTypeMapperExtend()
167
167
168
168
$ cache = new ArrayCache ();
169
169
170
- $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Types ' , $ typeGenerator , $ inputTypeGenerator , $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ cache );
170
+ $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Types ' , $ typeGenerator , $ inputTypeGenerator , $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ this -> getLockFactory (), $ cache );
171
171
172
172
$ type = $ mapper ->mapClassToType (TestObject::class, null , $ this ->getTypeMapper ());
173
173
@@ -178,7 +178,7 @@ public function testGlobTypeMapperExtend()
178
178
$ this ->assertFalse ($ mapper ->canExtendTypeForName ('NotExists ' , $ type , $ this ->getTypeMapper ()));
179
179
180
180
// Again to test cache
181
- $ anotherMapperSameCache = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Types ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ cache );
181
+ $ anotherMapperSameCache = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Types ' , $ typeGenerator , $ this ->getInputTypeGenerator (), $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ this -> getLockFactory (), $ cache );
182
182
$ this ->assertTrue ($ anotherMapperSameCache ->canExtendTypeForClass (TestObject::class, $ type , $ this ->getTypeMapper ()));
183
183
$ this ->assertTrue ($ anotherMapperSameCache ->canExtendTypeForName ('TestObject ' , $ type , $ this ->getTypeMapper ()));
184
184
@@ -195,7 +195,7 @@ public function testEmptyGlobTypeMapper()
195
195
196
196
$ cache = new ArrayCache ();
197
197
198
- $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Integration\Controllers ' , $ typeGenerator , $ inputTypeGenerator , $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ cache );
198
+ $ mapper = new GlobTypeMapper ('TheCodingMachine\GraphQLite\Fixtures\Integration\Controllers ' , $ typeGenerator , $ inputTypeGenerator , $ this ->getInputTypeUtils (), $ container , new \TheCodingMachine \GraphQLite \AnnotationReader (new AnnotationReader ()), new NamingStrategy (), $ this -> getLockFactory (), $ cache );
199
199
200
200
$ this ->assertSame ([], $ mapper ->getSupportedClasses ());
201
201
}
0 commit comments