RequireTest.php 960 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace JsonSchema\Tests;
  3. class RequireTest extends BaseTestCase
  4. {
  5. public function getInvalidTests()
  6. {
  7. return array(
  8. array(
  9. '{
  10. "state":"DF"
  11. }',
  12. '{
  13. "type":"object",
  14. "properties":{
  15. "state":{"type":"string","requires":"city"},
  16. "city":{"type":"string"}
  17. }
  18. }'
  19. )
  20. );
  21. }
  22. public function getValidTests()
  23. {
  24. return array(
  25. array(
  26. '{
  27. "state":"DF",
  28. "city":"Brasília"
  29. }',
  30. '{
  31. "type":"object",
  32. "properties":{
  33. "state":{"type":"string","requires":"city"},
  34. "city":{"type":"string"}
  35. }
  36. }'
  37. )
  38. );
  39. }
  40. }