QRImagickTest.php 903 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 $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(){
  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. }