From 0f20196b638ff3cc8f5746e699778fecbee3fad3 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Wed, 7 Sep 2022 15:15:31 +1000 Subject: [PATCH] PHP Tests: Try removing registry from WP_Block constructor calls (#43927) --- phpunit/blocks/render-block-navigation-test.php | 6 +++--- phpunit/blocks/render-comments-test.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpunit/blocks/render-block-navigation-test.php b/phpunit/blocks/render-block-navigation-test.php index de11fc266107f0..e2eab4b72ca319 100644 --- a/phpunit/blocks/render-block-navigation-test.php +++ b/phpunit/blocks/render-block-navigation-test.php @@ -21,7 +21,7 @@ public function test_block_core_navigation_get_post_ids_from_block() { ); $parsed_block = $parsed_blocks[0]; $context = array(); - $block = new WP_Block( $parsed_block, $context, $this->registry ); + $block = new WP_Block( $parsed_block, $context ); $post_ids = gutenberg_block_core_navigation_from_block_get_post_ids( $block ); $this->assertSameSets( array( 755 ), $post_ids ); @@ -46,7 +46,7 @@ public function test_block_core_navigation_get_post_ids_from_block_nested() { ); $parsed_block = $parsed_blocks[0]; $context = array(); - $block = new WP_Block( $parsed_block, $context, $this->registry ); + $block = new WP_Block( $parsed_block, $context ); $post_ids = gutenberg_block_core_navigation_from_block_get_post_ids( $block ); $this->assertSameSets( array( 40, 60, 10, 20, 30 ), $post_ids ); @@ -59,7 +59,7 @@ public function test_block_core_navigation_get_post_ids_from_block_with_submenu( $parsed_blocks = parse_blocks( '\n\n' ); $parsed_block = $parsed_blocks[0]; $context = array(); - $block = new WP_Block( $parsed_block, $context, $this->registry ); + $block = new WP_Block( $parsed_block, $context ); $post_ids = gutenberg_block_core_navigation_from_block_get_post_ids( $block ); $this->assertSameSetsWithIndex( array( 755, 789 ), $post_ids ); diff --git a/phpunit/blocks/render-comments-test.php b/phpunit/blocks/render-comments-test.php index 112e161ba24b0f..a6930c50c22266 100644 --- a/phpunit/blocks/render-comments-test.php +++ b/phpunit/blocks/render-comments-test.php @@ -38,7 +38,7 @@ public function test_render_block_core_comments_empty_output_if_comments_disable ); $parsed_block = $parsed_blocks[0]; $context = array( 'postId' => self::$post_with_comments_disabled->ID ); - $block = new WP_Block( $parsed_block, $context, $this->registry ); + $block = new WP_Block( $parsed_block, $context ); $rendered = gutenberg_render_block_core_comments( $attributes, '', $block ); $this->assertEmpty( $rendered );