NumberTest.php 827 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Class NumberTest
  4. *
  5. * @created 24.11.2017
  6. * @author Smiley <smiley@chillerlan.net>
  7. * @copyright 2017 Smiley
  8. * @license MIT
  9. */
  10. declare(strict_types=1);
  11. namespace chillerlan\QRCodeTest\Data;
  12. use chillerlan\QRCode\Data\Number;
  13. use chillerlan\QRCode\Data\QRDataModeInterface;
  14. /**
  15. * Tests the Number class
  16. */
  17. final class NumberTest extends DataInterfaceTestAbstract{
  18. protected const testData = '0123456789';
  19. protected static function getDataModeInterface(string $data):QRDataModeInterface{
  20. return new Number($data);
  21. }
  22. /**
  23. * isNumber() should pass on any number and fail on anything else
  24. *
  25. * @phpstan-return array<int, array{0: string, 1: bool}>
  26. */
  27. public static function stringValidateProvider():array{
  28. return [
  29. ['0123456789', true],
  30. ['ABC123', false],
  31. ];
  32. }
  33. }