Skip to content

Commit 26d1dbb

Browse files
committed
Tests: Add test for passing a query string to get_posts().
1 parent 25af7c1 commit 26d1dbb

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/phpunit/tests/post/getPosts.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,18 @@ public function test_explicit_offset_non_0_should_override_paged() {
163163

164164
$this->assertSame( array( $p3 ), $found );
165165
}
166+
167+
/**
168+
* Verifies that get_posts() accepts a query string for the `$args` parameter.
169+
*
170+
* @ticket 64813
171+
*/
172+
public function test_should_accept_query_string_args() {
173+
$p1 = self::factory()->post->create();
174+
$p2 = self::factory()->post->create();
175+
176+
$found = get_posts( 'numberposts=1&fields=ids' );
177+
178+
$this->assertSame( array( $p2 ), $found );
179+
}
166180
}

0 commit comments

Comments
 (0)