- Timestamp:
- 06/27/2023 11:26:12 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/registerCoreBlockStyleHandles.php
r56044 r56064 56 56 * 57 57 * @dataProvider data_block_data 58 * 59 * @param string $name The block name. 60 * @param array $schema The block's schema. 58 61 */ 59 62 public function test_wp_should_load_separate_core_block_assets_false( $name, $schema ) { … … 75 78 * 76 79 * @dataProvider data_block_data 80 * 81 * @param string $name The block name. 82 * @param array $schema The block's schema. 77 83 */ 78 84 public function test_wp_should_load_separate_core_block_assets_true( $name, $schema ) { … … 100 106 } 101 107 108 /** 109 * @ticket 58560 110 * 111 * @dataProvider data_block_data 112 * 113 * @param string $name The block name. 114 */ 115 public function test_wp_should_load_separate_core_block_assets_current_theme_supports( $name ) { 116 add_filter( 'should_load_separate_core_block_assets', '__return_true' ); 117 add_theme_support( 'wp-block-styles' ); 118 register_core_block_style_handles(); 119 120 $wp_styles = $GLOBALS['wp_styles']; 121 122 $style_handle = "wp-block-{$name}-theme"; 123 124 $this->assertArrayHasKey( $style_handle, $wp_styles->registered, 'The key should exist, as this style should be registered' ); 125 if ( false === $wp_styles->registered[ $style_handle ]->src ) { 126 $this->assertEmpty( $wp_styles->registered[ $style_handle ]->extra, 'If source is false, not style path should be set' ); 127 } else { 128 $this->assertStringContainsString( $this->includes_url, $wp_styles->registered[ $style_handle ]->src, 'Source of style should contain the includes url' ); 129 $this->assertNotEmpty( $wp_styles->registered[ $style_handle ]->extra, 'The path of the style should exist' ); 130 $this->assertArrayHasKey( 'path', $wp_styles->registered[ $style_handle ]->extra, 'The path key of the style should exist in extra array' ); 131 $this->assertNotEmpty( $wp_styles->registered[ $style_handle ]->extra['path'], 'The path key of the style should not be empty' ); 132 } 133 } 102 134 103 135 public function data_block_data() {
Note: See TracChangeset
for help on using the changeset viewer.