123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- namespace JsonSchema\Tests;
- class ArraysTest extends BaseTestCase
- {
- public function getInvalidTests()
- {
- return array(
- array(
- '{
- "array":[1,2,"a"]
- }',
- '{
- "type":"object",
- "properties":{
- "array":{
- "type":"array",
- "items":{"type":"number"}
- }
- }
- }'
- ),
- array(
- '{
- "array":[1,2,null]
- }',
- '{
- "type":"object",
- "properties":{
- "array":{
- "type":"array",
- "items":{"type":["number","boolean"]}
- }
- }
- }'
- )
- );
- }
- public function getValidTests()
- {
- return array(
- array(
- '{
- "array":[1,2,"a"]
- }',
- '{
- "type":"object",
- "properties":{
- "array":{"type":"array"}
- }
- }'
- ),
- array(
- '{
- "array":[1,2,"a"]
- }',
- '{
- "type":"object",
- "properties":{
- "array":{
- "type":"array",
- "items":{"type":"number"},
- "additionalItems": {"type": "string"}
- }
- }
- }'
- ),
- );
- }
- }
|