Commit 5a96e2a
committed
Tests: Clean up the
Four independent clean-ups in the test file:
- **Remove the unused `$user_ids` fixture.** The property and its `wpSetUpBeforeClass()` method were copied over from the `wp_insert_post()` tests. Nothing in this class references `self::$user_ids`, so the only effect was creating three users for every test in the class.
- **Rename `test_wp_delete_post_returns_false_for_invalid_post()`** to `test_wp_delete_post_returns_null_for_already_deleted_post()`. The test asserts `assertNull()`, and that is the correct expectation: for an ID with no matching row, `wp_delete_post()` returns the `null` coming out of `$wpdb->get_row()`, whereas `false` is only returned by the `$post_id <= 0` guard. The old name described the opposite of what the test covers.
- **Reuse the `$actions` array** in the assertion loop of `test_wp_delete_post_actions()`. The same six action names were spelled out a second time inline, so the registration loop and the assertion loop could drift apart.
- **Fix the `@ticket @63975` annotation.** The stray `@` made the tag invalid, so the test was not associated with the ticket.
No assertion was added, removed or changed, and no test behavior changes.
Developed in #13036.
Follow-up to [60906].
Props Soean.
See #65819.
git-svn-id: https://develop.svn.wordpress.org/trunk@63295 602fd350-edb4-49c9-b593-d223f7449a82wp_delete_post() unit tests.1 parent 3bbb42e commit 5a96e2a
1 file changed
Lines changed: 4 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | 19 | | |
52 | 20 | | |
53 | 21 | | |
| |||
120 | 88 | | |
121 | 89 | | |
122 | 90 | | |
123 | | - | |
| 91 | + | |
124 | 92 | | |
125 | | - | |
| 93 | + | |
126 | 94 | | |
127 | 95 | | |
128 | 96 | | |
| |||
163 | 131 | | |
164 | 132 | | |
165 | 133 | | |
166 | | - | |
| 134 | + | |
167 | 135 | | |
168 | 136 | | |
169 | 137 | | |
| |||
175 | 143 | | |
176 | 144 | | |
177 | 145 | | |
178 | | - | |
| 146 | + | |
179 | 147 | | |
180 | 148 | | |
181 | 149 | | |
| |||
0 commit comments