diff --git a/tests/phpunit/tests/block-supports/elements.php b/tests/phpunit/tests/block-supports/elements.php deleted file mode 100644 index 0b1f720b5a..0000000000 --- a/tests/phpunit/tests/block-supports/elements.php +++ /dev/null @@ -1,173 +0,0 @@ -Hello WordPress!
', - array( - 'blockName' => 'core/paragraph', - 'attrs' => array( - 'style' => array( - 'elements' => array( - 'link' => array( - 'color' => array( - 'text' => 'var:preset|color|subtle-background', - ), - ), - ), - ), - ), - ) - ) - ); - $this->assertSame( - $result, - '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!