mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Coding Standards: Remove extra slashes when concatenating ABSPATH with a path.
Since `ABSPATH` is defined and documented to end with a forward slash `/`, this changeset removes the first `/` from strings appended to `ABSPATH` in various files, leading to `//` in the resulting path. Props TobiasBg, audrasjb, SergeyBiryukov, emanuelx. Fixes #57074. See #57071. git-svn-id: https://develop.svn.wordpress.org/trunk@54872 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -302,7 +302,7 @@ if ( isset( $GLOBALS['wp_tests_options'] ) ) {
|
||||
}
|
||||
|
||||
// Load WordPress.
|
||||
require_once ABSPATH . '/wp-settings.php';
|
||||
require_once ABSPATH . 'wp-settings.php';
|
||||
|
||||
// Delete any default posts & related data.
|
||||
_delete_all_posts();
|
||||
|
||||
@@ -37,10 +37,10 @@ $_SERVER['PHP_SELF'] = '/index.php';
|
||||
|
||||
tests_add_filter( 'wp_die_handler', '_wp_die_handler_filter_exit' );
|
||||
|
||||
require_once ABSPATH . '/wp-settings.php';
|
||||
require_once ABSPATH . 'wp-settings.php';
|
||||
|
||||
require_once ABSPATH . '/wp-admin/includes/upgrade.php';
|
||||
require_once ABSPATH . '/wp-includes/class-wpdb.php';
|
||||
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
||||
require_once ABSPATH . 'wp-includes/class-wpdb.php';
|
||||
|
||||
// Override the PHPMailer.
|
||||
global $phpmailer;
|
||||
|
||||
@@ -556,7 +556,7 @@ class Tests_WP_Customize_Widgets extends WP_UnitTestCase {
|
||||
*/
|
||||
private function get_test_widget_control_args() {
|
||||
global $wp_registered_widgets;
|
||||
require_once ABSPATH . '/wp-admin/includes/widgets.php';
|
||||
require_once ABSPATH . 'wp-admin/includes/widgets.php';
|
||||
$widget_id = 'search-2';
|
||||
$widget = $wp_registered_widgets[ $widget_id ];
|
||||
$args = array(
|
||||
|
||||
@@ -19,8 +19,8 @@ class Tests_Feed_wpSimplePieFile extends WP_UnitTestCase {
|
||||
public static function set_up_before_class() {
|
||||
parent::set_up_before_class();
|
||||
|
||||
require_once ABSPATH . '/wp-includes/class-simplepie.php';
|
||||
require_once ABSPATH . '/wp-includes/class-wp-simplepie-file.php';
|
||||
require_once ABSPATH . 'wp-includes/class-simplepie.php';
|
||||
require_once ABSPATH . 'wp-includes/class-wp-simplepie-file.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -76,7 +76,7 @@ class Tests_Pluggable_Signatures extends WP_UnitTestCase {
|
||||
*/
|
||||
public function get_defined_pluggable_functions() {
|
||||
|
||||
require_once ABSPATH . '/wp-admin/includes/upgrade.php';
|
||||
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
||||
|
||||
$test_functions = array(
|
||||
'install_network',
|
||||
@@ -103,7 +103,7 @@ class Tests_Pluggable_Signatures extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
foreach ( $test_files as $file ) {
|
||||
preg_match_all( '#^\t?function (\w+)#m', file_get_contents( ABSPATH . '/' . $file ), $functions );
|
||||
preg_match_all( '#^\t?function (\w+)#m', file_get_contents( ABSPATH . $file ), $functions );
|
||||
|
||||
foreach ( $functions[1] as $function ) {
|
||||
$data[] = array(
|
||||
|
||||
@@ -173,7 +173,7 @@ class Tests_Pluggable_wpMail extends WP_UnitTestCase {
|
||||
$this->assertTrue( wp_mail( 'valid@address.com', 'subject', 'body' ) );
|
||||
|
||||
// Non-fatal errors.
|
||||
$this->assertTrue( wp_mail( 'valid@address.com', 'subject', 'body', "Cc: invalid-address\nBcc: @invalid.address", ABSPATH . '/non-existent-file.html' ) );
|
||||
$this->assertTrue( wp_mail( 'valid@address.com', 'subject', 'body', "Cc: invalid-address\nBcc: @invalid.address", ABSPATH . 'non-existent-file.html' ) );
|
||||
|
||||
// Fatal errors.
|
||||
$this->assertFalse( wp_mail( 'invalid.address', 'subject', 'body', '', array() ) );
|
||||
|
||||
@@ -48,7 +48,7 @@ http://wordpress.org/
|
||||
public static function set_up_before_class() {
|
||||
parent::set_up_before_class();
|
||||
|
||||
require_once ABSPATH . '/wp-includes/pomo/po.php';
|
||||
require_once ABSPATH . 'wp-includes/pomo/po.php';
|
||||
}
|
||||
|
||||
public function test_prepend_each_line() {
|
||||
|
||||
@@ -285,7 +285,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();
|
||||
|
||||
|
||||
@@ -813,7 +813,7 @@ class Tests_Widgets extends WP_UnitTestCase {
|
||||
);
|
||||
|
||||
wp_widgets_init();
|
||||
require_once ABSPATH . '/wp-admin/includes/widgets.php';
|
||||
require_once ABSPATH . 'wp-admin/includes/widgets.php';
|
||||
$widget_id = 'search-2';
|
||||
$widget = $wp_registered_widgets[ $widget_id ];
|
||||
$params = array(
|
||||
|
||||
Reference in New Issue
Block a user