summaryrefslogtreecommitdiff
path: root/vendor/chillerlan/php-qrcode/tests/Output/QRImagickTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/chillerlan/php-qrcode/tests/Output/QRImagickTest.php')
-rw-r--r--vendor/chillerlan/php-qrcode/tests/Output/QRImagickTest.php66
1 files changed, 66 insertions, 0 deletions
diff --git a/vendor/chillerlan/php-qrcode/tests/Output/QRImagickTest.php b/vendor/chillerlan/php-qrcode/tests/Output/QRImagickTest.php
new file mode 100644
index 000000000..c927cc64e
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/tests/Output/QRImagickTest.php
@@ -0,0 +1,66 @@
+<?php
+/**
+ * Class QRImagickTest
+ *
+ * @filesource QRImagickTest.php
+ * @created 04.07.2018
+ * @package chillerlan\QRCodeTest\Output
+ * @author smiley <[email protected]>
+ * @copyright 2018 smiley
+ * @license MIT
+ *
+ * @noinspection PhpComposerExtensionStubsInspection
+ */
+
+namespace chillerlan\QRCodeTest\Output;
+
+use Imagick;
+use chillerlan\QRCode\{QRCode, Output\QRImagick};
+
+class QRImagickTest extends QROutputTestAbstract{
+
+ protected $FQCN = QRImagick::class;
+
+ public function setUp():void{
+
+ if(!extension_loaded('imagick')){
+ $this->markTestSkipped('ext-imagick not loaded');
+ return;
+ }
+
+ parent::setUp();
+ }
+
+ public function testImageOutput(){
+ $type = QRCode::OUTPUT_IMAGICK;
+
+ $this->options->outputType = $type;
+ $this->setOutputInterface();
+ $this->outputInterface->dump($this::cachefile.$type);
+ $img = $this->outputInterface->dump();
+
+ $this->assertSame($img, file_get_contents($this::cachefile.$type));
+ }
+
+ public function testSetModuleValues(){
+
+ $this->options->moduleValues = [
+ // data
+ 1024 => '#4A6000',
+ 4 => '#ECF9BE',
+ ];
+
+ $this->setOutputInterface()->dump();
+
+ $this->assertTrue(true); // tricking the code coverage
+ }
+
+ public function testOutputGetResource():void{
+ $this->options->returnResource = true;
+
+ $this->setOutputInterface();
+
+ $this::assertInstanceOf(Imagick::class, $this->outputInterface->dump());
+ }
+
+}