Tests: Fix leakage in WP_List_Table tests.

Fixes `WP_List_table` tests leaking into other tests by:

* Restores the original `$hook_suffix` global value.
Rather than modifying the global for all tests, it now restores the original value between tests. Why? To ensure each test starts at a known state.

* Uses a new instance of `WP_List_Table` for each test.
A test may modify the `$list_table` object. If it does, it could impact tests yet to run. By instantiating a new instance in the `set_up()` test fixture, each test is isolated from the others.

Follow-up to [53868], [54215].

Props hellofromTonya, antonvlasenko.
See #58955, #58896.
Built from https://develop.svn.wordpress.org/trunk@56348


git-svn-id: http://core.svn.wordpress.org/trunk@55860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2023-08-02 18:00:22 +00:00
parent 6cd7404aa3
commit d0e63ca7d2
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.4-alpha-56347';
$wp_version = '6.4-alpha-56348';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.