From 4d5859bececc8b451ca95108d942f2a870bdf806 Mon Sep 17 00:00:00 2001
From: Felix Arntz
Hello WordPress!
' - ); - } - - /** - * Test wp_render_elements_support() with a paragraph containing a class. - * @ticket 54337 - */ - public function test_class_paragraph_link_color() { - $result = self::make_unique_id_one( - wp_render_elements_support( - 'Hello WordPress!
', - array( - 'blockName' => 'core/paragraph', - 'attrs' => array( - 'style' => array( - 'elements' => array( - 'link' => array( - 'color' => array( - 'text' => 'red', - ), - ), - ), - ), - 'backgroundColor' => 'dark-gray', - ), - ) - ) - ); - $this->assertSame( - $result, - 'Hello WordPress!
' - ); - } - - /** - * Test wp_render_elements_support() with a paragraph containing a anchor. - * @ticket 54337 - */ - public function test_anchor_paragraph_link_color() { - $result = self::make_unique_id_one( - wp_render_elements_support( - 'Hello WordPress!
', - array( - 'blockName' => 'core/paragraph', - 'attrs' => array( - 'style' => array( - 'elements' => array( - 'link' => array( - 'color' => array( - 'text' => '#fff000', - ), - ), - ), - ), - ), - ) - ) - ); - $this->assertSame( - $result, - 'Hello WordPress!
' - ); - } - - /** - * Test wp_render_elements_support() with a group block that has a button - * element color set. - * - * @ticket 59309 - */ - public function test_group_with_button_element_style() { - $result = self::make_unique_id_one( - wp_render_elements_support( - 'Hello WordPress!
', + 'expected_markup' => '/^Hello WordPress<\/a>!<\/p>$/',
+ ),
+ 'link element styles with serialization skipped' => array(
+ 'color_settings' => array(
+ 'link' => true,
+ '__experimentalSkipSerialization' => true,
+ ),
+ 'elements_styles' => array(
+ 'link' => array( 'color' => $color_styles ),
+ ),
+ 'block_markup' => ' Hello WordPress! Hello WordPress<\/a>!<\/p>$/',
+ ),
+ 'heading element styles with serialization skipped' => array(
+ 'color_settings' => array(
+ 'heading' => true,
+ '__experimentalSkipSerialization' => true,
+ ),
+ 'elements_styles' => array(
+ 'heading' => array( 'color' => $color_styles ),
+ ),
+ 'block_markup' => ' Hello WordPress! Hello WordPress<\/a>!<\/p>$/',
+ ),
+ 'button element styles apply class to wrapper' => array(
+ 'color_settings' => array( 'button' => true ),
+ 'elements_styles' => array(
+ 'button' => array( 'color' => $color_styles ),
+ ),
+ 'block_markup' => ' Hello WordPress! Hello WordPress<\/a>!<\/p>$/',
+ ),
+ 'link element styles apply class to wrapper' => array(
+ 'color_settings' => array( 'link' => true ),
+ 'elements_styles' => array(
+ 'link' => array( 'color' => $color_styles ),
+ ),
+ 'block_markup' => ' Hello WordPress! Hello WordPress<\/a>!<\/p>$/',
+ ),
+ 'heading element styles apply class to wrapper' => array(
+ 'color_settings' => array( 'heading' => true ),
+ 'elements_styles' => array(
+ 'heading' => array( 'color' => $color_styles ),
+ ),
+ 'block_markup' => ' Hello WordPress! Hello WordPress<\/a>!<\/p>$/',
+ ),
+ 'element styles apply class to wrapper when it has other classes' => array(
+ 'color_settings' => array( 'link' => true ),
+ 'elements_styles' => array(
+ 'link' => array( 'color' => $color_styles ),
+ ),
+ 'block_markup' => ' Hello WordPress! Hello WordPress<\/a>!<\/p>$/',
+ ),
+ 'element styles apply class to wrapper when it has other attributes' => array(
+ 'color_settings' => array( 'link' => true ),
+ 'elements_styles' => array(
+ 'link' => array( 'color' => $color_styles ),
+ ),
+ 'block_markup' => ' Hello WordPress!