Changeset 973 in tests
- Timestamp:
- 08/16/2012 05:36:20 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/meta.php
r904 r973 84 84 } 85 85 86 /** 87 * @ticket 18158 88 */ 89 function test_user_metadata_not_exists() { 90 $u = get_users( array( 'meta_query' => array( array( 'key' => 'meta_key', 'compare' => 'NOT EXISTS' ) ) ) ); 91 92 $this->assertEquals( 1, count( $u ) ); 93 94 // User found is not locally defined author (it's the admin) 95 $this->assertNotEquals( $this->author->user_login, $u[0]->user_login ); 96 97 // Test EXISTS and NOT EXISTS together, no users should be found 98 $this->assertEquals( 0, count( get_users( array( 'meta_query' => array( array( 'key' => 'meta_key', 'compare' => 'NOT EXISTS' ), 99 array( 'key' => 'delete_meta_key', 'compare' => 'EXISTS' ) ) ) ) ) ); 100 101 $this->assertEquals( 2, count( get_users( array( 'meta_query' => array( array( 'key' => 'non_existing_meta', 'compare' => 'NOT EXISTS' ) ) ) ) ) ); 102 103 delete_metadata( 'user', $this->author->ID, 'meta_key' ); 104 $this->assertEquals( 2, count( get_users( array( 'meta_query' => array( array( 'key' => 'meta_key', 'compare' => 'NOT EXISTS' ) ) ) ) ) ); 105 } 106 86 107 function test_metadata_slashes() { 87 108 $key = rand_str();
Note: See TracChangeset
for help on using the changeset viewer.