Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
This is done in a single test, because if you reset the Type without resetting the rest
it will result in different standard types.
  • Loading branch information
ruudk committed Nov 12, 2024
1 parent a27291a commit 457b23c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/ResetTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php declare(strict_types=1);

namespace GraphQL\Tests;

use GraphQL\Type\Definition\Directive;
use GraphQL\Type\Definition\Type;
use GraphQL\Type\Introspection;
use PHPUnit\Framework\TestCase;

final class ResetTest extends TestCase
{
public function testReset(): void
{
$string = Type::string();
$schema = Introspection::_schema();
$directives = Directive::getInternalDirectives();

Type::reset();
Introspection::reset();
Directive::reset();

self::assertNotSame($string, Type::string());
self::assertNotSame($schema, Introspection::_schema());
self::assertNotSame($directives, Directive::getInternalDirectives());
}
}

0 comments on commit 457b23c

Please sign in to comment.