From af21213de7f0a70bf02bd9a6a9c34b1ffa26da2b Mon Sep 17 00:00:00 2001 From: David Levine Date: Sun, 15 Sep 2024 19:41:28 +0000 Subject: [PATCH] chore: cleanup --- tests/unit/CoreHeadingTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/unit/CoreHeadingTest.php b/tests/unit/CoreHeadingTest.php index f992b241..3ca5e058 100644 --- a/tests/unit/CoreHeadingTest.php +++ b/tests/unit/CoreHeadingTest.php @@ -15,12 +15,16 @@ public function setUp(): void { 'post_status' => 'publish', ] ); + + \WPGraphQL::clear_schema(); } public function tearDown(): void { parent::tearDown(); wp_delete_post( $this->post_id, true ); + + \WPGraphQL::clear_schema(); } public function query(): string { @@ -95,8 +99,6 @@ public function test_retrieve_core_heading_attributes() { $actual = graphql( compact( 'query', 'variables' ) ); - error_log( print_r( $actual, true ) ); - $this->assertArrayNotHasKey( 'errors', $actual, 'There should not be any errors' ); $this->assertArrayHasKey( 'data', $actual, 'The data key should be present' ); $this->assertArrayHasKey( 'post', $actual['data'], 'The post key should be present' ); @@ -108,7 +110,6 @@ public function test_retrieve_core_heading_attributes() { $this->assertEquals( 1, count( $actual['data']['post']['editorBlocks'] ) ); // Verify the block data. - error_log( print_r( $actual['data']['post']['editorBlocks'][0], true ) ); $this->assertNotEmpty( $actual['data']['post']['editorBlocks'][0]['apiVersion'], 'The apiVersion should be present' ); $this->assertEquals( 'text', $actual['data']['post']['editorBlocks'][0]['blockEditorCategoryName'], 'The blockEditorCategoryName should be text' ); $this->assertNotEmpty( $actual['data']['post']['editorBlocks'][0]['clientId'], 'The clientId should be present' );