Skip to content
Merged
Changes from 1 commit
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
21 changes: 21 additions & 0 deletions features/config-has.feature
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,24 @@ Feature: Check whether the wp-config.php file or the wp-custom-config.php file h
"""
Error: Found both a constant and a variable 'SOME_NAME' in the 'wp-custom-config.php' file. Use --type=<type> to disambiguate.
"""

Scenario: Find variable after a concatenation assignment
Given a WP install
And a wp-config.php file:
"""
$do_redirect = 'https://example.com' . $_SERVER['REQUEST_URI'];
$table_prefix = 'wp_';
define( 'DB_NAME', 'wp' );
"""
Comment thread
pwtyler marked this conversation as resolved.

When I run `wp config has table_prefix --type=variable`
Then STDOUT should be empty
And the return code should be 0

When I run `wp config has DB_NAME --type=constant`
Then STDOUT should be empty
And the return code should be 0

When I run `wp config has do_redirect --type=variable`
Then STDOUT should be empty
And the return code should be 0
Loading