File tree Expand file tree Collapse file tree 3 files changed +27
-20
lines changed Expand file tree Collapse file tree 3 files changed +27
-20
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace GraphQL \Validator ;
4
4
5
- use GraphQL \GraphQL ;
6
5
use GraphQL \Language \AST \DocumentNode ;
7
6
use GraphQL \Type \Schema ;
8
7
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+
4
+ namespace GraphQL \Tests \Executor \TestClasses ;
5
+
6
+ use GraphQL \Language \AST \DocumentNode ;
7
+ use GraphQL \Tests \PsrValidationCacheAdapter ;
8
+ use GraphQL \Type \Schema ;
9
+
10
+ final class SpyValidationCacheAdapter extends PsrValidationCacheAdapter
11
+ {
12
+ public int $ isValidatedCalls = 0 ;
13
+ public int $ markValidatedCalls = 0 ;
14
+
15
+ public function isValidated (Schema $ schema , DocumentNode $ ast ): bool
16
+ {
17
+ $ this ->isValidatedCalls ++;
18
+ return parent ::isValidated ($ schema , $ ast );
19
+ }
20
+
21
+ public function markValidated (Schema $ schema , DocumentNode $ ast ): void
22
+ {
23
+ $ this ->markValidatedCalls ++;
24
+ parent ::markValidated ($ schema , $ ast );
25
+ }
26
+ }
Original file line number Diff line number Diff line change 8
8
use GraphQL \Language \AST \DocumentNode ;
9
9
use GraphQL \Tests \Executor \TestClasses \Cat ;
10
10
use GraphQL \Tests \Executor \TestClasses \Dog ;
11
+ use GraphQL \Tests \Executor \TestClasses \SpyValidationCacheAdapter ;
11
12
use GraphQL \Tests \PsrValidationCacheAdapter ;
12
13
use GraphQL \Type \Definition \InterfaceType ;
13
14
use GraphQL \Type \Definition \ObjectType ;
17
18
use Symfony \Component \Cache \Adapter \ArrayAdapter ;
18
19
use Symfony \Component \Cache \Psr16Cache ;
19
20
20
- final class SpyValidationCacheAdapter extends PsrValidationCacheAdapter
21
- {
22
- public int $ isValidatedCalls = 0 ;
23
- public int $ markValidatedCalls = 0 ;
24
-
25
- public function isValidated (Schema $ schema , DocumentNode $ ast ): bool
26
- {
27
- $ this ->isValidatedCalls ++;
28
- return parent ::isValidated ($ schema , $ ast );
29
- }
30
-
31
- public function markValidated (Schema $ schema , DocumentNode $ ast ): void
32
- {
33
- $ this ->markValidatedCalls ++;
34
- parent ::markValidated ($ schema , $ ast );
35
- }
36
- }
37
-
38
-
39
21
final class ValidationWithCacheTest extends TestCase
40
22
{
41
23
use ArraySubsetAsserts;
You can’t perform that action at this time.
0 commit comments