Changeset 51369 for trunk/tests/phpunit/tests/blocks/block-editor.php
- Timestamp:
- 07/07/2021 02:12:46 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/blocks/block-editor.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/block-editor.php
r51331 r51369 345 345 346 346 /** 347 * @ticket 53458 348 */ 349 function test_get_block_editor_settings_theme_json_settings() { 350 switch_theme( 'fse' ); 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
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)