NumberTest.php 802 B

123456789101112131415161718192021222324252627282930313233343536373839
  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, QRDataModeInterface};
  13. /**
  14. * Tests the Number class
  15. */
  16. final class NumberTest extends DataInterfaceTestAbstract{
  17. protected const testData = '0123456789';
  18. protected static function getDataModeInterface(string $data):QRDataModeInterface{
  19. return new Number($data);
  20. }
  21. /**
  22. * isNumber() should pass on any number and fail on anything else
  23. *
  24. * @phpstan-return array<int, array{0: string, 1: bool}>
  25. */
  26. public static function stringValidateProvider():array{
  27. return [
  28. ['0123456789', true],
  29. ['ABC123', false],
  30. ];
  31. }
  32. }