Ticket #39265: networkQuery.php.patch
File networkQuery.php.patch, 7.4 KB (added by , 4 years ago) |
---|
-
tests/phpunit/tests/multisite/networkQuery.php
61 61 } 62 62 } 63 63 64 /** 65 * @covers WP_Network_Query::query 66 */ 64 67 public function test_wp_network_query_by_number() { 65 68 $q = new WP_Network_Query(); 66 69 $found = $q->query( … … 73 76 $this->assertSame( 3, count( $found ) ); 74 77 } 75 78 79 /** 80 * @covers WP_Network_Query::query 81 */ 76 82 public function test_wp_network_query_by_network__in_with_order() { 77 83 $expected = array( self::$network_ids['wordpress.org/'], self::$network_ids['make.wordpress.org/'] ); 78 84 … … 98 104 $this->assertSame( array_reverse( $expected ), $found ); 99 105 } 100 106 107 /** 108 * @covers WP_Network_Query::query 109 */ 101 110 public function test_wp_network_query_by_network__in_with_single_id() { 102 111 $expected = array( self::$network_ids['wordpress.org/'] ); 103 112 … … 112 121 $this->assertSameSets( $expected, $found ); 113 122 } 114 123 124 /** 125 * @covers WP_Network_Query::query 126 */ 115 127 public function test_wp_network_query_by_network__in_with_multiple_ids() { 116 128 $expected = array( self::$network_ids['wordpress.org/'], self::$network_ids['www.wordpress.net/'] ); 117 129 … … 126 138 $this->assertSameSets( $expected, $found ); 127 139 } 128 140 141 /** 142 * @covers WP_Network_Query::query 143 */ 129 144 public function test_wp_network_query_by_network__in_and_count_with_multiple_ids() { 130 145 $expected = array( self::$network_ids['wordpress.org/'], self::$network_ids['make.wordpress.org/'] ); 131 146 … … 141 156 $this->assertSame( 2, $found ); 142 157 } 143 158 159 /** 160 * @covers WP_Network_Query::query 161 */ 144 162 public function test_wp_network_query_by_network__not_in_with_single_id() { 145 163 $excluded = array( self::$network_ids['wordpress.org/'] ); 146 164 $expected = array_diff( self::$network_ids, $excluded ); … … 159 177 $this->assertSameSets( $expected, $found ); 160 178 } 161 179 180 /** 181 * @covers WP_Network_Query::query 182 */ 162 183 public function test_wp_network_query_by_network__not_in_with_multiple_ids() { 163 184 $excluded = array( self::$network_ids['wordpress.org/'], self::$network_ids['www.w.org/foo/'] ); 164 185 $expected = array_diff( self::$network_ids, $excluded ); … … 177 198 $this->assertSameSets( $expected, $found ); 178 199 } 179 200 201 /** 202 * @covers WP_Network_Query::query 203 */ 180 204 public function test_wp_network_query_by_domain() { 181 205 $q = new WP_Network_Query(); 182 206 $found = $q->query( … … 193 217 $this->assertSameSets( $expected, $found ); 194 218 } 195 219 220 /** 221 * @covers WP_Network_Query::query 222 */ 196 223 public function test_wp_network_query_by_domain__in_with_single_domain() { 197 224 $q = new WP_Network_Query(); 198 225 $found = $q->query( … … 209 236 $this->assertSameSets( $expected, $found ); 210 237 } 211 238 239 /** 240 * @covers WP_Network_Query::query 241 */ 212 242 public function test_wp_network_query_by_domain__in_with_multiple_domains() { 213 243 $q = new WP_Network_Query(); 214 244 $found = $q->query( … … 226 256 $this->assertSameSets( $expected, $found ); 227 257 } 228 258 259 /** 260 * @covers WP_Network_Query::query 261 */ 229 262 public function test_wp_network_query_by_domain__in_with_multiple_domains_and_number() { 230 263 $q = new WP_Network_Query(); 231 264 $found = $q->query( … … 243 276 $this->assertSameSets( $expected, $found ); 244 277 } 245 278 279 /** 280 * @covers WP_Network_Query::query 281 */ 246 282 public function test_wp_network_query_by_domain__in_with_multiple_domains_and_number_and_offset() { 247 283 $q = new WP_Network_Query(); 248 284 $found = $q->query( … … 261 297 $this->assertSameSets( $expected, $found ); 262 298 } 263 299 300 /** 301 * @covers WP_Network_Query::query 302 */ 264 303 public function test_wp_network_query_by_domain__not_in_with_single_domain() { 265 304 $q = new WP_Network_Query(); 266 305 $found = $q->query( … … 280 319 $this->assertSameSets( $expected, $found ); 281 320 } 282 321 322 /** 323 * @covers WP_Network_Query::query 324 */ 283 325 public function test_wp_network_query_by_domain__not_in_with_multiple_domains() { 284 326 $q = new WP_Network_Query(); 285 327 $found = $q->query( … … 298 340 $this->assertSameSets( $expected, $found ); 299 341 } 300 342 343 /** 344 * @covers WP_Network_Query::query 345 */ 301 346 public function test_wp_network_query_by_domain__not_in_with_multiple_domains_and_number() { 302 347 $q = new WP_Network_Query(); 303 348 $found = $q->query( … … 316 361 $this->assertSameSets( $expected, $found ); 317 362 } 318 363 364 /** 365 * @covers WP_Network_Query::query 366 */ 319 367 public function test_wp_network_query_by_domain__not_in_with_multiple_domains_and_number_and_offset() { 320 368 $q = new WP_Network_Query(); 321 369 $found = $q->query( … … 335 383 $this->assertSameSets( $expected, $found ); 336 384 } 337 385 386 /** 387 * @covers WP_Network_Query::query 388 */ 338 389 public function test_wp_network_query_by_path_with_expected_results() { 339 390 $q = new WP_Network_Query(); 340 391 $found = $q->query( … … 354 405 $this->assertSameSets( $expected, $found ); 355 406 } 356 407 408 /** 409 * @covers WP_Network_Query::query 410 */ 357 411 public function test_wp_network_query_by_path_and_number_and_offset_with_expected_results() { 358 412 $q = new WP_Network_Query(); 359 413 $found = $q->query( … … 373 427 $this->assertSameSets( $expected, $found ); 374 428 } 375 429 430 /** 431 * @covers WP_Network_Query::query 432 */ 376 433 public function test_wp_network_query_by_path_with_no_expected_results() { 377 434 $q = new WP_Network_Query(); 378 435 $found = $q->query( … … 385 442 $this->assertEmpty( $found ); 386 443 } 387 444 445 /** 446 * @covers WP_Network_Query::query 447 */ 388 448 public function test_wp_network_query_by_search_with_text_in_domain() { 389 449 $q = new WP_Network_Query(); 390 450 $found = $q->query( … … 401 461 $this->assertSameSets( $expected, $found ); 402 462 } 403 463 464 /** 465 * @covers WP_Network_Query::query 466 */ 404 467 public function test_wp_network_query_by_search_with_text_in_path() { 405 468 $q = new WP_Network_Query(); 406 469 $found = $q->query( … … 417 480 $this->assertSameSets( $expected, $found ); 418 481 } 419 482 483 /** 484 * @covers WP_Network_Query::query 485 */ 420 486 public function test_wp_network_query_by_path_order_by_domain_desc() { 421 487 $q = new WP_Network_Query(); 422 488 $found = $q->query( … … 440 506 441 507 /** 442 508 * @ticket 41347 509 * 510 * @covers WP_Network_Query::query 443 511 */ 444 512 public function test_wp_network_query_cache_with_different_fields_no_count() { 445 513 global $wpdb; … … 467 535 468 536 /** 469 537 * @ticket 41347 538 * 539 * @covers WP_Network_Query::query 470 540 */ 471 541 public function test_wp_network_query_cache_with_different_fields_active_count() { 472 542 global $wpdb; … … 496 566 497 567 /** 498 568 * @ticket 41347 569 * 570 * @covers WP_Network_Query::query 499 571 */ 500 572 public function test_wp_network_query_cache_with_same_fields_different_count() { 501 573 global $wpdb; … … 526 598 /** 527 599 * @ticket 45749 528 600 * @ticket 47599 601 * 602 * @covers WP_Network_Query::query 529 603 */ 530 604 public function test_networks_pre_query_filter_should_bypass_database_query() { 531 605 global $wpdb; … … 557 631 558 632 /** 559 633 * @ticket 51333 634 * 635 * @covers WP_Network_Query::query 560 636 */ 561 637 public function test_networks_pre_query_filter_should_set_networks_property() { 562 638 add_filter( 'networks_pre_query', array( __CLASS__, 'filter_networks_pre_query_and_set_networks' ), 10, 2 );