Changeset 42343 for trunk/tests/phpunit/tests/includes/factory.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/includes/factory.php
r35242 r42343 9 9 function test_create_creates_a_category() { 10 10 $id = $this->category_factory->create(); 11 $this->assertTrue( (bool) get_term_by( 'id', $id, 'category' ) );11 $this->assertTrue( (bool) get_term_by( 'id', $id, 'category' ) ); 12 12 } 13 13 14 14 function test_get_object_by_id_gets_an_object() { 15 15 $id = $this->category_factory->create(); 16 $this->assertTrue( (bool) $this->category_factory->get_object_by_id( $id ) );16 $this->assertTrue( (bool) $this->category_factory->get_object_by_id( $id ) ); 17 17 } 18 18 19 19 function test_get_object_by_id_gets_an_object_with_the_same_name() { 20 $id = $this->category_factory->create( array( 'name' => 'Boo') );20 $id = $this->category_factory->create( array( 'name' => 'Boo' ) ); 21 21 $object = $this->category_factory->get_object_by_id( $id ); 22 22 $this->assertEquals( 'Boo', $object->name ); … … 25 25 function test_the_taxonomy_argument_overrules_the_factory_taxonomy() { 26 26 $term_factory = new WP_UnitTest_Factory_For_term( null, 'category' ); 27 $id = $term_factory->create( array( 'taxonomy' => 'post_tag' ) );28 $term = get_term( $id, 'post_tag' );27 $id = $term_factory->create( array( 'taxonomy' => 'post_tag' ) ); 28 $term = get_term( $id, 'post_tag' ); 29 29 $this->assertEquals( $id, $term->term_id ); 30 30 }
Note: See TracChangeset
for help on using the changeset viewer.