Skip to content

Commit

Permalink
Add Canvas image test
Browse files Browse the repository at this point in the history
Helps ensure PHP graphics library extensions are tested.
  • Loading branch information
bsweeney committed Dec 20, 2024
1 parent 01fde07 commit 02d46e9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/Canvas/CPDFTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@

class CPDFTest extends TestCase
{
public function testImage(): void
{
$basePath = realpath(__DIR__ . "/..");
$imagePath = "$basePath/_files/red-dot.png";

$dompdf = new Dompdf();
$canvas = new CPDF([0, 0, 200, 200], "portrait", $dompdf);
$canvas->new_page();
$canvas->image($imagePath, 0, 0, 5, 5);
$output = $canvas->output();
$this->assertNotSame("", $output);
}

public function testPageScript(): void
{
global $called;
Expand Down
Binary file added tests/_files/red-dot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 02d46e9

Please sign in to comment.