File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -135,4 +135,27 @@ public function test_taxonomy_classes_hit_cache() {
135135
136136 $ this ->assertSame ( $ num_queries , get_num_queries () );
137137 }
138+
139+ /**
140+ * @ticket 64247
141+ */
142+ public function test_class_list_is_list () {
143+
144+ // Filter 'post_class' to add a duplicate, which should be removed by `array_unique()`, causing a non-indexed array.
145+ add_filter (
146+ 'post_class ' ,
147+ function ( $ classes ) {
148+ return array_merge (
149+ array ( 'duplicate-class ' , 'duplicate-class ' ),
150+ $ classes
151+ );
152+ }
153+ );
154+
155+ $ class_list = get_post_class ( 'original ' , $ this ->post_id );
156+
157+ $ this ->assertTrue ( array_is_list ( $ class_list ), 'Expected get_post_class() to return list. ' );
158+ $ this ->assertContains ( 'duplicate-class ' , $ class_list );
159+ $ this ->assertContains ( 'original ' , $ class_list );
160+ }
138161}
You can’t perform that action at this time.
0 commit comments