mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Code Modernization: Replace dirname( __FILE__ ) calls with __DIR__ magic constant.
This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`. This commit also includes: * Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls. * Replacing `include` statements for several files with `require_once`, for consistency: * `wp-admin/admin-header.php` * `wp-admin/admin-footer.php` * `wp-includes/version.php` Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb. Fixes #48082. git-svn-id: https://develop.svn.wordpress.org/trunk@47198 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -34,7 +34,7 @@ class Test_WP_Community_Events extends WP_UnitTestCase {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-community-events.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-community-events.php';
|
||||
|
||||
$this->instance = new WP_Community_Events( 1, $this->get_user_location() );
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class Tests_Admin_Includes_Schema extends WP_UnitTestCase {
|
||||
$blogmeta = self::$blogmeta;
|
||||
$sitemeta = self::$sitemeta;
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/includes/schema.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/schema.php';
|
||||
|
||||
$charset_collate = $wpdb->get_charset_collate();
|
||||
$max_index_length = 191;
|
||||
|
||||
@@ -8,7 +8,7 @@ class Tests_Admin_IncludesUpdateCore extends WP_UnitTestCase {
|
||||
public function data_old_files() {
|
||||
global $_old_files;
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/includes/update-core.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/update-core.php';
|
||||
|
||||
$files = $_old_files;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class Tests_AdminBar extends WP_UnitTestCase {
|
||||
protected static $user_ids = array();
|
||||
|
||||
public static function setUpBeforeClass() {
|
||||
require_once( ABSPATH . WPINC . '/class-wp-admin-bar.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-admin-bar.php';
|
||||
|
||||
parent::setUpBeforeClass();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Admin Ajax functions to be tested.
|
||||
*/
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
/**
|
||||
* Testing Add Meta AJAX functionality.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Admin Ajax functions to be tested.
|
||||
*/
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
/**
|
||||
* Testing Ajax attachment handling.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Admin Ajax functions to be tested.
|
||||
*/
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
/**
|
||||
* Testing Ajax save draft functionality.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Admin Ajax functions to be tested.
|
||||
*/
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
/**
|
||||
* Testing Ajax compression test functionality.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Admin Ajax functions to be tested.
|
||||
*/
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
/**
|
||||
* Testing Ajax comment functionality.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Admin Ajax functions to be tested.
|
||||
*/
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
/**
|
||||
* Testing Ajax handler for deleting a plugin.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Admin Ajax functions to be tested.
|
||||
*/
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
/**
|
||||
* Testing Ajax comment functionality
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Admin Ajax functions to be tested.
|
||||
*/
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
/**
|
||||
* Testing Ajax comment functionality.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Admin Ajax functions to be tested.
|
||||
*/
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
/**
|
||||
* Testing Ajax comment functionality.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Admin Ajax functions to be tested.
|
||||
*/
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
/**
|
||||
* Testing Ajax handler for instlaling, updating, and deleting themes.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Admin Ajax functions to be tested.
|
||||
*/
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
/**
|
||||
* Testing Ajax media editing.
|
||||
@@ -27,7 +27,7 @@ class Tests_Ajax_MediaEdit extends WP_Ajax_UnitTestCase {
|
||||
* @ticket 22985
|
||||
*/
|
||||
public function testCropImageThumbnail() {
|
||||
include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/image-edit.php';
|
||||
|
||||
$filename = DIR_TESTDATA . '/images/canola.jpg';
|
||||
$contents = file_get_contents( $filename );
|
||||
@@ -58,7 +58,7 @@ class Tests_Ajax_MediaEdit extends WP_Ajax_UnitTestCase {
|
||||
public function testImageEditOverwriteConstant() {
|
||||
define( 'IMAGE_EDIT_OVERWRITE', true );
|
||||
|
||||
include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/image-edit.php';
|
||||
|
||||
$filename = DIR_TESTDATA . '/images/canola.jpg';
|
||||
$contents = file_get_contents( $filename );
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Admin Ajax functions to be tested.
|
||||
*/
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
/**
|
||||
* Testing Quick Edit AJAX functionality.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Admin Ajax functions to be tested.
|
||||
*/
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
/**
|
||||
* Testing Ajax comment functionality.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Admin Ajax functions to be tested.
|
||||
*/
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
/**
|
||||
* Testing Ajax tag search functionality.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Admin Ajax functions to be tested.
|
||||
*/
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
/**
|
||||
* Testing Ajax handler for updating a plugin.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once dirname( dirname( __FILE__ ) ) . '/canonical.php';
|
||||
require_once dirname( __DIR__ ) . '/canonical.php';
|
||||
|
||||
/**
|
||||
* @group canonical
|
||||
|
||||
@@ -183,7 +183,7 @@ EOT;
|
||||
* @expectedException PHPUnit_Framework_Error_Deprecated
|
||||
*/
|
||||
function test_json_encode_decode() {
|
||||
require_once( ABSPATH . WPINC . '/class-json.php' );
|
||||
require_once ABSPATH . WPINC . '/class-json.php';
|
||||
$json = new Services_JSON();
|
||||
// Super basic test to verify Services_JSON is intact and working.
|
||||
$this->assertEquals( '["foo"]', $json->encodeUnsafe( array( 'foo' ) ) );
|
||||
|
||||
@@ -27,7 +27,7 @@ class Test_WP_Customize_Control extends WP_UnitTestCase {
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) );
|
||||
require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
|
||||
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
|
||||
$this->wp_customize = $GLOBALS['wp_customize'];
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase {
|
||||
*/
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
|
||||
$this->manager = $this->instantiate();
|
||||
$this->undefined = new stdClass();
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class Tests_WP_Customize_Panel extends WP_UnitTestCase {
|
||||
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
|
||||
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
|
||||
$this->manager = $GLOBALS['wp_customize'];
|
||||
$this->undefined = new stdClass();
|
||||
|
||||
@@ -31,7 +31,7 @@ class Test_WP_Customize_Partial extends WP_UnitTestCase {
|
||||
*/
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
|
||||
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
|
||||
$this->wp_customize = $GLOBALS['wp_customize'];
|
||||
if ( isset( $this->wp_customize->selective_refresh ) ) {
|
||||
|
||||
@@ -21,7 +21,7 @@ class Tests_WP_Customize_Section extends WP_UnitTestCase {
|
||||
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
|
||||
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
|
||||
$this->manager = $GLOBALS['wp_customize'];
|
||||
$this->undefined = new stdClass();
|
||||
|
||||
@@ -41,7 +41,7 @@ class Test_WP_Customize_Selective_Refresh_Ajax extends WP_UnitTestCase {
|
||||
add_filter( 'wp_doing_ajax', '__return_true' );
|
||||
add_filter( 'wp_die_ajax_handler', array( $this, 'get_wp_die_handler' ), 1, 1 );
|
||||
|
||||
require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
|
||||
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
|
||||
$this->wp_customize = $GLOBALS['wp_customize'];
|
||||
if ( isset( $this->wp_customize->selective_refresh ) ) {
|
||||
|
||||
@@ -31,7 +31,7 @@ class Test_WP_Customize_Selective_Refresh extends WP_UnitTestCase {
|
||||
*/
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
|
||||
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
|
||||
$this->wp_customize = $GLOBALS['wp_customize'];
|
||||
if ( isset( $this->wp_customize->selective_refresh ) ) {
|
||||
|
||||
@@ -19,7 +19,7 @@ class Tests_WP_Customize_Setting extends WP_UnitTestCase {
|
||||
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
|
||||
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
|
||||
$this->manager = $GLOBALS['wp_customize'];
|
||||
$this->undefined = new stdClass();
|
||||
|
||||
@@ -22,7 +22,7 @@ class Tests_WP_Customize_Widgets extends WP_UnitTestCase {
|
||||
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
|
||||
|
||||
add_theme_support( 'customize-selective-refresh-widgets' );
|
||||
$user_id = self::factory()->user->create( array( 'role' => 'administrator' ) );
|
||||
|
||||
@@ -25,7 +25,7 @@ class Tests_DB_Charset extends WP_UnitTestCase {
|
||||
public static function setUpBeforeClass() {
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
require_once( dirname( dirname( __FILE__ ) ) . '/db.php' );
|
||||
require_once dirname( __DIR__ ) . '/db.php';
|
||||
|
||||
self::$_wpdb = new WpdbExposedMethodsForTesting();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
|
||||
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -72,7 +72,7 @@ class Tests_Feeds_Atom extends WP_UnitTestCase {
|
||||
global $post;
|
||||
try {
|
||||
// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
|
||||
@require( ABSPATH . 'wp-includes/feed-atom.php' );
|
||||
@require ABSPATH . 'wp-includes/feed-atom.php';
|
||||
$out = ob_get_clean();
|
||||
} catch ( Exception $e ) {
|
||||
$out = ob_get_clean();
|
||||
|
||||
@@ -84,7 +84,7 @@ class Tests_Feeds_RSS2 extends WP_UnitTestCase {
|
||||
global $post;
|
||||
try {
|
||||
// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
|
||||
@require( ABSPATH . 'wp-includes/feed-rss2.php' );
|
||||
@require ABSPATH . 'wp-includes/feed-rss2.php';
|
||||
$out = ob_get_clean();
|
||||
} catch ( Exception $e ) {
|
||||
$out = ob_get_clean();
|
||||
|
||||
@@ -24,7 +24,7 @@ abstract class WP_Filesystem_UnitTestCase extends WP_UnitTestCase {
|
||||
return 'MockFS';
|
||||
}
|
||||
function filter_abstraction_file( $file ) {
|
||||
return dirname( dirname( dirname( __FILE__ ) ) ) . '/includes/mock-fs.php';
|
||||
return dirname( dirname( __DIR__ ) ) . '/includes/mock-fs.php';
|
||||
}
|
||||
|
||||
function test_is_MockFS_sane() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once dirname( __FILE__ ) . '/base.php';
|
||||
require_once __DIR__ . '/base.php';
|
||||
|
||||
/**
|
||||
* @group filesystem
|
||||
|
||||
@@ -2107,7 +2107,7 @@ String with a number followed by a single quote !q1!Expendables 3!q1! vestibulum
|
||||
}
|
||||
|
||||
function data_whole_posts() {
|
||||
require_once( DIR_TESTDATA . '/formatting/whole-posts.php' );
|
||||
require_once DIR_TESTDATA . '/formatting/whole-posts.php';
|
||||
return data_whole_posts();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ class Tests_Formatting_WpHtmlSplit extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
function data_whole_posts() {
|
||||
require_once( DIR_TESTDATA . '/formatting/whole-posts.php' );
|
||||
require_once DIR_TESTDATA . '/formatting/whole-posts.php';
|
||||
return data_whole_posts();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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' );
|
||||
include_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' );
|
||||
include_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 );
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @group site_icon
|
||||
*/
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-icon.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-site-icon.php';
|
||||
|
||||
class Tests_General_Template extends WP_UnitTestCase {
|
||||
protected $wp_site_icon;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once dirname( __FILE__ ) . '/base.php';
|
||||
require_once __DIR__ . '/base.php';
|
||||
|
||||
/**
|
||||
* @group http
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once dirname( __FILE__ ) . '/base.php';
|
||||
require_once __DIR__ . '/base.php';
|
||||
|
||||
/**
|
||||
* @group http
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once dirname( __FILE__ ) . '/base.php';
|
||||
require_once __DIR__ . '/base.php';
|
||||
|
||||
/**
|
||||
* Test the WP_Image_Editor base class
|
||||
@@ -15,9 +15,9 @@ class Tests_Image_Editor extends WP_Image_UnitTestCase {
|
||||
* Setup test fixture
|
||||
*/
|
||||
public function setUp() {
|
||||
require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-image-editor.php';
|
||||
|
||||
include_once( DIR_TESTDATA . '/../includes/mock-image-editor.php' );
|
||||
require_once DIR_TESTDATA . '/../includes/mock-image-editor.php';
|
||||
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
* @group media
|
||||
* @group wp-image-editor-gd
|
||||
*/
|
||||
require_once( dirname( __FILE__ ) . '/base.php' );
|
||||
require_once __DIR__ . '/base.php';
|
||||
|
||||
class Tests_Image_Editor_GD extends WP_Image_UnitTestCase {
|
||||
|
||||
public $editor_engine = 'WP_Image_Editor_GD';
|
||||
|
||||
public function setUp() {
|
||||
require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' );
|
||||
require_once( ABSPATH . WPINC . '/class-wp-image-editor-gd.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-image-editor.php';
|
||||
require_once ABSPATH . WPINC . '/class-wp-image-editor-gd.php';
|
||||
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
* @group media
|
||||
* @group wp-image-editor-imagick
|
||||
*/
|
||||
require_once( dirname( __FILE__ ) . '/base.php' );
|
||||
require_once __DIR__ . '/base.php';
|
||||
|
||||
class Tests_Image_Editor_Imagick extends WP_Image_UnitTestCase {
|
||||
|
||||
public $editor_engine = 'WP_Image_Editor_Imagick';
|
||||
|
||||
public function setUp() {
|
||||
require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' );
|
||||
require_once( ABSPATH . WPINC . '/class-wp-image-editor-imagick.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-image-editor.php';
|
||||
require_once ABSPATH . WPINC . '/class-wp-image-editor-imagick.php';
|
||||
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ class Tests_Image_Functions extends WP_UnitTestCase {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' );
|
||||
require_once( ABSPATH . WPINC . '/class-wp-image-editor-gd.php' );
|
||||
require_once( ABSPATH . WPINC . '/class-wp-image-editor-imagick.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-image-editor.php';
|
||||
require_once ABSPATH . WPINC . '/class-wp-image-editor-gd.php';
|
||||
require_once ABSPATH . WPINC . '/class-wp-image-editor-imagick.php';
|
||||
|
||||
include_once( DIR_TESTDATA . '/../includes/mock-image-editor.php' );
|
||||
require_once DIR_TESTDATA . '/../includes/mock-image-editor.php';
|
||||
|
||||
// Ensure no legacy / failed tests detritus.
|
||||
$folder = '/tmp/wordpress-gsoc-flyer*.{jpg,pdf}';
|
||||
@@ -133,7 +133,7 @@ class Tests_Image_Functions extends WP_UnitTestCase {
|
||||
$this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' );
|
||||
}
|
||||
|
||||
include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/image-edit.php';
|
||||
|
||||
// Mime types.
|
||||
$mime_types = array(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
require_once( ABSPATH . 'wp-admin/includes/class-custom-image-header.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/class-custom-image-header.php';
|
||||
|
||||
/**
|
||||
* @group image
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @group upload
|
||||
* @group resize
|
||||
*/
|
||||
require_once( dirname( __FILE__ ) . '/base.php' );
|
||||
require_once __DIR__ . '/base.php';
|
||||
|
||||
abstract class WP_Tests_Image_Resize_UnitTestCase extends WP_Image_UnitTestCase {
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @group upload
|
||||
* @group resize
|
||||
*/
|
||||
require_once( dirname( __FILE__ ) . '/resize.php' );
|
||||
require_once __DIR__ . '/resize.php';
|
||||
|
||||
class Test_Image_Resize_GD extends WP_Tests_Image_Resize_UnitTestCase {
|
||||
|
||||
@@ -18,8 +18,8 @@ class Test_Image_Resize_GD extends WP_Tests_Image_Resize_UnitTestCase {
|
||||
public $editor_engine = 'WP_Image_Editor_GD';
|
||||
|
||||
public function setUp() {
|
||||
require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' );
|
||||
require_once( ABSPATH . WPINC . '/class-wp-image-editor-gd.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-image-editor.php';
|
||||
require_once ABSPATH . WPINC . '/class-wp-image-editor-gd.php';
|
||||
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @group upload
|
||||
* @group resize
|
||||
*/
|
||||
require_once( dirname( __FILE__ ) . '/resize.php' );
|
||||
require_once __DIR__ . '/resize.php';
|
||||
|
||||
class Test_Image_Resize_Imagick extends WP_Tests_Image_Resize_UnitTestCase {
|
||||
|
||||
@@ -18,8 +18,8 @@ class Test_Image_Resize_Imagick extends WP_Tests_Image_Resize_UnitTestCase {
|
||||
public $editor_engine = 'WP_Image_Editor_Imagick';
|
||||
|
||||
public function setUp() {
|
||||
require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' );
|
||||
require_once( ABSPATH . WPINC . '/class-wp-image-editor-imagick.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-image-editor.php';
|
||||
require_once ABSPATH . WPINC . '/class-wp-image-editor-imagick.php';
|
||||
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @group site_icon
|
||||
*/
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-icon.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-site-icon.php';
|
||||
|
||||
class Tests_WP_Site_Icon extends WP_UnitTestCase {
|
||||
protected $wp_site_icon;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once dirname( __FILE__ ) . '/base.php';
|
||||
require_once __DIR__ . '/base.php';
|
||||
|
||||
/**
|
||||
* @group import
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once dirname( __FILE__ ) . '/base.php';
|
||||
require_once __DIR__ . '/base.php';
|
||||
|
||||
/**
|
||||
* @group import
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once dirname( __FILE__ ) . '/base.php';
|
||||
require_once __DIR__ . '/base.php';
|
||||
|
||||
/**
|
||||
* @group import
|
||||
|
||||
@@ -13,7 +13,7 @@ class Tests_Menu_Walker_Nav_Menu_Edit extends WP_UnitTestCase {
|
||||
parent::setUp();
|
||||
|
||||
/** Walker_Nav_Menu_Edit class */
|
||||
require_once( ABSPATH . 'wp-admin/includes/class-walker-nav-menu-edit.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/class-walker-nav-menu-edit.php';
|
||||
|
||||
$this->walker = new Walker_Nav_Menu_Edit();
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
class Tests_Menu_WpExpandNavMenuPostData extends WP_UnitTestCase {
|
||||
public function test_unnested_data_should_expand() {
|
||||
include_once( ABSPATH . 'wp-admin/includes/nav-menu.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
|
||||
|
||||
if ( empty( $_POST ) ) {
|
||||
$_POST = array();
|
||||
@@ -29,7 +29,7 @@ class Tests_Menu_WpExpandNavMenuPostData extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
public function test_multidimensional_nested_array_should_expand() {
|
||||
include_once( ABSPATH . 'wp-admin/includes/nav-menu.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
|
||||
|
||||
if ( empty( $_POST ) ) {
|
||||
$_POST = array();
|
||||
@@ -59,7 +59,7 @@ class Tests_Menu_WpExpandNavMenuPostData extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
public function test_multidimensional_nested_array_should_expand_and_merge() {
|
||||
include_once( ABSPATH . 'wp-admin/includes/nav-menu.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
|
||||
|
||||
if ( empty( $_POST ) ) {
|
||||
$_POST = array();
|
||||
|
||||
@@ -24,7 +24,7 @@ class Tests_Embed_Template extends WP_UnitTestCase {
|
||||
$this->assertQueryTrue( 'is_single', 'is_singular', 'is_embed' );
|
||||
|
||||
ob_start();
|
||||
include( ABSPATH . WPINC . '/theme-compat/embed.php' );
|
||||
require ABSPATH . WPINC . '/theme-compat/embed.php';
|
||||
$actual = ob_get_clean();
|
||||
|
||||
$doc = new DOMDocument();
|
||||
@@ -56,7 +56,7 @@ class Tests_Embed_Template extends WP_UnitTestCase {
|
||||
$this->assertQueryTrue( 'is_single', 'is_singular', 'is_embed' );
|
||||
|
||||
ob_start();
|
||||
include( ABSPATH . WPINC . '/theme-compat/embed.php' );
|
||||
require ABSPATH . WPINC . '/theme-compat/embed.php';
|
||||
$actual = ob_get_clean();
|
||||
|
||||
$doc = new DOMDocument();
|
||||
@@ -73,7 +73,7 @@ class Tests_Embed_Template extends WP_UnitTestCase {
|
||||
$this->assertQueryTrue( 'is_404', 'is_embed' );
|
||||
|
||||
ob_start();
|
||||
include( ABSPATH . WPINC . '/theme-compat/embed.php' );
|
||||
require ABSPATH . WPINC . '/theme-compat/embed.php';
|
||||
$actual = ob_get_clean();
|
||||
|
||||
$doc = new DOMDocument();
|
||||
@@ -100,7 +100,7 @@ class Tests_Embed_Template extends WP_UnitTestCase {
|
||||
$this->assertQueryTrue( 'is_single', 'is_singular', 'is_attachment', 'is_embed' );
|
||||
|
||||
ob_start();
|
||||
include( ABSPATH . WPINC . '/theme-compat/embed.php' );
|
||||
require ABSPATH . WPINC . '/theme-compat/embed.php';
|
||||
$actual = ob_get_clean();
|
||||
|
||||
$doc = new DOMDocument();
|
||||
@@ -125,7 +125,7 @@ class Tests_Embed_Template extends WP_UnitTestCase {
|
||||
$this->assertQueryTrue( 'is_404', 'is_embed' );
|
||||
|
||||
ob_start();
|
||||
include( ABSPATH . WPINC . '/theme-compat/embed.php' );
|
||||
require ABSPATH . WPINC . '/theme-compat/embed.php';
|
||||
$actual = ob_get_clean();
|
||||
|
||||
$doc = new DOMDocument();
|
||||
@@ -149,7 +149,7 @@ class Tests_Embed_Template extends WP_UnitTestCase {
|
||||
$this->assertQueryTrue( 'is_404', 'is_embed' );
|
||||
|
||||
ob_start();
|
||||
include( ABSPATH . WPINC . '/theme-compat/embed.php' );
|
||||
require ABSPATH . WPINC . '/theme-compat/embed.php';
|
||||
$actual = ob_get_clean();
|
||||
|
||||
$doc = new DOMDocument();
|
||||
@@ -172,7 +172,7 @@ class Tests_Embed_Template extends WP_UnitTestCase {
|
||||
$this->assertQueryTrue( 'is_404', 'is_embed' );
|
||||
|
||||
ob_start();
|
||||
include( ABSPATH . WPINC . '/theme-compat/embed.php' );
|
||||
require ABSPATH . WPINC . '/theme-compat/embed.php';
|
||||
$actual = ob_get_clean();
|
||||
|
||||
$doc = new DOMDocument();
|
||||
@@ -199,7 +199,7 @@ class Tests_Embed_Template extends WP_UnitTestCase {
|
||||
$this->assertQueryTrue( 'is_single', 'is_singular', 'is_embed' );
|
||||
|
||||
ob_start();
|
||||
include( ABSPATH . WPINC . '/theme-compat/embed.php' );
|
||||
require ABSPATH . WPINC . '/theme-compat/embed.php';
|
||||
$actual = ob_get_clean();
|
||||
|
||||
$doc = new DOMDocument();
|
||||
|
||||
@@ -78,7 +78,7 @@ class PluralFormsTest extends WP_UnitTestCase {
|
||||
$this->markTestSkipped( 'Lambda functions are deprecated in PHP 7.2' );
|
||||
}
|
||||
|
||||
require_once dirname( dirname( dirname( __FILE__ ) ) ) . '/includes/plural-form-function.php';
|
||||
require_once dirname( dirname( __DIR__ ) ) . '/includes/plural-form-function.php';
|
||||
|
||||
$parenthesized = self::parenthesize_plural_expression( $expression );
|
||||
$old_style = tests_make_plural_form_function( $nplurals, $parenthesized );
|
||||
|
||||
@@ -1010,7 +1010,7 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
$this->markTestSkipped( 'This test is only useful with the utf8 character set' );
|
||||
}
|
||||
|
||||
require_once( ABSPATH . '/wp-admin/includes/post.php' );
|
||||
require_once ABSPATH . '/wp-admin/includes/post.php';
|
||||
|
||||
$post_id = self::factory()->post->create();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once dirname( __FILE__ ) . '/conditionals.php';
|
||||
require_once __DIR__ . '/conditionals.php';
|
||||
|
||||
/**
|
||||
* @group query
|
||||
|
||||
@@ -740,7 +740,7 @@ EOF;
|
||||
}
|
||||
|
||||
function data_whole_posts() {
|
||||
require_once( DIR_TESTDATA . '/formatting/whole-posts.php' );
|
||||
require_once DIR_TESTDATA . '/formatting/whole-posts.php';
|
||||
return data_whole_posts();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
class Tests_Site_Health extends WP_UnitTestCase {
|
||||
public static function wpSetUpBeforeClass() {
|
||||
// Include the `WP_Site_Health` file.
|
||||
include_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,7 @@ class Tests_Theme_Custom_Header extends WP_UnitTestCase {
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
|
||||
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
|
||||
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
|
||||
$this->customize_manager = $GLOBALS['wp_customize'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user