MinLengthMaxLengthTest.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace JsonSchema\Tests;
  3. class MinLengthMaxLengthTest extends BaseTestCase
  4. {
  5. public function getInvalidTests()
  6. {
  7. return array(
  8. array(
  9. '{
  10. "value":"w"
  11. }',
  12. '{
  13. "type":"object",
  14. "properties":{
  15. "value":{"type":"string","minLength":2,"maxLength":4}
  16. }
  17. }'
  18. ),
  19. array(
  20. '{
  21. "value":"wo7us"
  22. }',
  23. '{
  24. "type":"object",
  25. "properties":{
  26. "value":{"type":"string","minLength":2,"maxLength":4}
  27. }
  28. }'
  29. )
  30. );
  31. }
  32. public function getValidTests()
  33. {
  34. return array(
  35. array(
  36. '{
  37. "value":"wo"
  38. }',
  39. '{
  40. "type":"object",
  41. "properties":{
  42. "value":{"type":"string","minLength":2,"maxLength":4}
  43. }
  44. }'
  45. ),
  46. array(
  47. '{
  48. "value":"wo7u"
  49. }',
  50. '{
  51. "type":"object",
  52. "properties":{
  53. "value":{"type":"string","minLength":2,"maxLength":4}
  54. }
  55. }'
  56. ),
  57. );
  58. }
  59. }