Changeset 51331 for trunk/tests/phpunit/tests/post/meta.php
- Timestamp:
- 07/05/2021 05:21:53 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/meta.php
r49603 r51331 47 47 function test_unique_postmeta() { 48 48 // Add a unique post meta item. 49 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'unique', 'value', true ) );49 $this->assertIsInt( add_post_meta( self::$post_id, 'unique', 'value', true ) ); 50 50 51 51 // Check unique is enforced. … … 70 70 function test_nonunique_postmeta() { 71 71 // Add two non-unique post meta items. 72 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'nonunique', 'value' ) );73 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'nonunique', 'another value' ) );72 $this->assertIsInt( add_post_meta( self::$post_id, 'nonunique', 'value' ) ); 73 $this->assertIsInt( add_post_meta( self::$post_id, 'nonunique', 'another value' ) ); 74 74 75 75 // Check they exist. … … 88 88 89 89 // Add a third one. 90 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'nonunique', 'someother value' ) );90 $this->assertIsInt( add_post_meta( self::$post_id, 'nonunique', 'someother value' ) ); 91 91 92 92 // Check they exist. … … 107 107 function test_update_post_meta() { 108 108 // Add a unique post meta item. 109 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'unique_update', 'value', true ) );109 $this->assertIsInt( add_post_meta( self::$post_id, 'unique_update', 'value', true ) ); 110 110 111 111 // Add two non-unique post meta items. 112 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'nonunique_update', 'value' ) );113 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'nonunique_update', 'another value' ) );112 $this->assertIsInt( add_post_meta( self::$post_id, 'nonunique_update', 'value' ) ); 113 $this->assertIsInt( add_post_meta( self::$post_id, 'nonunique_update', 'another value' ) ); 114 114 115 115 // Check they exist. … … 134 134 function test_delete_post_meta() { 135 135 // Add two unique post meta items. 136 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'unique_delete', 'value', true ) );137 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id_2, 'unique_delete', 'value', true ) );136 $this->assertIsInt( add_post_meta( self::$post_id, 'unique_delete', 'value', true ) ); 137 $this->assertIsInt( add_post_meta( self::$post_id_2, 'unique_delete', 'value', true ) ); 138 138 139 139 // Check they exist. … … 151 151 function test_delete_post_meta_by_key() { 152 152 // Add two unique post meta items. 153 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'unique_delete_by_key', 'value', true ) );154 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id_2, 'unique_delete_by_key', 'value', true ) );153 $this->assertIsInt( add_post_meta( self::$post_id, 'unique_delete_by_key', 'value', true ) ); 154 $this->assertIsInt( add_post_meta( self::$post_id_2, 'unique_delete_by_key', 'value', true ) ); 155 155 156 156 // Check they exist. … … 168 168 function test_get_post_meta_by_id() { 169 169 $mid = add_post_meta( self::$post_id, 'get_post_meta_by_key', 'get_post_meta_by_key_value', true ); 170 $this->assertI nternalType( 'integer',$mid );170 $this->assertIsInt( $mid ); 171 171 172 172 $mobj = new stdClass; … … 179 179 180 180 $mid = add_post_meta( self::$post_id, 'get_post_meta_by_key', array( 'foo', 'bar' ), true ); 181 $this->assertI nternalType( 'integer',$mid );181 $this->assertIsInt( $mid ); 182 182 $mobj->meta_id = $mid; 183 183 $mobj->meta_value = array( 'foo', 'bar' ); … … 188 188 function test_delete_meta() { 189 189 $mid = add_post_meta( self::$post_id, 'delete_meta', 'delete_meta_value', true ); 190 $this->assertI nternalType( 'integer',$mid );190 $this->assertIsInt( $mid ); 191 191 192 192 $this->assertTrue( delete_meta( $mid ) ); … … 198 198 function test_update_meta() { 199 199 // Add a unique post meta item. 200 $this->assertInternalType( 'integer', $mid1 = add_post_meta( self::$post_id, 'unique_update', 'value', true ) ); 200 $mid1 = add_post_meta( self::$post_id, 'unique_update', 'value', true ); 201 $this->assertIsInt( $mid1 ); 201 202 202 203 // Add two non-unique post meta items. 203 $this->assertInternalType( 'integer', $mid2 = add_post_meta( self::$post_id, 'nonunique_update', 'value' ) ); 204 $this->assertInternalType( 'integer', $mid3 = add_post_meta( self::$post_id, 'nonunique_update', 'another value' ) ); 204 $mid2 = add_post_meta( self::$post_id, 'nonunique_update', 'value' ); 205 $this->assertIsInt( $mid2 ); 206 $mid3 = add_post_meta( self::$post_id, 'nonunique_update', 'another value' ); 207 $this->assertIsInt( $mid3 ); 205 208 206 209 // Check they exist. … … 243 246 244 247 // Add a post meta item. 245 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'test_funky_post_meta', $funky_meta, true ) );248 $this->assertIsInt( add_post_meta( self::$post_id, 'test_funky_post_meta', $funky_meta, true ) ); 246 249 247 250 // Check it exists. … … 319 322 wp_cache_delete( 'last_changed', 'posts' ); 320 323 321 $this->assertI nternalType( 'integer',add_metadata( 'post', $post_id, 'foo', 'bar' ) );324 $this->assertIsInt( add_metadata( 'post', $post_id, 'foo', 'bar' ) ); 322 325 $this->assertNotFalse( wp_cache_get_last_changed( 'posts' ) ); 323 326 } … … 331 334 wp_cache_delete( 'last_changed', 'posts' ); 332 335 333 $this->assertI nternalType( 'integer',update_metadata( 'post', $post_id, 'foo', 'bar' ) );336 $this->assertIsInt( update_metadata( 'post', $post_id, 'foo', 'bar' ) ); 334 337 $this->assertNotFalse( wp_cache_get_last_changed( 'posts' ) ); 335 338 }
Note: See TracChangeset
for help on using the changeset viewer.