Make WordPress Core


Ignore:
Timestamp:
10/15/2015 06:52:19 AM (9 years ago)
Author:
wonderboymusic
Message:

Unit Tests: create fewer terms in Tests_Term_getTerms::test_get_terms_parent_zero()

See #30017, #33968.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/term/getTerms.php

    r35117 r35196  
    287287
    288288        $brie = $this->factory->term->create( array( 'name' => 'Brie', 'parent' => $cheese, 'taxonomy' => $tax ) );
    289         $post_ids = $this->factory->post->create_many( 7 );
    290         foreach ( $post_ids as $id ) {
    291             wp_set_post_terms( $id, $brie, $tax );
    292         }
     289        $post_id = $this->factory->post->create();
     290        wp_set_post_terms( $post_id, $brie, $tax );
    293291        $term = get_term( $brie, $tax );
    294         $this->assertEquals( 7, $term->count );
     292        $this->assertEquals( 1, $term->count );
    295293
    296294        $crackers = $this->factory->term->create( array( 'name' => 'Crackers', 'taxonomy' => $tax ) );
     
    305303
    306304        $multigrain = $this->factory->term->create( array( 'name' => 'Multigrain', 'parent' => $crackers, 'taxonomy' => $tax ) );
    307         $post_ids = $this->factory->post->create_many( 3 );
     305        $post_ids = $this->factory->post->create_many( 1 );
    308306        foreach ( $post_ids as $id ) {
    309307            wp_set_post_terms( $id, $multigrain, $tax );
    310308        }
    311309        $term = get_term( $multigrain, $tax );
    312         $this->assertEquals( 3, $term->count );
     310        $this->assertEquals( 1, $term->count );
    313311
    314312        $fruit = $this->factory->term->create( array( 'name' => 'Fruit', 'taxonomy' => $tax ) );
Note: See TracChangeset for help on using the changeset viewer.