RGBArrayModuleValueProviderTrait.php 887 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * RGBArrayModuleValueProviderTrait.php
  4. *
  5. * @created 06.05.2024
  6. * @author smiley <smiley@chillerlan.net>
  7. * @copyright 2024 smiley
  8. * @license MIT
  9. */
  10. declare(strict_types=1);
  11. namespace chillerlan\QRCodeTest\Traits;
  12. /**
  13. * A data provider for use in tests that include RGBArrayModuleValueTrait
  14. *
  15. * @see \chillerlan\QRCode\Output\RGBArrayModuleValueTrait
  16. */
  17. trait RGBArrayModuleValueProviderTrait{
  18. public static function moduleValueProvider():array{
  19. return [
  20. 'valid: int' => [[123, 123, 123], true],
  21. 'valid: w/invalid extra element' => [[123, 123, 123, 'abc'], true],
  22. 'valid: numeric string' => [['123', '123', '123'], true],
  23. 'invalid: wrong type' => ['foo', false],
  24. 'invalid: array too short' => [[1, 2], false],
  25. 'invalid: contains non-number' => [[1, 'b', 3], false],
  26. ];
  27. }
  28. }