diff --git a/tests/phpunit/tests/term/query.php b/tests/phpunit/tests/term/query.php
index 09925cdc7b..c55e136be8 100644
--- a/tests/phpunit/tests/term/query.php
+++ b/tests/phpunit/tests/term/query.php
@@ -292,6 +292,27 @@ class Tests_Term_Query extends WP_UnitTestCase {
 		$this->assertSame( $t, reset( $query->terms )->term_id );
 	}
 
+	public function test_number_should_not_limit_results_with_object_ids() {
+		register_taxonomy( 'wptests_tax_1', 'post' );
+		$posts = self::factory()->post->create_many( 2 );
+		$t     = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax_1' ) );
+		$t_common = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax_1' ) );
+
+		wp_set_object_terms( $posts[0], array( $t_common, $t ), 'wptests_tax_1' );
+		wp_set_object_terms( $posts[1], array( $t_common ), 'wptests_tax_1' );
+
+		$query = new WP_Term_Query(
+			array(
+				'taxonomy' => 'wptests_tax_1',
+				'object_ids' => $posts,
+				'order' => 'DESC',
+				'number' => 2
+			)
+		);
+
+		$this->assertSame(2, count($query->terms));
+	}
+
 	/**
 	 * @ticket 37198
 	 */
