Skip to content

Commit

Permalink
assert actual hash value in DocumentASTTest::testParsesSimpleSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
k0ka committed Sep 20, 2024
1 parent 289f80a commit 9b50d11
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/Unit/Schema/AST/DocumentASTTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,21 @@ final class DocumentASTTest extends TestCase
{
public function testParsesSimpleSchema(): void
{
$documentAST = DocumentAST::fromSource(/** @lang GraphQL */ '
$schema = /** @lang GraphQL */ '
type Query {
foo: Int
}
');
';
// calculated as hash('sha256', $schema)
$schemaHash = "99fd7bd3f58a98d8932c1f5d1da718707f6f471e93d96e0bc913436445a947ac";
$documentAST = DocumentAST::fromSource($schema);

$this->assertInstanceOf(
ObjectTypeDefinitionNode::class,
$documentAST->types[RootType::QUERY],
);

$this->assertNotNull($documentAST->hash);
$this->assertSame($schemaHash, $documentAST->hash);
}

public function testThrowsOnInvalidSchema(): void
Expand Down

0 comments on commit 9b50d11

Please sign in to comment.