Changeset 38699 for trunk/tests/phpunit/tests/meta.php
- Timestamp:
- 10/01/2016 06:27:27 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/meta.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/meta.php
r35242 r38699 294 294 295 295 /** 296 * @ticket 37746 297 */ 298 function test_negative_meta_id() { 299 $negative_mid = $this->meta_id * -1; 300 301 $this->assertTrue( $negative_mid < 0 ); 302 $this->assertFalse( get_metadata_by_mid( 'user', $negative_mid ) ); 303 $this->assertFalse( update_metadata_by_mid( 'user', $negative_mid, 'meta_new_value' ) ); 304 $this->assertFalse( delete_metadata_by_mid( 'user', $negative_mid ) ); 305 } 306 307 /** 308 * @ticket 37746 309 */ 310 function test_floating_meta_id() { 311 $floating_mid = $this->meta_id + 0.1337; 312 313 $this->assertTrue( floor( $floating_mid ) !== $floating_mid ); 314 $this->assertFalse( get_metadata_by_mid( 'user', $floating_mid ) ); 315 $this->assertFalse( update_metadata_by_mid( 'user', $floating_mid, 'meta_new_value' ) ); 316 $this->assertFalse( delete_metadata_by_mid( 'user', $floating_mid ) ); 317 } 318 319 /** 320 * @ticket 37746 321 */ 322 function test_string_point_zero_meta_id() { 323 $meta_id = add_metadata( 'user', $this->author->ID, 'meta_key', 'meta_value_2' ); 324 325 $string_mid = "{$meta_id}.0"; 326 327 $this->assertTrue( floor( $string_mid ) == $string_mid ); 328 $this->assertNotEquals( false, get_metadata_by_mid( 'user', $string_mid ) ); 329 $this->assertNotEquals( false, update_metadata_by_mid( 'user', $string_mid, 'meta_new_value_2' ) ); 330 $this->assertNotEquals( false, delete_metadata_by_mid( 'user', $string_mid ) ); 331 } 332 333 /** 296 334 * @ticket 15030 297 335 */
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)