Changeset 35225 for trunk/tests/phpunit/tests/comment/query.php
- Timestamp:
- 10/16/2015 09:04:12 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/query.php
r35192 r35225 13 13 parent::setUp(); 14 14 15 $this->post_id = $this->factory->post->create();15 $this->post_id = self::$factory->post->create(); 16 16 } 17 17 18 18 public function test_query() { 19 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );20 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );21 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );22 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );23 $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );19 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 20 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 21 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 22 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) ); 23 $c5 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) ); 24 24 25 25 $q = new WP_Comment_Query(); … … 32 32 33 33 public function test_query_post_id_0() { 34 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );34 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 35 35 36 36 $q = new WP_Comment_Query(); … … 47 47 */ 48 48 public function test_query_type_empty_string() { 49 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );50 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );51 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );52 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );53 $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );49 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 50 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 51 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 52 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) ); 53 $c5 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) ); 54 54 55 55 $q = new WP_Comment_Query(); … … 66 66 */ 67 67 public function test_query_type_comment() { 68 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );69 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );70 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );71 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );72 $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );68 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 69 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 70 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 71 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) ); 72 $c5 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) ); 73 73 74 74 $q = new WP_Comment_Query(); … … 82 82 83 83 public function test_query_type_pingback() { 84 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );85 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );86 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );87 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );84 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 85 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 86 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 87 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 88 88 89 89 $q = new WP_Comment_Query(); … … 98 98 99 99 public function test_query_type_trackback() { 100 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );101 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );102 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );103 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );100 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 101 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 102 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 103 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 104 104 105 105 $q = new WP_Comment_Query(); … … 117 117 */ 118 118 public function test_query_type_pings() { 119 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );120 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );121 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );122 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );123 $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );119 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 120 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 121 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 122 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) ); 123 $c5 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) ); 124 124 125 125 $q = new WP_Comment_Query(); … … 137 137 */ 138 138 public function test_type_array_comments_and_custom() { 139 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );140 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );141 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );142 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );143 $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );144 $c6 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );139 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 140 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 141 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 142 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) ); 143 $c5 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) ); 144 $c6 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) ); 145 145 146 146 $q = new WP_Comment_Query(); … … 157 157 */ 158 158 public function test_type_not__in_array_custom() { 159 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );160 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );161 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );162 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );163 $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );164 $c6 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );159 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 160 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 161 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 162 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) ); 163 $c5 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) ); 164 $c6 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) ); 165 165 166 166 $q = new WP_Comment_Query(); … … 177 177 */ 178 178 public function test_type__in_array_and_not_type_array_custom() { 179 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );180 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );181 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );182 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );183 $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );184 $c6 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );179 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 180 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 181 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 182 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) ); 183 $c5 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) ); 184 $c6 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) ); 185 185 186 186 $q = new WP_Comment_Query(); … … 198 198 */ 199 199 public function test_type_array_and_type__not_in_array_custom() { 200 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );201 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );202 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );203 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );204 $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );205 $c6 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );200 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 201 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 202 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 203 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) ); 204 $c5 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) ); 205 $c6 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) ); 206 206 207 207 $q = new WP_Comment_Query(); … … 219 219 */ 220 220 public function test_type__not_in_custom() { 221 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );222 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );223 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );224 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );225 $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );226 $c6 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );221 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 222 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 223 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 224 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) ); 225 $c5 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) ); 226 $c6 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) ); 227 227 228 228 $q = new WP_Comment_Query(); … … 239 239 */ 240 240 public function test_type_array_comments_and_pings() { 241 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );242 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );243 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );244 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );245 $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );241 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 242 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 243 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 244 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) ); 245 $c5 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) ); 246 246 247 247 $q = new WP_Comment_Query(); … … 258 258 */ 259 259 public function test_type_array_comment_pings() { 260 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );261 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );262 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );260 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 261 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 262 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 263 263 264 264 $q = new WP_Comment_Query(); … … 275 275 */ 276 276 public function test_type_array_pingback() { 277 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );278 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );279 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );277 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 278 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 279 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 280 280 281 281 $q = new WP_Comment_Query(); … … 292 292 */ 293 293 public function test_type_array_custom_pingpack() { 294 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );295 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );296 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );294 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 295 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 296 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 297 297 298 298 $q = new WP_Comment_Query(); … … 309 309 */ 310 310 public function test_type_array_pings() { 311 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );312 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );313 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );311 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 312 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 313 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 314 314 315 315 $q = new WP_Comment_Query(); … … 326 326 */ 327 327 public function test_type_status_approved_array_comment_pings() { 328 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );329 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );330 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );331 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0', 'comment_type' => 'pingback' ) );328 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 329 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 330 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 331 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0', 'comment_type' => 'pingback' ) ); 332 332 333 333 $q = new WP_Comment_Query(); … … 345 345 */ 346 346 public function test_type_array_trackback() { 347 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );348 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );349 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );347 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 348 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 349 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 350 350 351 351 $q = new WP_Comment_Query(); … … 362 362 */ 363 363 public function test_type_array_custom_trackback() { 364 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );365 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );366 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );364 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 365 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 366 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) ); 367 367 368 368 $q = new WP_Comment_Query(); … … 379 379 */ 380 380 public function test_type_array_pings_approved() { 381 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );382 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );383 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );384 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0', 'comment_type' => 'trackback' ) );381 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 382 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 383 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) ); 384 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0', 'comment_type' => 'trackback' ) ); 385 385 386 386 $q = new WP_Comment_Query(); … … 398 398 */ 399 399 public function test_status_empty_string() { 400 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );401 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );402 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'spam' ) );400 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 401 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) ); 402 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'spam' ) ); 403 403 404 404 $q = new WP_Comment_Query(); … … 415 415 */ 416 416 public function test_status_hold() { 417 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );418 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );417 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 418 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) ); 419 419 420 420 $q = new WP_Comment_Query(); … … 431 431 */ 432 432 public function test_status_approve() { 433 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );434 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );433 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 434 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) ); 435 435 436 436 $q = new WP_Comment_Query(); … … 444 444 445 445 public function test_status_custom() { 446 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );447 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) );448 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo1' ) );446 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 447 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) ); 448 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo1' ) ); 449 449 450 450 $q = new WP_Comment_Query(); … … 458 458 459 459 public function test_status_all() { 460 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );461 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) );462 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );460 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 461 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) ); 462 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) ); 463 463 464 464 $q = new WP_Comment_Query(); … … 472 472 473 473 public function test_status_default_to_all() { 474 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );475 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) );476 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );474 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 475 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) ); 476 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) ); 477 477 478 478 $q = new WP_Comment_Query(); … … 488 488 */ 489 489 public function test_status_comma_any() { 490 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );491 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) );492 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );490 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 491 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) ); 492 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) ); 493 493 494 494 $q = new WP_Comment_Query(); … … 505 505 */ 506 506 public function test_status_comma_separated() { 507 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );508 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) );509 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );507 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 508 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) ); 509 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) ); 510 510 511 511 $q = new WP_Comment_Query(); … … 522 522 */ 523 523 public function test_status_array() { 524 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );525 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) );526 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );524 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 525 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) ); 526 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) ); 527 527 528 528 $q = new WP_Comment_Query(); … … 538 538 $limit = 5; 539 539 540 $post_id = $this->factory->post->create();541 $this->factory->comment->create_post_comments( $post_id, $limit );540 $post_id = self::$factory->post->create(); 541 self::$factory->comment->create_post_comments( $post_id, $limit ); 542 542 $comments = get_comments( array( 'post_id' => $post_id ) ); 543 543 $this->assertEquals( $limit, count( $comments ) ); … … 546 546 } 547 547 548 $post_id2 = $this->factory->post->create();549 $this->factory->comment->create_post_comments( $post_id2, $limit );548 $post_id2 = self::$factory->post->create(); 549 self::$factory->comment->create_post_comments( $post_id2, $limit ); 550 550 $comments = get_comments( array( 'post_id' => $post_id2 ) ); 551 551 $this->assertEquals( $limit, count( $comments ) ); … … 554 554 } 555 555 556 $post_id3 = $this->factory->post->create();557 $this->factory->comment->create_post_comments( $post_id3, $limit, array( 'comment_approved' => '0' ) );556 $post_id3 = self::$factory->post->create(); 557 self::$factory->comment->create_post_comments( $post_id3, $limit, array( 'comment_approved' => '0' ) ); 558 558 $comments = get_comments( array( 'post_id' => $post_id3 ) ); 559 559 $this->assertEquals( $limit, count( $comments ) ); … … 571 571 $this->assertEquals( 0, count( $comments ) ); 572 572 573 $this->factory->comment->create_post_comments( $post_id3, $limit, array( 'comment_approved' => '1' ) );573 self::$factory->comment->create_post_comments( $post_id3, $limit, array( 'comment_approved' => '1' ) ); 574 574 $comments = get_comments( array( 'post_id' => $post_id3 ) ); 575 575 $this->assertEquals( $limit * 2, count( $comments ) ); … … 583 583 */ 584 584 function test_orderby_meta() { 585 $comment_id = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id ) );586 $comment_id2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id ) );587 $comment_id3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id ) );585 $comment_id = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id ) ); 586 $comment_id2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id ) ); 587 $comment_id3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id ) ); 588 588 589 589 add_comment_meta( $comment_id, 'key', 'value1', true ); … … 633 633 */ 634 634 public function test_orderby_clause_key() { 635 $comments = $this->factory->comment->create_many( 3 );635 $comments = self::$factory->comment->create_many( 3 ); 636 636 add_comment_meta( $comments[0], 'foo', 'aaa' ); 637 637 add_comment_meta( $comments[1], 'foo', 'zzz' ); … … 658 658 */ 659 659 public function test_orderby_clause_key_as_secondary_sort() { 660 $c1 = $this->factory->comment->create( array(660 $c1 = self::$factory->comment->create( array( 661 661 'comment_date' => '2015-01-28 03:00:00', 662 662 ) ); 663 $c2 = $this->factory->comment->create( array(663 $c2 = self::$factory->comment->create( array( 664 664 'comment_date' => '2015-01-28 05:00:00', 665 665 ) ); 666 $c3 = $this->factory->comment->create( array(666 $c3 = self::$factory->comment->create( array( 667 667 'comment_date' => '2015-01-28 03:00:00', 668 668 ) ); … … 694 694 */ 695 695 public function test_orderby_more_than_one_clause_key() { 696 $comments = $this->factory->comment->create_many( 3 );696 $comments = self::$factory->comment->create_many( 3 ); 697 697 698 698 add_comment_meta( $comments[0], 'foo', 'jjj' ); … … 729 729 */ 730 730 public function test_meta_query_should_work_with_comment__in() { 731 $comments = $this->factory->comment->create_many( 3 );731 $comments = self::$factory->comment->create_many( 3 ); 732 732 733 733 add_comment_meta( $comments[0], 'foo', 'jjj' ); … … 753 753 */ 754 754 public function test_meta_query_should_work_with_comment__not_in() { 755 $comments = $this->factory->comment->create_many( 3 );755 $comments = self::$factory->comment->create_many( 3 ); 756 756 757 757 add_comment_meta( $comments[0], 'foo', 'jjj' ); … … 777 777 */ 778 778 function test_get_comments_by_user() { 779 $users = $this->factory->user->create_many( 2 );780 $this->factory->comment->create( array( 'user_id' => $users[0], 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );781 $this->factory->comment->create( array( 'user_id' => $users[0], 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );782 $this->factory->comment->create( array( 'user_id' => $users[1], 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );779 $users = self::$factory->user->create_many( 2 ); 780 self::$factory->comment->create( array( 'user_id' => $users[0], 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 781 self::$factory->comment->create( array( 'user_id' => $users[0], 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 782 self::$factory->comment->create( array( 'user_id' => $users[1], 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 783 783 784 784 $comments = get_comments( array( … … 809 809 */ 810 810 function test_fields_ids_query() { 811 $comment_1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );812 $comment_2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );813 $comment_3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );811 $comment_1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) ); 812 $comment_2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) ); 813 $comment_3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) ); 814 814 815 815 // Ensure we are dealing with integers, and not objects. … … 827 827 */ 828 828 function test_fields_comment__in() { 829 $comment_1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );830 $comment_2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );831 $comment_3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );829 $comment_1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) ); 830 $comment_2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) ); 831 $comment_3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) ); 832 832 833 833 $comment_ids = get_comments( array( … … 843 843 */ 844 844 function test_fields_comment__not_in() { 845 $comment_1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );846 $comment_2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );847 $comment_3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );845 $comment_1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) ); 846 $comment_2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) ); 847 $comment_3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) ); 848 848 849 849 $comment_ids = get_comments( array( … … 859 859 */ 860 860 function test_fields_post__in() { 861 $p1 = $this->factory->post->create();862 $p2 = $this->factory->post->create();863 $p3 = $this->factory->post->create();864 865 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 7, 'comment_approved' => '1' ) );866 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $p2, 'user_id' => 1, 'comment_approved' => '1' ) );867 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $p3, 'user_id' => 1, 'comment_approved' => '1' ) );861 $p1 = self::$factory->post->create(); 862 $p2 = self::$factory->post->create(); 863 $p3 = self::$factory->post->create(); 864 865 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 7, 'comment_approved' => '1' ) ); 866 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $p2, 'user_id' => 1, 'comment_approved' => '1' ) ); 867 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $p3, 'user_id' => 1, 'comment_approved' => '1' ) ); 868 868 869 869 $comment_ids = get_comments( array( … … 879 879 */ 880 880 function test_fields_post__not_in() { 881 $p1 = $this->factory->post->create();882 $p2 = $this->factory->post->create();883 $p3 = $this->factory->post->create();884 885 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 7, 'comment_approved' => '1' ) );886 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $p2, 'user_id' => 1, 'comment_approved' => '1' ) );887 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $p3, 'user_id' => 1, 'comment_approved' => '1' ) );881 $p1 = self::$factory->post->create(); 882 $p2 = self::$factory->post->create(); 883 $p3 = self::$factory->post->create(); 884 885 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 7, 'comment_approved' => '1' ) ); 886 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $p2, 'user_id' => 1, 'comment_approved' => '1' ) ); 887 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $p3, 'user_id' => 1, 'comment_approved' => '1' ) ); 888 888 889 889 $comment_ids = get_comments( array( … … 902 902 $author_id2 = 106; 903 903 904 $p1 = $this->factory->post->create( array( 'post_author' => $author_id1 ) );905 $p2 = $this->factory->post->create( array( 'post_author' => $author_id1 ) );906 $p3 = $this->factory->post->create( array( 'post_author' => $author_id2 ) );907 908 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 1, 'comment_approved' => '1' ) );909 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $p2, 'user_id' => 1, 'comment_approved' => '1' ) );910 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $p3, 'user_id' => 1, 'comment_approved' => '1' ) );904 $p1 = self::$factory->post->create( array( 'post_author' => $author_id1 ) ); 905 $p2 = self::$factory->post->create( array( 'post_author' => $author_id1 ) ); 906 $p3 = self::$factory->post->create( array( 'post_author' => $author_id2 ) ); 907 908 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 1, 'comment_approved' => '1' ) ); 909 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $p2, 'user_id' => 1, 'comment_approved' => '1' ) ); 910 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $p3, 'user_id' => 1, 'comment_approved' => '1' ) ); 911 911 912 912 $comment_ids = get_comments( array( … … 925 925 $author_id2 = 112; 926 926 927 $p1 = $this->factory->post->create( array( 'post_author' => $author_id1 ) );928 $p2 = $this->factory->post->create( array( 'post_author' => $author_id1 ) );929 $p3 = $this->factory->post->create( array( 'post_author' => $author_id2 ) );930 931 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 1, 'comment_approved' => '1' ) );932 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $p2, 'user_id' => 1, 'comment_approved' => '1' ) );933 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $p3, 'user_id' => 1, 'comment_approved' => '1' ) );927 $p1 = self::$factory->post->create( array( 'post_author' => $author_id1 ) ); 928 $p2 = self::$factory->post->create( array( 'post_author' => $author_id1 ) ); 929 $p3 = self::$factory->post->create( array( 'post_author' => $author_id2 ) ); 930 931 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 1, 'comment_approved' => '1' ) ); 932 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $p2, 'user_id' => 1, 'comment_approved' => '1' ) ); 933 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $p3, 'user_id' => 1, 'comment_approved' => '1' ) ); 934 934 935 935 $comment_ids = get_comments( array( … … 945 945 */ 946 946 function test_fields_author__in() { 947 $p1 = $this->factory->post->create();948 $p2 = $this->factory->post->create();949 $p3 = $this->factory->post->create();950 $p4 = $this->factory->post->create();951 952 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 1, 'comment_approved' => '1' ) );953 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 2, 'comment_approved' => '1' ) );954 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $p2, 'user_id' => 3, 'comment_approved' => '1' ) );955 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $p4, 'user_id' => 4, 'comment_approved' => '1' ) );947 $p1 = self::$factory->post->create(); 948 $p2 = self::$factory->post->create(); 949 $p3 = self::$factory->post->create(); 950 $p4 = self::$factory->post->create(); 951 952 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 1, 'comment_approved' => '1' ) ); 953 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 2, 'comment_approved' => '1' ) ); 954 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $p2, 'user_id' => 3, 'comment_approved' => '1' ) ); 955 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $p4, 'user_id' => 4, 'comment_approved' => '1' ) ); 956 956 957 957 $comment_ids = get_comments( array( … … 967 967 */ 968 968 function test_fields_author__not_in() { 969 $p1 = $this->factory->post->create();970 $p2 = $this->factory->post->create();971 $p3 = $this->factory->post->create();972 $p4 = $this->factory->post->create();973 974 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 1, 'comment_approved' => '1' ) );975 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 2, 'comment_approved' => '1' ) );976 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $p2, 'user_id' => 3, 'comment_approved' => '1' ) );977 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $p4, 'user_id' => 4, 'comment_approved' => '1' ) );969 $p1 = self::$factory->post->create(); 970 $p2 = self::$factory->post->create(); 971 $p3 = self::$factory->post->create(); 972 $p4 = self::$factory->post->create(); 973 974 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 1, 'comment_approved' => '1' ) ); 975 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $p1, 'user_id' => 2, 'comment_approved' => '1' ) ); 976 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $p2, 'user_id' => 3, 'comment_approved' => '1' ) ); 977 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $p4, 'user_id' => 4, 'comment_approved' => '1' ) ); 978 978 979 979 $comment_ids = get_comments( array( … … 989 989 */ 990 990 public function test_get_comments_with_status_all() { 991 $comment_1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );992 $comment_2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );993 $comment_3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '0' ) );991 $comment_1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) ); 992 $comment_2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) ); 993 $comment_3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '0' ) ); 994 994 $comments_approved_1 = get_comments( array( 'status' => 'all' ) ); 995 995 … … 1002 1002 */ 1003 1003 public function test_get_comments_with_include_unapproved_user_id() { 1004 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );1005 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );1006 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '0' ) );1007 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 6, 'comment_approved' => '0' ) );1004 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) ); 1005 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) ); 1006 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '0' ) ); 1007 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 6, 'comment_approved' => '0' ) ); 1008 1008 1009 1009 $found = get_comments( array( … … 1020 1020 */ 1021 1021 public function test_get_comments_with_include_unapproved_user_id_array() { 1022 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );1023 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );1024 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '0' ) );1025 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 6, 'comment_approved' => '0' ) );1026 $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 8, 'comment_approved' => '0' ) );1022 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) ); 1023 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) ); 1024 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '0' ) ); 1025 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 6, 'comment_approved' => '0' ) ); 1026 $c5 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 8, 'comment_approved' => '0' ) ); 1027 1027 1028 1028 $found = get_comments( array( … … 1039 1039 */ 1040 1040 public function test_get_comments_with_include_unapproved_user_id_comma_separated() { 1041 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );1042 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );1043 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '0' ) );1044 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 6, 'comment_approved' => '0' ) );1045 $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 8, 'comment_approved' => '0' ) );1041 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) ); 1042 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) ); 1043 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '0' ) ); 1044 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 6, 'comment_approved' => '0' ) ); 1045 $c5 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 8, 'comment_approved' => '0' ) ); 1046 1046 1047 1047 $found = get_comments( array( … … 1058 1058 */ 1059 1059 public function test_get_comments_with_include_unapproved_author_email() { 1060 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );1061 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '1', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );1062 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );1063 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );1060 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) ); 1061 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '1', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) ); 1062 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) ); 1063 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) ); 1064 1064 1065 1065 $found = get_comments( array( … … 1076 1076 */ 1077 1077 public function test_get_comments_with_include_unapproved_mixed_array() { 1078 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );1079 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '1', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );1080 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );1081 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );1082 $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );1078 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) ); 1079 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '1', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) ); 1080 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) ); 1081 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) ); 1082 $c5 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) ); 1083 1083 1084 1084 $found = get_comments( array( … … 1095 1095 */ 1096 1096 public function test_get_comments_with_include_unapproved_mixed_comma_separated() { 1097 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );1098 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '1', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );1099 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );1100 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );1101 $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );1097 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) ); 1098 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '1', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) ); 1099 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) ); 1100 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) ); 1101 $c5 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) ); 1102 1102 1103 1103 $found = get_comments( array( … … 1111 1111 1112 1112 public function test_search() { 1113 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );1114 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'foo@example.com' ) );1115 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://foo.bar' ) );1116 $c4 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://example.com', 'comment_author_IP' => 'foo.bar' ) );1117 $c5 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://example.com', 'comment_content' => 'Nice foo comment' ) );1118 $c6 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://example.com' ) );1113 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) ); 1114 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'foo@example.com' ) ); 1115 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://foo.bar' ) ); 1116 $c4 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://example.com', 'comment_author_IP' => 'foo.bar' ) ); 1117 $c5 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://example.com', 'comment_content' => 'Nice foo comment' ) ); 1118 $c6 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://example.com' ) ); 1119 1119 1120 1120 $q = new WP_Comment_Query(); … … 1364 1364 public function test_orderby_date_modified_gmt_should_order_by_comment_ID_in_case_of_tie_ASC() { 1365 1365 $now = current_time( 'mysql', 1 ); 1366 $comments = $this->factory->comment->create_many( 5, array(1366 $comments = self::$factory->comment->create_many( 5, array( 1367 1367 'comment_post_ID' => $this->post_id, 1368 1368 'comment_date_gmt' => $now, … … 1384 1384 public function test_orderby_date_modified_gmt_should_order_by_comment_ID_in_case_of_tie_DESC() { 1385 1385 $now = current_time( 'mysql', 1 ); 1386 $comments = $this->factory->comment->create_many( 5, array(1386 $comments = self::$factory->comment->create_many( 5, array( 1387 1387 'comment_post_ID' => $this->post_id, 1388 1388 'comment_date_gmt' => $now, … … 1417 1417 1418 1418 public function test_count() { 1419 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7 ) );1420 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7 ) );1419 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7 ) ); 1420 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7 ) ); 1421 1421 1422 1422 $q = new WP_Comment_Query(); … … 1432 1432 */ 1433 1433 public function test_count_with_meta_query() { 1434 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7 ) );1435 $c2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7 ) );1436 $c3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7 ) );1434 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7 ) ); 1435 $c2 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7 ) ); 1436 $c3 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7 ) ); 1437 1437 add_comment_meta( $c1, 'foo', 'bar' ); 1438 1438 add_comment_meta( $c3, 'foo', 'bar' ); … … 1456 1456 register_post_type( 'post-type-2' ); 1457 1457 1458 $p1 = $this->factory->post->create( array( 'post_type' => 'post-type-1' ) );1459 $p2 = $this->factory->post->create( array( 'post_type' => 'post-type-2' ) );1460 1461 $c1 = $this->factory->comment->create_post_comments( $p1, 1 );1462 $c2 = $this->factory->comment->create_post_comments( $p2, 1 );1458 $p1 = self::$factory->post->create( array( 'post_type' => 'post-type-1' ) ); 1459 $p2 = self::$factory->post->create( array( 'post_type' => 'post-type-2' ) ); 1460 1461 $c1 = self::$factory->comment->create_post_comments( $p1, 1 ); 1462 $c2 = self::$factory->comment->create_post_comments( $p2, 1 ); 1463 1463 1464 1464 $q = new WP_Comment_Query(); … … 1481 1481 register_post_type( 'post-type-2' ); 1482 1482 1483 $p1 = $this->factory->post->create( array( 'post_type' => 'post-type-1' ) );1484 $p2 = $this->factory->post->create( array( 'post_type' => 'post-type-2' ) );1485 1486 $c1 = $this->factory->comment->create_post_comments( $p1, 1 );1487 $c2 = $this->factory->comment->create_post_comments( $p2, 1 );1483 $p1 = self::$factory->post->create( array( 'post_type' => 'post-type-1' ) ); 1484 $p2 = self::$factory->post->create( array( 'post_type' => 'post-type-2' ) ); 1485 1486 $c1 = self::$factory->comment->create_post_comments( $p1, 1 ); 1487 $c2 = self::$factory->comment->create_post_comments( $p2, 1 ); 1488 1488 1489 1489 $q = new WP_Comment_Query(); … … 1506 1506 register_post_type( 'post-type-2' ); 1507 1507 1508 $p1 = $this->factory->post->create( array( 'post_type' => 'post-type-1' ) );1509 $p2 = $this->factory->post->create( array( 'post_type' => 'post-type-2' ) );1510 $p3 = $this->factory->post->create( array( 'post_type' => 'post-type-3' ) );1511 1512 $c1 = $this->factory->comment->create_post_comments( $p1, 1 );1513 $c2 = $this->factory->comment->create_post_comments( $p2, 1 );1514 $c3 = $this->factory->comment->create_post_comments( $p3, 1 );1508 $p1 = self::$factory->post->create( array( 'post_type' => 'post-type-1' ) ); 1509 $p2 = self::$factory->post->create( array( 'post_type' => 'post-type-2' ) ); 1510 $p3 = self::$factory->post->create( array( 'post_type' => 'post-type-3' ) ); 1511 1512 $c1 = self::$factory->comment->create_post_comments( $p1, 1 ); 1513 $c2 = self::$factory->comment->create_post_comments( $p2, 1 ); 1514 $c3 = self::$factory->comment->create_post_comments( $p3, 1 ); 1515 1515 1516 1516 $q = new WP_Comment_Query(); … … 1527 1527 1528 1528 public function test_post_name_single_value() { 1529 $p1 = $this->factory->post->create( array( 'post_name' => 'foo' ) );1530 $p2 = $this->factory->post->create( array( 'post_name' => 'bar' ) );1531 1532 $c1 = $this->factory->comment->create_post_comments( $p1, 1 );1533 $c2 = $this->factory->comment->create_post_comments( $p2, 1 );1529 $p1 = self::$factory->post->create( array( 'post_name' => 'foo' ) ); 1530 $p2 = self::$factory->post->create( array( 'post_name' => 'bar' ) ); 1531 1532 $c1 = self::$factory->comment->create_post_comments( $p1, 1 ); 1533 $c2 = self::$factory->comment->create_post_comments( $p2, 1 ); 1534 1534 1535 1535 $q = new WP_Comment_Query(); … … 1546 1546 */ 1547 1547 public function test_post_name_singleton_array() { 1548 $p1 = $this->factory->post->create( array( 'post_name' => 'foo' ) );1549 $p2 = $this->factory->post->create( array( 'post_name' => 'bar' ) );1550 1551 $c1 = $this->factory->comment->create_post_comments( $p1, 1 );1552 $c2 = $this->factory->comment->create_post_comments( $p2, 1 );1548 $p1 = self::$factory->post->create( array( 'post_name' => 'foo' ) ); 1549 $p2 = self::$factory->post->create( array( 'post_name' => 'bar' ) ); 1550 1551 $c1 = self::$factory->comment->create_post_comments( $p1, 1 ); 1552 $c2 = self::$factory->comment->create_post_comments( $p2, 1 ); 1553 1553 1554 1554 $q = new WP_Comment_Query(); … … 1565 1565 */ 1566 1566 public function test_post_name_array() { 1567 $p1 = $this->factory->post->create( array( 'post_name' => 'foo' ) );1568 $p2 = $this->factory->post->create( array( 'post_name' => 'bar' ) );1569 $p3 = $this->factory->post->create( array( 'post_name' => 'baz' ) );1570 1571 $c1 = $this->factory->comment->create_post_comments( $p1, 1 );1572 $c2 = $this->factory->comment->create_post_comments( $p2, 1 );1573 $c3 = $this->factory->comment->create_post_comments( $p3, 1 );1567 $p1 = self::$factory->post->create( array( 'post_name' => 'foo' ) ); 1568 $p2 = self::$factory->post->create( array( 'post_name' => 'bar' ) ); 1569 $p3 = self::$factory->post->create( array( 'post_name' => 'baz' ) ); 1570 1571 $c1 = self::$factory->comment->create_post_comments( $p1, 1 ); 1572 $c2 = self::$factory->comment->create_post_comments( $p2, 1 ); 1573 $c3 = self::$factory->comment->create_post_comments( $p3, 1 ); 1574 1574 1575 1575 $q = new WP_Comment_Query(); … … 1583 1583 1584 1584 public function test_post_status_single_value() { 1585 $p1 = $this->factory->post->create( array( 'post_status' => 'publish' ) );1586 $p2 = $this->factory->post->create( array( 'post_status' => 'draft' ) );1587 1588 $c1 = $this->factory->comment->create_post_comments( $p1, 1 );1589 $c2 = $this->factory->comment->create_post_comments( $p2, 1 );1585 $p1 = self::$factory->post->create( array( 'post_status' => 'publish' ) ); 1586 $p2 = self::$factory->post->create( array( 'post_status' => 'draft' ) ); 1587 1588 $c1 = self::$factory->comment->create_post_comments( $p1, 1 ); 1589 $c2 = self::$factory->comment->create_post_comments( $p2, 1 ); 1590 1590 1591 1591 $q = new WP_Comment_Query(); … … 1602 1602 */ 1603 1603 public function test_post_status_singleton_array() { 1604 $p1 = $this->factory->post->create( array( 'post_status' => 'publish' ) );1605 $p2 = $this->factory->post->create( array( 'post_status' => 'draft' ) );1606 1607 $c1 = $this->factory->comment->create_post_comments( $p1, 1 );1608 $c2 = $this->factory->comment->create_post_comments( $p2, 1 );1604 $p1 = self::$factory->post->create( array( 'post_status' => 'publish' ) ); 1605 $p2 = self::$factory->post->create( array( 'post_status' => 'draft' ) ); 1606 1607 $c1 = self::$factory->comment->create_post_comments( $p1, 1 ); 1608 $c2 = self::$factory->comment->create_post_comments( $p2, 1 ); 1609 1609 1610 1610 $q = new WP_Comment_Query(); … … 1621 1621 */ 1622 1622 public function test_post_status_array() { 1623 $p1 = $this->factory->post->create( array( 'post_status' => 'publish' ) );1624 $p2 = $this->factory->post->create( array( 'post_status' => 'draft' ) );1625 $p3 = $this->factory->post->create( array( 'post_status' => 'future' ) );1626 1627 $c1 = $this->factory->comment->create_post_comments( $p1, 1 );1628 $c2 = $this->factory->comment->create_post_comments( $p2, 1 );1629 $c3 = $this->factory->comment->create_post_comments( $p3, 1 );1623 $p1 = self::$factory->post->create( array( 'post_status' => 'publish' ) ); 1624 $p2 = self::$factory->post->create( array( 'post_status' => 'draft' ) ); 1625 $p3 = self::$factory->post->create( array( 'post_status' => 'future' ) ); 1626 1627 $c1 = self::$factory->comment->create_post_comments( $p1, 1 ); 1628 $c2 = self::$factory->comment->create_post_comments( $p2, 1 ); 1629 $c3 = self::$factory->comment->create_post_comments( $p3, 1 ); 1630 1630 1631 1631 $q = new WP_Comment_Query(); … … 1642 1642 */ 1643 1643 public function test_comment_query_object() { 1644 $comment_id = $this->factory->comment->create();1644 $comment_id = self::$factory->comment->create(); 1645 1645 1646 1646 $query1 = new WP_Comment_Query(); … … 1664 1664 global $wpdb; 1665 1665 1666 $p = $this->factory->post->create();1667 $c = $this->factory->comment->create( array( 'comment_post_ID' => $p ) );1666 $p = self::$factory->post->create(); 1667 $c = self::$factory->comment->create( array( 'comment_post_ID' => $p ) ); 1668 1668 1669 1669 $q1 = new WP_Comment_Query(); … … 1689 1689 */ 1690 1690 public function test_it_should_be_possible_to_modify_meta_query_using_pre_get_comments_action() { 1691 $comments = $this->factory->comment->create_many( 2, array(1691 $comments = self::$factory->comment->create_many( 2, array( 1692 1692 'comment_post_ID' => $this->post_id, 1693 1693 ) ); … … 1720 1720 */ 1721 1721 public function test_it_should_be_possible_to_modify_meta_params_using_pre_get_comments_action() { 1722 $comments = $this->factory->comment->create_many( 2, array(1722 $comments = self::$factory->comment->create_many( 2, array( 1723 1723 'comment_post_ID' => $this->post_id, 1724 1724 ) ); … … 1747 1747 */ 1748 1748 public function test_parent__in() { 1749 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );1750 $c2 = $this->factory->comment->create( array(1749 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 1750 $c2 = self::$factory->comment->create( array( 1751 1751 'comment_post_ID' => $this->post_id, 1752 1752 'comment_approved' => '1', … … 1767 1767 */ 1768 1768 public function test_parent__in_commas() { 1769 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );1770 $c2 = $this->factory->comment->create( array(1769 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 1770 $c2 = self::$factory->comment->create( array( 1771 1771 'comment_post_ID' => $this->post_id, 1772 1772 'comment_approved' => '1' 1773 1773 ) ); 1774 $c3 = $this->factory->comment->create( array(1774 $c3 = self::$factory->comment->create( array( 1775 1775 'comment_post_ID' => $this->post_id, 1776 1776 'comment_approved' => '1', 1777 1777 'comment_parent' => $c1, 1778 1778 ) ); 1779 $c4 = $this->factory->comment->create( array(1779 $c4 = self::$factory->comment->create( array( 1780 1780 'comment_post_ID' => $this->post_id, 1781 1781 'comment_approved' => '1', … … 1796 1796 */ 1797 1797 public function test_parent__not_in() { 1798 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );1799 1800 $this->factory->comment->create( array(1798 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 1799 1800 self::$factory->comment->create( array( 1801 1801 'comment_post_ID' => $this->post_id, 1802 1802 'comment_approved' => '1', … … 1817 1817 */ 1818 1818 public function test_parent__not_in_commas() { 1819 $c1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );1820 $c2 = $this->factory->comment->create( array(1819 $c1 = self::$factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); 1820 $c2 = self::$factory->comment->create( array( 1821 1821 'comment_post_ID' => $this->post_id, 1822 1822 'comment_approved' => '1' 1823 1823 ) ); 1824 1824 1825 $this->factory->comment->create( array(1825 self::$factory->comment->create( array( 1826 1826 'comment_post_ID' => $this->post_id, 1827 1827 'comment_approved' => '1', 1828 1828 'comment_parent' => $c1, 1829 1829 ) ); 1830 $this->factory->comment->create( array(1830 self::$factory->comment->create( array( 1831 1831 'comment_post_ID' => $this->post_id, 1832 1832 'comment_approved' => '1', … … 1847 1847 */ 1848 1848 public function test_orderby_comment__in() { 1849 $this->factory->comment->create( array(1849 self::$factory->comment->create( array( 1850 1850 'comment_post_ID' => $this->post_id, 1851 1851 'comment_approved' => '1' 1852 1852 ) ); 1853 1853 1854 $c2 = $this->factory->comment->create( array(1854 $c2 = self::$factory->comment->create( array( 1855 1855 'comment_post_ID' => $this->post_id, 1856 1856 'comment_approved' => '1' 1857 1857 ) ); 1858 $c3 = $this->factory->comment->create( array(1858 $c3 = self::$factory->comment->create( array( 1859 1859 'comment_post_ID' => $this->post_id, 1860 1860 'comment_approved' => '1' 1861 1861 ) ); 1862 1862 1863 $this->factory->comment->create( array(1863 self::$factory->comment->create( array( 1864 1864 'comment_post_ID' => $this->post_id, 1865 1865 'comment_approved' => '1' … … 1881 1881 */ 1882 1882 public function test_no_found_rows_should_default_to_true() { 1883 $comments = $this->factory->comment->create_many( 3, array( 'comment_post_ID' => $this->post_id ) );1883 $comments = self::$factory->comment->create_many( 3, array( 'comment_post_ID' => $this->post_id ) ); 1884 1884 1885 1885 $q = new WP_Comment_Query( array( … … 1896 1896 */ 1897 1897 public function test_should_respect_no_found_rows_true() { 1898 $comments = $this->factory->comment->create_many( 3, array( 'comment_post_ID' => $this->post_id ) );1898 $comments = self::$factory->comment->create_many( 3, array( 'comment_post_ID' => $this->post_id ) ); 1899 1899 1900 1900 $q = new WP_Comment_Query( array( … … 1912 1912 */ 1913 1913 public function test_should_respect_no_found_rows_false() { 1914 $comments = $this->factory->comment->create_many( 3, array( 'comment_post_ID' => $this->post_id ) );1914 $comments = self::$factory->comment->create_many( 3, array( 'comment_post_ID' => $this->post_id ) ); 1915 1915 1916 1916 $q = new WP_Comment_Query( array( … … 1928 1928 */ 1929 1929 public function test_hierarchical_should_skip_child_comments_in_offset() { 1930 $top_level_0 = $this->factory->comment->create( array(1931 'comment_post_ID' => $this->post_id, 1932 'comment_approved' => '1', 1933 ) ); 1934 1935 $child_of_0 = $this->factory->comment->create( array(1930 $top_level_0 = self::$factory->comment->create( array( 1931 'comment_post_ID' => $this->post_id, 1932 'comment_approved' => '1', 1933 ) ); 1934 1935 $child_of_0 = self::$factory->comment->create( array( 1936 1936 'comment_post_ID' => $this->post_id, 1937 1937 'comment_approved' => '1', … … 1939 1939 ) ); 1940 1940 1941 $top_level_comments = $this->factory->comment->create_many( 3, array(1941 $top_level_comments = self::$factory->comment->create_many( 3, array( 1942 1942 'comment_post_ID' => $this->post_id, 1943 1943 'comment_approved' => '1', … … 1961 1961 */ 1962 1962 public function test_hierarchical_should_not_include_child_comments_in_number() { 1963 $top_level_0 = $this->factory->comment->create( array(1964 'comment_post_ID' => $this->post_id, 1965 'comment_approved' => '1', 1966 ) ); 1967 1968 $child_of_0 = $this->factory->comment->create( array(1963 $top_level_0 = self::$factory->comment->create( array( 1964 'comment_post_ID' => $this->post_id, 1965 'comment_approved' => '1', 1966 ) ); 1967 1968 $child_of_0 = self::$factory->comment->create( array( 1969 1969 'comment_post_ID' => $this->post_id, 1970 1970 'comment_approved' => '1', … … 1972 1972 ) ); 1973 1973 1974 $top_level_comments = $this->factory->comment->create_many( 3, array(1974 $top_level_comments = self::$factory->comment->create_many( 3, array( 1975 1975 'comment_post_ID' => $this->post_id, 1976 1976 'comment_approved' => '1', … … 1992 1992 */ 1993 1993 public function test_hierarchical_threaded() { 1994 $c1 = $this->factory->comment->create( array(1995 'comment_post_ID' => $this->post_id, 1996 'comment_approved' => '1', 1997 ) ); 1998 1999 $c2 = $this->factory->comment->create( array(1994 $c1 = self::$factory->comment->create( array( 1995 'comment_post_ID' => $this->post_id, 1996 'comment_approved' => '1', 1997 ) ); 1998 1999 $c2 = self::$factory->comment->create( array( 2000 2000 'comment_post_ID' => $this->post_id, 2001 2001 'comment_approved' => '1', … … 2003 2003 ) ); 2004 2004 2005 $c3 = $this->factory->comment->create( array(2005 $c3 = self::$factory->comment->create( array( 2006 2006 'comment_post_ID' => $this->post_id, 2007 2007 'comment_approved' => '1', … … 2009 2009 ) ); 2010 2010 2011 $c4 = $this->factory->comment->create( array(2011 $c4 = self::$factory->comment->create( array( 2012 2012 'comment_post_ID' => $this->post_id, 2013 2013 'comment_approved' => '1', … … 2015 2015 ) ); 2016 2016 2017 $c5 = $this->factory->comment->create( array(2018 'comment_post_ID' => $this->post_id, 2019 'comment_approved' => '1', 2020 ) ); 2021 2022 $c6 = $this->factory->comment->create( array(2017 $c5 = self::$factory->comment->create( array( 2018 'comment_post_ID' => $this->post_id, 2019 'comment_approved' => '1', 2020 ) ); 2021 2022 $c6 = self::$factory->comment->create( array( 2023 2023 'comment_post_ID' => $this->post_id, 2024 2024 'comment_approved' => '1', … … 2055 2055 */ 2056 2056 public function test_hierarchical_threaded_approved() { 2057 $c1 = $this->factory->comment->create( array(2058 'comment_post_ID' => $this->post_id, 2059 'comment_approved' => '1', 2060 ) ); 2061 2062 $c2 = $this->factory->comment->create( array(2057 $c1 = self::$factory->comment->create( array( 2058 'comment_post_ID' => $this->post_id, 2059 'comment_approved' => '1', 2060 ) ); 2061 2062 $c2 = self::$factory->comment->create( array( 2063 2063 'comment_post_ID' => $this->post_id, 2064 2064 'comment_approved' => '1', … … 2066 2066 ) ); 2067 2067 2068 $c3 = $this->factory->comment->create( array(2068 $c3 = self::$factory->comment->create( array( 2069 2069 'comment_post_ID' => $this->post_id, 2070 2070 'comment_approved' => '0', … … 2072 2072 ) ); 2073 2073 2074 $c4 = $this->factory->comment->create( array(2074 $c4 = self::$factory->comment->create( array( 2075 2075 'comment_post_ID' => $this->post_id, 2076 2076 'comment_approved' => '1', … … 2078 2078 ) ); 2079 2079 2080 $c5 = $this->factory->comment->create( array(2081 'comment_post_ID' => $this->post_id, 2082 'comment_approved' => '1', 2083 ) ); 2084 2085 $this->factory->comment->create( array(2080 $c5 = self::$factory->comment->create( array( 2081 'comment_post_ID' => $this->post_id, 2082 'comment_approved' => '1', 2083 ) ); 2084 2085 self::$factory->comment->create( array( 2086 2086 'comment_post_ID' => $this->post_id, 2087 2087 'comment_approved' => '1', … … 2118 2118 global $wpdb; 2119 2119 2120 $p = $this->factory->post->create();2121 $c = $this->factory->comment->create( array( 'comment_post_ID' => $p ) );2120 $p = self::$factory->post->create(); 2121 $c = self::$factory->comment->create( array( 'comment_post_ID' => $p ) ); 2122 2122 2123 2123 $q = new WP_Comment_Query( array( … … 2136 2136 global $wpdb; 2137 2137 2138 $p = $this->factory->post->create();2139 $c = $this->factory->comment->create( array( 'comment_post_ID' => $p ) );2138 $p = self::$factory->post->create(); 2139 $c = self::$factory->comment->create( array( 'comment_post_ID' => $p ) ); 2140 2140 2141 2141 $q = new WP_Comment_Query( array(
Note: See TracChangeset
for help on using the changeset viewer.