Changeset 56991 for trunk/tests/phpunit/tests/block-supports/duotone.php
- Timestamp:
- 10/23/2023 11:37:55 PM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/block-supports/duotone.php
r56981 r56991 104 104 105 105 /** 106 * Tests whether the CSS declarations are generated even if the block content is 107 * empty. This is needed to make the CSS output stable across paginations for 108 * features like the enhanced pagination of the Query block. 109 * 110 * @ticket 59694 111 * 112 * @covers ::render_duotone_support 113 */ 114 public function test_css_declarations_are_generated_even_with_empty_block_content() { 115 $block = array( 116 'blockName' => 'core/image', 117 'attrs' => array( 'style' => array( 'color' => array( 'duotone' => 'var:preset|duotone|blue-orange' ) ) ), 118 ); 119 $wp_block = new WP_Block( $block ); 120 $block_css_declarations_property = new ReflectionProperty( 'WP_Duotone', 'block_css_declarations' ); 121 $block_css_declarations_property->setAccessible( true ); 122 $block_css_declarations_property->setValue( $wp_block, array() ); 123 124 WP_Duotone::render_duotone_support( '', $block, $wp_block ); 125 $actual = $block_css_declarations_property->getValue(); 126 // Reset the property's visibility. 127 $block_css_declarations_property->setAccessible( false ); 128 129 $this->assertNotEmpty( $actual ); 130 } 131 132 /** 106 133 * @dataProvider data_is_preset 107 134 */
Note: See TracChangeset
for help on using the changeset viewer.