Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Nov 13, 2024
1 parent 05069b3 commit 14c4bd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/Type/Definition/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ public function jsonSerialize(): string

public static function reset(): void
{
static::$standardTypes = null;
static::$builtInTypes = null;

Introspection::reset();
Expand Down
11 changes: 10 additions & 1 deletion tests/Type/StandardTypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,25 @@
use GraphQL\Type\Definition\CustomScalarType;
use GraphQL\Type\Definition\Directive;
use GraphQL\Type\Definition\ObjectType;
use GraphQL\Type\Definition\ScalarType;
use GraphQL\Type\Definition\Type;
use GraphQL\Type\Introspection;
use PHPUnit\Framework\TestCase;

final class StandardTypesTest extends TestCase
{
/** @var array<string, ScalarType> */
private static array $originalStandardTypes;

public static function setUpBeforeClass(): void
{
self::$originalStandardTypes = Type::getStandardTypes();
}

public function tearDown(): void
{
parent::tearDown();
Type::reset();
Type::overrideStandardTypes(self::$originalStandardTypes);
}

public function testAllowsOverridingStandardTypes(): void
Expand Down

0 comments on commit 14c4bd2

Please sign in to comment.