Make WordPress Core

Ticket #37904: 37904.tests.diff

File 37904.tests.diff, 840 bytes (added by TimothyBlynJacobs, 8 years ago)
  • tests/phpunit/tests/term/query.php

     
    165165
    166166                $this->assertNotEmpty( $q2->terms );
    167167        }
     168
     169        public function test_order_by_include_with_comma_separated_list() {
     170
     171                register_taxonomy( 'wptests_tax_1', 'post' );
     172
     173                $t1 = self::factory()->term->create_and_get( array( 'taxonomy' => 'wptests_tax_1' ) );
     174                $t2 = self::factory()->term->create_and_get( array( 'taxonomy' => 'wptests_tax_1' ) );
     175
     176                $query = new WP_Term_Query( array(
     177                        'include' => "{$t1->term_id},{$t2->term_id}",
     178                        'orderby' => 'include',
     179                        'hide_empty' => false,
     180                ) );
     181                $terms = $query->get_terms();
     182
     183                $this->assertEquals( array( $t1, $t2 ), $terms );
     184        }
    168185}