diff --git a/composer.json b/composer.json index 16dd4cf6..c62edb00 100644 --- a/composer.json +++ b/composer.json @@ -16,9 +16,15 @@ "homepage": "https://www.alainschlesser.com" } ], + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/wp-cli/wp-config-transformer" + } + ], "require": { "wp-cli/wp-cli": "^2.13", - "wp-cli/wp-config-transformer": "^1.4.0" + "wp-cli/wp-config-transformer": "dev-main" }, "require-dev": { "wp-cli/db-command": "^1.3 || ^2", diff --git a/features/config-has.feature b/features/config-has.feature index 332aaa22..d5a43c1a 100644 --- a/features/config-has.feature +++ b/features/config-has.feature @@ -170,3 +170,42 @@ 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= to disambiguate. """ + + Scenario Outline: Find constants and variables in a config with complex expressions + Given an empty directory + And a wp-includes/version.php file: + """ + --type=` + Then STDOUT should be empty + And the return code should be 0 + + Examples: + | name | type | description | + | do_redirect | variable | concatenation expression itself | + | table_prefix | variable | variable after concatenation | + | DB_NAME | constant | constant after concatenation variable | + | CUSTOM_CSS | constant | constant with multiline string value | + | after_multiline | variable | variable after multiline string value | + | long_url | variable | multiline concatenation variable | + | ALLOWED_HOSTS | constant | constant with multiline raw value | + | after_array_define | variable | variable after multiline raw define |