From 38b1b894303d9ed980473c1a029757f044a81092 Mon Sep 17 00:00:00 2001 From: Chris Nissen Date: Wed, 2 Aug 2023 09:12:07 +0200 Subject: [PATCH] fix: Improve schema testing a bit by providing a readable message with a reference to the failed schema --- .../thunder_gqls/tests/src/Traits/ThunderGqlsTestTrait.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/thunder_gqls/tests/src/Traits/ThunderGqlsTestTrait.php b/modules/thunder_gqls/tests/src/Traits/ThunderGqlsTestTrait.php index 1608ed543..75dca16a5 100644 --- a/modules/thunder_gqls/tests/src/Traits/ThunderGqlsTestTrait.php +++ b/modules/thunder_gqls/tests/src/Traits/ThunderGqlsTestTrait.php @@ -29,7 +29,11 @@ protected function runAndTestQuery(string $schema): void { $expectedData = $this->jsonDecode($this->getExpectedResponseFromFile($schema))['data']; - $this->assertEqualsCanonicalizing($expectedData, $responseData); + $this->assertEqualsCanonicalizing( + $expectedData, + $responseData, + 'The expected schema for "' . $schema . '" did not match the result.' + ); } /**