Changeset 51374
- Timestamp:
- 07/07/2021 06:59:21 PM (3 years ago)
- Location:
- branches/5.8
- Files:
-
- 3 deleted
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/5.8
- Property svn:mergeinfo changed
/trunk merged: 51370-51371
- Property svn:mergeinfo changed
-
branches/5.8/tests/phpunit/tests/blocks/block-editor.php
r51200 r51374 345 345 346 346 /** 347 * @ticket 53458 348 */ 349 function test_get_block_editor_settings_theme_json_settings() { 350 switch_theme( 'block-theme' ); 351 352 $post_editor_context = new WP_Block_Editor_Context( array( 'post' => get_post() ) ); 353 354 $settings = get_block_editor_settings( array(), $post_editor_context ); 355 356 // Related entry in theme.json: settings.color.palette 357 $this->assertSameSetsWithIndex( 358 array( 359 array( 360 'slug' => 'light', 361 'name' => 'Light', 362 'color' => '#f5f7f9', 363 ), 364 array( 365 'slug' => 'dark', 366 'name' => 'Dark', 367 'color' => '#000', 368 ), 369 ), 370 $settings['colors'] 371 ); 372 // settings.color.gradients 373 $this->assertSameSetsWithIndex( 374 array( 375 array( 376 'name' => 'Custom gradient', 377 'gradient' => 'linear-gradient(135deg,rgba(0,0,0) 0%,rgb(0,0,0) 100%)', 378 'slug' => 'custom-gradient', 379 ), 380 ), 381 $settings['gradients'] 382 ); 383 // settings.typography.fontSizes 384 $this->assertSameSetsWithIndex( 385 array( 386 array( 387 'name' => 'Custom', 388 'slug' => 'custom', 389 'size' => '100px', 390 ), 391 ), 392 $settings['fontSizes'] 393 ); 394 // settings.color.custom 395 $this->assertTrue( $settings['disableCustomColors'] ); 396 // settings.color.customGradient 397 $this->assertTrue( $settings['disableCustomGradients'] ); 398 // settings.typography.customFontSize 399 $this->assertTrue( $settings['disableCustomFontSizes'] ); 400 // settings.typography.customLineHeight 401 $this->assertTrue( $settings['enableCustomLineHeight'] ); 402 // settings.spacing.enableCustomUnits 403 $this->assertSameSets( array( 'rem' ), $settings['enableCustomUnits'] ); 404 // settings.spacing.customPadding 405 $this->assertTrue( $settings['enableCustomSpacing'] ); 406 407 switch_theme( WP_DEFAULT_THEME ); 408 } 409 410 /** 347 411 * @ticket 52920 348 412 * @expectedDeprecated block_editor_settings -
branches/5.8/tests/phpunit/tests/theme/themeDir.php
r50960 r51374 162 162 'camelCase', 163 163 'REST Theme', 164 ' FSETheme',164 'Block Theme', 165 165 ); 166 166 -
branches/5.8/tests/phpunit/tests/theme/wpThemeJsonResolver.php
r51305 r51374 97 97 public function test_translations_are_applied() { 98 98 add_filter( 'locale', array( $this, 'filter_set_locale_to_polish' ) ); 99 load_textdomain( ' fse', realpath( DIR_TESTDATA . '/languages/themes/fse-pl_PL.mo' ) );99 load_textdomain( 'block-theme', realpath( DIR_TESTDATA . '/languages/themes/block-theme-pl_PL.mo' ) ); 100 100 101 switch_theme( ' fse' );101 switch_theme( 'block-theme' ); 102 102 103 103 $actual = WP_Theme_JSON_Resolver::get_theme_data(); 104 104 105 unload_textdomain( ' fse' );105 unload_textdomain( 'block-theme' ); 106 106 remove_filter( 'locale', array( $this, 'filter_set_locale_to_polish' ) ); 107 107 108 $this->assertSame( wp_get_theme()->get( 'TextDomain' ), ' fse' );108 $this->assertSame( wp_get_theme()->get( 'TextDomain' ), 'block-theme' ); 109 109 $this->assertSame( 110 110 array( … … 155 155 156 156 // Switch to a theme that does have support. 157 switch_theme( ' fse' );158 $ fse= WP_Theme_JSON_Resolver::theme_has_support();157 switch_theme( 'block-theme' ); 158 $has_theme_json_support = WP_Theme_JSON_Resolver::theme_has_support(); 159 159 160 160 $this->assertFalse( $default ); 161 $this->assertTrue( $ fse);161 $this->assertTrue( $has_theme_json_support ); 162 162 } 163 163
Note: See TracChangeset
for help on using the changeset viewer.