Changeset 32659
- Timestamp:
- 05/30/2015 01:03:07 PM (10 years ago)
- Location:
- trunk/tests/phpunit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/factory.php
r27178 r32659 251 251 function add_post_terms( $post_id, $terms, $taxonomy, $append = true ) { 252 252 return wp_set_post_terms( $post_id, $terms, $taxonomy, $append ); 253 } 254 255 function create_and_get( $args = array(), $generation_definitions = null ) { 256 $term_id = $this->create( $args, $generation_definitions ); 257 $taxonomy = isset( $args['taxonomy'] ) ? $args['taxonomy'] : $this->taxonomy; 258 return get_term( $term_id, $taxonomy ); 253 259 } 254 260 -
trunk/tests/phpunit/tests/includes/factory.php
r25002 r32659 29 29 $this->assertEquals( $id, $term->term_id ); 30 30 } 31 32 /** 33 * @ticket 32536 34 */ 35 public function test_term_factory_create_and_get_should_return_term_object() { 36 register_taxonomy( 'wptests_tax', 'post' ); 37 $term = $this->factory->term->create_and_get( array( 'taxonomy' => 'wptests_tax' ) ); 38 $this->assertInternalType( 'object', $term ); 39 $this->assertNotEmpty( $term->term_id ); 40 } 31 41 }
Note: See TracChangeset
for help on using the changeset viewer.