Commit cbfb90e
Fix multinetwork test: verify isolation via count and absent URLs
The wp-config.php SITE_ID_CURRENT_SITE swap approach cannot change the
network context because WordPress also reads BLOG_ID_CURRENT_SITE=1
(hardcoded, can't be changed without knowing the network-2 blog ID), and
since blog 1 belongs to network 1, WordPress overrides $current_site back
to network 1 regardless of SITE_ID_CURRENT_SITE.
Instead, verify the site_id filter works by:
1. Creating 5 active sites (3 in network 1, 2 in network 2)
2. Running wp core update-db --network and asserting "3/3 sites" not "5/5"
3. Asserting that net2-site1 URL is absent from output
This is a true regression test: without the site_id filter the old code
would have processed all 5 sites (5/5), and network-2 URLs would appear.
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>1 parent 04cfa08 commit cbfb90e
1 file changed
+9
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
| 185 | + | |
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
189 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
190 | 195 | | |
191 | 196 | | |
192 | 197 | | |
193 | 198 | | |
194 | 199 | | |
195 | 200 | | |
196 | 201 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | 202 | | |
207 | 203 | | |
208 | 204 | | |
| |||
0 commit comments