Changeset 1191 in tests
- Timestamp:
- 01/23/2013 05:46:26 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/comment/query.php
r1059 r1191 92 92 add_comment_meta( $comment_id3, 'key3', 'value3', true ); 93 93 94 $comments = get_comments( array( 'meta_key' => 'key', 'orderby' => array( 'key' ) ) ); 95 $this->assertEquals( 2, count( $comments ) ); 96 $this->assertEquals( $comment_id2, $comments[0]->comment_ID ); 97 $this->assertEquals( $comment_id, $comments[1]->comment_ID ); 98 94 99 $comments = get_comments( array( 'meta_key' => 'key', 'orderby' => array( 'meta_value' ) ) ); 95 100 $this->assertEquals( 2, count( $comments ) ); … … 97 102 $this->assertEquals( $comment_id, $comments[1]->comment_ID ); 98 103 104 $comments = get_comments( array( 'meta_key' => 'key', 'orderby' => array( 'key' ), 'order' => 'ASC' ) ); 105 $this->assertEquals( 2, count( $comments ) ); 106 $this->assertEquals( $comment_id, $comments[0]->comment_ID ); 107 $this->assertEquals( $comment_id2, $comments[1]->comment_ID ); 108 99 109 $comments = get_comments( array( 'meta_key' => 'key', 'orderby' => array( 'meta_value' ), 'order' => 'ASC' ) ); 100 110 $this->assertEquals( 2, count( $comments ) ); 101 111 $this->assertEquals( $comment_id, $comments[0]->comment_ID ); 102 112 $this->assertEquals( $comment_id2, $comments[1]->comment_ID ); 113 114 $comments = get_comments( array( 'meta_value' => 'value3', 'orderby' => array( 'key' ) ) ); 115 $this->assertEquals( 2, count( $comments ) ); 116 $this->assertEquals( $comment_id, $comments[0]->comment_ID ); 117 $this->assertEquals( $comment_id3, $comments[1]->comment_ID ); 103 118 104 119 $comments = get_comments( array( 'meta_value' => 'value3', 'orderby' => array( 'meta_value' ) ) ); … … 109 124 // value1 is present on two different keys for $comment_id yet we should get only one instance 110 125 // of that comment in the results 126 $comments = get_comments( array( 'meta_value' => 'value1', 'orderby' => array( 'key' ) ) ); 127 $this->assertEquals( 1, count( $comments ) ); 128 111 129 $comments = get_comments( array( 'meta_value' => 'value1', 'orderby' => array( 'meta_value' ) ) ); 112 130 $this->assertEquals( 1, count( $comments ) ); 113 131 } 114 132 115 133 function test_get_status() {
Note: See TracChangeset
for help on using the changeset viewer.