From 8d39be803af5d5e162d2877666f352cc30c502e9 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Mon, 18 Apr 2022 20:19:03 +0200 Subject: [PATCH] PlayNiceWithScriptsTest: wrap output expectation in condition Yet another one which fails on the notorious PHP 5.5 / Composer 1.x on Windows combination. --- tests/IntegrationTest/PlayNiceWithScriptsTest.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/IntegrationTest/PlayNiceWithScriptsTest.php b/tests/IntegrationTest/PlayNiceWithScriptsTest.php index 9efaae0c..e741eb1c 100644 --- a/tests/IntegrationTest/PlayNiceWithScriptsTest.php +++ b/tests/IntegrationTest/PlayNiceWithScriptsTest.php @@ -86,15 +86,18 @@ public function testScriptsAreNotBlockedFromRunning($command, $expectedOutputs) $this->assertSame(0, $result['exitcode'], 'Exitcode for initial composer install did not match 0'); - $this->assertStringContainsString( - Plugin::MESSAGE_RUNNING_INSTALLER, - $result['stdout'], - 'Output from initial composer install missing expected contents.' - ); + if ($this->willPluginOutputShow()) { + $this->assertStringContainsString( + Plugin::MESSAGE_RUNNING_INSTALLER, + $result['stdout'], + 'Output from initial composer install missing expected contents.' + ); + } + $output = $this->willPluginOutputShow() ? $result['stdout'] : $result['stderr']; $this->assertStringContainsString( 'post-update-cmd successfully run', - $result['stdout'], + $output, 'Output from initial composer install missing expected contents.' );