@@ -99,7 +99,13 @@ public function test_columns_should_be_sortable( $order, $orderby, $search, $exp
9999 unset( $ _REQUEST ['orderby ' ] );
100100 unset( $ _REQUEST ['s ' ] );
101101
102- $ this ->assertStringContainsString ( "ORDER BY {$ wpdb ->posts }. {$ expected }" , $ this ->sql );
102+ $ expected_query = explode ( ', ' , $ expected );
103+ $ expected_query = array_map ( function ( $ item ) use ( $ wpdb ) {
104+ return "{$ wpdb ->posts }. {$ item }" ;
105+ }, $ expected_query );
106+ $ expected_query = implode ( ', ' , $ expected_query );
107+
108+ $ this ->assertStringContainsString ( "ORDER BY {$ expected_query }" , $ this ->sql );
103109 }
104110
105111 /**
@@ -136,42 +142,42 @@ public function data_columns_should_be_sortable() {
136142 'order ' => null ,
137143 'orderby ' => null ,
138144 's ' => null ,
139- 'expected ' => 'post_date DESC ' ,
145+ 'expected ' => 'post_date DESC, ID DESC ' ,
140146 ),
141147 // Default order (ID) DESC.
142148 array (
143149 'order ' => '' ,
144150 'orderby ' => '' ,
145151 's ' => '' ,
146- 'expected ' => 'post_date DESC ' ,
152+ 'expected ' => 'post_date DESC, ID DESC ' ,
147153 ),
148154 // Order by requester (post_title) ASC.
149155 array (
150156 'order ' => 'ASC ' ,
151157 'orderby ' => 'requester ' ,
152158 's ' => '' ,
153- 'expected ' => 'post_title ASC ' ,
159+ 'expected ' => 'post_title ASC, ID ASC ' ,
154160 ),
155161 // Order by requester (post_title) DESC.
156162 array (
157163 'order ' => 'DESC ' ,
158164 'orderby ' => 'requester ' ,
159165 's ' => null ,
160- 'expected ' => 'post_title DESC ' ,
166+ 'expected ' => 'post_title DESC, ID DESC ' ,
161167 ),
162168 // Order by requested (post_date) ASC.
163169 array (
164170 'order ' => 'ASC ' ,
165171 'orderby ' => 'requested ' ,
166172 's ' => null ,
167- 'expected ' => 'post_date ASC ' ,
173+ 'expected ' => 'post_date ASC, ID ASC ' ,
168174 ),
169175 // Order by requested (post_date) DESC.
170176 array (
171177 'order ' => 'DESC ' ,
172178 'orderby ' => 'requested ' ,
173179 's ' => null ,
174- 'expected ' => 'post_date DESC ' ,
180+ 'expected ' => 'post_date DESC, ID DESC ' ,
175181 ),
176182 // Search and order by relevance.
177183 array (
0 commit comments