Changeset 52010 for trunk/tests/phpunit/tests/blocks/editor.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/editor.php
r51568 r52010 43 43 } 44 44 45 function filter_set_block_categories_post( $block_categories, $post ) {45 public function filter_set_block_categories_post( $block_categories, $post ) { 46 46 if ( empty( $post ) ) { 47 47 return $block_categories; … … 57 57 } 58 58 59 function filter_set_allowed_block_types_post( $allowed_block_types, $post ) {59 public function filter_set_allowed_block_types_post( $allowed_block_types, $post ) { 60 60 if ( empty( $post ) ) { 61 61 return $allowed_block_types; … … 65 65 } 66 66 67 function filter_set_block_editor_settings_post( $editor_settings, $post ) {67 public function filter_set_block_editor_settings_post( $editor_settings, $post ) { 68 68 if ( empty( $post ) ) { 69 69 return $allowed_block_types; … … 78 78 * @ticket 52920 79 79 */ 80 function test_block_editor_context_no_settings() {80 public function test_block_editor_context_no_settings() { 81 81 $context = new WP_Block_Editor_Context(); 82 82 … … 87 87 * @ticket 52920 88 88 */ 89 function test_block_editor_context_post() {89 public function test_block_editor_context_post() { 90 90 $context = new WP_Block_Editor_Context( array( 'post' => get_post() ) ); 91 91 … … 97 97 * @expectedDeprecated block_categories 98 98 */ 99 function test_get_block_categories_deprecated_filter_post_object() {99 public function test_get_block_categories_deprecated_filter_post_object() { 100 100 add_filter( 'block_categories', array( $this, 'filter_set_block_categories_post' ), 10, 2 ); 101 101 … … 120 120 * @expectedDeprecated block_categories 121 121 */ 122 function test_get_block_categories_deprecated_filter_post_editor() {122 public function test_get_block_categories_deprecated_filter_post_editor() { 123 123 add_filter( 'block_categories', array( $this, 'filter_set_block_categories_post' ), 10, 2 ); 124 124 … … 143 143 * @ticket 52920 144 144 */ 145 function test_get_allowed_block_types_default() {145 public function test_get_allowed_block_types_default() { 146 146 $post_editor_context = new WP_Block_Editor_Context( array( 'post' => get_post() ) ); 147 147 $allowed_block_types = get_allowed_block_types( $post_editor_context ); … … 154 154 * @expectedDeprecated allowed_block_types 155 155 */ 156 function test_get_allowed_block_types_deprecated_filter_post_editor() {156 public function test_get_allowed_block_types_deprecated_filter_post_editor() { 157 157 add_filter( 'allowed_block_types', array( $this, 'filter_set_allowed_block_types_post' ), 10, 2 ); 158 158 … … 168 168 * @ticket 52920 169 169 */ 170 function test_get_default_block_editor_settings() {170 public function test_get_default_block_editor_settings() { 171 171 $settings = get_default_block_editor_settings(); 172 172 … … 271 271 * @ticket 53397 272 272 */ 273 function test_get_legacy_widget_block_editor_settings() {273 public function test_get_legacy_widget_block_editor_settings() { 274 274 $settings = get_legacy_widget_block_editor_settings(); 275 275 $this->assertCount( 1, $settings ); … … 300 300 * @ticket 52920 301 301 */ 302 function test_get_block_editor_settings_overrides_default_settings_all_editors() {302 public function test_get_block_editor_settings_overrides_default_settings_all_editors() { 303 303 function filter_allowed_block_types_my_editor() { 304 304 return array( 'test/filtered-my-block' ); … … 347 347 * @ticket 53458 348 348 */ 349 function test_get_block_editor_settings_theme_json_settings() {349 public function test_get_block_editor_settings_theme_json_settings() { 350 350 switch_theme( 'block-theme' ); 351 351 … … 412 412 * @expectedDeprecated block_editor_settings 413 413 */ 414 function test_get_block_editor_settings_deprecated_filter_post_editor() {414 public function test_get_block_editor_settings_deprecated_filter_post_editor() { 415 415 add_filter( 'block_editor_settings', array( $this, 'filter_set_block_editor_settings_post' ), 10, 2 ); 416 416 … … 431 431 * @ticket 52920 432 432 */ 433 function test_block_editor_rest_api_preload_no_paths() {433 public function test_block_editor_rest_api_preload_no_paths() { 434 434 $editor_context = new WP_Block_Editor_Context(); 435 435 block_editor_rest_api_preload( array(), $editor_context ); … … 443 443 * @expectedDeprecated block_editor_preload_paths 444 444 */ 445 function test_block_editor_rest_api_preload_deprecated_filter_post_editor() {445 public function test_block_editor_rest_api_preload_deprecated_filter_post_editor() { 446 446 function filter_remove_preload_paths( $preload_paths, $post ) { 447 447 if ( empty( $post ) ) { … … 469 469 * @ticket 52920 470 470 */ 471 function test_block_editor_rest_api_preload_filter_all() {471 public function test_block_editor_rest_api_preload_filter_all() { 472 472 function filter_add_preload_paths( $preload_paths, WP_Block_Editor_Context $context ) { 473 473 if ( empty( $context->post ) ) { … … 498 498 * @ticket 53344 499 499 */ 500 function test_get_block_editor_theme_styles() {500 public function test_get_block_editor_theme_styles() { 501 501 $theme_styles = get_block_editor_theme_styles(); 502 502 $this->assertCount( 1, $theme_styles );
Note: See TracChangeset
for help on using the changeset viewer.