diff --git a/tests/QrCodeTest.php b/tests/QrCodeTest.php index afe8ec8..4dfee98 100755 --- a/tests/QrCodeTest.php +++ b/tests/QrCodeTest.php @@ -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)); + } } diff --git a/tests/output/.gitignore b/tests/output/.gitignore new file mode 100644 index 0000000..35ec3b9 --- /dev/null +++ b/tests/output/.gitignore @@ -0,0 +1 @@ +/ \ No newline at end of file