Changeset 40543
- Timestamp:
- 04/23/2017 09:57:31 PM (7 years ago)
- Location:
- trunk/tests/phpunit
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r40542 r40543 195 195 if ( false !== $travis_pull_request && 'master' !== $travis_branch ) { 196 196 $this->markTestSkipped( 'For automated test runs, this test is only run on trunk/master' ); 197 } 198 } 199 200 /** 201 * Allow tests to be skipped when Multisite is not in use. 202 * 203 * Use in conjunction with the ms-required group. 204 */ 205 public function skipWithoutMultisite() { 206 if ( ! is_multisite() ) { 207 $this->markTestSkipped( 'Test only runs on Multisite' ); 208 } 209 } 210 211 /** 212 * Allow tests to be skipped when Multisite is in use. 213 * 214 * Use in conjunction with the ms-excluded group. 215 */ 216 public function skipWithMultisite() { 217 if ( is_multisite() ) { 218 $this->markTestSkipped( 'Test does not run on Multisite' ); 197 219 } 198 220 } -
trunk/tests/phpunit/tests/adminbar.php
r40520 r40543 76 76 */ 77 77 public function test_admin_bar_contains_correct_links_for_users_with_no_role() { 78 if ( is_multisite() ) { 79 $this->markTestSkipped( 'Test does not run in multisite' ); 80 } 78 $this->skipWithMultisite(); 81 79 82 80 $this->assertFalse( user_can( self::$no_role_id, 'read' ) ); … … 105 103 */ 106 104 public function test_admin_bar_contains_correct_links_for_users_with_role() { 107 if ( is_multisite() ) { 108 $this->markTestSkipped( 'Test does not run in multisite' ); 109 } 105 $this->skipWithMultisite(); 110 106 111 107 $this->assertTrue( user_can( self::$editor_id, 'read' ) ); … … 137 133 */ 138 134 public function test_admin_bar_contains_correct_links_for_users_with_no_role_on_blog() { 139 if ( ! is_multisite() ) { 140 $this->markTestSkipped( 'Test only runs in multisite' ); 141 } 135 $this->skipWithoutMultisite(); 142 136 143 137 $blog_id = self::factory()->blog->create( array( … … 188 182 */ 189 183 public function test_admin_bar_contains_correct_links_for_users_with_no_role_on_network() { 190 if ( ! is_multisite() ) { 191 $this->markTestSkipped( 'Test only runs in multisite' ); 192 } 184 $this->skipWithoutMultisite(); 193 185 194 186 $this->assertTrue( user_can( self::$admin_id, 'read' ) ); … … 433 425 */ 434 426 public function test_admin_bar_contains_correct_about_link_for_users_with_role() { 435 if ( is_multisite() ) { 436 $this->markTestSkipped( 'Test does not run in multisite' ); 437 } 427 $this->skipWithMultisite(); 438 428 439 429 wp_set_current_user( self::$editor_id ); … … 454 444 */ 455 445 public function test_admin_bar_contains_correct_about_link_for_users_with_no_role() { 456 if ( is_multisite() ) { 457 $this->markTestSkipped( 'Test does not run in multisite' ); 458 } 446 $this->skipWithMultisite(); 459 447 460 448 wp_set_current_user( self::$no_role_id ); … … 477 465 */ 478 466 public function test_admin_bar_contains_correct_about_link_for_users_with_no_role_in_multisite() { 479 if ( ! is_multisite() ) { 480 $this->markTestSkipped( 'Test only runs in multisite' ); 481 } 467 $this->skipWithoutMultisite(); 482 468 483 469 // User is not a member of a site. … … 597 583 */ 598 584 public function test_my_sites_network_menu_for_regular_user() { 599 if ( ! is_multisite() ) { 600 $this->markTestSkipped( 'Test only runs in multisite' ); 601 } 585 $this->skipWithoutMultisite(); 602 586 603 587 wp_set_current_user( self::$editor_id ); … … 616 600 */ 617 601 public function test_my_sites_network_menu_for_super_admin() { 618 if ( ! is_multisite() ) { 619 $this->markTestSkipped( 'Test only runs in multisite' ); 620 } 602 $this->skipWithoutMultisite(); 621 603 622 604 wp_set_current_user( self::$editor_id ); … … 637 619 */ 638 620 public function test_my_sites_network_menu_for_regular_user_with_network_caps() { 621 $this->skipWithoutMultisite(); 622 639 623 global $current_user; 640 641 if ( ! is_multisite() ) {642 $this->markTestSkipped( 'Test only runs in multisite' );643 }644 624 645 625 $network_user_caps = array( 'manage_network', 'manage_network_themes', 'manage_network_plugins' ); -
trunk/tests/phpunit/tests/customize/setting.php
r40520 r40543 565 565 */ 566 566 function test_previewing_with_switch_to_blog() { 567 if ( ! is_multisite() ) { 568 $this->markTestSkipped( 'Cannot test WP_Customize_Setting::is_current_blog_previewed() with switch_to_blog() if not on multisite.' ); 569 } 567 $this->skipWithoutMultisite(); 570 568 571 569 wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); -
trunk/tests/phpunit/tests/functions.php
r40533 r40543 939 939 */ 940 940 function test_wp_check_filetype_and_ext_with_filtered_svg() { 941 $this->skipWithMultisite(); 942 941 943 if ( ! extension_loaded( 'fileinfo' ) ) { 942 944 $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' ); 943 }944 945 if ( is_multisite() ) {946 $this->markTestSkipped( 'Test does not run in multisite' );947 945 } 948 946 … … 965 963 /** 966 964 * @ticket 39550 965 * @group ms-excluded 967 966 */ 968 967 function test_wp_check_filetype_and_ext_with_filtered_woff() { 968 $this->skipWithMultisite(); 969 969 970 if ( ! extension_loaded( 'fileinfo' ) ) { 970 971 $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' ); 971 }972 973 if ( is_multisite() ) {974 $this->markTestSkipped( 'Test does not run in multisite' );975 972 } 976 973 -
trunk/tests/phpunit/tests/general/template.php
r40520 r40543 76 76 */ 77 77 function test_has_site_icon_returns_true_when_called_for_other_site_with_site_icon_set() { 78 if ( ! is_multisite() ) { 79 $this->markTestSkipped( 'This test requires multisite.' ); 80 } 78 $this->skipWithoutMultisite(); 81 79 82 80 $blog_id = $this->factory->blog->create(); … … 94 92 */ 95 93 function test_has_site_icon_returns_false_when_called_for_other_site_without_site_icon_set() { 96 if ( ! is_multisite() ) { 97 $this->markTestSkipped( 'This test requires multisite.' ); 98 } 94 $this->skipWithoutMultisite(); 99 95 100 96 $blog_id = $this->factory->blog->create(); … … 270 266 */ 271 267 function test_has_custom_logo_returns_true_when_called_for_other_site_with_custom_logo_set() { 272 if ( ! is_multisite() ) { 273 $this->markTestSkipped( 'This test requires multisite.' ); 274 } 268 $this->skipWithoutMultisite(); 275 269 276 270 $blog_id = $this->factory->blog->create(); … … 288 282 */ 289 283 function test_has_custom_logo_returns_false_when_called_for_other_site_without_custom_logo_set() { 290 if ( ! is_multisite() ) { 291 $this->markTestSkipped( 'This test requires multisite.' ); 292 } 284 $this->skipWithoutMultisite(); 293 285 294 286 $blog_id = $this->factory->blog->create(); … … 320 312 */ 321 313 function test_get_custom_logo_returns_logo_when_called_for_other_site_with_custom_logo_set() { 322 if ( ! is_multisite() ) { 323 $this->markTestSkipped( 'This test requires multisite.' ); 324 } 314 $this->skipWithoutMultisite(); 325 315 326 316 $blog_id = $this->factory->blog->create(); … … 543 533 */ 544 534 function test_get_site_icon_url_preserves_switched_state() { 545 if ( ! is_multisite() ) { 546 $this->markTestSkipped( 'This test requires multisite.' ); 547 } 535 $this->skipWithoutMultisite(); 548 536 549 537 $blog_id = $this->factory->blog->create(); … … 566 554 */ 567 555 function test_has_custom_logo_preserves_switched_state() { 568 if ( ! is_multisite() ) { 569 $this->markTestSkipped( 'This test requires multisite.' ); 570 } 556 $this->skipWithoutMultisite(); 571 557 572 558 $blog_id = $this->factory->blog->create(); … … 589 575 */ 590 576 function test_get_custom_logo_preserves_switched_state() { 591 if ( ! is_multisite() ) { 592 $this->markTestSkipped( 'This test requires multisite.' ); 593 } 577 $this->skipWithoutMultisite(); 594 578 595 579 $blog_id = $this->factory->blog->create(); -
trunk/tests/phpunit/tests/l10n/getLocale.php
r40520 r40543 22 22 */ 23 23 public function test_local_option_should_take_precedence_on_multisite() { 24 if ( ! is_multisite() ) { 25 $this->markTestSkipped( __METHOD__ . ' requires Multisite' ); 26 } 24 $this->skipWithoutMultisite(); 27 25 28 26 global $locale; -
trunk/tests/phpunit/tests/link/getDashboardUrl.php
r40520 r40543 42 42 */ 43 43 public function test_get_dashboard_url_for_network_administrator_with_no_sites() { 44 if ( ! is_multisite() ) { 45 $this->markTestSkipped( 'Test only runs in multisite.' ); 46 } 44 $this->skipWithoutMultisite(); 47 45 48 46 grant_super_admin( self::$user_id ); … … 63 61 */ 64 62 public function test_get_dashboard_url_for_administrator_of_different_site() { 65 if ( ! is_multisite() ) { 66 $this->markTestSkipped( 'Test only runs in multisite.' ); 67 } 63 $this->skipWithoutMultisite(); 68 64 69 65 $site_id = self::factory()->blog->create( array( 'user_id' => self::$user_id ) ); -
trunk/tests/phpunit/tests/oembed/controller.php
r40520 r40543 257 257 */ 258 258 function test_request_ms_child_in_root_blog() { 259 if ( ! is_multisite() ) { 260 $this->markTestSkipped( __METHOD__ . ' is a multisite-only test.' ); 261 } 259 $this->skipWithoutMultisite(); 262 260 263 261 $child = self::factory()->blog->create(); -
trunk/tests/phpunit/tests/option/networkOption.php
r40520 r40543 17 17 */ 18 18 function test_add_network_option_not_available_on_other_network() { 19 if ( ! is_multisite() ) { 20 $this->markTestSkipped( 'Test requires multisite' ); 21 } 19 $this->skipWithoutMultisite(); 22 20 23 21 $id = self::factory()->network->create(); … … 33 31 */ 34 32 function test_add_network_option_available_on_same_network() { 35 if ( ! is_multisite() ) { 36 $this->markTestSkipped( 'Test requires multisite' ); 37 } 33 $this->skipWithoutMultisite(); 38 34 39 35 $id = self::factory()->network->create(); … … 49 45 */ 50 46 function test_delete_network_option_on_only_one_network() { 51 if ( ! is_multisite() ) { 52 $this->markTestSkipped( 'Test requires multisite' ); 53 } 47 $this->skipWithoutMultisite(); 54 48 55 49 $id = self::factory()->network->create(); … … 68 62 */ 69 63 public function test_add_network_option_is_not_stored_as_autoload_option() { 64 $this->skipWithMultisite(); 65 70 66 $key = __FUNCTION__; 71 72 if ( is_multisite() ) {73 $this->markTestSkipped( 'Does not apply when used in multisite.' );74 }75 67 76 68 add_network_option( null, $key, 'Not an autoload option' ); … … 86 78 */ 87 79 public function test_update_network_option_is_not_stored_as_autoload_option() { 80 $this->skipWithMultisite(); 81 88 82 $key = __FUNCTION__; 89 90 if ( is_multisite() ) {91 $this->markTestSkipped( 'Does not apply when used in multisite.' );92 }93 83 94 84 update_network_option( null, $key, 'Not an autoload option' ); -
trunk/tests/phpunit/tests/option/siteTransient.php
r40520 r40543 48 48 */ 49 49 public function test_set_site_transient_is_not_stored_as_autoload_option() { 50 $this->skipWithMultisite(); 51 50 52 $key = 'not_autoloaded'; 51 53 52 if ( is_multisite() ) {53 $this->markTestSkipped( 'Does not apply when used in multisite.' );54 }55 54 set_site_transient( $key, 'Not an autoload option' ); 56 55 -
trunk/tests/phpunit/tests/rest-api/rest-users-controller.php
r40520 r40543 997 997 */ 998 998 public function test_create_new_network_user_on_site_does_not_add_user_to_sub_site() { 999 if ( ! is_multisite() ) { 1000 $this->markTestSkipped( 'Test requires multisite.' ); 1001 } 999 $this->skipWithoutMultisite(); 1002 1000 1003 1001 $this->allow_user_to_manage_multisite(); … … 1029 1027 */ 1030 1028 public function test_create_new_network_user_on_sub_site_adds_user_to_site() { 1031 if ( ! is_multisite() ) { 1032 $this->markTestSkipped( 'Test requires multisite.' ); 1033 } 1029 $this->skipWithoutMultisite(); 1034 1030 1035 1031 $this->allow_user_to_manage_multisite(); … … 1065 1061 */ 1066 1062 public function test_create_existing_network_user_on_sub_site_has_error() { 1067 if ( ! is_multisite() ) { 1068 $this->markTestSkipped( 'Test requires multisite.' ); 1069 } 1063 $this->skipWithoutMultisite(); 1070 1064 1071 1065 $this->allow_user_to_manage_multisite(); … … 1455 1449 */ 1456 1450 public function test_update_user_role_invalid_privilege_deescalation() { 1457 if ( is_multisite() ) { 1458 return $this->markTestSkipped( 'Test only intended for single site.' ); 1459 } 1451 $this->skipWithMultisite(); 1460 1452 1461 1453 $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) ); … … 1488 1480 */ 1489 1481 public function test_update_user_role_privilege_deescalation_multisite() { 1490 if ( ! is_multisite() ) { 1491 return $this->markTestSkipped( 'Test only intended for multisite.' ); 1492 } 1482 $this->skipWithoutMultisite(); 1493 1483 1494 1484 $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) ); … … 2239 2229 */ 2240 2230 public function test_get_item_from_different_site_as_site_administrator() { 2241 if ( ! is_multisite() ) { 2242 $this->markTestSkipped( 'Test only runs in multisite' ); 2243 } 2231 $this->skipWithoutMultisite(); 2244 2232 2245 2233 switch_to_blog( self::$site ); … … 2261 2249 */ 2262 2250 public function test_get_item_from_different_site_as_network_administrator() { 2263 if ( ! is_multisite() ) { 2264 $this->markTestSkipped( 'Test only runs in multisite' ); 2265 } 2251 $this->skipWithoutMultisite(); 2266 2252 2267 2253 switch_to_blog( self::$site ); … … 2283 2269 */ 2284 2270 public function test_update_item_from_different_site_as_site_administrator() { 2285 if ( ! is_multisite() ) { 2286 $this->markTestSkipped( 'Test only runs in multisite' ); 2287 } 2271 $this->skipWithoutMultisite(); 2288 2272 2289 2273 switch_to_blog( self::$site ); … … 2307 2291 */ 2308 2292 public function test_update_item_from_different_site_as_network_administrator() { 2309 if ( ! is_multisite() ) { 2310 $this->markTestSkipped( 'Test only runs in multisite' ); 2311 } 2293 $this->skipWithoutMultisite(); 2312 2294 2313 2295 switch_to_blog( self::$site ); … … 2331 2313 */ 2332 2314 public function test_delete_item_from_different_site_as_site_administrator() { 2333 if ( ! is_multisite() ) { 2334 $this->markTestSkipped( 'Test only runs in multisite' ); 2335 } 2315 $this->skipWithoutMultisite(); 2336 2316 2337 2317 switch_to_blog( self::$site ); … … 2355 2335 */ 2356 2336 public function test_delete_item_from_different_site_as_network_administrator() { 2357 if ( ! is_multisite() ) { 2358 $this->markTestSkipped( 'Test only runs in multisite' ); 2359 } 2337 $this->skipWithoutMultisite(); 2360 2338 2361 2339 switch_to_blog( self::$site ); -
trunk/tests/phpunit/tests/rewrite.php
r40520 r40543 123 123 */ 124 124 function test_url_to_postid_of_http_site_when_current_site_uses_https() { 125 if ( ! is_multisite() ) { 126 $this->markTestSkipped( 'This test requires multisite' ); 127 } 125 $this->skipWithoutMultisite(); 128 126 129 127 $_SERVER['HTTPS'] = 'on'; … … 320 318 */ 321 319 function test_url_to_postid_ms_home_url_collision() { 322 323 if ( ! is_multisite() ) { 324 $this->markTestSkipped( 'test_url_to_postid_ms_home_url_collision requires multisite' ); 325 } 320 $this->skipWithoutMultisite(); 326 321 327 322 $blog_id = self::factory()->blog->create( array( 'path' => '/example' ) ); -
trunk/tests/phpunit/tests/theme/WPTheme.php
r40520 r40543 149 149 */ 150 150 function test_wp_theme_network_enable_single_theme() { 151 if ( ! is_multisite() ) { 152 $this->markTestSkipped( 'This test requires multisite' ); 153 } 151 $this->skipWithoutMultisite(); 154 152 155 153 $theme = 'testtheme-1'; … … 170 168 */ 171 169 function test_wp_theme_network_enable_multiple_themes() { 172 if ( ! is_multisite() ) { 173 $this->markTestSkipped( 'This test requires multisite' ); 174 } 170 $this->skipWithoutMultisite(); 175 171 176 172 $themes = array( 'testtheme-2', 'testtheme-3' ); … … 191 187 */ 192 188 function test_network_disable_single_theme() { 193 if ( ! is_multisite() ) { 194 $this->markTestSkipped( 'This test requires multisite' ); 195 } 189 $this->skipWithoutMultisite(); 196 190 197 191 $current_allowed_themes = get_site_option( 'allowedthemes' ); … … 216 210 */ 217 211 function test_network_disable_multiple_themes() { 218 if ( ! is_multisite() ) { 219 $this->markTestSkipped( 'This test requires multisite' ); 220 } 212 $this->skipWithoutMultisite(); 221 213 222 214 $current_allowed_themes = get_site_option( 'allowedthemes' ); -
trunk/tests/phpunit/tests/user.php
r40520 r40543 653 653 */ 654 654 function test_illegal_user_logins_multisite() { 655 if ( ! is_multisite() ) { 656 $this->markTestSkipped( __METHOD__ . ' requires multisite.' ); 657 } 655 $this->skipWithoutMultisite(); 658 656 659 657 $user_data = array( -
trunk/tests/phpunit/tests/user/capabilities.php
r40520 r40543 616 616 */ 617 617 function test_super_admin_caps() { 618 if ( ! is_multisite() ) { 619 $this->markTestSkipped( 'Test only runs in multisite' ); 620 } 618 $this->skipWithoutMultisite(); 619 621 620 $caps = $this->getAllCapsAndRoles(); 622 621 $user = self::$super_admin; … … 1362 1361 */ 1363 1362 function test_borked_current_user_can_for_blog() { 1364 if ( ! is_multisite() ) { 1365 $this->markTestSkipped( 'Test only runs in multisite' ); 1366 } 1363 $this->skipWithoutMultisite(); 1367 1364 1368 1365 $orig_blog_id = get_current_blog_id(); … … 1425 1422 */ 1426 1423 function test_multisite_administrator_can_not_edit_users() { 1427 if ( ! is_multisite() ) { 1428 $this->markTestSkipped( 'Test only runs in multisite' ); 1429 } 1424 $this->skipWithoutMultisite(); 1430 1425 1431 1426 $user = self::$users['administrator']; … … 1461 1456 */ 1462 1457 public function test_only_super_admins_can_delete_users_on_multisite() { 1463 if ( ! is_multisite() ) { 1464 $this->markTestSkipped( 'Test only runs on multisite' ); 1465 } 1458 $this->skipWithoutMultisite(); 1466 1459 1467 1460 $this->assertTrue( user_can( self::$super_admin->ID, 'delete_user', self::$users['subscriber']->ID ) ); … … 1478 1471 */ 1479 1472 public function test_only_admins_can_delete_users_on_single_site() { 1480 if ( is_multisite() ) { 1481 $this->markTestSkipped( 'Test does not run on multisite' ); 1482 } 1473 $this->skipWithMultisite(); 1483 1474 1484 1475 $this->assertTrue( user_can( self::$users['administrator']->ID, 'delete_user', self::$users['subscriber']->ID ) ); … … 1539 1530 */ 1540 1531 function test_multisite_administrator_with_manage_network_users_can_edit_users() { 1541 if ( ! is_multisite() ) { 1542 $this->markTestSkipped( 'Test only runs in multisite' ); 1543 } 1532 $this->skipWithoutMultisite(); 1544 1533 1545 1534 $user = self::$users['administrator']; … … 1560 1549 */ 1561 1550 function test_multisite_administrator_with_manage_network_users_can_not_edit_super_admin() { 1562 if ( ! is_multisite() ) { 1563 $this->markTestSkipped( 'Test only runs in multisite' ); 1564 } 1551 $this->skipWithoutMultisite(); 1565 1552 1566 1553 $user = self::$users['administrator']; … … 1784 1771 */ 1785 1772 public function test_only_super_admins_can_remove_themselves_on_multisite() { 1786 if ( ! is_multisite() ) { 1787 $this->markTestSkipped( 'Test only runs in multisite.' ); 1788 } 1773 $this->skipWithoutMultisite(); 1789 1774 1790 1775 $this->assertTrue( user_can( self::$super_admin->ID, 'remove_user', self::$super_admin->ID ) ); -
trunk/tests/phpunit/tests/user/countUsers.php
r40520 r40543 13 13 */ 14 14 public function test_count_users_is_accurate( $strategy ) { 15 16 if ( is_multisite() ) { 17 $this->markTestSkipped( 'Test does not run on multisite' ); 18 } 15 $this->skipWithMultisite(); 19 16 20 17 // Setup users … … 64 61 */ 65 62 public function test_count_users_multisite_is_accurate( $strategy ) { 66 67 if ( ! is_multisite() ) { 68 $this->markTestSkipped( 'Test requires multisite' ); 69 } 63 $this->skipWithoutMultisite(); 70 64 71 65 // Setup users -
trunk/tests/phpunit/tests/user/query.php
r40530 r40543 556 556 */ 557 557 public function test_roles_and_caps_should_be_populated_for_explicit_value_of_blog_id_on_nonms() { 558 if ( is_multisite() ) { 559 $this->markTestSkipped( __METHOD__ . ' is a non-multisite-only test.' ); 560 } 558 $this->skipWithMultisite(); 561 559 562 560 $query = new WP_User_Query( array( … … 577 575 */ 578 576 public function test_roles_and_caps_should_be_populated_for_explicit_value_of_current_blog_id_on_ms() { 579 if ( ! is_multisite() ) { 580 $this->markTestSkipped( __METHOD__ . ' is a multisite-only test.' ); 581 } 577 $this->skipWithoutMultisite(); 582 578 583 579 $query = new WP_User_Query( array( … … 598 594 */ 599 595 public function test_roles_and_caps_should_be_populated_for_explicit_value_of_different_blog_id_on_ms_when_fields_all_with_meta() { 600 if ( ! is_multisite() ) { 601 $this->markTestSkipped( __METHOD__ . ' is a multisite-only test.' ); 602 } 596 $this->skipWithoutMultisite(); 603 597 604 598 $b = self::factory()->blog->create(); … … 625 619 */ 626 620 public function test_roles_and_caps_should_be_populated_for_explicit_value_of_different_blog_id_on_ms_when_fields_all() { 627 if ( ! is_multisite() ) { 628 $this->markTestSkipped( __METHOD__ . ' is a multisite-only test.' ); 629 } 621 $this->skipWithoutMultisite(); 630 622 631 623 $b = self::factory()->blog->create(); … … 651 643 */ 652 644 public function test_who_authors() { 653 if ( ! is_multisite() ) { 654 $this->markTestSkipped( __METHOD__ . ' requires multisite.' ); 655 } 645 $this->skipWithoutMultisite(); 656 646 657 647 $b = self::factory()->blog->create(); … … 678 668 */ 679 669 public function test_who_authors_should_work_alongside_meta_query() { 680 if ( ! is_multisite() ) { 681 $this->markTestSkipped( __METHOD__ . ' requires multisite.' ); 682 } 670 $this->skipWithoutMultisite(); 683 671 684 672 $b = self::factory()->blog->create(); … … 714 702 */ 715 703 public function test_who_authors_should_work_alongside_meta_params() { 716 if ( ! is_multisite() ) { 717 $this->markTestSkipped( __METHOD__ . ' requires multisite.' ); 718 } 704 $this->skipWithoutMultisite(); 719 705 720 706 $b = self::factory()->blog->create(); … … 808 794 */ 809 795 public function test_has_published_posts_should_respect_blog_id() { 810 if ( ! is_multisite() ) { 811 $this->markTestSkipped( __METHOD__ . ' requires multisite.' ); 812 } 796 $this->skipWithoutMultisite(); 813 797 814 798 $blogs = self::factory()->blog->create_many( 2 ); … … 1376 1360 */ 1377 1361 public function test_blog_id_should_restrict_by_blog_without_requiring_a_named_role() { 1378 if ( ! is_multisite() ) { 1379 $this->markTestSkipped( __METHOD__ . ' requires multisite.' ); 1380 } 1362 $this->skipWithoutMultisite(); 1381 1363 1382 1364 $sites = self::factory()->blog->create_many( 2 ); … … 1399 1381 */ 1400 1382 public function test_calling_prepare_query_a_second_time_should_not_add_another_cap_query_on_multisite() { 1401 if ( ! is_multisite() ) { 1402 $this->markTestSkipped( __METHOD__ . ' requires Multisite.' ); 1403 } 1383 $this->skipWithoutMultisite(); 1404 1384 1405 1385 $site_id = get_current_blog_id(); -
trunk/tests/phpunit/tests/user/wpAuthenticateSpamCheck.php
r40520 r40543 10 10 */ 11 11 function test_wp_authenticate_spam_check_returns_user_when_single_site() { 12 if ( is_multisite() ) { 13 $this->markTestSkipped( 'This test applies to single site only.' ); 14 } 12 $this->skipWithMultisite(); 15 13 16 14 $user_id = self::factory()->user->create( array( 'role' => 'contributor' ) ); … … 26 24 */ 27 25 function test_wp_authenticate_spam_check_returns_user_when_not_flagged() { 28 if ( ! is_multisite() ) { 29 $this->markTestSkipped( 'This test applies to multisite only.' ); 30 } 26 $this->skipWithoutMultisite(); 31 27 32 28 $user_id = self::factory()->user->create( array( 'role' => 'contributor' ) ); … … 42 38 */ 43 39 function test_wp_authenticate_spam_check_returns_wp_error_when_flagged() { 44 if ( ! is_multisite() ) { 45 $this->markTestSkipped( 'This test applies to multisite only.' ); 46 } 40 $this->skipWithoutMultisite(); 47 41 48 42 $user_id = self::factory()->user->create( array( 'role' => 'contributor' ) ); -
trunk/tests/phpunit/tests/user/wpDeleteUser.php
r40520 r40543 128 128 */ 129 129 public function test_numeric_string_user_id() { 130 if ( is_multisite() ) { 131 $this->markTestSkipped( 'wp_delete_user() does not delete user records in Multisite.' ); 132 } 130 $this->skipWithMultisite(); 133 131 134 132 $u = self::factory()->user->create(); … … 151 149 */ 152 150 public function test_should_return_false_for_object_user_id() { 153 if ( is_multisite() ) { 154 $this->markTestSkipped( 'wp_delete_user() does not delete user records in Multisite.' ); 155 } 151 $this->skipWithMultisite(); 156 152 157 153 $u_obj = self::factory()->user->create_and_get(); -
trunk/tests/phpunit/tests/user/wpGetUsersWithNoRole.php
r40522 r40543 11 11 */ 12 12 public function test_get_users_with_no_role_is_accurate() { 13 14 if ( is_multisite() ) { 15 $this->markTestSkipped( 'Test does not run on multisite' ); 16 } 13 $this->skipWithMultisite(); 17 14 18 15 // Setup users … … 46 43 */ 47 44 public function test_get_users_with_no_role_multisite_is_accurate() { 48 49 if ( ! is_multisite() ) { 50 $this->markTestSkipped( 'Test requires multisite' ); 51 } 45 $this->skipWithoutMultisite(); 52 46 53 47 // Setup users
Note: See TracChangeset
for help on using the changeset viewer.