diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 28287e90d5..af65319791 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -549,7 +549,7 @@ function wp_default_packages_inline_scripts( &$scripts ) { ' wp.data', ' .use( wp.data.plugins.persistence, { storageKey: storageKey } )', ' .use( wp.data.plugins.controls );', - ' wp.data.plugins.persistence.__unstableMigrate( { storageKey: storageKey } );', + ' wp.data.plugins.persistence.__unstableMigrate( { storageKey: storageKey } );', '} )();', ) ) diff --git a/tests/phpunit/includes/functions.php b/tests/phpunit/includes/functions.php index d9f1f95cac..cc5469ca4e 100644 --- a/tests/phpunit/includes/functions.php +++ b/tests/phpunit/includes/functions.php @@ -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 ); diff --git a/tests/phpunit/tests/rest-api/rest-schema-setup.php b/tests/phpunit/tests/rest-api/rest-schema-setup.php index 8eb03cb4c2..92219b31da 100644 --- a/tests/phpunit/tests/rest-api/rest-schema-setup.php +++ b/tests/phpunit/tests/rest-api/rest-schema-setup.php @@ -122,9 +122,13 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase { '/wp/v2/block-renderer/(?Pcore/block)', '/wp/v2/block-renderer/(?Pcore/latest-comments)', '/wp/v2/block-renderer/(?Pcore/archives)', + '/wp/v2/block-renderer/(?Pcore/calendar)', '/wp/v2/block-renderer/(?Pcore/categories)', '/wp/v2/block-renderer/(?Pcore/latest-posts)', + '/wp/v2/block-renderer/(?Pcore/rss)', + '/wp/v2/block-renderer/(?Pcore/search)', '/wp/v2/block-renderer/(?Pcore/shortcode)', + '/wp/v2/block-renderer/(?Pcore/tag-cloud)', '/wp/v2/settings', '/wp/v2/themes', ); diff --git a/tests/qunit/fixtures/wp-api-generated.js b/tests/qunit/fixtures/wp-api-generated.js index 7e18cb0104..2ad1feb047 100644 --- a/tests/qunit/fixtures/wp-api-generated.js +++ b/tests/qunit/fixtures/wp-api-generated.js @@ -4410,6 +4410,46 @@ mockedApiResponse.Schema = { } ] }, + "/wp/v2/block-renderer/(?Pcore/calendar)": { + "namespace": "wp/v2", + "methods": [ + "GET" + ], + "endpoints": [ + { + "methods": [ + "GET" + ], + "args": { + "name": { + "required": false, + "description": "Unique registered name for the block.", + "type": "string" + }, + "context": { + "required": false, + "default": "view", + "enum": [ + "edit" + ], + "description": "Scope under which the request is made; determines fields present in response.", + "type": "string" + }, + "attributes": { + "required": false, + "default": [], + "description": "Attributes for core/calendar block", + "type": "object" + }, + "post_id": { + "required": false, + "description": "ID of the post context.", + "type": "integer" + } + } + } + ] + }, "/wp/v2/block-renderer/(?Pcore/categories)": { "namespace": "wp/v2", "methods": [ @@ -4490,6 +4530,86 @@ mockedApiResponse.Schema = { } ] }, + "/wp/v2/block-renderer/(?Pcore/rss)": { + "namespace": "wp/v2", + "methods": [ + "GET" + ], + "endpoints": [ + { + "methods": [ + "GET" + ], + "args": { + "name": { + "required": false, + "description": "Unique registered name for the block.", + "type": "string" + }, + "context": { + "required": false, + "default": "view", + "enum": [ + "edit" + ], + "description": "Scope under which the request is made; determines fields present in response.", + "type": "string" + }, + "attributes": { + "required": false, + "default": [], + "description": "Attributes for core/rss block", + "type": "object" + }, + "post_id": { + "required": false, + "description": "ID of the post context.", + "type": "integer" + } + } + } + ] + }, + "/wp/v2/block-renderer/(?Pcore/search)": { + "namespace": "wp/v2", + "methods": [ + "GET" + ], + "endpoints": [ + { + "methods": [ + "GET" + ], + "args": { + "name": { + "required": false, + "description": "Unique registered name for the block.", + "type": "string" + }, + "context": { + "required": false, + "default": "view", + "enum": [ + "edit" + ], + "description": "Scope under which the request is made; determines fields present in response.", + "type": "string" + }, + "attributes": { + "required": false, + "default": [], + "description": "Attributes for core/search block", + "type": "object" + }, + "post_id": { + "required": false, + "description": "ID of the post context.", + "type": "integer" + } + } + } + ] + }, "/wp/v2/block-renderer/(?Pcore/shortcode)": { "namespace": "wp/v2", "methods": [ @@ -4530,6 +4650,46 @@ mockedApiResponse.Schema = { } ] }, + "/wp/v2/block-renderer/(?Pcore/tag-cloud)": { + "namespace": "wp/v2", + "methods": [ + "GET" + ], + "endpoints": [ + { + "methods": [ + "GET" + ], + "args": { + "name": { + "required": false, + "description": "Unique registered name for the block.", + "type": "string" + }, + "context": { + "required": false, + "default": "view", + "enum": [ + "edit" + ], + "description": "Scope under which the request is made; determines fields present in response.", + "type": "string" + }, + "attributes": { + "required": false, + "default": [], + "description": "Attributes for core/tag-cloud block", + "type": "object" + }, + "post_id": { + "required": false, + "description": "ID of the post context.", + "type": "integer" + } + } + } + ] + }, "/wp/v2/settings": { "namespace": "wp/v2", "methods": [