Skip to content

Commit

Permalink
Fix a failed test
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedghanem00 committed Jun 7, 2024
1 parent 6af7da1 commit 126797b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/Unit/TesseractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use PHPUnit\Framework\TestCase;
use Smalot\PdfParser\Parser;
use stdClass;
use Symfony\Component\Process\Exception\ProcessStartFailedException;
use Symfony\Component\Process\Exception\ProcessTimedOutException;

#[CoversClass(Tesseract::class)]
Expand All @@ -44,7 +45,12 @@ public function testGetVersionWithInvalidBinaryPath(): void
{
$tesseract = new Tesseract("/not/exist/path");

$this->expectException(UnsuccessfulExecutionException::class);
if(PHP_OS === 'Linux') {
# Starting from `symfony/process:>=7.1.1` on Linux, this exception is being thrown in case that the binary does not exist
$this->expectException(ProcessStartFailedException::class);
} else {
$this->expectException(UnsuccessfulExecutionException::class);
}

$tesseract->getVersion();
}
Expand Down

0 comments on commit 126797b

Please sign in to comment.