Changeset 974 in tests for trunk/tests/meta.php
- Timestamp:
- 08/16/2012 05:41:57 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/meta.php
r973 r974 88 88 */ 89 89 function test_user_metadata_not_exists() { 90 $u = get_users( array( 'meta_query' => array( array( 'key' => 'meta_key', 'compare' => 'NOT EXISTS' ) ) ) ); 90 $u = get_users( array( 91 'meta_query' => array( 92 array( 'key' => 'meta_key', 'compare' => 'NOT EXISTS' ) 93 ) 94 ) ); 91 95 92 96 $this->assertEquals( 1, count( $u ) ); … … 96 100 97 101 // 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' ) ) ) ) ) ); 102 $this->assertEquals( 0, count( get_users( array( 103 'meta_query' => array( 104 array( 'key' => 'meta_key', 'compare' => 'NOT EXISTS' ), 105 array( 'key' => 'delete_meta_key', 'compare' => 'EXISTS' ) 106 ) 107 ) ) ) ); 100 108 101 $this->assertEquals( 2, count( get_users( array( 'meta_query' => array( array( 'key' => 'non_existing_meta', 'compare' => 'NOT EXISTS' ) ) ) ) ) ); 109 $this->assertEquals( 2, count( get_users( array( 110 'meta_query' => array( 111 array( 'key' => 'non_existing_meta', 'compare' => 'NOT EXISTS' ) 112 ) 113 ) ) ) ); 102 114 103 115 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' ) ) ) ) ) ); 116 117 $this->assertEquals( 2, count( get_users( array( 118 'meta_query' => array( 119 array( 'key' => 'meta_key', 'compare' => 'NOT EXISTS' ) 120 ) 121 ) ) ) ); 105 122 } 106 123
Note: See TracChangeset
for help on using the changeset viewer.