Changeset 40564
- Timestamp:
- 05/01/2017 08:34:10 PM (7 years ago)
- Location:
- trunk/tests/phpunit
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r40543 r40564 577 577 protected function checkRequirements() { 578 578 parent::checkRequirements(); 579 580 $annotations = $this->getAnnotations(); 581 582 if ( ! empty( $annotations['group'] ) ) { 583 if ( in_array( 'ms-required', $annotations['group'], true ) ) { 584 $this->skipWithoutMultisite(); 585 } 586 if ( in_array( 'ms-excluded', $annotations['group'], true ) ) { 587 $this->skipWithMultisite(); 588 } 589 } 579 590 580 591 // Core tests no longer check against open Trac tickets, but others using WP_UnitTestCase may do so. -
trunk/tests/phpunit/tests/adminbar.php
r40543 r40564 76 76 */ 77 77 public function test_admin_bar_contains_correct_links_for_users_with_no_role() { 78 $this->skipWithMultisite();79 80 78 $this->assertFalse( user_can( self::$no_role_id, 'read' ) ); 81 79 … … 103 101 */ 104 102 public function test_admin_bar_contains_correct_links_for_users_with_role() { 105 $this->skipWithMultisite();106 107 103 $this->assertTrue( user_can( self::$editor_id, 'read' ) ); 108 104 … … 133 129 */ 134 130 public function test_admin_bar_contains_correct_links_for_users_with_no_role_on_blog() { 135 $this->skipWithoutMultisite();136 137 131 $blog_id = self::factory()->blog->create( array( 138 132 'user_id' => self::$admin_id, … … 182 176 */ 183 177 public function test_admin_bar_contains_correct_links_for_users_with_no_role_on_network() { 184 $this->skipWithoutMultisite();185 186 178 $this->assertTrue( user_can( self::$admin_id, 'read' ) ); 187 179 $this->assertFalse( user_can( self::$no_role_id, 'read' ) ); … … 425 417 */ 426 418 public function test_admin_bar_contains_correct_about_link_for_users_with_role() { 427 $this->skipWithMultisite();428 429 419 wp_set_current_user( self::$editor_id ); 430 420 … … 444 434 */ 445 435 public function test_admin_bar_contains_correct_about_link_for_users_with_no_role() { 446 $this->skipWithMultisite();447 448 436 wp_set_current_user( self::$no_role_id ); 449 437 … … 465 453 */ 466 454 public function test_admin_bar_contains_correct_about_link_for_users_with_no_role_in_multisite() { 467 $this->skipWithoutMultisite();468 469 455 // User is not a member of a site. 470 456 remove_user_from_blog( self::$no_role_id, get_current_blog_id() ); … … 583 569 */ 584 570 public function test_my_sites_network_menu_for_regular_user() { 585 $this->skipWithoutMultisite();586 587 571 wp_set_current_user( self::$editor_id ); 588 572 … … 600 584 */ 601 585 public function test_my_sites_network_menu_for_super_admin() { 602 $this->skipWithoutMultisite();603 604 586 wp_set_current_user( self::$editor_id ); 605 587 … … 619 601 */ 620 602 public function test_my_sites_network_menu_for_regular_user_with_network_caps() { 621 $this->skipWithoutMultisite();622 623 603 global $current_user; 624 604 -
trunk/tests/phpunit/tests/customize/setting.php
r40543 r40564 565 565 */ 566 566 function test_previewing_with_switch_to_blog() { 567 $this->skipWithoutMultisite();568 569 567 wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); 570 568 $type = 'option'; -
trunk/tests/phpunit/tests/functions.php
r40543 r40564 939 939 */ 940 940 function test_wp_check_filetype_and_ext_with_filtered_svg() { 941 $this->skipWithMultisite();942 943 941 if ( ! extension_loaded( 'fileinfo' ) ) { 944 942 $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' ); … … 966 964 */ 967 965 function test_wp_check_filetype_and_ext_with_filtered_woff() { 968 $this->skipWithMultisite();969 970 966 if ( ! extension_loaded( 'fileinfo' ) ) { 971 967 $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' ); -
trunk/tests/phpunit/tests/general/template.php
r40543 r40564 76 76 */ 77 77 function test_has_site_icon_returns_true_when_called_for_other_site_with_site_icon_set() { 78 $this->skipWithoutMultisite();79 80 78 $blog_id = $this->factory->blog->create(); 81 79 switch_to_blog( $blog_id ); … … 92 90 */ 93 91 function test_has_site_icon_returns_false_when_called_for_other_site_without_site_icon_set() { 94 $this->skipWithoutMultisite();95 96 92 $blog_id = $this->factory->blog->create(); 97 93 … … 266 262 */ 267 263 function test_has_custom_logo_returns_true_when_called_for_other_site_with_custom_logo_set() { 268 $this->skipWithoutMultisite();269 270 264 $blog_id = $this->factory->blog->create(); 271 265 switch_to_blog( $blog_id ); … … 282 276 */ 283 277 function test_has_custom_logo_returns_false_when_called_for_other_site_without_custom_logo_set() { 284 $this->skipWithoutMultisite();285 286 278 $blog_id = $this->factory->blog->create(); 287 279 … … 312 304 */ 313 305 function test_get_custom_logo_returns_logo_when_called_for_other_site_with_custom_logo_set() { 314 $this->skipWithoutMultisite();315 316 306 $blog_id = $this->factory->blog->create(); 317 307 switch_to_blog( $blog_id ); … … 533 523 */ 534 524 function test_get_site_icon_url_preserves_switched_state() { 535 $this->skipWithoutMultisite();536 537 525 $blog_id = $this->factory->blog->create(); 538 526 switch_to_blog( $blog_id ); … … 554 542 */ 555 543 function test_has_custom_logo_preserves_switched_state() { 556 $this->skipWithoutMultisite();557 558 544 $blog_id = $this->factory->blog->create(); 559 545 switch_to_blog( $blog_id ); … … 575 561 */ 576 562 function test_get_custom_logo_preserves_switched_state() { 577 $this->skipWithoutMultisite();578 579 563 $blog_id = $this->factory->blog->create(); 580 564 switch_to_blog( $blog_id ); -
trunk/tests/phpunit/tests/l10n/getLocale.php
r40543 r40564 22 22 */ 23 23 public function test_local_option_should_take_precedence_on_multisite() { 24 $this->skipWithoutMultisite();25 26 24 global $locale; 27 25 $old_locale = $locale; -
trunk/tests/phpunit/tests/link/getDashboardUrl.php
r40543 r40564 42 42 */ 43 43 public function test_get_dashboard_url_for_network_administrator_with_no_sites() { 44 $this->skipWithoutMultisite();45 46 44 grant_super_admin( self::$user_id ); 47 45 … … 61 59 */ 62 60 public function test_get_dashboard_url_for_administrator_of_different_site() { 63 $this->skipWithoutMultisite();64 65 61 $site_id = self::factory()->blog->create( array( 'user_id' => self::$user_id ) ); 66 62 -
trunk/tests/phpunit/tests/oembed/controller.php
r40543 r40564 257 257 */ 258 258 function test_request_ms_child_in_root_blog() { 259 $this->skipWithoutMultisite();260 261 259 $child = self::factory()->blog->create(); 262 260 switch_to_blog( $child ); -
trunk/tests/phpunit/tests/option/networkOption.php
r40543 r40564 17 17 */ 18 18 function test_add_network_option_not_available_on_other_network() { 19 $this->skipWithoutMultisite();20 21 19 $id = self::factory()->network->create(); 22 20 $option = __FUNCTION__; … … 31 29 */ 32 30 function test_add_network_option_available_on_same_network() { 33 $this->skipWithoutMultisite();34 35 31 $id = self::factory()->network->create(); 36 32 $option = __FUNCTION__; … … 45 41 */ 46 42 function test_delete_network_option_on_only_one_network() { 47 $this->skipWithoutMultisite();48 49 43 $id = self::factory()->network->create(); 50 44 $option = __FUNCTION__; … … 62 56 */ 63 57 public function test_add_network_option_is_not_stored_as_autoload_option() { 64 $this->skipWithMultisite();65 66 58 $key = __FUNCTION__; 67 59 … … 78 70 */ 79 71 public function test_update_network_option_is_not_stored_as_autoload_option() { 80 $this->skipWithMultisite();81 82 72 $key = __FUNCTION__; 83 73 -
trunk/tests/phpunit/tests/option/siteTransient.php
r40543 r40564 48 48 */ 49 49 public function test_set_site_transient_is_not_stored_as_autoload_option() { 50 $this->skipWithMultisite();51 52 50 $key = 'not_autoloaded'; 53 51 -
trunk/tests/phpunit/tests/rest-api/rest-users-controller.php
r40543 r40564 997 997 */ 998 998 public function test_create_new_network_user_on_site_does_not_add_user_to_sub_site() { 999 $this->skipWithoutMultisite();1000 1001 999 $this->allow_user_to_manage_multisite(); 1002 1000 … … 1027 1025 */ 1028 1026 public function test_create_new_network_user_on_sub_site_adds_user_to_site() { 1029 $this->skipWithoutMultisite();1030 1031 1027 $this->allow_user_to_manage_multisite(); 1032 1028 … … 1061 1057 */ 1062 1058 public function test_create_existing_network_user_on_sub_site_has_error() { 1063 $this->skipWithoutMultisite();1064 1065 1059 $this->allow_user_to_manage_multisite(); 1066 1060 … … 1449 1443 */ 1450 1444 public function test_update_user_role_invalid_privilege_deescalation() { 1451 $this->skipWithMultisite();1452 1453 1445 $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) ); 1454 1446 … … 1480 1472 */ 1481 1473 public function test_update_user_role_privilege_deescalation_multisite() { 1482 $this->skipWithoutMultisite();1483 1484 1474 $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) ); 1485 1475 … … 2229 2219 */ 2230 2220 public function test_get_item_from_different_site_as_site_administrator() { 2231 $this->skipWithoutMultisite();2232 2233 2221 switch_to_blog( self::$site ); 2234 2222 $user_id = $this->factory->user->create( array( … … 2249 2237 */ 2250 2238 public function test_get_item_from_different_site_as_network_administrator() { 2251 $this->skipWithoutMultisite();2252 2253 2239 switch_to_blog( self::$site ); 2254 2240 $user_id = $this->factory->user->create( array( … … 2269 2255 */ 2270 2256 public function test_update_item_from_different_site_as_site_administrator() { 2271 $this->skipWithoutMultisite();2272 2273 2257 switch_to_blog( self::$site ); 2274 2258 $user_id = $this->factory->user->create( array( … … 2291 2275 */ 2292 2276 public function test_update_item_from_different_site_as_network_administrator() { 2293 $this->skipWithoutMultisite();2294 2295 2277 switch_to_blog( self::$site ); 2296 2278 $user_id = $this->factory->user->create( array( … … 2313 2295 */ 2314 2296 public function test_delete_item_from_different_site_as_site_administrator() { 2315 $this->skipWithoutMultisite();2316 2317 2297 switch_to_blog( self::$site ); 2318 2298 $user_id = $this->factory->user->create( array( … … 2335 2315 */ 2336 2316 public function test_delete_item_from_different_site_as_network_administrator() { 2337 $this->skipWithoutMultisite();2338 2339 2317 switch_to_blog( self::$site ); 2340 2318 $user_id = $this->factory->user->create( array( -
trunk/tests/phpunit/tests/rewrite.php
r40543 r40564 123 123 */ 124 124 function test_url_to_postid_of_http_site_when_current_site_uses_https() { 125 $this->skipWithoutMultisite();126 127 125 $_SERVER['HTTPS'] = 'on'; 128 126 … … 318 316 */ 319 317 function test_url_to_postid_ms_home_url_collision() { 320 $this->skipWithoutMultisite();321 322 318 $blog_id = self::factory()->blog->create( array( 'path' => '/example' ) ); 323 319 switch_to_blog( $blog_id ); -
trunk/tests/phpunit/tests/theme/WPTheme.php
r40543 r40564 149 149 */ 150 150 function test_wp_theme_network_enable_single_theme() { 151 $this->skipWithoutMultisite();152 153 151 $theme = 'testtheme-1'; 154 152 $current_allowed_themes = get_site_option( 'allowedthemes' ); … … 168 166 */ 169 167 function test_wp_theme_network_enable_multiple_themes() { 170 $this->skipWithoutMultisite();171 172 168 $themes = array( 'testtheme-2', 'testtheme-3' ); 173 169 $current_allowed_themes = get_site_option( 'allowedthemes' ); … … 187 183 */ 188 184 function test_network_disable_single_theme() { 189 $this->skipWithoutMultisite();190 191 185 $current_allowed_themes = get_site_option( 'allowedthemes' ); 192 186 … … 210 204 */ 211 205 function test_network_disable_multiple_themes() { 212 $this->skipWithoutMultisite();213 214 206 $current_allowed_themes = get_site_option( 'allowedthemes' ); 215 207 -
trunk/tests/phpunit/tests/user.php
r40543 r40564 653 653 */ 654 654 function test_illegal_user_logins_multisite() { 655 $this->skipWithoutMultisite();656 657 655 $user_data = array( 658 656 'user_login' => 'testuser', -
trunk/tests/phpunit/tests/user/capabilities.php
r40563 r40564 616 616 */ 617 617 function test_super_admin_caps() { 618 $this->skipWithoutMultisite();619 620 618 $caps = $this->getAllCapsAndRoles(); 621 619 $user = self::$super_admin; … … 1361 1359 */ 1362 1360 function test_borked_current_user_can_for_blog() { 1363 $this->skipWithoutMultisite();1364 1365 1361 $orig_blog_id = get_current_blog_id(); 1366 1362 $blog_id = self::factory()->blog->create(); … … 1422 1418 */ 1423 1419 function test_multisite_administrator_can_not_edit_users() { 1424 $this->skipWithoutMultisite();1425 1426 1420 $user = self::$users['administrator']; 1427 1421 $other_user = self::$users['subscriber']; … … 1456 1450 */ 1457 1451 public function test_only_super_admins_can_delete_users_on_multisite() { 1458 $this->skipWithoutMultisite();1459 1460 1452 $this->assertTrue( user_can( self::$super_admin->ID, 'delete_user', self::$users['subscriber']->ID ) ); 1461 1453 … … 1471 1463 */ 1472 1464 public function test_only_admins_can_delete_users_on_single_site() { 1473 $this->skipWithMultisite();1474 1475 1465 $this->assertTrue( user_can( self::$users['administrator']->ID, 'delete_user', self::$users['subscriber']->ID ) ); 1476 1466 … … 1530 1520 */ 1531 1521 function test_multisite_administrator_with_manage_network_users_can_edit_users() { 1532 $this->skipWithoutMultisite();1533 1534 1522 $user = self::$users['administrator']; 1535 1523 $user->add_cap( 'manage_network_users' ); … … 1549 1537 */ 1550 1538 function test_multisite_administrator_with_manage_network_users_can_not_edit_super_admin() { 1551 $this->skipWithoutMultisite();1552 1553 1539 $user = self::$users['administrator']; 1554 1540 $user->add_cap( 'manage_network_users' ); … … 1775 1761 */ 1776 1762 public function test_only_super_admins_can_remove_themselves_on_multisite() { 1777 $this->skipWithoutMultisite();1778 1779 1763 $this->assertTrue( user_can( self::$super_admin->ID, 'remove_user', self::$super_admin->ID ) ); 1780 1764 -
trunk/tests/phpunit/tests/user/countUsers.php
r40560 r40564 13 13 */ 14 14 public function test_count_users_is_accurate( $strategy ) { 15 $this->skipWithMultisite();16 17 15 // Setup users 18 16 $admin = self::factory()->user->create( array( … … 61 59 */ 62 60 public function test_count_users_multisite_is_accurate( $strategy ) { 63 $this->skipWithoutMultisite();64 65 61 // Setup users 66 62 $admin = self::factory()->user->create( array( -
trunk/tests/phpunit/tests/user/query.php
r40543 r40564 556 556 */ 557 557 public function test_roles_and_caps_should_be_populated_for_explicit_value_of_blog_id_on_nonms() { 558 $this->skipWithMultisite();559 560 558 $query = new WP_User_Query( array( 561 559 'include' => self::$author_ids[0], … … 575 573 */ 576 574 public function test_roles_and_caps_should_be_populated_for_explicit_value_of_current_blog_id_on_ms() { 577 $this->skipWithoutMultisite();578 579 575 $query = new WP_User_Query( array( 580 576 'include' => self::$author_ids[0], … … 594 590 */ 595 591 public function test_roles_and_caps_should_be_populated_for_explicit_value_of_different_blog_id_on_ms_when_fields_all_with_meta() { 596 $this->skipWithoutMultisite();597 598 592 $b = self::factory()->blog->create(); 599 593 … … 619 613 */ 620 614 public function test_roles_and_caps_should_be_populated_for_explicit_value_of_different_blog_id_on_ms_when_fields_all() { 621 $this->skipWithoutMultisite();622 623 615 $b = self::factory()->blog->create(); 624 616 add_user_to_blog( $b, self::$author_ids[0], 'author' ); … … 643 635 */ 644 636 public function test_who_authors() { 645 $this->skipWithoutMultisite();646 647 637 $b = self::factory()->blog->create(); 648 638 … … 668 658 */ 669 659 public function test_who_authors_should_work_alongside_meta_query() { 670 $this->skipWithoutMultisite();671 672 660 $b = self::factory()->blog->create(); 673 661 … … 702 690 */ 703 691 public function test_who_authors_should_work_alongside_meta_params() { 704 $this->skipWithoutMultisite();705 706 692 $b = self::factory()->blog->create(); 707 693 … … 794 780 */ 795 781 public function test_has_published_posts_should_respect_blog_id() { 796 $this->skipWithoutMultisite();797 798 782 $blogs = self::factory()->blog->create_many( 2 ); 799 783 … … 1360 1344 */ 1361 1345 public function test_blog_id_should_restrict_by_blog_without_requiring_a_named_role() { 1362 $this->skipWithoutMultisite();1363 1364 1346 $sites = self::factory()->blog->create_many( 2 ); 1365 1347 … … 1381 1363 */ 1382 1364 public function test_calling_prepare_query_a_second_time_should_not_add_another_cap_query_on_multisite() { 1383 $this->skipWithoutMultisite();1384 1385 1365 $site_id = get_current_blog_id(); 1386 1366 add_user_to_blog( $site_id, self::$author_ids[0], 'author' ); -
trunk/tests/phpunit/tests/user/wpAuthenticateSpamCheck.php
r40543 r40564 10 10 */ 11 11 function test_wp_authenticate_spam_check_returns_user_when_single_site() { 12 $this->skipWithMultisite();13 14 12 $user_id = self::factory()->user->create( array( 'role' => 'contributor' ) ); 15 13 $user = new WP_User( $user_id ); … … 24 22 */ 25 23 function test_wp_authenticate_spam_check_returns_user_when_not_flagged() { 26 $this->skipWithoutMultisite();27 28 24 $user_id = self::factory()->user->create( array( 'role' => 'contributor' ) ); 29 25 $user = new WP_User( $user_id ); … … 38 34 */ 39 35 function test_wp_authenticate_spam_check_returns_wp_error_when_flagged() { 40 $this->skipWithoutMultisite();41 42 36 $user_id = self::factory()->user->create( array( 'role' => 'contributor' ) ); 43 37 update_user_status( $user_id, 'spam', 1 ); -
trunk/tests/phpunit/tests/user/wpDeleteUser.php
r40543 r40564 128 128 */ 129 129 public function test_numeric_string_user_id() { 130 $this->skipWithMultisite();131 132 130 $u = self::factory()->user->create(); 133 131 … … 149 147 */ 150 148 public function test_should_return_false_for_object_user_id() { 151 $this->skipWithMultisite();152 153 149 $u_obj = self::factory()->user->create_and_get(); 154 150 $this->assertFalse( wp_delete_user( $u_obj ) ); -
trunk/tests/phpunit/tests/user/wpGetUsersWithNoRole.php
r40543 r40564 11 11 */ 12 12 public function test_get_users_with_no_role_is_accurate() { 13 $this->skipWithMultisite();14 15 13 // Setup users 16 14 $admin = self::factory()->user->create( array( … … 43 41 */ 44 42 public function test_get_users_with_no_role_multisite_is_accurate() { 45 $this->skipWithoutMultisite();46 47 43 // Setup users 48 44 $admin = self::factory()->user->create( array(
Note: See TracChangeset
for help on using the changeset viewer.