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 22
33namespace GraphQL \Validator ;
44
5- use GraphQL \GraphQL ;
65use GraphQL \Language \AST \DocumentNode ;
76use GraphQL \Type \Schema ;
87
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 88use GraphQL \Language \AST \DocumentNode ;
99use GraphQL \Tests \Executor \TestClasses \Cat ;
1010use GraphQL \Tests \Executor \TestClasses \Dog ;
11+ use GraphQL \Tests \Executor \TestClasses \SpyValidationCacheAdapter ;
1112use GraphQL \Tests \PsrValidationCacheAdapter ;
1213use GraphQL \Type \Definition \InterfaceType ;
1314use GraphQL \Type \Definition \ObjectType ;
1718use Symfony \Component \Cache \Adapter \ArrayAdapter ;
1819use Symfony \Component \Cache \Psr16Cache ;
1920
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-
3921final class ValidationWithCacheTest extends TestCase
4022{
4123 use ArraySubsetAsserts;
You can’t perform that action at this time.
0 commit comments