From 5cb1a136fb7fa20af009ad0d89be899c898f88ad Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Sun, 29 Oct 2017 09:31:31 +0100 Subject: [PATCH 1/2] Add regression test to make sure we detect Composer plugin errors in Phar files. --- features/package.feature | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/features/package.feature b/features/package.feature index 8cda511c0..3d176589b 100644 --- a/features/package.feature +++ b/features/package.feature @@ -56,3 +56,16 @@ Feature: Manage WP-CLI packages When I run `wp --require=bad-command.php package list` Then STDERR should be empty + + Scenario: Run package commands without hitting Composer plugin errors in Phar files + Given an empty directory + + When I run `wp package list` + Then STDOUT should not contain: + """ + failed to open stream + """ + And STDOUT should not contain: + """ + is not a file in phar + """ From 1a79123636d80c35df4476d8871e0eadb380a2d6 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Sun, 29 Oct 2017 10:18:36 +0100 Subject: [PATCH 2/2] Use STDERR against built Phar. --- features/package.feature | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/features/package.feature b/features/package.feature index 3d176589b..4f9363721 100644 --- a/features/package.feature +++ b/features/package.feature @@ -59,13 +59,14 @@ Feature: Manage WP-CLI packages Scenario: Run package commands without hitting Composer plugin errors in Phar files Given an empty directory + And a new Phar with the same version - When I run `wp package list` - Then STDOUT should not contain: + When I run `{PHAR_PATH} package list` + Then STDERR should not contain: """ failed to open stream """ - And STDOUT should not contain: + And STDERR should not contain: """ is not a file in phar """