Skip to content

Commit 5215d6e

Browse files
committed
Add behat test for config has after concatenation assignment
1 parent 8509501 commit 5215d6e

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

features/config-has.feature

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,24 @@ Feature: Check whether the wp-config.php file or the wp-custom-config.php file h
170170
"""
171171
Error: Found both a constant and a variable 'SOME_NAME' in the 'wp-custom-config.php' file. Use --type=<type> to disambiguate.
172172
"""
173+
174+
Scenario: Find variable after a concatenation assignment
175+
Given a WP install
176+
And a wp-config.php file:
177+
"""
178+
$do_redirect = 'https://example.com' . $_SERVER['REQUEST_URI'];
179+
$table_prefix = 'wp_';
180+
define( 'DB_NAME', 'wp' );
181+
"""
182+
183+
When I run `wp config has table_prefix --type=variable`
184+
Then STDOUT should be empty
185+
And the return code should be 0
186+
187+
When I run `wp config has DB_NAME --type=constant`
188+
Then STDOUT should be empty
189+
And the return code should be 0
190+
191+
When I run `wp config has do_redirect --type=variable`
192+
Then STDOUT should be empty
193+
And the return code should be 0

0 commit comments

Comments
 (0)