Skip to content

Commit

Permalink
PHP Tests: Try removing registry from WP_Block constructor calls (#43927
Browse files Browse the repository at this point in the history
)
  • Loading branch information
andrewserong authored Sep 7, 2022
1 parent ccc0d51 commit 0f20196
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions phpunit/blocks/render-block-navigation-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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 );
Expand All @@ -59,7 +59,7 @@ public function test_block_core_navigation_get_post_ids_from_block_with_submenu(
$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 -->' );
$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 );
Expand Down
2 changes: 1 addition & 1 deletion phpunit/blocks/render-comments-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 0f20196

Please sign in to comment.