Changeset 25255 for trunk/tests/phpunit/tests/meta.php
- Timestamp:
- 09/05/2013 04:56:36 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/meta.php
r25254 r25255 151 151 $this->assertEquals( $expected2, get_metadata( 'user', $this->author->ID, $key, true ) ); 152 152 } 153 154 function test_meta_type_cast() { 155 $post_id1 = $this->factory->post->create(); 156 add_post_meta( $post_id1, 'num_as_longtext', 123 ); 157 $post_id2 = $this->factory->post->create(); 158 add_post_meta( $post_id2, 'num_as_longtext', 99 ); 159 160 $posts = new WP_Query( array( 161 'fields' => 'ids', 162 'post_type' => 'any', 163 'meta_key' => 'num_as_longtext', 164 'meta_value' => '0', 165 'meta_compare' => '>', 166 'meta_type' => 'UNSIGNED', 167 'orderby' => 'meta_value', 168 'order' => 'ASC' 169 ) ); 170 171 $this->assertEquals( array( $post_id2, $post_id1 ), $posts->posts ); 172 $this->assertEquals( 2, substr_count( $posts->request, 'CAST(' ) ); 173 } 153 174 }
Note: See TracChangeset
for help on using the changeset viewer.