'expected_array_plugin' =>
['context_definitions' =>
[]],
'expected_object_plugin' =>
new ContextAwarePluginDefinition(),
];
// No context, all plugins available.
$data[] =
[FALSE,
$plugins,
$plugins];
$plugins =
[ 'expected_array_plugin' =>
[ 'context_definitions' =>
['context1' =>
new ContextDefinition('string'
)],
],
'expected_object_plugin'
=> (new ContextAwarePluginDefinition()) ->
addContextDefinition('context1',
new ContextDefinition('string'
)),
];
// Missing context, no plugins available.
$data[] =
[FALSE,
$plugins,
[]];
// Satisfied context, all plugins available.
$data[] =
[TRUE,
$plugins,
$plugins];
$mismatched_context_definition =
(new ContextDefinition('expected_data_type'
))->
setConstraints(['mismatched_constraint_name' => 'mismatched_constraint_value'
]);
$plugins =
[ 'expected_array_plugin' =>
[ 'context_definitions' =>
['context1' =>
$mismatched_context_definition],
],