From ac131f050b173e898df37b57d20bc9038495aff4 Mon Sep 17 00:00:00 2001 From: "John P. Bloch" Date: Sat, 13 Jul 2024 18:45:50 +0000 Subject: [PATCH 1/3] Store the outer filesystem's filename in a constant for later use --- php/boot-phar.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/boot-phar.php b/php/boot-phar.php index 406402e97..6bcf30091 100644 --- a/php/boot-phar.php +++ b/php/boot-phar.php @@ -11,6 +11,7 @@ // Store the path to the Phar early on for `Utils\phar-safe-path()` function. define( 'WP_CLI_PHAR_PATH', getcwd() ); +define( 'WP_CLI_PHAR_HOST_FILENAME', basename( dirname( __DIR__ ) ) ); if ( file_exists( 'phar://wp-cli.phar/php/wp-cli.php' ) ) { define( 'WP_CLI_ROOT', 'phar://wp-cli.phar' ); From f350e4276075397168b2abf0cff344a3702a7964 Mon Sep 17 00:00:00 2001 From: "John P. Bloch" Date: Sat, 13 Jul 2024 14:31:29 -0500 Subject: [PATCH 2/3] Add a functional test for the correct output from wp plugin status akismet --- features/command.feature | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/features/command.feature b/features/command.feature index 26242b4df..aef444f1e 100644 --- a/features/command.feature +++ b/features/command.feature @@ -1676,3 +1676,14 @@ Feature: WP-CLI Commands """ core custom-subcommand """ + + Scenario: Templates should still be found when WP CLI phar is renamed + Given a WP installation + And these installed and active plugins: akismet + And a new Phar with the same version + + When I run `wp plugin status akismet` + Then STDOUT should contain: + """ + Plugin akismet details: + """ From 36edac8f59bacef9c4aed8c69ddbfd23ac9f4c03 Mon Sep 17 00:00:00 2001 From: "John P. Bloch" Date: Sun, 14 Jul 2024 13:18:20 +0000 Subject: [PATCH 3/3] Fix plugins syntax in feature test Co-authored-by: Pascal Birchler --- features/command.feature | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/features/command.feature b/features/command.feature index aef444f1e..69ba35a03 100644 --- a/features/command.feature +++ b/features/command.feature @@ -1679,7 +1679,10 @@ Feature: WP-CLI Commands Scenario: Templates should still be found when WP CLI phar is renamed Given a WP installation - And these installed and active plugins: akismet + And these installed and active plugins: + """ + akismet + """ And a new Phar with the same version When I run `wp plugin status akismet`