Commit 88570fd
committed
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@56348 602fd350-edb4-49c9-b593-d223f7449a821 parent 02f9f1e commit 88570fd
1 file changed
Lines changed: 25 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
| 27 | + | |
| 28 | + | |
22 | 29 | | |
| 30 | + | |
23 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
24 | 35 | | |
25 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
26 | 43 | | |
27 | 44 | | |
28 | 45 | | |
| |||
142 | 159 | | |
143 | 160 | | |
144 | 161 | | |
145 | | - | |
| 162 | + | |
146 | 163 | | |
147 | 164 | | |
148 | | - | |
| 165 | + | |
149 | 166 | | |
150 | 167 | | |
151 | 168 | | |
| |||
257 | 274 | | |
258 | 275 | | |
259 | 276 | | |
260 | | - | |
| 277 | + | |
261 | 278 | | |
262 | | - | |
| 279 | + | |
263 | 280 | | |
264 | 281 | | |
265 | 282 | | |
| |||
0 commit comments