ByteTest.php 823 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Class ByteTest
  4. *
  5. * @created 24.11.2017
  6. * @author Smiley <smiley@chillerlan.net>
  7. * @copyright 2017 Smiley
  8. * @license MIT
  9. */
  10. namespace chillerlan\QRCodeTest\Data;
  11. use chillerlan\QRCode\Data\Byte;
  12. /**
  13. * Tests the Byte class
  14. */
  15. final class ByteTest extends DataInterfaceTestAbstract{
  16. protected string $FQN = Byte::class;
  17. protected string $testdata = '[¯\_(ツ)_/¯]';
  18. /**
  19. * isByte() passses any binary string and only fails on empty strings
  20. */
  21. public function stringValidateProvider():array{
  22. return [
  23. ["\x01\x02\x03", true],
  24. [' ', true], // not empty!
  25. ['0', true], // should survive !empty()
  26. ['', false],
  27. ];
  28. }
  29. /**
  30. * @inheritDoc
  31. */
  32. public function testInvalidDataException():void{
  33. $this::markTestSkipped('N/A (binary mode)');
  34. }
  35. }