protected function RouteGroupResolverTest::getTestEntityProperties in Organic groups 8
Returns properties used to create mock test entities.
This is used to facilitate referring to entities in data providers. Since a data provider is called before the test setup runs, we cannot return actual entities in the data provider. Instead the data provider can refer to these test entities by ID, and the actual entity mocks will be generated in the test setup.
The test groups should be declared first, the group content last.
Return value
array An array of entity metadata, keyed by test entity ID. Each item is an array with the following keys:
- type (required): The entity type ID.
- bundle (required): The entity bundle.
- group (optional): Whether or not the entity is a group.
- group_content (optional): An array containing IDs of groups this group content belongs to.
Overrides OgGroupResolverTestBase::getTestEntityProperties
File
- tests/
src/ Unit/ Plugin/ OgGroupResolver/ RouteGroupResolverTest.php, line 42
Class
- RouteGroupResolverTest
- Tests the RouteGroupResolver plugin.
Namespace
Drupal\Tests\og\Unit\Plugin\OgGroupResolverCode
protected function getTestEntityProperties() {
return [
'group' => [
'type' => 'node',
'bundle' => 'group',
'group' => TRUE,
],
'group_content' => [
'type' => 'entity_test',
'bundle' => 'group_content',
],
'non_group' => [
'type' => 'taxonomy_term',
'bundle' => 'taxonomy_term',
],
];
}