@@ -22,7 +22,7 @@ class Tests_HtmlApi_WpHtmlProcessor_Token_Scanning extends WP_UnitTestCase {
2222 * @covers WP_HTML_Tag_Processor::next_token
2323 */
2424 public function test_completes_empty_document () {
25- $ processor = WP_HTML_Processor:: create_fragment ( '' );
25+ $ processor = new WP_HTML_Tag_Processor ( '' );
2626
2727 $ this ->assertFalse (
2828 $ processor ->next_token (),
@@ -40,7 +40,7 @@ public function test_completes_empty_document() {
4040 * @covers WP_HTML_Tag_Processor::next_token
4141 */
4242 public function test_basic_assertion_text_node () {
43- $ processor = WP_HTML_Processor:: create_fragment ( 'Hello, World! ' );
43+ $ processor = new WP_HTML_Tag_Processor ( 'Hello, World! ' );
4444 $ processor ->next_token ();
4545
4646 $ this ->assertSame (
@@ -66,7 +66,7 @@ public function test_basic_assertion_text_node() {
6666 * @covers WP_HTML_Tag_Processor::next_token
6767 */
6868 public function test_basic_assertion_element () {
69- $ processor = WP_HTML_Processor:: create_fragment ( '<div id="test" inert>Hello, World!</div> ' );
69+ $ processor = new WP_HTML_Tag_Processor ( '<div id="test" inert>Hello, World!</div> ' );
7070 $ processor ->next_token ();
7171
7272 $ this ->assertSame (
@@ -111,7 +111,7 @@ public function test_basic_assertion_element() {
111111 * @covers WP_HTML_Tag_Processor::next_token
112112 */
113113 public function test_basic_assertion_script_element () {
114- $ processor = WP_HTML_Processor:: create_fragment ( '<script type="module">console.log( "Hello, World!" );</script> ' );
114+ $ processor = new WP_HTML_Tag_Processor ( '<script type="module">console.log( "Hello, World!" );</script> ' );
115115 $ processor ->next_token ();
116116
117117 $ this ->assertSame (
@@ -151,7 +151,7 @@ public function test_basic_assertion_script_element() {
151151 * @covers WP_HTML_Tag_Processor::next_token
152152 */
153153 public function test_basic_assertion_textarea_element () {
154- $ processor = WP_HTML_Processor:: create_fragment (
154+ $ processor = new WP_HTML_Tag_Processor (
155155 <<<HTML
156156<textarea rows=30 cols="80">
157157Is <HTML> > XHTML?
@@ -204,7 +204,7 @@ public function test_basic_assertion_textarea_element() {
204204 * @covers WP_HTML_Tag_Processor::next_token
205205 */
206206 public function test_basic_assertion_title_element () {
207- $ processor = WP_HTML_Processor:: create_fragment (
207+ $ processor = new WP_HTML_Tag_Processor (
208208 <<<HTML
209209<title class="multi-line-title">
210210Is <HTML> > XHTML?
@@ -254,7 +254,7 @@ public function test_basic_assertion_title_element() {
254254 * @param string $tag_name The name of the RAWTEXT tag to test.
255255 */
256256 public function test_basic_assertion_rawtext_elements ( $ tag_name ) {
257- $ processor = WP_HTML_Processor:: create_fragment (
257+ $ processor = new WP_HTML_Tag_Processor (
258258 <<<HTML
259259< {$ tag_name } class="multi-line-title">
260260Is <HTML> > XHTML?
@@ -315,7 +315,7 @@ public function data_rawtext_elements() {
315315 * @covers WP_HTML_Tag_Processor::next_token
316316 */
317317 public function test_basic_assertion_cdata_section () {
318- $ processor = WP_HTML_Processor:: create_fragment ( '<![CDATA[this is a comment]]> ' );
318+ $ processor = new WP_HTML_Tag_Processor ( '<![CDATA[this is a comment]]> ' );
319319 $ processor ->next_token ();
320320
321321 $ this ->assertSame (
@@ -351,7 +351,7 @@ public function test_basic_assertion_cdata_section() {
351351 * @covers WP_HTML_Tag_Processor::next_token
352352 */
353353 public function test_basic_assertion_abruptly_closed_cdata_section () {
354- $ processor = WP_HTML_Processor:: create_fragment ( '<![CDATA[this is > a comment]]> ' );
354+ $ processor = new WP_HTML_Tag_Processor ( '<![CDATA[this is > a comment]]> ' );
355355 $ processor ->next_token ();
356356
357357 $ this ->assertSame (
@@ -401,7 +401,7 @@ public function test_basic_assertion_abruptly_closed_cdata_section() {
401401 * @covers WP_HTML_Tag_Processor::next_token
402402 */
403403 public function test_basic_assertion_processing_instruction () {
404- $ processor = WP_HTML_Processor:: create_fragment ( '<?wp-bit {"just": "kidding"}?> ' );
404+ $ processor = new WP_HTML_Tag_Processor ( '<?wp-bit {"just": "kidding"}?> ' );
405405 $ processor ->next_token ();
406406
407407 $ this ->assertSame (
@@ -443,7 +443,7 @@ public function test_basic_assertion_processing_instruction() {
443443 * @covers WP_HTML_Tag_Processor::next_token
444444 */
445445 public function test_basic_assertion_abruptly_closed_processing_instruction () {
446- $ processor = WP_HTML_Processor:: create_fragment ( '<?version=">=5.3.6"?> ' );
446+ $ processor = new WP_HTML_Tag_Processor ( '<?version=">=5.3.6"?> ' );
447447 $ processor ->next_token ();
448448
449449 $ this ->assertSame (
@@ -498,7 +498,7 @@ public function test_basic_assertion_abruptly_closed_processing_instruction() {
498498 * @param string $text Contains the appropriate modifiable text.
499499 */
500500 public function test_basic_assertion_common_comments ( $ html , $ text ) {
501- $ processor = WP_HTML_Processor:: create_fragment ( $ html );
501+ $ processor = new WP_HTML_Tag_Processor ( $ html );
502502 $ processor ->next_token ();
503503
504504 $ this ->assertSame (
@@ -557,7 +557,7 @@ public function data_common_comments() {
557557 * @covers WP_HTML_Tag_Processor::next_token
558558 */
559559 public function test_basic_assertion_html_comment () {
560- $ processor = WP_HTML_Processor:: create_fragment ( '<!-- wp:paragraph --> ' );
560+ $ processor = new WP_HTML_Tag_Processor ( '<!-- wp:paragraph --> ' );
561561 $ processor ->next_token ();
562562
563563 $ this ->assertSame (
@@ -599,7 +599,7 @@ public function test_basic_assertion_html_comment() {
599599 * @covers WP_HTML_Tag_Processor::next_token
600600 */
601601 public function test_basic_assertion_doctype () {
602- $ processor = WP_HTML_Processor:: create_fragment ( '<!DOCTYPE html> ' );
602+ $ processor = new WP_HTML_Tag_Processor ( '<!DOCTYPE html> ' );
603603 $ processor ->next_token ();
604604
605605 $ this ->assertSame (
@@ -641,7 +641,7 @@ public function test_basic_assertion_doctype() {
641641 * @covers WP_HTML_Tag_Processor::next_token
642642 */
643643 public function test_basic_assertion_presumptuous_tag () {
644- $ processor = WP_HTML_Processor:: create_fragment ( '</> ' );
644+ $ processor = new WP_HTML_Tag_Processor ( '</> ' );
645645 $ processor ->next_token ();
646646
647647 $ this ->assertSame (
@@ -683,7 +683,7 @@ public function test_basic_assertion_presumptuous_tag() {
683683 * @covers WP_HTML_Tag_Processor::next_token
684684 */
685685 public function test_basic_assertion_funky_comment () {
686- $ processor = WP_HTML_Processor:: create_fragment ( '</%url> ' );
686+ $ processor = new WP_HTML_Tag_Processor ( '</%url> ' );
687687 $ processor ->next_token ();
688688
689689 $ this ->assertSame (
0 commit comments