From 43db05f1909b7501924cb11ae70ed37ecfba6c0e Mon Sep 17 00:00:00 2001 From: Dennis Snell Date: Sun, 13 Aug 2023 16:08:50 -0700 Subject: [PATCH] Add more test cases with non-empty changes. --- .../tests/html-api/wpHtmlProcessorSetInnerMarkup.php | 8 ++++++++ .../tests/html-api/wpHtmlProcessorSetOuterMarkup.php | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessorSetInnerMarkup.php b/tests/phpunit/tests/html-api/wpHtmlProcessorSetInnerMarkup.php index 84ab4790109a9..02d1546e27494 100644 --- a/tests/phpunit/tests/html-api/wpHtmlProcessorSetInnerMarkup.php +++ b/tests/phpunit/tests/html-api/wpHtmlProcessorSetInnerMarkup.php @@ -53,6 +53,14 @@ public function data_html_with_inner_markup_changes() { 'Unclosed nested element' => array( '

One thought

And another', '', '

And another' ), 'Partially-closed element' => array( '

This is all inside the DIV' ), 'Implicitly-closed element' => array( '

Inside the P

Outside the P

', '', '

Outside the P

' ), + + 'Text markup' => array( '', 'Today is the best day to start.', 'Today is the best day to start.' ), + 'Text with ampersand (raw)' => array( '', 'Today & yesterday are the best days to start.', 'Today & yesterday are the best days to start.' ), + 'Text with tag (raw)' => array( '', 'Yesterday was the best day to start.', 'Yesterday was the best day to start.' ), + 'Text with unclosed tag (raw)' => array( '', 'Yesterday was the best day to start.', 'Yesterday was the best day to start.' ), + 'Text with ending tag (raw)' => array( '', 'Here is no
', 'Here is no
' ), + 'Text with scope-creating tag (raw)' => array( '', '

Start

Finish

Repeat', '

Start

Finish

Repeat' ), + 'Text with scope-ending tag (raw)' => array( '', 'Sneaky closing No more span.', 'Sneaky closing No more span.' ), ); $inner_html = << array( '

One thought

And another', '', '

And another' ), 'Partially-closed element' => array( '

This is all inside the DIV array( '

Inside the P

Outside the P

', '', '
Outside the P

' ), + + 'Text markup' => array( '', 'Today is the best day to start.', 'Today is the best day to start.' ), + 'Text with ampersand (raw)' => array( '', 'Today & yesterday are the best days to start.', 'Today & yesterday are the best days to start.' ), + 'Text with tag (raw)' => array( '', 'Yesterday was the best day to start.', 'Yesterday was the best day to start.' ), + 'Text with unclosed tag (raw)' => array( '', 'Yesterday was the best day to start.', 'Yesterday was the best day to start.' ), + 'Text with ending tag (raw)' => array( '', 'Here is no
', 'Here is no
' ), + 'Text with scope-creating tag (raw)' => array( '', '

Start

Finish

Repeat', '

Start

Finish

Repeat' ), + 'Text with scope-ending tag (raw)' => array( '', 'Sneaky closing No more span.', 'Sneaky closing No more span.' ), ); /*