QRImagickTest.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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, QROptions};
  14. use chillerlan\QRCode\Output\{QROutputInterface, QRImagick};
  15. /**
  16. * Tests the QRImagick output module
  17. */
  18. class QRImagickTest extends QROutputTestAbstract{
  19. /**
  20. * @inheritDoc
  21. * @internal
  22. */
  23. public function setUp():void{
  24. if(!extension_loaded('imagick')){
  25. $this->markTestSkipped('ext-imagick not loaded');
  26. return;
  27. }
  28. parent::setUp();
  29. }
  30. /**
  31. * @inheritDoc
  32. * @internal
  33. */
  34. protected function getOutputInterface(QROptions $options):QROutputInterface{
  35. return new QRImagick($options, $this->matrix);
  36. }
  37. /**
  38. * @inheritDoc
  39. * @internal
  40. */
  41. public function types():array{
  42. return [
  43. 'imagick' => [QRCode::OUTPUT_IMAGICK],
  44. ];
  45. }
  46. /**
  47. * @inheritDoc
  48. */
  49. public function testSetModuleValues():void{
  50. $this->options->moduleValues = [
  51. // data
  52. 1024 => '#4A6000',
  53. 4 => '#ECF9BE',
  54. ];
  55. $this->outputInterface = $this->getOutputInterface($this->options);
  56. $this->outputInterface->dump();
  57. $this::assertTrue(true); // tricking the code coverage
  58. }
  59. }