QRImagickTest.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * Class QRImagickTest
  4. *
  5. * @filesource QRImagickTest.php
  6. * @created 04.07.2018
  7. * @package chillerlan\QRCodeTest\Output
  8. * @author smiley <smiley@chillerlan.net>
  9. * @copyright 2018 smiley
  10. * @license MIT
  11. */
  12. namespace chillerlan\QRCodeTest\Output;
  13. use chillerlan\QRCode\{QRCode, Output\QRImagick};
  14. class QRImagickTest extends QROutputTestAbstract{
  15. protected string $FQCN = QRImagick::class;
  16. public function setUp():void{
  17. if(!extension_loaded('imagick')){
  18. $this->markTestSkipped('ext-imagick not loaded');
  19. return;
  20. }
  21. parent::setUp();
  22. }
  23. public function testImageOutput():void{
  24. $type = QRCode::OUTPUT_IMAGICK;
  25. $this->options->outputType = $type;
  26. $this->setOutputInterface();
  27. $this->outputInterface->dump($this::cachefile.$type);
  28. $img = $this->outputInterface->dump();
  29. $this::assertSame($img, file_get_contents($this::cachefile.$type));
  30. }
  31. public function testSetModuleValues():void{
  32. $this->options->moduleValues = [
  33. // data
  34. 1024 => '#4A6000',
  35. 4 => '#ECF9BE',
  36. ];
  37. $this->setOutputInterface()->dump();
  38. $this::assertTrue(true); // tricking the code coverage
  39. }
  40. }