diff --git a/test/behaviour/CliContext.php b/test/behaviour/CliContext.php index b1b3bff..cd77c2f 100644 --- a/test/behaviour/CliContext.php +++ b/test/behaviour/CliContext.php @@ -17,6 +17,7 @@ /** @psalm-api */ class CliContext implements Context { + private const PHP_BINARY = 'php'; private string|null $output = null; private int|null $exitCode = null; /** @var list */ @@ -37,7 +38,7 @@ public function iRunACommandToDownloadSpecificVersionOfAnExtension(string $versi /** @param list $command */ public function runPieCommand(array $command): void { - $pieCommand = array_merge(['php', ...$this->phpArguments, 'bin/pie'], $command, ['--skip-enable-extension']); + $pieCommand = array_merge([self::PHP_BINARY, ...$this->phpArguments, 'bin/pie'], $command); $proc = (new Process($pieCommand))->mustRun(); @@ -123,6 +124,8 @@ public function theExtensionShouldHaveBeenInstalled(): void { $this->assertCommandSuccessful(); + Assert::contains($this->output, 'Extension is enabled and loaded'); + if (Platform::isWindows()) { Assert::regex($this->output, '#Copied DLL to: [-\\\_:.a-zA-Z0-9]+\\\php_example_pie_extension.dll#'); @@ -130,6 +133,12 @@ public function theExtensionShouldHaveBeenInstalled(): void } Assert::regex($this->output, '#Install complete: [-_a-zA-Z0-9/]+/example_pie_extension.so#'); + + $isExtEnabled = (new Process([self::PHP_BINARY, '-r', 'echo extension_loaded("example_pie_extension")?"yes":"no";'])) + ->mustRun() + ->getOutput(); + + Assert::same('yes', $isExtEnabled); } #[Given('I have an invalid extension installed')]