Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions features/framework.feature
Original file line number Diff line number Diff line change
Expand Up @@ -327,19 +327,26 @@ Feature: Load WP-CLI
"""

Given "define( 'DOMAIN_CURRENT_SITE', 'example.org' );" replaced with " " in the wp-config.php file
# 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
# So empty wp_blogs.domain to make behavior consistent across WP versions.
And I run `wp db query 'UPDATE wp_blogs SET domain = NULL'`

When I run `cat wp-config.php`
Then STDOUT should not contain:
"""
DOMAIN_CURRENT_SITE
"""

When I try `wp option get home`
Then STDERR should be:
# This will work as finds blog with empty domain and thus uses `home` option.
When I run `wp option get home`
Then STDOUT should be:
"""
Error: Site not found. Define DOMAIN_CURRENT_SITE in 'wp-config.php' or use `--url=<url>` to override.
http://example.com
"""

# Undo above.
Given I run `wp db query 'UPDATE wp_blogs SET domain = "example.com"'`

When I try `wp option get home --url=example.io`
Then STDERR should be:
"""
Expand Down