QRStringJSONTest.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * Class QRStringJSONTest
  4. *
  5. * @created 11.12.2021
  6. * @author smiley <smiley@chillerlan.net>
  7. * @copyright 2021 smiley
  8. * @license MIT
  9. */
  10. namespace chillerlan\QRCodeTest\Output;
  11. use chillerlan\QRCode\QROptions;
  12. use chillerlan\QRCode\Data\QRMatrix;
  13. use chillerlan\QRCode\Output\{QROutputInterface, QRStringJSON};
  14. use function extension_loaded;
  15. /**
  16. *
  17. */
  18. final class QRStringJSONTest extends QROutputTestAbstract{
  19. protected string $type = QROutputInterface::STRING_JSON;
  20. /**
  21. * @inheritDoc
  22. */
  23. protected function setUp():void{
  24. // just in case someone's running this on some weird distro that's been compiled without ext-json
  25. if(!extension_loaded('json')){
  26. $this::markTestSkipped('ext-json not loaded');
  27. }
  28. parent::setUp();
  29. }
  30. protected function getOutputInterface(QROptions $options, QRMatrix $matrix):QROutputInterface{
  31. return new QRStringJSON($options, $matrix);
  32. }
  33. public static function moduleValueProvider():array{
  34. return [[null, false]];
  35. }
  36. /**
  37. * @param mixed $value
  38. * @param bool $expected
  39. *
  40. * @dataProvider moduleValueProvider
  41. */
  42. public function testValidateModuleValues($value, bool $expected):void{
  43. $this::markTestSkipped('N/A (JSON test)');
  44. }
  45. public function testSetModuleValues():void{
  46. /** @noinspection PhpUnitTestFailedLineInspection */
  47. $this::markTestSkipped('N/A (JSON test)');
  48. }
  49. }