QRStringTEXTTest.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Class QRStringTEXTTest
  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\Data\QRMatrix;
  12. use chillerlan\QRCode\Output\QRStringText;
  13. /**
  14. *
  15. */
  16. final class QRStringTEXTTest extends QROutputTestAbstract{
  17. protected string $FQN = QRStringText::class;
  18. public static function moduleValueProvider():array{
  19. return [
  20. 'invalid: wrong type' => [[], false],
  21. 'valid: string' => ['abc', true],
  22. 'valid: zero length string' => ['', true],
  23. 'valid: empty string' => [' ', true],
  24. ];
  25. }
  26. /**
  27. * @inheritDoc
  28. */
  29. public function testSetModuleValues():void{
  30. $this->options->moduleValues = [
  31. // data
  32. QRMatrix::M_DATA_DARK => 'A',
  33. QRMatrix::M_DATA => 'B',
  34. ];
  35. $this->outputInterface = new $this->FQN($this->options, $this->matrix);
  36. $data = $this->outputInterface->dump();
  37. $this::assertStringContainsString('A', $data);
  38. $this::assertStringContainsString('B', $data);
  39. }
  40. }