Changeset 57799
- Timestamp:
- 03/11/2024 12:52:18 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/block-template-utils.php
r57790 r57799 93 93 */ 94 94 public function tear_down() { 95 global $wp_current_filter;96 97 if (98 'rest_pre_insert_wp_template' === current_filter() ||99 'rest_pre_insert_wp_template_part' === current_filter()100 ) {101 array_pop( $wp_current_filter );102 }103 104 95 if ( WP_Block_Type_Registry::get_instance()->is_registered( 'tests/hooked-block' ) ) { 105 96 unregister_block_type( 'tests/hooked-block' ); … … 421 412 public function test_inject_ignored_hooked_blocks_metadata_attributes_into_template() { 422 413 global $wp_current_filter; 423 // Mock currently set filter. 414 // Mock currently set filter. The $wp_current_filter global is reset during teardown by 415 // WP_UnitTestCase_Base::_restore_hooks() in tests/phpunit/includes/abstract-testcase.php. 424 416 $wp_current_filter[] = 'rest_pre_insert_wp_template'; 425 417 … … 454 446 public function test_inject_ignored_hooked_blocks_metadata_attributes_into_template_part() { 455 447 global $wp_current_filter; 456 // Mock currently set filter. 448 // Mock currently set filter. The $wp_current_filter global is reset during teardown by 449 // WP_UnitTestCase_Base::_restore_hooks() in tests/phpunit/includes/abstract-testcase.php. 457 450 $wp_current_filter[] = 'rest_pre_insert_wp_template_part'; 458 451
Note: See TracChangeset
for help on using the changeset viewer.