Block Editor: Fix unit tests after new blocks addition.

- Regenerate the REST API fixtures.
 - Remove the block registration hooks in the unit tests.

Refs #46429.


git-svn-id: https://develop.svn.wordpress.org/trunk@44812 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Riad Benguella
2019-03-07 11:53:15 +00:00
parent 0ad7b1a169
commit ccfb76d26f
4 changed files with 169 additions and 1 deletions

View File

@@ -237,8 +237,12 @@ tests_add_filter( 'send_auth_cookies', '__return_false' );
*/
function _unhook_block_registration() {
remove_action( 'init', 'register_block_core_archives' );
remove_action( 'init', 'register_block_core_calendar' );
remove_action( 'init', 'register_block_core_categories' );
remove_action( 'init', 'register_block_core_latest_posts' );
remove_action( 'init', 'register_block_core_rss' );
remove_action( 'init', 'register_block_core_search' );
remove_action( 'init', 'register_block_core_shortcode' );
remove_action( 'init', 'register_block_core_tag_cloud' );
}
tests_add_filter( 'init', '_unhook_block_registration', 1000 );

View File

@@ -122,9 +122,13 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase {
'/wp/v2/block-renderer/(?P<name>core/block)',
'/wp/v2/block-renderer/(?P<name>core/latest-comments)',
'/wp/v2/block-renderer/(?P<name>core/archives)',
'/wp/v2/block-renderer/(?P<name>core/calendar)',
'/wp/v2/block-renderer/(?P<name>core/categories)',
'/wp/v2/block-renderer/(?P<name>core/latest-posts)',
'/wp/v2/block-renderer/(?P<name>core/rss)',
'/wp/v2/block-renderer/(?P<name>core/search)',
'/wp/v2/block-renderer/(?P<name>core/shortcode)',
'/wp/v2/block-renderer/(?P<name>core/tag-cloud)',
'/wp/v2/settings',
'/wp/v2/themes',
);