Changeset 48555 for trunk/tests/phpunit/tests/rest-api.php
- Timestamp:
- 07/21/2020 09:20:22 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api.php
r48526 r48555 1086 1086 public function _dp_rest_filter_response_by_context() { 1087 1087 return array( 1088 'default' => array(1088 'default' => array( 1089 1089 array( 1090 1090 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1107 1107 array( 'first' => 'a' ), 1108 1108 ), 1109 'keeps missing context' => array(1109 'keeps missing context' => array( 1110 1110 array( 1111 1111 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1130 1130 ), 1131 1131 ), 1132 'removes empty context' => array(1132 'removes empty context' => array( 1133 1133 array( 1134 1134 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1151 1151 array( 'first' => 'a' ), 1152 1152 ), 1153 'nested properties' => array(1153 'nested properties' => array( 1154 1154 array( 1155 1155 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1180 1180 array( 'parent' => array( 'child' => 'hi' ) ), 1181 1181 ), 1182 'grand child properties' => array(1182 'grand child properties' => array( 1183 1183 array( 1184 1184 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1216 1216 array( 'parent' => array( 'child' => array( 'grand' => 'hi' ) ) ), 1217 1217 ), 1218 'array' => array(1218 'array' => array( 1219 1219 array( 1220 1220 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1251 1251 array( 'arr' => array( array( 'visible' => 'hi' ) ) ), 1252 1252 ), 1253 'additional properties' => array(1253 'additional properties' => array( 1254 1254 array( 1255 1255 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1285 1285 array( 'additional' => array( 'a' => '1' ) ), 1286 1286 ), 1287 'multiple types object' => array(1287 'multiple types object' => array( 1288 1288 array( 1289 1289 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1314 1314 array( 'multi' => array( 'a' => '1' ) ), 1315 1315 ), 1316 'multiple types array' => array(1316 'multiple types array' => array( 1317 1317 array( 1318 1318 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1349 1349 array( 'multi' => array( array( 'visible' => '1' ) ) ), 1350 1350 ), 1351 ' grand child properties does not traverses missing context'=> array(1351 'does not traverse missing context' => array( 1352 1352 array( 1353 1353 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1392 1392 ), 1393 1393 ), 1394 'object with no matching properties' => array( 1395 array( 1396 '$schema' => 'http://json-schema.org/draft-04/schema#', 1397 'type' => 'object', 1398 'properties' => array( 1399 'a' => array( 1400 'type' => 'string', 1401 'context' => array( 'edit' ), 1402 ), 1403 'b' => array( 1404 'type' => 'string', 1405 'context' => array( 'edit' ), 1406 ), 1407 ), 1408 ), 1409 array( 1410 'a' => 'hi', 1411 'b' => 'hello', 1412 ), 1413 array(), 1414 ), 1415 'array whose type does not match' => array( 1416 array( 1417 '$schema' => 'http://json-schema.org/draft-04/schema#', 1418 'type' => 'object', 1419 'properties' => array( 1420 'arr' => array( 1421 'type' => 'array', 1422 'context' => array( 'view' ), 1423 'items' => array( 1424 'type' => 'string', 1425 'context' => array( 'edit' ), 1426 ), 1427 ), 1428 ), 1429 ), 1430 array( 1431 'arr' => array( 'foo', 'bar', 'baz' ), 1432 ), 1433 array( 'arr' => array() ), 1434 ), 1435 'array and object type passed object' => array( 1436 array( 1437 '$schema' => 'http://json-schema.org/draft-04/schema#', 1438 'type' => array( 'array', 'object' ), 1439 'properties' => array( 1440 'a' => array( 1441 'type' => 'string', 1442 'context' => array( 'view' ), 1443 ), 1444 'b' => array( 1445 'type' => 'string', 1446 'context' => array( 'view' ), 1447 ), 1448 ), 1449 'items' => array( 1450 'type' => 'object', 1451 'context' => array( 'edit' ), 1452 'properties' => array( 1453 'a' => array( 1454 'type' => 'string', 1455 'context' => array( 'view' ), 1456 ), 1457 'b' => array( 1458 'type' => 'string', 1459 'context' => array( 'view' ), 1460 ), 1461 ), 1462 ), 1463 ), 1464 array( 1465 'a' => 'foo', 1466 'b' => 'bar', 1467 ), 1468 array( 1469 'a' => 'foo', 1470 'b' => 'bar', 1471 ), 1472 ), 1473 'array and object type passed array' => array( 1474 array( 1475 '$schema' => 'http://json-schema.org/draft-04/schema#', 1476 'type' => array( 'array', 'object' ), 1477 'properties' => array( 1478 'a' => array( 1479 'type' => 'string', 1480 'context' => array( 'view' ), 1481 ), 1482 'b' => array( 1483 'type' => 'string', 1484 'context' => array( 'view' ), 1485 ), 1486 ), 1487 'items' => array( 1488 'type' => 'object', 1489 'context' => array( 'edit' ), 1490 'properties' => array( 1491 'a' => array( 1492 'type' => 'string', 1493 'context' => array( 'view' ), 1494 ), 1495 'b' => array( 1496 'type' => 'string', 1497 'context' => array( 'view' ), 1498 ), 1499 ), 1500 ), 1501 ), 1502 array( 1503 array( 1504 'a' => 'foo', 1505 'b' => 'bar', 1506 ), 1507 array( 1508 'a' => 'foo', 1509 'b' => 'bar', 1510 ), 1511 ), 1512 array(), 1513 ), 1394 1514 ); 1395 1515 }
Note: See TracChangeset
for help on using the changeset viewer.