diff --git src/wp-admin/includes/class-wp-site-health-auto-updates.php src/wp-admin/includes/class-wp-site-health-auto-updates.php
index f6fb7d79b9..e3c02d0620 100644
|
|
|
class WP_Site_Health_Auto_Updates { |
| 277 | 277 | public function test_check_wp_filesystem_method() { |
| 278 | 278 | // Make sure the `request_filesystem_credentials()` function is available during our REST API call. |
| 279 | 279 | if ( ! function_exists( 'request_filesystem_credentials' ) ) { |
| 280 | | require_once ABSPATH . '/wp-admin/includes/file.php'; |
| | 280 | require_once ABSPATH . 'wp-admin/includes/file.php'; |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | $skin = new Automatic_Upgrader_Skin; |
| … |
… |
class WP_Site_Health_Auto_Updates { |
| 328 | 328 | |
| 329 | 329 | // Make sure the `get_core_checksums()` function is available during our REST API call. |
| 330 | 330 | if ( ! function_exists( 'get_core_checksums' ) ) { |
| 331 | | require_once ABSPATH . '/wp-admin/includes/update.php'; |
| | 331 | require_once ABSPATH . 'wp-admin/includes/update.php'; |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | $checksums = get_core_checksums( $wp_version, 'en_US' ); |
diff --git src/wp-admin/includes/class-wp-site-health.php src/wp-admin/includes/class-wp-site-health.php
index abe0fc6184..4300abd8de 100644
|
|
|
class WP_Site_Health { |
| 65 | 65 | */ |
| 66 | 66 | public function show_site_health_tab( $tab ) { |
| 67 | 67 | if ( 'debug' === $tab ) { |
| 68 | | require_once ABSPATH . '/wp-admin/site-health-info.php'; |
| | 68 | require_once ABSPATH . 'wp-admin/site-health-info.php'; |
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
diff --git src/wp-admin/includes/file.php src/wp-admin/includes/file.php
index bfd32ec899..a89e601060 100644
|
|
|
function request_filesystem_credentials( $form_post, $type = '', $error = false, |
| 2442 | 2442 | // Make sure the `submit_button()` function is available during the REST API call |
| 2443 | 2443 | // from WP_Site_Health_Auto_Updates::test_check_wp_filesystem_method(). |
| 2444 | 2444 | if ( ! function_exists( 'submit_button' ) ) { |
| 2445 | | require_once ABSPATH . '/wp-admin/includes/template.php'; |
| | 2445 | require_once ABSPATH . 'wp-admin/includes/template.php'; |
| 2446 | 2446 | } |
| 2447 | 2447 | ?> |
| 2448 | 2448 | <p class="request-filesystem-credentials-action-buttons"> |
diff --git src/wp-admin/menu-header.php src/wp-admin/menu-header.php
index ee90d23152..fd5eb21bdc 100644
|
|
|
function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { |
| 163 | 163 | if ( ! empty( $menu_hook ) |
| 164 | 164 | || ( ( 'index.php' !== $submenu_items[0][2] ) |
| 165 | 165 | && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) |
| 166 | | && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) |
| | 166 | && ! file_exists( ABSPATH . "wp-admin/$menu_file" ) ) |
| 167 | 167 | ) { |
| 168 | 168 | $admin_is_parent = true; |
| 169 | 169 | echo "<a href='admin.php?page={$submenu_items[0][2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style aria-hidden='true'>$img</div><div class='wp-menu-name'>$title</div></a>"; |
| … |
… |
function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { |
| 182 | 182 | if ( ! empty( $menu_hook ) |
| 183 | 183 | || ( ( 'index.php' !== $item[2] ) |
| 184 | 184 | && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) |
| 185 | | && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) |
| | 185 | && ! file_exists( ABSPATH . "wp-admin/$menu_file" ) ) |
| 186 | 186 | ) { |
| 187 | 187 | $admin_is_parent = true; |
| 188 | 188 | echo "\n\t<a href='admin.php?page={$item[2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style aria-hidden='true'>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>"; |
| … |
… |
function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { |
| 255 | 255 | if ( ! empty( $menu_hook ) |
| 256 | 256 | || ( ( 'index.php' !== $sub_item[2] ) |
| 257 | 257 | && file_exists( WP_PLUGIN_DIR . "/$sub_file" ) |
| 258 | | && ! file_exists( ABSPATH . "/wp-admin/$sub_file" ) ) |
| | 258 | && ! file_exists( ABSPATH . "wp-admin/$sub_file" ) ) |
| 259 | 259 | ) { |
| 260 | 260 | // If admin.php is the current page or if the parent exists as a file in the plugins or admin directory. |
| 261 | 261 | if ( ( ! $admin_is_parent && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! is_dir( WP_PLUGIN_DIR . "/{$item[2]}" ) ) || file_exists( $menu_file ) ) { |
diff --git tests/phpunit/includes/bootstrap.php tests/phpunit/includes/bootstrap.php
index 9a1b234b71..1113a87eea 100644
|
|
|
if ( isset( $GLOBALS['wp_tests_options'] ) ) { |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | // Load WordPress. |
| 305 | | require_once ABSPATH . '/wp-settings.php'; |
| | 305 | require_once ABSPATH . 'wp-settings.php'; |
| 306 | 306 | |
| 307 | 307 | // Delete any default posts & related data. |
| 308 | 308 | _delete_all_posts(); |
diff --git tests/phpunit/includes/install.php tests/phpunit/includes/install.php
index 1357b4d5fe..3157fd9384 100644
|
|
|
$_SERVER['PHP_SELF'] = '/index.php'; |
| 37 | 37 | |
| 38 | 38 | tests_add_filter( 'wp_die_handler', '_wp_die_handler_filter_exit' ); |
| 39 | 39 | |
| 40 | | require_once ABSPATH . '/wp-settings.php'; |
| | 40 | require_once ABSPATH . 'wp-settings.php'; |
| 41 | 41 | |
| 42 | | require_once ABSPATH . '/wp-admin/includes/upgrade.php'; |
| 43 | | require_once ABSPATH . '/wp-includes/class-wpdb.php'; |
| | 42 | require_once ABSPATH . 'wp-admin/includes/upgrade.php'; |
| | 43 | require_once ABSPATH . 'wp-includes/class-wpdb.php'; |
| 44 | 44 | |
| 45 | 45 | // Override the PHPMailer. |
| 46 | 46 | global $phpmailer; |
diff --git tests/phpunit/tests/customize/widgets.php tests/phpunit/tests/customize/widgets.php
index 446bcf5a68..654008a7a9 100644
|
|
|
class Tests_WP_Customize_Widgets extends WP_UnitTestCase { |
| 556 | 556 | */ |
| 557 | 557 | private function get_test_widget_control_args() { |
| 558 | 558 | global $wp_registered_widgets; |
| 559 | | require_once ABSPATH . '/wp-admin/includes/widgets.php'; |
| | 559 | require_once ABSPATH . 'wp-admin/includes/widgets.php'; |
| 560 | 560 | $widget_id = 'search-2'; |
| 561 | 561 | $widget = $wp_registered_widgets[ $widget_id ]; |
| 562 | 562 | $args = array( |
diff --git tests/phpunit/tests/feed/wpSimplePieFile.php tests/phpunit/tests/feed/wpSimplePieFile.php
index f9748e3a7b..fe16352cf7 100644
|
|
|
class Tests_Feed_wpSimplePieFile extends WP_UnitTestCase { |
| 19 | 19 | public static function set_up_before_class() { |
| 20 | 20 | parent::set_up_before_class(); |
| 21 | 21 | |
| 22 | | require_once ABSPATH . '/wp-includes/class-simplepie.php'; |
| 23 | | require_once ABSPATH . '/wp-includes/class-wp-simplepie-file.php'; |
| | 22 | require_once ABSPATH . 'wp-includes/class-simplepie.php'; |
| | 23 | require_once ABSPATH . 'wp-includes/class-wp-simplepie-file.php'; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
diff --git tests/phpunit/tests/pluggable/signatures.php tests/phpunit/tests/pluggable/signatures.php
index a802b03766..cc1b534732 100644
|
|
|
class Tests_Pluggable_Signatures extends WP_UnitTestCase { |
| 76 | 76 | */ |
| 77 | 77 | public function get_defined_pluggable_functions() { |
| 78 | 78 | |
| 79 | | require_once ABSPATH . '/wp-admin/includes/upgrade.php'; |
| | 79 | require_once ABSPATH . 'wp-admin/includes/upgrade.php'; |
| 80 | 80 | |
| 81 | 81 | $test_functions = array( |
| 82 | 82 | 'install_network', |
| … |
… |
class Tests_Pluggable_Signatures extends WP_UnitTestCase { |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | foreach ( $test_files as $file ) { |
| 106 | | preg_match_all( '#^\t?function (\w+)#m', file_get_contents( ABSPATH . '/' . $file ), $functions ); |
| | 106 | preg_match_all( '#^\t?function (\w+)#m', file_get_contents( ABSPATH . '' . $file ), $functions ); |
| 107 | 107 | |
| 108 | 108 | foreach ( $functions[1] as $function ) { |
| 109 | 109 | $data[] = array( |
diff --git tests/phpunit/tests/pluggable/wpMail.php tests/phpunit/tests/pluggable/wpMail.php
index bbe27bd88e..68982d6026 100644
|
|
|
class Tests_Pluggable_wpMail extends WP_UnitTestCase { |
| 173 | 173 | $this->assertTrue( wp_mail( 'valid@address.com', 'subject', 'body' ) ); |
| 174 | 174 | |
| 175 | 175 | // Non-fatal errors. |
| 176 | | $this->assertTrue( wp_mail( 'valid@address.com', 'subject', 'body', "Cc: invalid-address\nBcc: @invalid.address", ABSPATH . '/non-existent-file.html' ) ); |
| | 176 | $this->assertTrue( wp_mail( 'valid@address.com', 'subject', 'body', "Cc: invalid-address\nBcc: @invalid.address", ABSPATH . 'non-existent-file.html' ) ); |
| 177 | 177 | |
| 178 | 178 | // Fatal errors. |
| 179 | 179 | $this->assertFalse( wp_mail( 'invalid.address', 'subject', 'body', '', array() ) ); |
diff --git tests/phpunit/tests/pomo/po.php tests/phpunit/tests/pomo/po.php
index d7652f27e6..8c58099b69 100644
|
|
|
http://wordpress.org/ |
| 48 | 48 | public static function set_up_before_class() { |
| 49 | 49 | parent::set_up_before_class(); |
| 50 | 50 | |
| 51 | | require_once ABSPATH . '/wp-includes/pomo/po.php'; |
| | 51 | require_once ABSPATH . 'wp-includes/pomo/po.php'; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | public function test_prepend_each_line() { |
diff --git tests/phpunit/tests/post.php tests/phpunit/tests/post.php
index 6f07ca8593..551cbd8c56 100644
|
|
|
class Tests_Post extends WP_UnitTestCase { |
| 285 | 285 | $this->markTestSkipped( 'This test is only useful with the utf8 character set.' ); |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | | require_once ABSPATH . '/wp-admin/includes/post.php'; |
| | 288 | require_once ABSPATH . 'wp-admin/includes/post.php'; |
| 289 | 289 | |
| 290 | 290 | $post_id = self::factory()->post->create(); |
| 291 | 291 | |
diff --git tests/phpunit/tests/widgets.php tests/phpunit/tests/widgets.php
index 2407a2de1b..a3dbdfea73 100644
|
|
|
class Tests_Widgets extends WP_UnitTestCase { |
| 813 | 813 | ); |
| 814 | 814 | |
| 815 | 815 | wp_widgets_init(); |
| 816 | | require_once ABSPATH . '/wp-admin/includes/widgets.php'; |
| | 816 | require_once ABSPATH . 'wp-admin/includes/widgets.php'; |
| 817 | 817 | $widget_id = 'search-2'; |
| 818 | 818 | $widget = $wp_registered_widgets[ $widget_id ]; |
| 819 | 819 | $params = array( |