From 30965710474260b25031951df31eec901e716e28 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 6 Feb 2020 21:40:05 +0000 Subject: [PATCH] Tests: Change a few remaining `include_once` statements to `require_once`, for consistency. See #48082. git-svn-id: https://develop.svn.wordpress.org/trunk@47200 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/functions/deprecated.php | 4 ++-- tests/phpunit/tests/l10n/loadTextdomainJustInTime.php | 2 +- tests/phpunit/tests/menu/wpAjaxMenuQuickSearch.php | 2 +- tests/phpunit/tests/user/query.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/tests/functions/deprecated.php b/tests/phpunit/tests/functions/deprecated.php index 18674554df..2473972bb4 100644 --- a/tests/phpunit/tests/functions/deprecated.php +++ b/tests/phpunit/tests/functions/deprecated.php @@ -154,7 +154,7 @@ class Test_Functions_Deprecated extends WP_UnitTestCase { } // Call wp_save_image_file(). - include_once ABSPATH . 'wp-admin/includes/image-edit.php'; + require_once ABSPATH . 'wp-admin/includes/image-edit.php'; $file = wp_tempnam(); $img = imagecreatefromjpeg( DIR_TESTDATA . '/images/canola.jpg' ); wp_save_image_file( $file, $img, 'image/jpeg', 1 ); @@ -177,7 +177,7 @@ class Test_Functions_Deprecated extends WP_UnitTestCase { } // Call wp_save_image_file(). - include_once ABSPATH . 'wp-admin/includes/image-edit.php'; + require_once ABSPATH . 'wp-admin/includes/image-edit.php'; $file = wp_tempnam(); $img = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' ); wp_save_image_file( $file, $img, 'image/jpeg', 1 ); diff --git a/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php b/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php index ea35bbfcfd..e0aa3df644 100644 --- a/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php +++ b/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php @@ -90,7 +90,7 @@ class Tests_L10n_loadTextdomainJustInTime extends WP_UnitTestCase { switch_theme( 'internationalized-theme' ); - include_once get_stylesheet_directory() . '/functions.php'; + require_once get_stylesheet_directory() . '/functions.php'; $is_textdomain_loaded_before = is_textdomain_loaded( 'internationalized-theme' ); $expected_output = i18n_theme_test(); diff --git a/tests/phpunit/tests/menu/wpAjaxMenuQuickSearch.php b/tests/phpunit/tests/menu/wpAjaxMenuQuickSearch.php index b5df3a188c..55febb9e8d 100644 --- a/tests/phpunit/tests/menu/wpAjaxMenuQuickSearch.php +++ b/tests/phpunit/tests/menu/wpAjaxMenuQuickSearch.php @@ -36,7 +36,7 @@ class Tests_Menu_WpAjaxMenuQuickSeach extends WP_UnitTestCase { * @ticket 27042 */ public function test_search_returns_results_for_pages() { - include_once ABSPATH . 'wp-admin/includes/nav-menu.php'; + require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; self::factory()->post->create_many( 3, diff --git a/tests/phpunit/tests/user/query.php b/tests/phpunit/tests/user/query.php index 9fe4144cbc..bdef6bfa71 100644 --- a/tests/phpunit/tests/user/query.php +++ b/tests/phpunit/tests/user/query.php @@ -1661,7 +1661,7 @@ class Tests_User_Query extends WP_UnitTestCase { $ids = $q->get_results(); - /* must include user that has same string in display_name */ + // Must include user that has the same string in display_name. $this->assertEquals( array( $new_user1 ), $ids ); } @@ -1689,7 +1689,7 @@ class Tests_User_Query extends WP_UnitTestCase { $ids = $q->get_results(); - /* must not include user that has same string in other fields */ + // Must not include user that has the same string in other fields. $this->assertEquals( array(), $ids ); }