Changeset 60729 for trunk/tests/phpunit/tests/theme/wpThemeJsonResolver.php
- Timestamp:
- 09/11/2025 02:45:56 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/wpThemeJsonResolver.php
r60234 r60729 78 78 79 79 static::$property_blocks_cache = new ReflectionProperty( WP_Theme_JSON_Resolver::class, 'blocks_cache' ); 80 static::$property_blocks_cache->setAccessible( true ); 80 if ( PHP_VERSION_ID < 80100 ) { 81 static::$property_blocks_cache->setAccessible( true ); 82 } 81 83 static::$property_blocks_cache_orig_value = static::$property_blocks_cache->getValue(); 82 84 83 85 static::$property_core = new ReflectionProperty( WP_Theme_JSON_Resolver::class, 'core' ); 84 static::$property_core->setAccessible( true ); 86 if ( PHP_VERSION_ID < 80100 ) { 87 static::$property_core->setAccessible( true ); 88 } 85 89 static::$property_core_orig_value = static::$property_core->getValue(); 86 90 } … … 307 311 public function test_has_same_registered_blocks_when_all_blocks_not_cached( $origin, array $cache = array() ) { 308 312 $has_same_registered_blocks = new ReflectionMethod( WP_Theme_JSON_Resolver::class, 'has_same_registered_blocks' ); 309 $has_same_registered_blocks->setAccessible( true ); 313 if ( PHP_VERSION_ID < 80100 ) { 314 $has_same_registered_blocks->setAccessible( true ); 315 } 310 316 $expected_cache = $this->get_registered_block_names(); 311 317 … … 381 387 public function test_has_same_registered_blocks_when_all_blocks_are_cached( $origin ) { 382 388 $has_same_registered_blocks = new ReflectionMethod( WP_Theme_JSON_Resolver::class, 'has_same_registered_blocks' ); 383 $has_same_registered_blocks->setAccessible( true ); 389 if ( PHP_VERSION_ID < 80100 ) { 390 $has_same_registered_blocks->setAccessible( true ); 391 } 384 392 $expected_cache = $this->get_registered_block_names(); 385 393 … … 837 845 // Force-unset $i18n_schema property to "unload" translation schema. 838 846 $property = new ReflectionProperty( $theme_json_resolver, 'i18n_schema' ); 839 $property->setAccessible( true ); 847 if ( PHP_VERSION_ID < 80100 ) { 848 $property->setAccessible( true ); 849 } 840 850 $property->setValue( null, null ); 841 851
Note: See TracChangeset
for help on using the changeset viewer.