diff --git a/features/bootstrap.feature b/features/bootstrap.feature index b2ef01e7a..8024e37b4 100644 --- a/features/bootstrap.feature +++ b/features/bootstrap.feature @@ -81,3 +81,17 @@ Feature: Bootstrap WP-CLI Status: Inactive """ And STDERR should be empty + + Scenario: Mustache templates should be resolved correctly when PHAR is renamed without extension + + Given an empty directory + And a new Phar with the same version + And I run `php {PHAR_PATH} core download` + + When I run `cp {PHAR_PATH} wp-renamed` + And I run `php wp-renamed config create --dbname=wordpress --dbuser=user --dbpass=pass --skip-check` + Then STDOUT should contain: + """ + Success: Generated 'wp-config.php' file. + """ + And STDERR should be empty diff --git a/php/boot-phar.php b/php/boot-phar.php index e5f94a262..64fb7e948 100644 --- a/php/boot-phar.php +++ b/php/boot-phar.php @@ -10,7 +10,7 @@ } // Store the path to the Phar early on for `Utils\phar-safe-path()` function. -define( 'WP_CLI_PHAR_PATH', Phar::running( true ) ); +define( 'WP_CLI_PHAR_PATH', Phar::running( false ) ); if ( file_exists( 'phar://wp-cli.phar/php/wp-cli.php' ) ) { define( 'WP_CLI_ROOT', 'phar://wp-cli.phar' );