5
5
6
6
7
7
use Doctrine \Common \Annotations \AnnotationReader ;
8
- use GraphQL \Error \Debug ;
8
+ use GraphQL \Error \DebugFlag ;
9
9
use GraphQL \GraphQL ;
10
10
use GraphQL \Type \Schema ;
11
11
use Mouf \Picotainer \Picotainer ;
12
12
use PHPUnit \Framework \TestCase ;
13
13
use Psr \Container \ContainerInterface ;
14
14
use Symfony \Component \Cache \Adapter \ArrayAdapter ;
15
- use Symfony \Component \Cache \Adapter \Psr16Adapter ;
16
15
use Symfony \Component \Cache \Psr16Cache ;
17
- use Symfony \Component \Cache \Simple \ArrayCache ;
18
16
use Symfony \Component \Translation \Translator ;
19
17
use Symfony \Component \Validator \ContainerConstraintValidatorFactory ;
20
18
use Symfony \Component \Validator \Validator \ValidatorInterface ;
21
19
use Symfony \Component \Validator \ValidatorBuilder ;
22
20
use Symfony \Contracts \Translation \TranslatorInterface ;
23
21
use TheCodingMachine \GraphQLite \Containers \BasicAutoWiringContainer ;
24
- use TheCodingMachine \GraphQLite \Containers \EmptyContainer ;
25
22
use TheCodingMachine \GraphQLite \Exceptions \WebonyxErrorHandler ;
26
23
use TheCodingMachine \GraphQLite \SchemaFactory ;
27
24
use TheCodingMachine \GraphQLite \Validator \Fixtures \Controllers \UserController ;
28
25
use TheCodingMachine \GraphQLite \Validator \Mappers \Parameters \AssertParameterMiddleware ;
29
26
use TheCodingMachine \GraphQLite \Validator \Mappers \Parameters \InvalidAssertionAnnotationException ;
30
- use function var_dump ;
31
- use function var_export ;
32
- use const JSON_PRETTY_PRINT ;
33
27
34
28
class IntegrationTest extends TestCase
35
29
{
@@ -83,7 +77,7 @@ public function testEndToEndThrowException(): void
83
77
$ result ->setErrorsHandler ([WebonyxErrorHandler::class, 'errorHandler ' ]);
84
78
$ result ->setErrorFormatter ([WebonyxErrorHandler::class, 'errorFormatter ' ]);
85
79
86
- $ errors = $ result ->toArray (Debug ::RETHROW_UNSAFE_EXCEPTIONS )['errors ' ];
80
+ $ errors = $ result ->toArray (DebugFlag ::RETHROW_UNSAFE_EXCEPTIONS )['errors ' ];
87
81
$ this ->assertSame ('The email \'"foofgdjkerbrtehrthjker.com" \' is not a valid email. ' , $ errors [0 ]['message ' ]);
88
82
$ this ->assertSame ('email ' , $ errors [0 ]['extensions ' ]['field ' ]);
89
83
$ this ->assertSame ('Validate ' , $ errors [0 ]['extensions ' ]['category ' ]);
@@ -112,7 +106,7 @@ public function testEndToEndAssert(): void
112
106
$ result ->setErrorsHandler ([WebonyxErrorHandler::class, 'errorHandler ' ]);
113
107
$ result ->setErrorFormatter ([WebonyxErrorHandler::class, 'errorFormatter ' ]);
114
108
115
- $ errors = $ result ->toArray (Debug ::RETHROW_UNSAFE_EXCEPTIONS )['errors ' ];
109
+ $ errors = $ result ->toArray (DebugFlag ::RETHROW_UNSAFE_EXCEPTIONS )['errors ' ];
116
110
117
111
// TODO: find why message is not in French...
118
112
$ this ->assertSame ('This value is not a valid email address. ' , $ errors [0 ]['message ' ]);
@@ -135,7 +129,7 @@ public function testEndToEndAssert(): void
135
129
$ result ->setErrorsHandler ([WebonyxErrorHandler::class, 'errorHandler ' ]);
136
130
$ result ->setErrorFormatter ([WebonyxErrorHandler::class, 'errorFormatter ' ]);
137
131
138
- $ data = $ result ->toArray (Debug ::RETHROW_UNSAFE_EXCEPTIONS )['data ' ];
132
+ $ data = $ result ->toArray (DebugFlag ::RETHROW_UNSAFE_EXCEPTIONS )['data ' ];
139
133
$ this ->
assertSame (
'[email protected] ' ,
$ data[
'findByMail ' ][
'email ' ]);
140
134
141
135
// Test default parameter
@@ -154,7 +148,7 @@ public function testEndToEndAssert(): void
154
148
$ result ->setErrorsHandler ([WebonyxErrorHandler::class, 'errorHandler ' ]);
155
149
$ result ->setErrorFormatter ([WebonyxErrorHandler::class, 'errorFormatter ' ]);
156
150
157
- $ data = $ result ->toArray (Debug ::RETHROW_UNSAFE_EXCEPTIONS )['data ' ];
151
+ $ data = $ result ->toArray (DebugFlag ::RETHROW_UNSAFE_EXCEPTIONS )['data ' ];
158
152
$ this ->
assertSame (
'[email protected] ' ,
$ data[
'findByMail ' ][
'email ' ]);
159
153
160
154
}
0 commit comments