Skip to content

Commit 0f20196

Browse files
authoredSep 7, 2022
PHP Tests: Try removing registry from WP_Block constructor calls (#43927)
1 parent ccc0d51 commit 0f20196

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎phpunit/blocks/render-block-navigation-test.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function test_block_core_navigation_get_post_ids_from_block() {
2121
);
2222
$parsed_block = $parsed_blocks[0];
2323
$context = array();
24-
$block = new WP_Block( $parsed_block, $context, $this->registry );
24+
$block = new WP_Block( $parsed_block, $context );
2525

2626
$post_ids = gutenberg_block_core_navigation_from_block_get_post_ids( $block );
2727
$this->assertSameSets( array( 755 ), $post_ids );
@@ -46,7 +46,7 @@ public function test_block_core_navigation_get_post_ids_from_block_nested() {
4646
);
4747
$parsed_block = $parsed_blocks[0];
4848
$context = array();
49-
$block = new WP_Block( $parsed_block, $context, $this->registry );
49+
$block = new WP_Block( $parsed_block, $context );
5050

5151
$post_ids = gutenberg_block_core_navigation_from_block_get_post_ids( $block );
5252
$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(
5959
$parsed_blocks = parse_blocks( '<!-- wp:navigation-submenu {"label":"Test","type":"post","id":789,"url":"http://localhost/blog/test-3","kind":"post-type","isTopLevelItem":true} -->\n<!-- wp:navigation-link {"label":"(no title)","type":"post","id":755,"url":"http://localhost/blog/755","kind":"post-type","isTopLevelLink":false} /-->\n<!-- /wp:navigation-submenu -->' );
6060
$parsed_block = $parsed_blocks[0];
6161
$context = array();
62-
$block = new WP_Block( $parsed_block, $context, $this->registry );
62+
$block = new WP_Block( $parsed_block, $context );
6363

6464
$post_ids = gutenberg_block_core_navigation_from_block_get_post_ids( $block );
6565
$this->assertSameSetsWithIndex( array( 755, 789 ), $post_ids );

‎phpunit/blocks/render-comments-test.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function test_render_block_core_comments_empty_output_if_comments_disable
3838
);
3939
$parsed_block = $parsed_blocks[0];
4040
$context = array( 'postId' => self::$post_with_comments_disabled->ID );
41-
$block = new WP_Block( $parsed_block, $context, $this->registry );
41+
$block = new WP_Block( $parsed_block, $context );
4242

4343
$rendered = gutenberg_render_block_core_comments( $attributes, '', $block );
4444
$this->assertEmpty( $rendered );

0 commit comments

Comments
 (0)