Skip to content

Commit 60bffe6

Browse files
committed
move to file
1 parent cf20ef3 commit 60bffe6

File tree

3 files changed

+27
-20
lines changed

3 files changed

+27
-20
lines changed

src/Validator/ValidationCache.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace GraphQL\Validator;
44

5-
use GraphQL\GraphQL;
65
use GraphQL\Language\AST\DocumentNode;
76
use GraphQL\Type\Schema;
87

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
}

tests/Executor/ValidationWithCacheTest.php

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use GraphQL\Language\AST\DocumentNode;
99
use GraphQL\Tests\Executor\TestClasses\Cat;
1010
use GraphQL\Tests\Executor\TestClasses\Dog;
11+
use GraphQL\Tests\Executor\TestClasses\SpyValidationCacheAdapter;
1112
use GraphQL\Tests\PsrValidationCacheAdapter;
1213
use GraphQL\Type\Definition\InterfaceType;
1314
use GraphQL\Type\Definition\ObjectType;
@@ -17,25 +18,6 @@
1718
use Symfony\Component\Cache\Adapter\ArrayAdapter;
1819
use 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-
3921
final class ValidationWithCacheTest extends TestCase
4022
{
4123
use ArraySubsetAsserts;

0 commit comments

Comments
 (0)