Changeset 63595
- Timestamp:
- 09/10/2026 09:39:21 PM (3 days ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 7 edited
-
blocks/editor.php (modified) (3 diffs)
-
blocks/getBlockAssetUrl.php (modified) (2 diffs)
-
blocks/getBlockTemplates.php (modified) (2 diffs)
-
blocks/getHookedBlocks.php (modified) (2 diffs)
-
blocks/register.php (modified) (3 diffs)
-
blocks/wpBlockPatternsRegistry.php (modified) (3 diffs)
-
theme/wpThemeGetBlockPatterns.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/editor.php
r61678 r63595 17 17 18 18 parent::set_up(); 19 $this->original_stylesheet = get_stylesheet(); 19 20 20 21 remove_action( 'wp_print_styles', 'print_emoji_styles' ); … … 52 53 global $post_ID; 53 54 $post_ID = null; 55 56 if ( get_stylesheet() !== $this->original_stylesheet ) { 57 switch_theme( $this->original_stylesheet ); 58 } 59 54 60 parent::tear_down(); 55 61 } … … 64 70 */ 65 71 protected $original_wp_styles; 72 73 /** 74 * Original stylesheet. 75 * 76 * @var string 77 */ 78 private $original_stylesheet; 66 79 67 80 public function filter_set_block_categories_post( $block_categories, $post ) { -
trunk/tests/phpunit/tests/blocks/getBlockAssetUrl.php
r56692 r63595 19 19 private $orig_theme_dir; 20 20 21 /** 22 * Original stylesheet. 23 * 24 * @var string 25 */ 26 private $original_stylesheet; 27 21 28 public function set_up() { 22 29 global $wp_theme_directories; 23 30 24 31 parent::set_up(); 32 $this->original_stylesheet = get_stylesheet(); 25 33 26 34 // Sets up the `wp-content/themes/` directory to ensure consistency when running tests. … … 34 42 public function tear_down() { 35 43 global $wp_theme_directories; 44 45 if ( get_stylesheet() !== $this->original_stylesheet ) { 46 switch_theme( $this->original_stylesheet ); 47 } 36 48 37 49 $wp_theme_directories = $this->orig_theme_dir; -
trunk/tests/phpunit/tests/blocks/getBlockTemplates.php
r59951 r63595 9 9 10 10 const TEST_THEME = 'block-theme'; 11 12 /** 13 * Original stylesheet. 14 * 15 * @var string 16 */ 17 private $original_stylesheet; 11 18 12 19 /** … … 92 99 public function set_up() { 93 100 parent::set_up(); 101 $this->original_stylesheet = get_stylesheet(); 94 102 switch_theme( self::TEST_THEME ); 103 } 104 105 public function tear_down() { 106 if ( get_stylesheet() !== $this->original_stylesheet ) { 107 switch_theme( $this->original_stylesheet ); 108 } 109 110 parent::tear_down(); 95 111 } 96 112 -
trunk/tests/phpunit/tests/blocks/getHookedBlocks.php
r62264 r63595 16 16 17 17 const TEST_THEME_NAME = 'block-theme-with-hooked-blocks'; 18 19 /** 20 * Original stylesheet. 21 * 22 * @var string 23 */ 24 private $original_stylesheet; 25 26 public function set_up() { 27 parent::set_up(); 28 $this->original_stylesheet = get_stylesheet(); 29 } 18 30 19 31 /** … … 44 56 } 45 57 58 if ( get_stylesheet() !== $this->original_stylesheet ) { 59 switch_theme( $this->original_stylesheet ); 60 } 61 46 62 parent::tear_down(); 47 63 } -
trunk/tests/phpunit/tests/blocks/register.php
r61019 r63595 22 22 23 23 /** 24 * Original stylesheet. 25 * 26 * @var string 27 */ 28 private $original_stylesheet; 29 30 /** 24 31 * ID for a test post. 25 32 * … … 62 69 public function set_up() { 63 70 parent::set_up(); 71 $this->original_stylesheet = get_stylesheet(); 64 72 65 73 global $wp_scripts, $wp_styles; … … 96 104 $wp_scripts = $this->original_wp_scripts; 97 105 $wp_styles = $this->original_wp_styles; 106 107 if ( get_stylesheet() !== $this->original_stylesheet ) { 108 switch_theme( $this->original_stylesheet ); 109 } 98 110 99 111 parent::tear_down(); -
trunk/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php
r60904 r63595 29 29 30 30 /** 31 * Original stylesheet. 32 * 33 * @var string 34 */ 35 private $original_stylesheet; 36 37 /** 31 38 * Set up each test method. 32 39 * … … 38 45 $this->registry = new WP_Block_Patterns_Registry(); 39 46 $this->original_registered_patterns = $this->get_registered_patterns_variable_value(); 47 $this->original_stylesheet = get_stylesheet(); 40 48 } 41 49 … … 55 63 56 64 $this->set_registered_patterns_variable_value( $this->original_registered_patterns ); 65 66 if ( get_stylesheet() !== $this->original_stylesheet ) { 67 switch_theme( $this->original_stylesheet ); 68 } 69 57 70 parent::tear_down(); 58 71 } -
trunk/tests/phpunit/tests/theme/wpThemeGetBlockPatterns.php
r60729 r63595 20 20 private $initial_cache_object; 21 21 22 /** 23 * Original stylesheet. 24 * 25 * @var string 26 */ 27 private $original_stylesheet; 28 22 29 public function set_up() { 23 30 parent::set_up(); 24 31 25 32 $this->initial_cache_object = wp_using_ext_object_cache(); 33 $this->original_stylesheet = get_stylesheet(); 26 34 } 27 35 28 36 public function tear_down() { 29 37 wp_using_ext_object_cache( $this->initial_cache_object ); 38 39 if ( get_stylesheet() !== $this->original_stylesheet ) { 40 switch_theme( $this->original_stylesheet ); 41 } 42 30 43 parent::tear_down(); 31 44 }
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)