Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add test for filter by context falling thru.
  • Loading branch information
TimothyBJacobs committed Oct 20, 2020
commit 583f6ba95d3ee987a8f7e294c3e012bb54ca129c
46 changes: 46 additions & 0 deletions tests/phpunit/tests/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1705,6 +1705,52 @@ public function _dp_rest_filter_response_by_context() {
'b' => false,
),
),
'oneOf combined with base' => array(
array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'type' => 'object',
'properties' => array(
'c' => array(
'type' => 'integer',
'context' => array( 'edit' ),
),
),
'oneOf' => array(
array(
'properties' => array(
'a' => array(
'type' => 'string',
'context' => array( 'view' ),
),
'b' => array(
'type' => 'string',
'context' => array( 'edit' ),
),
),
),
array(
'properties' => array(
'a' => array(
'type' => 'integer',
'context' => array( 'edit' ),
),
'b' => array(
'type' => 'integer',
'context' => array( 'view' ),
),
),
),
),
),
array(
'a' => 1,
'b' => 2,
'c' => 3,
),
array(
'b' => 2,
),
),
);
}

Expand Down