From 2f905284323b24e06ca853370acb3e02df13561e Mon Sep 17 00:00:00 2001 From: Ta5r Date: Tue, 24 Sep 2024 19:46:52 +0530 Subject: [PATCH] chore : cleanup the redundant tests --- tests/unit/CoreQuoteTest.php | 72 +----------------------------------- 1 file changed, 1 insertion(+), 71 deletions(-) diff --git a/tests/unit/CoreQuoteTest.php b/tests/unit/CoreQuoteTest.php index ae54ff53..5703f0ca 100644 --- a/tests/unit/CoreQuoteTest.php +++ b/tests/unit/CoreQuoteTest.php @@ -280,19 +280,8 @@ public function test_retrieve_core_quote_layout_attributes(): void { } } attributes { - anchor - backgroundColor - citation - className - cssClassName - fontFamily - fontSize - gradient layout - lock # metadata - style - textColor value } } @@ -317,6 +306,7 @@ className } } '; + $variables = [ 'id' => $this->post_id, ]; @@ -333,31 +323,7 @@ className // Verify the block data. $block = $actual['data']['post']['editorBlocks'][0]; - $this->assertNotEmpty( $block['apiVersion'], 'The apiVersion should be present' ); - $this->assertEquals( 'text', $block['blockEditorCategoryName'], 'The blockEditorCategoryName should be text' ); - $this->assertNotEmpty( $block['clientId'], 'The clientId should be present' ); - - $this->assertNotEmpty( $block['innerBlocks'], 'There should be no inner blocks' ); - $this->assertEquals( 1, count( $block['innerBlocks'] ), 'There should be only one inner block' ); - $this->assertEquals( 'core/paragraph', $block['innerBlocks'][0]['name'], 'The inner block name should be core/paragraph' ); - $this->assertEquals( 'core/quote', $block['name'], 'The block name should be core/quote' ); - $this->assertEmpty( $block['parentClientId'], 'There should be no parentClientId' ); - $this->assertNotEmpty( $block['renderedHtml'], 'The renderedHtml should be present' ); - - unset( $block['attributes']['citation'] ); // Tested above. - unset( $block['attributes']['className'] ); // Tested above. - unset( $block['attributes']['cssClassName'] ); // Tested above. - - unset( $block['attributes']['anchor'] ); // Tested above. - unset( $block['attributes']['backgroundColor'] ); // Tested above. - unset( $block['attributes']['fontFamily'] ); // Tested above. - unset( $block['attributes']['fontSize'] ); // Tested above. - unset( $block['attributes']['gradient'] ); // Tested above. - unset( $block['attributes']['lock'] ); // Tested above. - unset( $block['attributes']['style'] ); // Tested above. - unset( $block['attributes']['textColor'] ); // Tested above. - // Verify the attributes. $this->assertEquals( @@ -409,20 +375,9 @@ public function test_retrieve_core_quote_text_align_attributes(): void { } } attributes { - anchor - backgroundColor - citation - className - cssClassName - fontFamily - fontSize - gradient layout - lock # metadata - style textAlign - textColor value } } @@ -462,32 +417,7 @@ className // Verify the block data. $block = $actual['data']['post']['editorBlocks'][0]; - - $this->assertNotEmpty( $block['apiVersion'], 'The apiVersion should be present' ); - $this->assertEquals( 'text', $block['blockEditorCategoryName'], 'The blockEditorCategoryName should be text' ); - $this->assertNotEmpty( $block['clientId'], 'The clientId should be present' ); - - $this->assertNotEmpty( $block['innerBlocks'], 'There should be no inner blocks' ); - $this->assertEquals( 1, count( $block['innerBlocks'] ), 'There should be only one inner block' ); - $this->assertEquals( 'core/paragraph', $block['innerBlocks'][0]['name'], 'The inner block name should be core/paragraph' ); - $this->assertEquals( 'core/quote', $block['name'], 'The block name should be core/quote' ); - $this->assertEmpty( $block['parentClientId'], 'There should be no parentClientId' ); - $this->assertNotEmpty( $block['renderedHtml'], 'The renderedHtml should be present' ); - - unset( $block['attributes']['citation'] ); // Tested above. - unset( $block['attributes']['className'] ); // Tested above. - unset( $block['attributes']['cssClassName'] ); // Tested above. - - unset( $block['attributes']['anchor'] ); // Tested above. - unset( $block['attributes']['backgroundColor'] ); // Tested above. - unset( $block['attributes']['fontFamily'] ); // Tested above. - unset( $block['attributes']['fontSize'] ); // Tested above. - unset( $block['attributes']['gradient'] ); // Tested above. - unset( $block['attributes']['lock'] ); // Tested above. - unset( $block['attributes']['style'] ); // Tested above. - unset( $block['attributes']['textColor'] ); // Tested above. - // Verify the attributes. $this->assertEquals(