Skip to content

Commit 565c1fc

Browse files
committed
Explain tests that were previously asserting invalid behaviors. (comments-rest)
1 parent 36ebba8 commit 565c1fc

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/phpunit/tests/rest-api/rest-comments-controller.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3107,6 +3107,19 @@ public function test_comment_roundtrip_as_editor_unfiltered_html() {
31073107
}
31083108
}
31093109

3110+
/**
3111+
* Ensures that saving a comment as a super-admin does not corrupt the
3112+
* comment content when presented with common edge cases.
3113+
*
3114+
* Note that this test used to assert the wrong behavior due to a bug
3115+
* in {@see wp_html_split()}. Whereby the unescaped `<` used to be
3116+
* mistakenly identified as the start of an HTML tag or comment, this
3117+
* led to accidental replacement “inside” the mistaken tag. The test
3118+
* has been updated with `wp_html_split()` in accordance with the
3119+
* HTML5 living specification.
3120+
*
3121+
* @ticket {TICKET_NUMBER}
3122+
*/
31103123
public function test_comment_roundtrip_as_superadmin() {
31113124
wp_set_current_user( self::$superadmin_id );
31123125

0 commit comments

Comments
 (0)