Skip to content

Commit

Permalink
add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
waithawoo committed Sep 11, 2024
1 parent d37c9b1 commit afe039e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/Unit/PdfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,15 @@

expect($imagick1)->toBeInstanceOf(Imagick::class);
});

it('can set the background color', function ($backgroundColor) {
$image = (new Pdf($this->testFile))
->backgroundColor($backgroundColor)
->selectPage(1)
->getImageData('page-1.jpg', 1)
->getImageBackgroundColor()
->getColorAsString();

$expectedSRGBValueForWhiteColor = 'srgb(255,255,255)';
expect($image)->toEqual($expectedSRGBValueForWhiteColor);
})->with(['srgb(255,255,255)', 'rgb(255,255,255)', 'white', '#fff']);

0 comments on commit afe039e

Please sign in to comment.