Changeset 34997 for trunk/tests/phpunit/tests/term/getTerm.php
- Timestamp:
- 10/10/2015 01:58:37 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/getTerm.php
r34035 r34997 34 34 35 35 $this->assertSame( $num_queries, $wpdb->num_queries ); 36 }37 38 public function test_passing_term_object_should_not_skip_database_query_when_filter_property_is_set() {39 global $wpdb;40 41 $term = $this->factory->term->create_and_get( array( 'taxonomy' => 'wptests_tax' ) );42 clean_term_cache( $term->term_id, 'wptests_tax' );43 44 $num_queries = $wpdb->num_queries;45 46 $term_a = get_term( $term, 'wptests_tax' );47 48 $this->assertSame( $num_queries + 1, $wpdb->num_queries );49 36 } 50 37 … … 99 86 $this->assertInternalType( 'object', get_term( $t, 'wptests_tax', 'foo' ) ); 100 87 } 88 89 /** 90 * @ticket 14162 91 */ 92 public function test_numeric_properties_should_be_cast_to_ints() { 93 global $wpdb; 94 95 $t = $this->factory->term->create( array( 'taxonomy' => 'wptests_tax' ) ); 96 97 // Get raw data from the database. 98 $term_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->terms t JOIN $wpdb->term_taxonomy tt ON ( t.term_id = tt.term_id ) WHERE t.term_id = %d", $t ) ); 99 100 $found = get_term( $term_data ); 101 102 $this->assertTrue( $found instanceof WP_Term ); 103 $this->assertInternalType( 'int', $found->term_id ); 104 $this->assertInternalType( 'int', $found->term_taxonomy_id ); 105 $this->assertInternalType( 'int', $found->parent ); 106 $this->assertInternalType( 'int', $found->count ); 107 $this->assertInternalType( 'int', $found->term_group ); 108 } 101 109 }
Note: See TracChangeset
for help on using the changeset viewer.