Tests: `get_terms()` 'search' test should have more precise fixtures..

Without a fixture that does not match the search term, it's possible for the
test to pass even if the search clause isn't built properly.

See #13992, #35381.

git-svn-id: https://develop.svn.wordpress.org/trunk@37519 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges 2016-05-23 03:25:51 +00:00
parent d11f7ed391
commit dd70966885
1 changed files with 1 additions and 0 deletions

View File

@ -267,6 +267,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase {
function test_get_terms_search() {
$term_id1 = self::factory()->tag->create( array( 'slug' => 'burrito' ) );
$term_id2 = self::factory()->tag->create( array( 'name' => 'Wilbur' ) );
$term_id3 = self::factory()->tag->create( array( 'name' => 'Foo' ) );
$terms = get_terms( 'post_tag', array( 'hide_empty' => false, 'search' => 'bur', 'fields' => 'ids' ) );
$this->assertEqualSets( array( $term_id1, $term_id2 ), $terms );