Skip to content

Commit

Permalink
Add writeFile test
Browse files Browse the repository at this point in the history
  • Loading branch information
endroid committed Dec 5, 2017
1 parent dc26285 commit 35ca45c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/QrCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,16 @@ public function testSetLogo(): void
$pngData = $qrCode->writeString();
$this->assertTrue(is_string($pngData));
}

public function testWriteFile(): void
{
$filename = __DIR__.'/output/qr-code.png';

$qrCode = new QrCode('QrCode');
$qrCode->writeFile($filename);

$image = imagecreatefromstring(file_get_contents($filename));

$this->assertTrue(is_resource($image));
}
}
1 change: 1 addition & 0 deletions tests/output/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/

0 comments on commit 35ca45c

Please sign in to comment.