ByteTest.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. use chillerlan\QRCode\Data\QRDataModeInterface;
  13. /**
  14. * Tests the Byte class
  15. */
  16. final class ByteTest extends DataInterfaceTestAbstract{
  17. protected const testData = '[¯\_(ツ)_/¯]';
  18. protected static function getDataModeInterface(string $data):QRDataModeInterface{
  19. return new Byte($data);
  20. }
  21. /**
  22. * isByte() passses any binary string and only fails on empty strings
  23. */
  24. public static function stringValidateProvider():array{
  25. return [
  26. ["\x01\x02\x03", true],
  27. [' ', true], // not empty!
  28. ['0', true], // should survive !empty()
  29. ['', false],
  30. ];
  31. }
  32. /**
  33. * @inheritDoc
  34. */
  35. public function testInvalidDataException():void{
  36. $this::markTestSkipped('N/A (binary mode)');
  37. }
  38. /**
  39. * @inheritDoc
  40. */
  41. public function testBinaryStringInvalid():void{
  42. $this::markTestSkipped('N/A (binary mode)');
  43. }
  44. }