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
This commit is contained in:
Sergey Biryukov 2020-02-06 21:40:05 +00:00
parent 8640eaa96e
commit 3096571047
4 changed files with 6 additions and 6 deletions

View File

@ -154,7 +154,7 @@ class Test_Functions_Deprecated extends WP_UnitTestCase {
} }
// Call wp_save_image_file(). // 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(); $file = wp_tempnam();
$img = imagecreatefromjpeg( DIR_TESTDATA . '/images/canola.jpg' ); $img = imagecreatefromjpeg( DIR_TESTDATA . '/images/canola.jpg' );
wp_save_image_file( $file, $img, 'image/jpeg', 1 ); 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(). // 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(); $file = wp_tempnam();
$img = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' ); $img = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
wp_save_image_file( $file, $img, 'image/jpeg', 1 ); wp_save_image_file( $file, $img, 'image/jpeg', 1 );

View File

@ -90,7 +90,7 @@ class Tests_L10n_loadTextdomainJustInTime extends WP_UnitTestCase {
switch_theme( 'internationalized-theme' ); 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' ); $is_textdomain_loaded_before = is_textdomain_loaded( 'internationalized-theme' );
$expected_output = i18n_theme_test(); $expected_output = i18n_theme_test();

View File

@ -36,7 +36,7 @@ class Tests_Menu_WpAjaxMenuQuickSeach extends WP_UnitTestCase {
* @ticket 27042 * @ticket 27042
*/ */
public function test_search_returns_results_for_pages() { 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( self::factory()->post->create_many(
3, 3,

View File

@ -1661,7 +1661,7 @@ class Tests_User_Query extends WP_UnitTestCase {
$ids = $q->get_results(); $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 ); $this->assertEquals( array( $new_user1 ), $ids );
} }
@ -1689,7 +1689,7 @@ class Tests_User_Query extends WP_UnitTestCase {
$ids = $q->get_results(); $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 ); $this->assertEquals( array(), $ids );
} }