QREpsTest.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * QREpsTest.php
  4. *
  5. * @created 16.03.2023
  6. * @author smiley <smiley@chillerlan.net>
  7. * @copyright 2023 smiley
  8. * @license MIT
  9. */
  10. namespace chillerlan\QRCodeTest\Output;
  11. use chillerlan\QRCode\Data\QRMatrix;
  12. use chillerlan\QRCode\Output\QREps;
  13. use chillerlan\QRCode\Output\QROutputInterface;
  14. class QREpsTest extends QROutputTestAbstract{
  15. protected string $FQN = QREps::class;
  16. protected string $type = QROutputInterface::EPS;
  17. public static function moduleValueProvider():array{
  18. return [
  19. 'valid: 3 int' => [[123, 123, 123], true],
  20. 'valid: 4 int' => [[123, 123, 123, 123], true],
  21. 'valid: w/invalid extra element' => [[123, 123, 123, 123, 'abc'], true],
  22. 'valid: numeric string' => [['123', '123', '123'], true],
  23. 'invalid: wrong type' => ['foo', false],
  24. 'invalid: array too short' => [[1, 2], false],
  25. 'invalid: contains non-number' => [[1, 'b', 3], false],
  26. ];
  27. }
  28. /**
  29. * @inheritDoc
  30. */
  31. public function testSetModuleValues():void{
  32. $this->options->moduleValues = [
  33. // data
  34. QRMatrix::M_DATA_DARK => [0, 0, 0],
  35. QRMatrix::M_DATA => [255, 255, 255],
  36. ];
  37. $this->outputInterface = new $this->FQN($this->options, $this->matrix);
  38. $this->outputInterface->dump();
  39. $this::assertTrue(true); // tricking the code coverage
  40. }
  41. }