@@ -205,29 +205,29 @@ public function data_single_tags() {
205205 }
206206
207207 /**
208+ * Tests closing unknown single tags.
209+ *
208210 * @ticket 1597
211+ * @dataProvider data_unknown_single_tags_with_closing_tag
209212 */
210- public function test_closes_unknown_single_tags_with_closing_tag () {
213+ public function test_closes_unknown_single_tags_with_closing_tag ( $ input , $ expected ) {
214+ $ this ->assertSame ( $ expected , balanceTags ( $ input , true ) );
215+ }
211216
212- $ inputs = array (
213- '<strong/> ' ,
214- '<em /> ' ,
215- '<p class="main1"/> ' ,
216- '<p class="main2" /> ' ,
217- '<STRONG/> ' ,
218- );
219- $ expected = array (
220- '<strong></strong> ' ,
221- '<em></em> ' ,
222- '<p class="main1"></p> ' ,
223- '<p class="main2"></p> ' ,
217+ /**
218+ * Data provider for test_closes_unknown_single_tags_with_closing_tag.
219+ *
220+ * @return array<string, array<string, string>>
221+ */
222+ public function data_unknown_single_tags_with_closing_tag () {
223+ return array (
224+ 'default ' => array ( '<strong/> ' , '<strong></strong> ' ),
225+ 'with-space ' => array ( '<em /> ' , '<em></em> ' ),
226+ 'with-class ' => array ( '<p class="main1"/> ' , '<p class="main1"></p> ' ),
227+ 'with-class-and-space ' => array ( '<p class="main2" /> ' , '<p class="main2"></p> ' ),
224228 // Valid tags are transformed to lowercase.
225- '< strong></strong> ' ,
229+ 'uppercase ' => array ( ' <STRONG/> ' , ' < strong></strong> ' ) ,
226230 );
227-
228- foreach ( $ inputs as $ key => $ input ) {
229- $ this ->assertSame ( $ expected [ $ key ], balanceTags ( $ inputs [ $ key ], true ) );
230- }
231231 }
232232
233233 public function test_closes_unclosed_single_tags_having_attributes () {
0 commit comments