Changeset 31662
- Timestamp:
- 03/07/2015 03:44:28 PM (10 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/query.php
r31467 r31662 1109 1109 } 1110 1110 1111 public function test_orderby_space_separated() { 1112 global $wpdb; 1113 1114 $q = new WP_Comment_Query(); 1115 $q->query( array( 1116 'orderby' => 'comment_agent comment_approved', 1117 ) ); 1118 1119 $this->assertContains( "ORDER BY $wpdb->comments.comment_agent DESC, $wpdb->comments.comment_approved DESC", $q->request ); 1120 } 1121 1111 1122 public function test_orderby_comma_separated() { 1112 1123 global $wpdb; -
trunk/tests/phpunit/tests/query.php
r31366 r31662 123 123 unset( $q->query_vars['wptests_tax'] ); 124 124 } 125 126 public function test_orderby_space_separated() { 127 global $wpdb; 128 129 $q = new WP_Query( array( 130 'orderby' => 'title date', 131 'order' => 'DESC', 132 ) ); 133 134 $this->assertContains( "ORDER BY $wpdb->posts.post_title DESC, $wpdb->posts.post_date DESC", $q->request ); 135 } 125 136 } -
trunk/tests/phpunit/tests/user/query.php
r31369 r31662 112 112 $this->assertInstanceOf( 'WP_User', $user ); 113 113 } 114 } 115 116 /** 117 * @dataProvider orderby_should_convert_non_prefixed_keys_data 118 */ 119 public function test_orderby_should_convert_non_prefixed_keys( $short_key, $full_key ) { 120 $q = new WP_User_Query( array( 121 'orderby' => $short_key, 122 ) ); 123 124 $this->assertContains( "ORDER BY $full_key", $q->query_orderby ); 125 } 126 127 public function orderby_should_convert_non_prefixed_keys_data() { 128 return array( 129 array( 'nicename', 'user_nicename' ), 130 array( 'email', 'user_email' ), 131 array( 'url', 'user_url' ), 132 array( 'registered', 'user_registered' ), 133 array( 'name', 'display_name' ), 134 ); 114 135 } 115 136
Note: See TracChangeset
for help on using the changeset viewer.