| | 1317 | 'object with no matching properties' => array( |
| | 1318 | array( |
| | 1319 | '$schema' => 'http://json-schema.org/draft-04/schema#', |
| | 1320 | 'type' => 'object', |
| | 1321 | 'properties' => array( |
| | 1322 | 'a' => array( |
| | 1323 | 'type' => 'string', |
| | 1324 | 'context' => array( 'edit' ), |
| | 1325 | ), |
| | 1326 | 'b' => array( |
| | 1327 | 'type' => 'string', |
| | 1328 | 'context' => array( 'edit' ), |
| | 1329 | ), |
| | 1330 | ), |
| | 1331 | ), |
| | 1332 | array( |
| | 1333 | 'a' => 'hi', |
| | 1334 | 'b' => 'hello', |
| | 1335 | ), |
| | 1336 | array(), |
| | 1337 | ), |
| | 1338 | 'array whose type does not match' => array( |
| | 1339 | array( |
| | 1340 | '$schema' => 'http://json-schema.org/draft-04/schema#', |
| | 1341 | 'type' => 'object', |
| | 1342 | 'properties' => array( |
| | 1343 | 'arr' => array( |
| | 1344 | 'type' => 'array', |
| | 1345 | 'context' => array( 'view' ), |
| | 1346 | 'items' => array( |
| | 1347 | 'type' => 'string', |
| | 1348 | 'context' => array( 'edit' ), |
| | 1349 | ), |
| | 1350 | ), |
| | 1351 | ), |
| | 1352 | ), |
| | 1353 | array( |
| | 1354 | 'arr' => array( 'foo', 'bar', 'baz' ), |
| | 1355 | ), |
| | 1356 | array( 'arr' => array() ), |
| | 1357 | ), |
| | 1358 | 'array and object type passed object' => array( |
| | 1359 | array( |
| | 1360 | '$schema' => 'http://json-schema.org/draft-04/schema#', |
| | 1361 | 'type' => array( 'array', 'object' ), |
| | 1362 | 'properties' => array( |
| | 1363 | 'a' => array( |
| | 1364 | 'type' => 'string', |
| | 1365 | 'context' => array( 'view' ), |
| | 1366 | ), |
| | 1367 | 'b' => array( |
| | 1368 | 'type' => 'string', |
| | 1369 | 'context' => array( 'view' ), |
| | 1370 | ), |
| | 1371 | ), |
| | 1372 | 'items' => array( |
| | 1373 | 'type' => 'object', |
| | 1374 | 'context' => array( 'edit' ), |
| | 1375 | 'properties' => array( |
| | 1376 | 'a' => array( |
| | 1377 | 'type' => 'string', |
| | 1378 | 'context' => array( 'view' ), |
| | 1379 | ), |
| | 1380 | 'b' => array( |
| | 1381 | 'type' => 'string', |
| | 1382 | 'context' => array( 'view' ), |
| | 1383 | ), |
| | 1384 | ), |
| | 1385 | ), |
| | 1386 | ), |
| | 1387 | array( |
| | 1388 | 'a' => 'foo', |
| | 1389 | 'b' => 'bar', |
| | 1390 | ), |
| | 1391 | array( |
| | 1392 | 'a' => 'foo', |
| | 1393 | 'b' => 'bar', |
| | 1394 | ), |
| | 1395 | ), |
| | 1396 | 'array and object type passed array' => array( |
| | 1397 | array( |
| | 1398 | '$schema' => 'http://json-schema.org/draft-04/schema#', |
| | 1399 | 'type' => array( 'array', 'object' ), |
| | 1400 | 'properties' => array( |
| | 1401 | 'a' => array( |
| | 1402 | 'type' => 'string', |
| | 1403 | 'context' => array( 'view' ), |
| | 1404 | ), |
| | 1405 | 'b' => array( |
| | 1406 | 'type' => 'string', |
| | 1407 | 'context' => array( 'view' ), |
| | 1408 | ), |
| | 1409 | ), |
| | 1410 | 'items' => array( |
| | 1411 | 'type' => 'object', |
| | 1412 | 'context' => array( 'edit' ), |
| | 1413 | 'properties' => array( |
| | 1414 | 'a' => array( |
| | 1415 | 'type' => 'string', |
| | 1416 | 'context' => array( 'view' ), |
| | 1417 | ), |
| | 1418 | 'b' => array( |
| | 1419 | 'type' => 'string', |
| | 1420 | 'context' => array( 'view' ), |
| | 1421 | ), |
| | 1422 | ), |
| | 1423 | ), |
| | 1424 | ), |
| | 1425 | array( |
| | 1426 | array( |
| | 1427 | 'a' => 'foo', |
| | 1428 | 'b' => 'bar', |
| | 1429 | ), |
| | 1430 | array( |
| | 1431 | 'a' => 'foo', |
| | 1432 | 'b' => 'bar', |
| | 1433 | ), |
| | 1434 | ), |
| | 1435 | array(), |
| | 1436 | ), |