diff --git a/tests/phpunit/tests/term/query.php b/tests/phpunit/tests/term/query.php
index 09925cdc7b..c55e136be8 100644
|
a
|
b
|
class Tests_Term_Query extends WP_UnitTestCase {
|
| 292 | 292 | $this->assertSame( $t, reset( $query->terms )->term_id ); |
| 293 | 293 | } |
| 294 | 294 | |
| | 295 | public function test_number_should_not_limit_results_with_object_ids() { |
| | 296 | register_taxonomy( 'wptests_tax_1', 'post' ); |
| | 297 | $posts = self::factory()->post->create_many( 2 ); |
| | 298 | $t = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax_1' ) ); |
| | 299 | $t_common = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax_1' ) ); |
| | 300 | |
| | 301 | wp_set_object_terms( $posts[0], array( $t_common, $t ), 'wptests_tax_1' ); |
| | 302 | wp_set_object_terms( $posts[1], array( $t_common ), 'wptests_tax_1' ); |
| | 303 | |
| | 304 | $query = new WP_Term_Query( |
| | 305 | array( |
| | 306 | 'taxonomy' => 'wptests_tax_1', |
| | 307 | 'object_ids' => $posts, |
| | 308 | 'order' => 'DESC', |
| | 309 | 'number' => 2 |
| | 310 | ) |
| | 311 | ); |
| | 312 | |
| | 313 | $this->assertSame(2, count($query->terms)); |
| | 314 | } |
| | 315 | |
| 295 | 316 | /** |
| 296 | 317 | * @ticket 37198 |
| 297 | 318 | */ |