diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index 9c0725d1b5779..83dd0acccf7ed 100644 --- a/src/wp-admin/includes/file.php +++ b/src/wp-admin/includes/file.php @@ -1779,8 +1779,6 @@ function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) { mbstring_binary_safe_encoding(); - require_once ABSPATH . 'wp-admin/includes/class-pclzip.php'; - $archive = new PclZip( $file ); $archive_files = $archive->extract( PCLZIP_OPT_EXTRACT_AS_STRING ); diff --git a/src/wp-includes/class-wp-autoload.php b/src/wp-includes/class-wp-autoload.php index b8ca0ec407f08..55550f808f7e2 100644 --- a/src/wp-includes/class-wp-autoload.php +++ b/src/wp-includes/class-wp-autoload.php @@ -25,6 +25,8 @@ final class WP_Autoload { /* Classes in the wp-includes/ folder. */ 'passwordhash' => 'wp-includes/class-phpass.php', 'pop3' => 'wp-includes/class-pop3.php', + 'services_json' => 'wp-includes/class-json.php', + 'services_json_error' => 'wp-includes/class-json.php', 'walker_categorydropdown' => 'wp-includes/class-walker-category-dropdown.php', 'walker_category' => 'wp-includes/class-walker-category.php', 'walker_comment' => 'wp-includes/class-walker-comment.php', diff --git a/tests/phpunit/tests/admin/wpAutomaticUpdater.php b/tests/phpunit/tests/admin/wpAutomaticUpdater.php index 91ceaa1b38fe7..f8bc6a0904729 100644 --- a/tests/phpunit/tests/admin/wpAutomaticUpdater.php +++ b/tests/phpunit/tests/admin/wpAutomaticUpdater.php @@ -25,7 +25,7 @@ class Tests_Admin_WpAutomaticUpdater extends WP_UnitTestCase { * Sets up shared fixtures. */ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { - require_once ABSPATH . 'wp-admin/includes/class-wp-automatic-updater.php'; + require_once ABSPATH . WPINC . '/class-wp-autoload.php'; self::$updater = new WP_Automatic_Updater(); self::$send_plugin_theme_email = new ReflectionMethod( self::$updater, 'send_plugin_theme_email' ); diff --git a/tests/phpunit/tests/admin/wpCommunityEvents.php b/tests/phpunit/tests/admin/wpCommunityEvents.php index 6b8ccc7f9bc99..811ecf88728f3 100644 --- a/tests/phpunit/tests/admin/wpCommunityEvents.php +++ b/tests/phpunit/tests/admin/wpCommunityEvents.php @@ -28,7 +28,7 @@ class Tests_Admin_wpCommunityEvents extends WP_UnitTestCase { public static function set_up_before_class() { parent::set_up_before_class(); - require_once ABSPATH . 'wp-admin/includes/class-wp-community-events.php'; + require_once ABSPATH . WPINC . '/class-wp-autoload.php'; } /** diff --git a/tests/phpunit/tests/admin/wpListTable.php b/tests/phpunit/tests/admin/wpListTable.php index c28113d99f133..66599a57ca92b 100644 --- a/tests/phpunit/tests/admin/wpListTable.php +++ b/tests/phpunit/tests/admin/wpListTable.php @@ -19,7 +19,7 @@ public static function set_up_before_class() { parent::set_up_before_class(); - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; + require_once ABSPATH . WPINC . '/class-wp-autoload.php'; $hook_suffix = '_wp_tests'; self::$list_table = new WP_List_Table(); diff --git a/tests/phpunit/tests/admin/wpMediaListTable.php b/tests/phpunit/tests/admin/wpMediaListTable.php index a130a3250673d..d6d59761d4968 100644 --- a/tests/phpunit/tests/admin/wpMediaListTable.php +++ b/tests/phpunit/tests/admin/wpMediaListTable.php @@ -8,7 +8,7 @@ class Tests_Admin_wpMediaListTable extends WP_UnitTestCase { public static function set_up_before_class() { parent::set_up_before_class(); - require_once ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php'; + require_once ABSPATH . WPINC . '/class-wp-autoload.php'; } /** diff --git a/tests/phpunit/tests/adminbar.php b/tests/phpunit/tests/adminbar.php index aa8043e7ec78a..6bbfd3c2b6102 100644 --- a/tests/phpunit/tests/adminbar.php +++ b/tests/phpunit/tests/adminbar.php @@ -17,7 +17,7 @@ class Tests_AdminBar extends WP_UnitTestCase { public static function set_up_before_class() { parent::set_up_before_class(); - require_once ABSPATH . WPINC . '/class-wp-admin-bar.php'; + require_once ABSPATH . WPINC . '/class-wp-autoload.php'; } public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { @@ -651,7 +651,6 @@ public function test_new_user_link_does_not_exist_for_user_without_create_or_pro */ public function test_customize_link() { global $wp_customize; - require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; $uuid = wp_generate_uuid4(); $this->go_to( home_url( "/?customize_changeset_uuid=$uuid" ) ); wp_set_current_user( self::$admin_id ); diff --git a/tests/phpunit/tests/ajax/wpAjaxCropImage.php b/tests/phpunit/tests/ajax/wpAjaxCropImage.php index 3a23f3a425b50..3406c8d185e94 100644 --- a/tests/phpunit/tests/ajax/wpAjaxCropImage.php +++ b/tests/phpunit/tests/ajax/wpAjaxCropImage.php @@ -4,8 +4,7 @@ * Admin Ajax functions to be tested. */ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; -require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'; -require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php'; +require_once ABSPATH . 'wp-includes/class-wp-autoload.php'; /** * Class for testing ajax crop image functionality. diff --git a/tests/phpunit/tests/ajax/wpCustomizeManager.php b/tests/phpunit/tests/ajax/wpCustomizeManager.php index 15ee1f0d5c639..ff68d9d86c9c8 100644 --- a/tests/phpunit/tests/ajax/wpCustomizeManager.php +++ b/tests/phpunit/tests/ajax/wpCustomizeManager.php @@ -53,7 +53,7 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { */ public function set_up() { parent::set_up(); - require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; + require_once ABSPATH . WPINC . '/class-wp-autoload.php'; } /** diff --git a/tests/phpunit/tests/ajax/wpCustomizeNavMenus.php b/tests/phpunit/tests/ajax/wpCustomizeNavMenus.php index db34c1c5d0383..1db609ab06d80 100644 --- a/tests/phpunit/tests/ajax/wpCustomizeNavMenus.php +++ b/tests/phpunit/tests/ajax/wpCustomizeNavMenus.php @@ -52,7 +52,7 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { */ public function set_up() { parent::set_up(); - require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; + require_once ABSPATH . WPINC . '/class-wp-autoload.php'; wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); global $wp_customize; $this->wp_customize = new WP_Customize_Manager(); diff --git a/tests/phpunit/tests/compat/jsonEncodeDecode.php b/tests/phpunit/tests/compat/jsonEncodeDecode.php index be51c6022b193..7c311868be0c9 100644 --- a/tests/phpunit/tests/compat/jsonEncodeDecode.php +++ b/tests/phpunit/tests/compat/jsonEncodeDecode.php @@ -18,7 +18,7 @@ public function test_json_encode_decode() { $this->setExpectedDeprecated( 'Services_JSON::strlen8' ); $this->setExpectedDeprecated( 'Services_JSON::substr8' ); - require_once ABSPATH . WPINC . '/class-json.php'; + require_once ABSPATH . WPINC . '/class-wp-autoload.php'; $json = new Services_JSON(); // Super basic test to verify Services_JSON is intact and working. diff --git a/tests/phpunit/tests/customize/control.php b/tests/phpunit/tests/customize/control.php index d472eacad920a..88feca20a937f 100644 --- a/tests/phpunit/tests/customize/control.php +++ b/tests/phpunit/tests/customize/control.php @@ -23,7 +23,7 @@ class Test_WP_Customize_Control extends WP_UnitTestCase { public function set_up() { parent::set_up(); wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); - require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; + require_once ABSPATH . WPINC . '/class-wp-autoload.php'; $GLOBALS['wp_customize'] = new WP_Customize_Manager(); $this->wp_customize = $GLOBALS['wp_customize']; } diff --git a/tests/phpunit/tests/customize/custom-css-setting.php b/tests/phpunit/tests/customize/custom-css-setting.php index 015b6308af306..4f14cf9e5cc07 100644 --- a/tests/phpunit/tests/customize/custom-css-setting.php +++ b/tests/phpunit/tests/customize/custom-css-setting.php @@ -29,7 +29,7 @@ class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase { */ public function set_up() { parent::set_up(); - require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; + require_once ABSPATH . WPINC . '/class-wp-autoload.php'; $user_id = self::factory()->user->create( array( diff --git a/tests/phpunit/tests/customize/manager.php b/tests/phpunit/tests/customize/manager.php index 9498211a1f4c3..d363c840ac2f6 100644 --- a/tests/phpunit/tests/customize/manager.php +++ b/tests/phpunit/tests/customize/manager.php @@ -55,7 +55,7 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { */ public function set_up() { parent::set_up(); - require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; + require_once ABSPATH . WPINC . '/class-wp-autoload.php'; $this->manager = $this->instantiate(); } @@ -3638,7 +3638,7 @@ public function test_sanitize_external_header_video_trim() { } } -require_once ABSPATH . WPINC . '/class-wp-customize-setting.php'; +require_once ABSPATH . WPINC . '/class-wp-autoload.php'; /** * Class Test_Dynamic_Customize_Setting diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php index 378ed16093339..34e9430a822a4 100644 --- a/tests/phpunit/tests/theme.php +++ b/tests/phpunit/tests/theme.php @@ -380,7 +380,7 @@ public function test_wp_keep_alive_customize_changeset_dependent_auto_drafts() { ), ); wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); - require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; + require_once ABSPATH . WPINC . '/class-wp-autoload.php'; $wp_customize = new WP_Customize_Manager(); do_action( 'customize_register', $wp_customize ); diff --git a/tests/phpunit/tests/widgets.php b/tests/phpunit/tests/widgets.php index 8f64669c2951b..30a9a316492d8 100644 --- a/tests/phpunit/tests/widgets.php +++ b/tests/phpunit/tests/widgets.php @@ -638,7 +638,7 @@ public function test_wp_widget_is_preview() { $this->assertFalse( $widget->is_preview() ); wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); - require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; + require_once ABSPATH . WPINC . '/class-wp-autoload.php'; $wp_customize = new WP_Customize_Manager(); $wp_customize->start_previewing_theme();