Changeset 27185 for trunk/tests/phpunit/tests/user/query.php
- Timestamp:
- 02/17/2014 09:40:04 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/query.php
r25392 r27185 44 44 $ids = $users->get_results(); 45 45 $this->assertEquals( array( $this->user_id ), $ids ); 46 47 46 } 48 47 … … 102 101 $this->assertEquals( $names, $values ); 103 102 } 103 104 function test_prepare_query() { 105 $query = new WP_User_Query(); 106 $this->assertEmpty( $query->query_fields ); 107 $this->assertEmpty( $query->query_from ); 108 $this->assertEmpty( $query->query_limit ); 109 $this->assertEmpty( $query->query_orderby ); 110 $this->assertEmpty( $query->query_where ); 111 $this->assertEmpty( $query->query_vars ); 112 $_query_vars = $query->query_vars; 113 114 $query->prepare_query(); 115 $this->assertNotEmpty( $query->query_fields ); 116 $this->assertNotEmpty( $query->query_from ); 117 $this->assertEmpty( $query->query_limit ); 118 $this->assertNotEmpty( $query->query_orderby ); 119 $this->assertNotEmpty( $query->query_where ); 120 $this->assertNotEmpty( $query->query_vars ); 121 $this->assertNotEquals( $_query_vars, $query->query_vars ); 122 123 // All values get reset 124 $query->prepare_query( array( 'number' => 8 ) ); 125 $this->assertNotEmpty( $query->query_limit ); 126 $this->assertEquals( 'LIMIT 8', $query->query_limit ); 127 128 // All values get reset 129 $query->prepare_query( array( 'fields' => 'all' ) ); 130 $this->assertEmpty( $query->query_limit ); 131 $this->assertEquals( '', $query->query_limit ); 132 $_query_vars = $query->query_vars; 133 134 $query->prepare_query(); 135 $this->assertEquals( $_query_vars, $query->query_vars ); 136 } 104 137 }
Note: See TracChangeset
for help on using the changeset viewer.