From 9b50d119734230751c603abe6f2a723794b7aa01 Mon Sep 17 00:00:00 2001 From: Konstantin Babushkin Date: Fri, 20 Sep 2024 08:21:39 +0200 Subject: [PATCH] assert actual hash value in `DocumentASTTest::testParsesSimpleSchema` --- tests/Unit/Schema/AST/DocumentASTTest.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/Unit/Schema/AST/DocumentASTTest.php b/tests/Unit/Schema/AST/DocumentASTTest.php index c965847a5..f2c36174e 100644 --- a/tests/Unit/Schema/AST/DocumentASTTest.php +++ b/tests/Unit/Schema/AST/DocumentASTTest.php @@ -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