Changeset 60729 for trunk/tests/phpunit/tests/block-supports/duotone.php
- Timestamp:
- 09/11/2025 02:45:56 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/block-supports/duotone.php
r57652 r60729 79 79 80 80 $reflection = new ReflectionMethod( 'WP_Duotone', 'get_slug_from_attribute' ); 81 $reflection->setAccessible( true ); 81 if ( PHP_VERSION_ID < 80100 ) { 82 $reflection->setAccessible( true ); 83 } 82 84 83 85 $this->assertSame( $expected, $reflection->invoke( null, $data_attr ) ); … … 129 131 $wp_duotone = new WP_Duotone(); 130 132 $block_css_declarations_property = new ReflectionProperty( 'WP_Duotone', 'block_css_declarations' ); 131 $block_css_declarations_property->setAccessible( true ); 133 if ( PHP_VERSION_ID < 80100 ) { 134 $block_css_declarations_property->setAccessible( true ); 135 } 132 136 $previous_value = $block_css_declarations_property->getValue(); 133 137 $block_css_declarations_property->setValue( $wp_duotone, array() ); … … 138 142 // Reset the property. 139 143 $block_css_declarations_property->setValue( $wp_duotone, $previous_value ); 140 $block_css_declarations_property->setAccessible( false ); 144 if ( PHP_VERSION_ID < 80100 ) { 145 $block_css_declarations_property->setAccessible( false ); 146 } 141 147 142 148 $this->assertNotEmpty( $actual ); … … 148 154 public function test_is_preset( $data_attr, $expected ) { 149 155 $reflection = new ReflectionMethod( 'WP_Duotone', 'is_preset' ); 150 $reflection->setAccessible( true ); 156 if ( PHP_VERSION_ID < 80100 ) { 157 $reflection->setAccessible( true ); 158 } 151 159 152 160 $this->assertSame( $expected, $reflection->invoke( null, $data_attr ) ); … … 174 182 public function test_colord_parse_hue( $value, $unit, $expected ) { 175 183 $reflection = new ReflectionMethod( 'WP_Duotone', 'colord_parse_hue' ); 176 $reflection->setAccessible( true ); 184 if ( PHP_VERSION_ID < 80100 ) { 185 $reflection->setAccessible( true ); 186 } 177 187 178 188 $this->assertSame( $expected, $reflection->invoke( null, $value, $unit ) );
Note: See TracChangeset
for help on using the changeset viewer.