Skip to content

Commit 4e06559

Browse files
committed
Document new assertion helper
1 parent 42bce38 commit 4e06559

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/phpunit/tests/dependencies/scripts.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,20 @@ public function tear_down() {
6969
parent::tear_down();
7070
}
7171

72+
/**
73+
* Asserts that two HTML SCRIPT tags are semantically equal within a larger HTML text.
74+
*
75+
* The expected string should contain a single SCRIPT tag with an ID attribute. This ID will
76+
* be used to locate the corresponding SCRIPT tag within the provided HTML.
77+
*
78+
* The provided HTML will be traversed to locate the SCRIPT tag with the matcing ID.
79+
*
80+
* These two tags will be compared for semantic equality of their HTML.
81+
*
82+
* @param string $expected The expected SCRIPT tag HTML.
83+
* @param string $html The HTML to search within.
84+
* @param string $message Optional. Message to display upon failure. Default 'The SCRIPT tag did not match.'.
85+
*/
7286
private function assertEqualHTMLScriptTagById( string $expected, string $html, string $message = 'The SCRIPT tag did not match.' ) {
7387
$find_id_tag_processor = new WP_HTML_Tag_Processor( $expected );
7488
$find_id_tag_processor->next_token();

0 commit comments

Comments
 (0)