From 7b6e9d0be42b9fede6e0e9454a3125ad3ea690b3 Mon Sep 17 00:00:00 2001 From: James Titcumb Date: Mon, 23 Dec 2024 07:51:00 +0000 Subject: [PATCH] Improve wording of invalid extension behaviour --- features/install-extensions.feature | 2 +- test/behaviour/CliContext.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/features/install-extensions.feature b/features/install-extensions.feature index 603fea4..27841d2 100644 --- a/features/install-extensions.feature +++ b/features/install-extensions.feature @@ -23,7 +23,7 @@ Feature: Extensions can be installed with Behat Then the extension should have been built Example: An extension can be built with warnings at PHP startup - Given I use the "-d extension=invalid_extension.so" PHP arguments + Given I have an invalid extension installed When I run a command to build an extension Then the extension should have been built diff --git a/test/behaviour/CliContext.php b/test/behaviour/CliContext.php index 776a74d..1607602 100644 --- a/test/behaviour/CliContext.php +++ b/test/behaviour/CliContext.php @@ -5,6 +5,7 @@ namespace Php\PieBehaviourTest; use Behat\Behat\Context\Context; +use Behat\Step\Given; use Behat\Step\Then; use Behat\Step\When; use Composer\Util\Platform; @@ -12,7 +13,6 @@ use Webmozart\Assert\Assert; use function array_merge; -use function explode; /** @psalm-api */ class CliContext implements Context @@ -132,9 +132,9 @@ public function theExtensionShouldHaveBeenInstalled(): void Assert::regex($this->output, '#Install complete: [-_a-zA-Z0-9/]+/example_pie_extension.so#'); } - #[When('I use the :phpArguments PHP arguments')] - public function iUsePhpArguments(string $phpArguments): void + #[Given('I have an invalid extension installed')] + public function iHaveAnInvalidExtensionInstalled(): void { - $this->phpArguments = explode(' ', $phpArguments); + $this->phpArguments = ['-d', 'extension=invalid_extension']; } }