public static function GroupTypeConditionTest::conditionsProvider in Organic groups 8
Data provider for ::testConditions().
Return value
array An indexed array with the following elements:
- 0: An array of group types that are configured in the plugin, in the format '{entity_type_id}-{bundle_id}'.
- 1: A boolean indicating whether or not the plugin is configured to negate the condition.
- 2: The ID of the test group that is present on the route context.
- 3: A boolean indicating whether or not the condition is expected to be true.
File
- tests/
src/ Kernel/ GroupTypeConditionTest.php, line 130
Class
- GroupTypeConditionTest
- Tests the GroupType condition plugin.
Namespace
Drupal\Tests\og\KernelCode
public static function conditionsProvider() {
return [
[
// The plugin is configured to act on group type node, bundle node0.
[
'node-node0',
],
// It's configuration is not negated.
FALSE,
// Our test group 'node0' is available as context.
'node0',
// So the condition is expected to match.
TRUE,
],
[
[
'node-node1',
],
TRUE,
'node1',
FALSE,
],
[
[
'entity_test-entity_test',
],
TRUE,
'node1',
TRUE,
],
[
[
'node-node0',
'node-node1',
],
FALSE,
'entity_test',
FALSE,
],
[
[
'node-node0',
'node-node1',
'entity_test-entity_test',
],
FALSE,
'entity_test',
TRUE,
],
[
[
'node-node0',
'node-node1',
],
TRUE,
'node0',
FALSE,
],
];
}