@@ -830,35 +830,32 @@ public static function data_html_with_unbalanced_tags() {
830830 'SPAN opener inside ' => array ( '<div data-wp-bind--id="myPlugin::state.id"><span>Inner content</div> ' ),
831831 'SPAN closer after ' => array ( '<div data-wp-bind--id="myPlugin::state.id">Inner content</div></span> ' ),
832832 'SPAN overlapping ' => array ( '<div data-wp-bind--id="myPlugin::state.id"><span>Inner content</div></span> ' ),
833- 'BR self-closing ' => array ( '<div data-wp-bind--id="myPlugin::state.id">Content<br></br></div> ' ),
834833 );
835834 }
836835
837836 /**
838- * Tests that the `process_directives` handles self-closing tags with invalid
839- * closing tags without causing fatal errors.
837+ * Tests that the `process_directives` handles self-closing BR tags without
838+ * causing fatal errors and processes directives correctly .
840839 *
840+ * @ticket 63891
841841 * @covers ::process_directives
842- *
843- * @expectedIncorrectUsage WP_Interactivity_API::_process_directives
844842 */
845- public function test_process_directives_handles_self_closing_tags_with_invalid_closers () {
843+ public function test_process_directives_handles_br_self_closing_tags_with_invalid_closers () {
846844 $ this ->interactivity ->state (
847845 'myPlugin ' ,
848846 array (
849847 'id ' => 'some-id ' ,
850848 ),
851849 );
852850
853- $ html = '<div data-wp-bind--id="myPlugin::state.id">Content<br></br> </div> ' ;
851+ $ html = '</br>< div data-wp-bind--id="myPlugin::state.id">Content</div> ' ;
854852
855853 $ processed_html = $ this ->interactivity ->process_directives ( $ html );
856854
857- $ this ->assertSame ( $ html , $ processed_html );
858-
859855 $ p = new WP_HTML_Tag_Processor ( $ processed_html );
860856 $ p ->next_tag ( 'div ' );
861- $ this ->assertNull ( $ p ->get_attribute ( 'id ' ) );
857+
858+ $ this ->assertSame ( 'some-id ' , $ p ->get_attribute ( 'id ' ) );
862859 }
863860
864861 /**
0 commit comments