File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
tests/phpunit/tests/html-api Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -863,4 +863,30 @@ public function test_adjusts_for_mathml_integration_points() {
863863 'Found the wrong namespace for the transformed "IMAGE"/"IMG" element. '
864864 );
865865 }
866+
867+ /**
868+ * @ticket TBD
869+ *
870+ * @dataProvider data_set_inner_html
871+ */
872+ public function test_set_inner_html ( string $ html , string $ replacement , string $ expected ) {
873+ $ processor = WP_HTML_Processor::create_fragment ( $ html );
874+ while ( $ processor ->next_tag () ) {
875+ if ( $ processor ->get_attribute ( 'target ' ) ) {
876+ break ;
877+ }
878+ }
879+ $ processor ->set_inner_html ( $ replacement );
880+ $ this ->assertSame ( $ expected , $ processor ->get_updated_html () );
881+ }
882+
883+ public static function data_set_inner_html () {
884+ return array (
885+ 'image in mathml ' => array (
886+ '<div target>replace me</div> ' ,
887+ 'with me! ' ,
888+ '<div target>with me!</div> ' ,
889+ ),
890+ );
891+ }
866892}
You can’t perform that action at this time.
0 commit comments