Skip to content

Commit

Permalink
cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Mar 29, 2023
1 parent f519144 commit 24d7ccd
Show file tree
Hide file tree
Showing 18 changed files with 0 additions and 60 deletions.
1 change: 0 additions & 1 deletion tests/phpunit/tests/admin/wpAutomaticUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class Tests_Admin_WpAutomaticUpdater extends WP_UnitTestCase {
* Sets up shared fixtures.
*/
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
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' );
Expand Down
11 changes: 0 additions & 11 deletions tests/phpunit/tests/admin/wpCommunityEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ class Tests_Admin_wpCommunityEvents extends WP_UnitTestCase {
*/
private $instance;

/**
* Performs setup tasks before the first test is run.
*
* @since 5.9.0
*/
public static function set_up_before_class() {
parent::set_up_before_class();

require_once ABSPATH . WPINC . '/class-wp-autoload.php';
}

/**
* Performs setup tasks for every test.
*
Expand Down
2 changes: 0 additions & 2 deletions tests/phpunit/tests/admin/wpListTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ public static function set_up_before_class() {

parent::set_up_before_class();

require_once ABSPATH . WPINC . '/class-wp-autoload.php';

$hook_suffix = '_wp_tests';
self::$list_table = new WP_List_Table();
}
Expand Down
6 changes: 0 additions & 6 deletions tests/phpunit/tests/admin/wpMediaListTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
*/
class Tests_Admin_wpMediaListTable extends WP_UnitTestCase {

public static function set_up_before_class() {
parent::set_up_before_class();

require_once ABSPATH . WPINC . '/class-wp-autoload.php';
}

/**
* Tests that a call to WP_Media_List_Table::prepare_items() on a site without any scheduled events
* does not result in a PHP warning.
Expand Down
13 changes: 0 additions & 13 deletions tests/phpunit/tests/admin/wpSiteHealth.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,6 @@
*/
class Tests_Admin_wpSiteHealth extends WP_UnitTestCase {

/**
* An instance of the class to test.
*
* @since 6.1.0
*
* @var WP_Site_Health
*/
private $instance;

public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
require_once ABSPATH . 'wp-includes/class-wp-autoload.php';
}

/**
* Performs setup tasks for every test.
*
Expand Down
6 changes: 0 additions & 6 deletions tests/phpunit/tests/adminbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ class Tests_AdminBar extends WP_UnitTestCase {

protected static $user_ids = array();

public static function set_up_before_class() {
parent::set_up_before_class();

require_once ABSPATH . WPINC . '/class-wp-autoload.php';
}

public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
self::$editor_id = $factory->user->create( array( 'role' => 'editor' ) );
self::$user_ids[] = self::$editor_id;
Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/tests/ajax/wpAjaxCropImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Admin Ajax functions to be tested.
*/
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
require_once ABSPATH . 'wp-includes/class-wp-autoload.php';

/**
* Class for testing ajax crop image functionality.
Expand Down
8 changes: 0 additions & 8 deletions tests/phpunit/tests/ajax/wpCustomizeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
self::$admin_user_id = $factory->user->create( array( 'role' => 'administrator' ) );
}

/**
* Set up the test fixture.
*/
public function set_up() {
parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-autoload.php';
}

/**
* Tear down.
*/
Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/tests/ajax/wpCustomizeNavMenus.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
*/
public function set_up() {
parent::set_up();
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();
Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/tests/category/walkerCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class Tests_Category_Walker_Category extends WP_UnitTestCase {
public function set_up() {
parent::set_up();

require_once ABSPATH . 'wp-includes/class-wp-autoload.php';
$this->walker = new Walker_Category();
}

Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/tests/compat/jsonEncodeDecode.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public function test_json_encode_decode() {
$this->setExpectedDeprecated( 'Services_JSON::strlen8' );
$this->setExpectedDeprecated( 'Services_JSON::substr8' );

require_once ABSPATH . WPINC . '/class-wp-autoload.php';
$json = new Services_JSON();

// Super basic test to verify Services_JSON is intact and working.
Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/tests/customize/control.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ 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-autoload.php';
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
$this->wp_customize = $GLOBALS['wp_customize'];
}
Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/tests/customize/custom-css-setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase {
*/
public function set_up() {
parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-autoload.php';

$user_id = self::factory()->user->create(
array(
Expand Down
3 changes: 0 additions & 3 deletions tests/phpunit/tests/customize/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
*/
public function set_up() {
parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-autoload.php';
$this->manager = $this->instantiate();
}

Expand Down Expand Up @@ -3638,8 +3637,6 @@ public function test_sanitize_external_header_video_trim() {
}
}

require_once ABSPATH . WPINC . '/class-wp-autoload.php';

/**
* Class Test_Dynamic_Customize_Setting
*
Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/tests/oembed/wpOembed.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class Tests_WP_oEmbed extends WP_UnitTestCase {
public function set_up() {
parent::set_up();

require_once ABSPATH . WPINC . '/class-wp-autoload.php';
$this->oembed = _wp_oembed_get_object();

$this->pre_oembed_result_filtered = false;
Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/tests/post/walkerPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class Tests_Post_Walker_Page extends WP_UnitTestCase {
public function set_up() {
parent::set_up();

require_once ABSPATH . 'wp-includes/class-wp-autoload.php';
$this->walker = new Walker_Page();
}

Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/tests/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ 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-autoload.php';
$wp_customize = new WP_Customize_Manager();
do_action( 'customize_register', $wp_customize );

Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/tests/widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,6 @@ 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-autoload.php';
$wp_customize = new WP_Customize_Manager();
$wp_customize->start_previewing_theme();

Expand Down

0 comments on commit 24d7ccd

Please sign in to comment.