Repository navigation
Commit 04cfa08
Fix multinetwork test: use example.com domain and wp-config swap
Two bugs in the previous test:
1. Wrong domain: network 2 was created with domain=localhost but the
Behat test environment installs WordPress at https://example.com.
2. URL routing doesn't work: DOMAIN_CURRENT_SITE is a PHP constant
hardcoded in wp-config.php, so WordPress skips the DB lookup entirely
and get_current_network_id() always returns SITE_ID_CURRENT_SITE (1)
regardless of --url. The --url=localhost/net2-site1/ approach could
never route to network 2.
Fix: create network 2 with domain=example.com, move 2 blogs to it, then
swap SITE_ID_CURRENT_SITE from 1 to 2 in wp-config.php before the second
run. This correctly puts WordPress into network 2 context so the command
processes only the 2 network-2 sites.
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>1 parent c0f3bd3 commit 04cfa08
1 file changed
Lines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
178 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
183 | | - | |
| 184 | + | |
184 | 185 | | |
185 | 186 | | |
186 | 187 | | |
| |||
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
196 | | - | |
197 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
198 | 201 | | |
199 | 202 | | |
200 | 203 | | |
| |||
0 commit comments