1
0
mirror of https://github.com/php/pie.git synced 2026-03-23 23:12:17 +01:00

Display more output for some failures

This commit is contained in:
James Titcumb
2025-11-11 13:57:56 +00:00
parent 74e35f453c
commit 3018777f7a
2 changed files with 23 additions and 4 deletions

View File

@@ -150,10 +150,17 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: intl, sodium, zip
extensions: none, intl, zip
tools: composer
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v5
- name: Testing
run: |
php -m
bin/pie show --all
which composer
composer -v
- uses: ramsey/composer-install@v3
- name: Run Behat on Windows
if: matrix.operating-system == 'windows-latest'

View File

@@ -182,7 +182,11 @@ class CliContext implements Context
->mustRun()
->getOutput();
Assert::same($isExtEnabled, 'no');
Assert::same(
$isExtEnabled,
'no',
sprintf("Failed to remove extension.\n\nOutput:\n%s\n\nError output:\n%s\n", $this->output, $this->errorOutput),
);
}
#[Then('the extension should have been installed')]
@@ -302,7 +306,11 @@ class CliContext implements Context
public function theInformationShouldShowThatLibsodiumIsAMissingDependency(): void
{
Assert::notNull($this->output);
Assert::contains($this->output, 'lib-sodium: * 🚫 (not installed)');
Assert::contains(
$this->output,
'lib-sodium: * 🚫 (not installed)',
sprintf("Could not find missing lib-sodium.\n\nOutput:\n%s\n\nError output:\n%s\n", $this->output, $this->errorOutput),
);
}
#[Then('the extension fails to install due to the missing library')]
@@ -310,7 +318,11 @@ class CliContext implements Context
{
Assert::notSame(0, $this->exitCode);
Assert::notNull($this->errorOutput);
Assert::regex($this->errorOutput, '#Cannot use php/sodium\'s latest version .* as it requires lib-sodium .* which is missing from your platform.#');
Assert::regex(
$this->errorOutput,
'#Cannot use php/sodium\'s latest version .* as it requires lib-sodium .* which is missing from your platform.#',
sprintf("Did not detect missing lib-sodium correctly.\n\nOutput:\n%s\n\nError output:\n%s\n", $this->output, $this->errorOutput),
);
}
#[Given('I am in a PHP project that has missing extensions')]