Changeset 44452 for trunk/tests/phpunit/tests/post/query.php
- Timestamp:
- 01/08/2019 03:32:04 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/query.php
r43571 r44452 172 172 ) 173 173 ); 174 $this->assertSame( $ordered, wp_list_pluck( $q->posts, 'ID' ) ); 175 } 176 177 /** 178 * @ticket 38034 179 */ 180 public function test_orderby_post__in_array() { 181 $posts = self::factory()->post->create_many( 4 ); 182 183 $ordered = array( $posts[2], $posts[0], $posts[3] ); 184 185 $q = new WP_Query( array( 186 'post_type' => 'any', 187 'post__in' => $ordered, 188 'orderby' => array( 'post__in' => 'ASC' ), 189 ) ); 190 $this->assertSame( $ordered, wp_list_pluck( $q->posts, 'ID' ) ); 191 } 192 193 /** 194 * @ticket 38034 195 */ 196 public function test_orderby_post__in_array_with_implied_order() { 197 $posts = self::factory()->post->create_many( 4 ); 198 199 $ordered = array( $posts[2], $posts[0], $posts[3] ); 200 201 $q = new WP_Query( array( 202 'post_type' => 'any', 203 'post__in' => $ordered, 204 'orderby' => 'post__in', 205 ) ); 174 206 $this->assertSame( $ordered, wp_list_pluck( $q->posts, 'ID' ) ); 175 207 }
Note: See TracChangeset
for help on using the changeset viewer.