55
66
77use Doctrine \Common \Annotations \AnnotationReader ;
8- use GraphQL \Error \Debug ;
8+ use GraphQL \Error \DebugFlag ;
99use GraphQL \GraphQL ;
1010use GraphQL \Type \Schema ;
1111use Mouf \Picotainer \Picotainer ;
1212use PHPUnit \Framework \TestCase ;
1313use Psr \Container \ContainerInterface ;
1414use Symfony \Component \Cache \Adapter \ArrayAdapter ;
15- use Symfony \Component \Cache \Adapter \Psr16Adapter ;
1615use Symfony \Component \Cache \Psr16Cache ;
17- use Symfony \Component \Cache \Simple \ArrayCache ;
1816use Symfony \Component \Translation \Translator ;
1917use Symfony \Component \Validator \ContainerConstraintValidatorFactory ;
2018use Symfony \Component \Validator \Validator \ValidatorInterface ;
2119use Symfony \Component \Validator \ValidatorBuilder ;
2220use Symfony \Contracts \Translation \TranslatorInterface ;
2321use TheCodingMachine \GraphQLite \Containers \BasicAutoWiringContainer ;
24- use TheCodingMachine \GraphQLite \Containers \EmptyContainer ;
2522use TheCodingMachine \GraphQLite \Exceptions \WebonyxErrorHandler ;
2623use TheCodingMachine \GraphQLite \SchemaFactory ;
2724use TheCodingMachine \GraphQLite \Validator \Fixtures \Controllers \UserController ;
2825use TheCodingMachine \GraphQLite \Validator \Mappers \Parameters \AssertParameterMiddleware ;
2926use TheCodingMachine \GraphQLite \Validator \Mappers \Parameters \InvalidAssertionAnnotationException ;
30- use function var_dump ;
31- use function var_export ;
32- use const JSON_PRETTY_PRINT ;
3327
3428class IntegrationTest extends TestCase
3529{
@@ -83,7 +77,7 @@ public function testEndToEndThrowException(): void
8377 $ result ->setErrorsHandler ([WebonyxErrorHandler::class, 'errorHandler ' ]);
8478 $ result ->setErrorFormatter ([WebonyxErrorHandler::class, 'errorFormatter ' ]);
8579
86- $ errors = $ result ->toArray (Debug ::RETHROW_UNSAFE_EXCEPTIONS )['errors ' ];
80+ $ errors = $ result ->toArray (DebugFlag ::RETHROW_UNSAFE_EXCEPTIONS )['errors ' ];
8781 $ this ->assertSame ('The email \'"foofgdjkerbrtehrthjker.com" \' is not a valid email. ' , $ errors [0 ]['message ' ]);
8882 $ this ->assertSame ('email ' , $ errors [0 ]['extensions ' ]['field ' ]);
8983 $ this ->assertSame ('Validate ' , $ errors [0 ]['extensions ' ]['category ' ]);
@@ -112,7 +106,7 @@ public function testEndToEndAssert(): void
112106 $ result ->setErrorsHandler ([WebonyxErrorHandler::class, 'errorHandler ' ]);
113107 $ result ->setErrorFormatter ([WebonyxErrorHandler::class, 'errorFormatter ' ]);
114108
115- $ errors = $ result ->toArray (Debug ::RETHROW_UNSAFE_EXCEPTIONS )['errors ' ];
109+ $ errors = $ result ->toArray (DebugFlag ::RETHROW_UNSAFE_EXCEPTIONS )['errors ' ];
116110
117111 // TODO: find why message is not in French...
118112 $ this ->assertSame ('This value is not a valid email address. ' , $ errors [0 ]['message ' ]);
@@ -135,7 +129,7 @@ public function testEndToEndAssert(): void
135129 $ result ->setErrorsHandler ([WebonyxErrorHandler::class, 'errorHandler ' ]);
136130 $ result ->setErrorFormatter ([WebonyxErrorHandler::class, 'errorFormatter ' ]);
137131
138- $ data = $ result ->toArray (Debug ::RETHROW_UNSAFE_EXCEPTIONS )['data ' ];
132+ $ data = $ result ->toArray (DebugFlag ::RETHROW_UNSAFE_EXCEPTIONS )['data ' ];
139133 $ this ->
assertSame (
'[email protected] ' ,
$ data[
'findByMail ' ][
'email ' ]);
140134
141135 // Test default parameter
@@ -154,7 +148,7 @@ public function testEndToEndAssert(): void
154148 $ result ->setErrorsHandler ([WebonyxErrorHandler::class, 'errorHandler ' ]);
155149 $ result ->setErrorFormatter ([WebonyxErrorHandler::class, 'errorFormatter ' ]);
156150
157- $ data = $ result ->toArray (Debug ::RETHROW_UNSAFE_EXCEPTIONS )['data ' ];
151+ $ data = $ result ->toArray (DebugFlag ::RETHROW_UNSAFE_EXCEPTIONS )['data ' ];
158152 $ this ->
assertSame (
'[email protected] ' ,
$ data[
'findByMail ' ][
'email ' ]);
159153
160154 }
0 commit comments