Changeset 63435
- Timestamp:
- 09/02/2026 02:58:58 PM (41 hours ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 6 edited
-
fonts/font-face/base.php (modified) (1 diff)
-
fonts/font-face/wpPrintFontFacesFromStyleVariations.php (modified) (1 diff)
-
rest-api/rest-block-type-controller.php (modified) (3 diffs)
-
sitemaps/sitemaps.php (modified) (2 diffs)
-
widgets/wpWidgetMediaAudio.php (modified) (1 diff)
-
widgets/wpWidgetMediaVideo.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/fonts/font-face/base.php
r56500 r63435 70 70 // Reset static flags. 71 71 self::$requires_switch_theme_fixtures = false; 72 self::$theme_root = null; 72 73 73 74 parent::tear_down_after_class(); -
trunk/tests/phpunit/tests/fonts/font-face/wpPrintFontFacesFromStyleVariations.php
r61411 r63435 17 17 18 18 public static function set_up_before_class() { 19 self::$requires_switch_theme_fixtures = true; 20 19 21 parent::set_up_before_class(); 20 self::$requires_switch_theme_fixtures = true;21 22 } 22 23 -
trunk/tests/phpunit/tests/rest-api/rest-block-type-controller.php
r62957 r63435 33 33 34 34 /** 35 * Pre-existing block types registered before the current test. 36 * 37 * @var string[] $registered_block_types 38 */ 39 private $registered_block_types = array(); 40 41 /** 42 * Pre-existing block styles registered before the current test, grouped by block type name. 43 * 44 * @var array[] $registered_block_styles 45 */ 46 private $registered_block_styles = array(); 47 48 /** 35 49 * Create fake data before our tests run. 36 50 * … … 50 64 ) 51 65 ); 52 53 $name = 'fake/test';54 $settings = array(55 'icon' => 'text',56 );57 58 register_block_type( $name, $settings );59 66 } 60 67 … … 62 69 self::delete_user( self::$admin_id ); 63 70 self::delete_user( self::$subscriber_id ); 64 unregister_block_type( 'fake/test' ); 65 unregister_block_type( 'fake/invalid' ); 66 unregister_block_type( 'fake/false' ); 71 } 72 73 /** 74 * Sets up each test method. 75 * 76 * Records the registered block types and block styles so that anything 77 * registered by a test can be unregistered again in tear_down(), and 78 * registers a block type used by many tests in this class. 79 */ 80 public function set_up() { 81 parent::set_up(); 82 83 $this->registered_block_types = array_keys( WP_Block_Type_Registry::get_instance()->get_all_registered() ); 84 $this->registered_block_styles = WP_Block_Styles_Registry::get_instance()->get_all_registered(); 85 86 register_block_type( 87 'fake/test', 88 array( 89 'icon' => 'text', 90 ) 91 ); 92 } 93 94 /** 95 * Tears down each test method. 96 * 97 * Unregisters any block types and block styles registered while the test ran. 98 */ 99 public function tear_down() { 100 foreach ( WP_Block_Styles_Registry::get_instance()->get_all_registered() as $block_name => $block_styles ) { 101 foreach ( array_keys( $block_styles ) as $block_style_name ) { 102 if ( ! isset( $this->registered_block_styles[ $block_name ][ $block_style_name ] ) ) { 103 unregister_block_style( $block_name, $block_style_name ); 104 } 105 } 106 } 107 108 foreach ( array_keys( WP_Block_Type_Registry::get_instance()->get_all_registered() ) as $block_name ) { 109 if ( ! in_array( $block_name, $this->registered_block_types, true ) ) { 110 unregister_block_type( $block_name ); 111 } 112 } 113 114 parent::tear_down(); 67 115 } 68 116 -
trunk/tests/phpunit/tests/sitemaps/sitemaps.php
r57987 r63435 465 465 /** 466 466 * @ticket 50643 467 * @runInSeparateProcess468 * @preserveGlobalState disabled469 467 */ 470 468 public function test_disable_sitemap_should_return_404() { 471 469 add_filter( 'wp_sitemaps_enabled', '__return_false' ); 472 470 471 // Instantiate the server before navigating: registering the sitemap 472 // rewrite tags is what adds `sitemap` to `$wp->public_query_vars`. 473 $sitemaps = wp_sitemaps_get_server(); 474 473 475 $this->go_to( home_url( '/?sitemap=index' ) ); 474 476 475 wp_sitemaps_get_server()->render_sitemaps();477 $sitemaps->render_sitemaps(); 476 478 477 479 remove_filter( 'wp_sitemaps_enabled', '__return_false' ); … … 482 484 /** 483 485 * @ticket 50643 484 * @runInSeparateProcess485 * @preserveGlobalState disabled486 486 */ 487 487 public function test_empty_url_list_should_return_404() { -
trunk/tests/phpunit/tests/widgets/wpWidgetMediaAudio.php
r59987 r63435 317 317 */ 318 318 public function test_render_control_template_scripts() { 319 // Provides wp_underscore_audio_template(), normally loaded by wp_enqueue_media(). 320 require_once ABSPATH . WPINC . '/media-template.php'; 321 319 322 $widget = new WP_Widget_Media_Audio(); 320 323 -
trunk/tests/phpunit/tests/widgets/wpWidgetMediaVideo.php
r59954 r63435 345 345 */ 346 346 public function test_render_control_template_scripts() { 347 // Provides wp_underscore_video_template(), normally loaded by wp_enqueue_media(). 348 require_once ABSPATH . WPINC . '/media-template.php'; 349 347 350 $widget = new WP_Widget_Media_Video(); 348 351
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)