Changeset 49246 for trunk/tests/phpunit/tests/rest-api.php
- Timestamp:
- 10/20/2020 06:22:39 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api.php
r49082 r49246 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 'pattern properties' => array(1287 'pattern properties' => array( 1288 1288 array( 1289 1289 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1321 1321 ), 1322 1322 ), 1323 'multiple types object' => array(1323 'multiple types object' => array( 1324 1324 array( 1325 1325 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1350 1350 array( 'multi' => array( 'a' => '1' ) ), 1351 1351 ), 1352 'multiple types array' => array(1352 'multiple types array' => array( 1353 1353 array( 1354 1354 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1385 1385 array( 'multi' => array( array( 'visible' => '1' ) ) ), 1386 1386 ), 1387 'does not traverse missing context' => array(1387 'does not traverse missing context' => array( 1388 1388 array( 1389 1389 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1428 1428 ), 1429 1429 ), 1430 'object with no matching properties' => array(1430 'object with no matching properties' => array( 1431 1431 array( 1432 1432 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1449 1449 array(), 1450 1450 ), 1451 'array whose type does not match' => array(1451 'array whose type does not match' => array( 1452 1452 array( 1453 1453 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1469 1469 array( 'arr' => array() ), 1470 1470 ), 1471 'array and object type passed object' => array(1471 'array and object type passed object' => array( 1472 1472 array( 1473 1473 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1507 1507 ), 1508 1508 ), 1509 'array and object type passed array' => array(1509 'array and object type passed array' => array( 1510 1510 array( 1511 1511 '$schema' => 'http://json-schema.org/draft-04/schema#', … … 1548 1548 array(), 1549 1549 ), 1550 'anyOf applies the correct schema' => array( 1551 array( 1552 '$schema' => 'http://json-schema.org/draft-04/schema#', 1553 'type' => 'object', 1554 'anyOf' => array( 1555 array( 1556 'properties' => array( 1557 'a' => array( 1558 'type' => 'string', 1559 'context' => array( 'view' ), 1560 ), 1561 'b' => array( 1562 'type' => 'string', 1563 'context' => array( 'edit' ), 1564 ), 1565 ), 1566 ), 1567 array( 1568 'properties' => array( 1569 'a' => array( 1570 'type' => 'integer', 1571 'context' => array( 'edit' ), 1572 ), 1573 'b' => array( 1574 'type' => 'integer', 1575 'context' => array( 'view' ), 1576 ), 1577 ), 1578 ), 1579 ), 1580 ), 1581 array( 1582 'a' => 1, 1583 'b' => 2, 1584 ), 1585 array( 1586 'b' => 2, 1587 ), 1588 ), 1589 'anyOf is ignored if no valid schema is found' => array( 1590 array( 1591 '$schema' => 'http://json-schema.org/draft-04/schema#', 1592 'type' => 'object', 1593 'anyOf' => array( 1594 array( 1595 'properties' => array( 1596 'a' => array( 1597 'type' => 'string', 1598 'context' => array( 'view' ), 1599 ), 1600 'b' => array( 1601 'type' => 'string', 1602 'context' => array( 'edit' ), 1603 ), 1604 ), 1605 ), 1606 array( 1607 'properties' => array( 1608 'a' => array( 1609 'type' => 'integer', 1610 'context' => array( 'edit' ), 1611 ), 1612 'b' => array( 1613 'type' => 'integer', 1614 'context' => array( 'view' ), 1615 ), 1616 ), 1617 ), 1618 ), 1619 ), 1620 array( 1621 'a' => true, 1622 'b' => false, 1623 ), 1624 array( 1625 'a' => true, 1626 'b' => false, 1627 ), 1628 ), 1629 'oneOf applies the correct schema' => array( 1630 array( 1631 '$schema' => 'http://json-schema.org/draft-04/schema#', 1632 'type' => 'object', 1633 'oneOf' => array( 1634 array( 1635 'properties' => array( 1636 'a' => array( 1637 'type' => 'string', 1638 'context' => array( 'view' ), 1639 ), 1640 'b' => array( 1641 'type' => 'string', 1642 'context' => array( 'edit' ), 1643 ), 1644 ), 1645 ), 1646 array( 1647 'properties' => array( 1648 'a' => array( 1649 'type' => 'integer', 1650 'context' => array( 'edit' ), 1651 ), 1652 'b' => array( 1653 'type' => 'integer', 1654 'context' => array( 'view' ), 1655 ), 1656 ), 1657 ), 1658 ), 1659 ), 1660 array( 1661 'a' => 1, 1662 'b' => 2, 1663 ), 1664 array( 1665 'b' => 2, 1666 ), 1667 ), 1668 'oneOf ignored if no valid schema was found' => array( 1669 array( 1670 '$schema' => 'http://json-schema.org/draft-04/schema#', 1671 'type' => 'object', 1672 'anyOf' => array( 1673 array( 1674 'properties' => array( 1675 'a' => array( 1676 'type' => 'string', 1677 'context' => array( 'view' ), 1678 ), 1679 'b' => array( 1680 'type' => 'string', 1681 'context' => array( 'edit' ), 1682 ), 1683 ), 1684 ), 1685 array( 1686 'properties' => array( 1687 'a' => array( 1688 'type' => 'integer', 1689 'context' => array( 'edit' ), 1690 ), 1691 'b' => array( 1692 'type' => 'integer', 1693 'context' => array( 'view' ), 1694 ), 1695 ), 1696 ), 1697 ), 1698 ), 1699 array( 1700 'a' => true, 1701 'b' => false, 1702 ), 1703 array( 1704 'a' => true, 1705 'b' => false, 1706 ), 1707 ), 1708 'oneOf combined with base' => array( 1709 array( 1710 '$schema' => 'http://json-schema.org/draft-04/schema#', 1711 'type' => 'object', 1712 'properties' => array( 1713 'c' => array( 1714 'type' => 'integer', 1715 'context' => array( 'edit' ), 1716 ), 1717 ), 1718 'oneOf' => array( 1719 array( 1720 'properties' => array( 1721 'a' => array( 1722 'type' => 'string', 1723 'context' => array( 'view' ), 1724 ), 1725 'b' => array( 1726 'type' => 'string', 1727 'context' => array( 'edit' ), 1728 ), 1729 ), 1730 ), 1731 array( 1732 'properties' => array( 1733 'a' => array( 1734 'type' => 'integer', 1735 'context' => array( 'edit' ), 1736 ), 1737 'b' => array( 1738 'type' => 'integer', 1739 'context' => array( 'view' ), 1740 ), 1741 ), 1742 ), 1743 ), 1744 ), 1745 array( 1746 'a' => 1, 1747 'b' => 2, 1748 'c' => 3, 1749 ), 1750 array( 1751 'b' => 2, 1752 ), 1753 ), 1550 1754 ); 1551 1755 }
Note: See TracChangeset
for help on using the changeset viewer.