Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Bellangelo committed Dec 31, 2024
1 parent c0cc892 commit 54d0dfb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/integration/Command/DownloadCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,22 +152,23 @@ public function testDownloadCommandFailsWhenUsingIncompatiblePhpVersion(): void
$this->commandTester->execute(['requested-package-and-version' => self::TEST_PACKAGE . ':1.0.0']);
}

#[RequiresPhp('<8.3')]
#[RequiresPhp('<8.2')]
public function testDownloadCommandPassesWhenUsingIncompatiblePhpVersionWithForceOption(): void
{
$incompatiblePackage = self::TEST_PACKAGE . ':' . '1.x-dev';
// 1.0.1 is only compatible with PHP 8.3.0
$incompatiblePackage = self::TEST_PACKAGE . ':1.0.1';

// 1.0.0 is only compatible with PHP 8.3.0
$this->commandTester->execute(
[
'--force' => true,
'requested-package-and-version' => $incompatiblePackage,
'--force' => true,
],
);

$this->commandTester->assertCommandIsSuccessful();

$outputString = $this->commandTester->getDisplay();

self::assertStringContainsString('Found package: ' . $incompatiblePackage . ' which provides', $outputString);
self::assertStringContainsString('Extracted ' . $incompatiblePackage . ' source to', $outputString);
}
Expand Down

0 comments on commit 54d0dfb

Please sign in to comment.