Changeset 35196 for trunk/tests/phpunit/tests/term/getTerms.php
- Timestamp:
- 10/15/2015 06:52:19 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/getTerms.php
r35117 r35196 287 287 288 288 $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 ); 293 291 $term = get_term( $brie, $tax ); 294 $this->assertEquals( 7, $term->count );292 $this->assertEquals( 1, $term->count ); 295 293 296 294 $crackers = $this->factory->term->create( array( 'name' => 'Crackers', 'taxonomy' => $tax ) ); … … 305 303 306 304 $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 ); 308 306 foreach ( $post_ids as $id ) { 309 307 wp_set_post_terms( $id, $multigrain, $tax ); 310 308 } 311 309 $term = get_term( $multigrain, $tax ); 312 $this->assertEquals( 3, $term->count );310 $this->assertEquals( 1, $term->count ); 313 311 314 312 $fruit = $this->factory->term->create( array( 'name' => 'Fruit', 'taxonomy' => $tax ) );
Note: See TracChangeset
for help on using the changeset viewer.