ByteTest.php 970 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 static string $FQN = Byte::class;
  17. protected static string $testdata = '[¯\_(ツ)_/¯]';
  18. /**
  19. * isByte() passses any binary string and only fails on empty strings
  20. */
  21. public static 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. /**
  36. * @inheritDoc
  37. */
  38. public function testBinaryStringInvalid():void{
  39. $this::markTestSkipped('N/A (binary mode)');
  40. }
  41. }