Skip to content

Commit 5262bb0

Browse files
Merge pull request #4695 from wp-cli/get_sites_by_path-trunk-change-framework-test
Empty domain in framework test after get_sites_by_path change.
2 parents fa2ba92 + 39d35ef commit 5262bb0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

features/framework.feature

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,19 +327,26 @@ Feature: Load WP-CLI
327327
"""
328328
329329
Given "define( 'DOMAIN_CURRENT_SITE', 'example.org' );" replaced with " " in the wp-config.php file
330+
# WP < 5.0 have bug which will not find a blog given an empty domain unless wp_blogs.domain empty which was (partly) addressed by https://core.trac.wordpress.org/ticket/42299
331+
# So empty wp_blogs.domain to make behavior consistent across WP versions.
332+
And I run `wp db query 'UPDATE wp_blogs SET domain = NULL'`
330333
331334
When I run `cat wp-config.php`
332335
Then STDOUT should not contain:
333336
"""
334337
DOMAIN_CURRENT_SITE
335338
"""
336339
337-
When I try `wp option get home`
338-
Then STDERR should be:
340+
# This will work as finds blog with empty domain and thus uses `home` option.
341+
When I run `wp option get home`
342+
Then STDOUT should be:
339343
"""
340-
Error: Site not found. Define DOMAIN_CURRENT_SITE in 'wp-config.php' or use `--url=<url>` to override.
344+
http://example.com
341345
"""
342346
347+
# Undo above.
348+
Given I run `wp db query 'UPDATE wp_blogs SET domain = "example.com"'`
349+
343350
When I try `wp option get home --url=example.io`
344351
Then STDERR should be:
345352
"""

0 commit comments

Comments
 (0)