@@ -126,7 +126,7 @@ public function bench_tag_processor_html_parsing( array $params ): void {
126126 }
127127
128128 public function set_up_html_tag_processor ( array $ params ): void {
129- $ this ->processor = new WP_HTML_Tag_Processor ( $ params [0 ] );
129+ $ this ->processor = new WP_HTML_Tag_Processor ( file_get_contents ( $ params [0 ] ) );
130130 }
131131
132132 /**
@@ -146,7 +146,7 @@ public function bench_html_fragment_parsing( array $params ): void {
146146 }
147147
148148 public function set_up_html_fragment_processor ( array $ params ): void {
149- $ this ->processor = WP_HTML_Processor::create_fragment ( $ params [0 ] );
149+ $ this ->processor = WP_HTML_Processor::create_fragment ( file_get_contents ( $ params [0 ] ) );
150150 }
151151
152152 /**
@@ -166,12 +166,12 @@ public function bench_html_full_parsing( array $params ): void {
166166 }
167167
168168 public function set_up_html_full_parser ( array $ params ): void {
169- $ this ->processor = WP_HTML_Processor::create_full_parser ( $ params [0 ] );
169+ $ this ->processor = WP_HTML_Processor::create_full_parser ( file_get_contents ( $ params [0 ] ) );
170170 }
171171
172172 public static function provide_html (): iterable {
173- yield 'Empty string ' => array ( '' );
174- yield 'Short doc ' => array ( '<h1>Hello, world!</h1> ' );
175- yield 'HTML Standard ' => array ( file_get_contents ( DIR_BENCHMARKDATA . '/html-standard.html ' ) );
173+ yield 'Empty string ' => array ( 'data://text/html, ' );
174+ yield 'Short doc ' => array ( 'data://text/html, <h1>Hello, world!</h1> ' );
175+ yield 'HTML Standard ' => array ( ' file:// ' . DIR_BENCHMARKDATA . '/html-standard.html ' );
176176 }
177177}
0 commit comments