You are here

abstract protected function OgGroupResolverTestBase::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.
2 calls to OgGroupResolverTestBase::getTestEntityProperties()
OgGroupResolverTestBase::setUp in tests/src/Unit/Plugin/OgGroupResolver/OgGroupResolverTestBase.php
OgRouteGroupResolverTestBase::mightCheckIfRouteObjectIsGroup in tests/src/Unit/Plugin/OgGroupResolver/OgRouteGroupResolverTestBase.php
Adds an expectation that checks if the route object is a group.
4 methods override OgGroupResolverTestBase::getTestEntityProperties()
RequestQueryArgumentResolverTest::getTestEntityProperties in tests/src/Unit/Plugin/OgGroupResolver/RequestQueryArgumentResolverTest.php
Returns properties used to create mock test entities.
RouteGroupContentResolverTest::getTestEntityProperties in tests/src/Unit/Plugin/OgGroupResolver/RouteGroupContentResolverTest.php
Returns properties used to create mock test entities.
RouteGroupResolverTest::getTestEntityProperties in tests/src/Unit/Plugin/OgGroupResolver/RouteGroupResolverTest.php
Returns properties used to create mock test entities.
UserGroupAccessResolverTest::getTestEntityProperties in tests/src/Unit/Plugin/OgGroupResolver/UserGroupAccessResolverTest.php
Returns properties used to create mock test entities.

File

tests/src/Unit/Plugin/OgGroupResolver/OgGroupResolverTestBase.php, line 161

Class

OgGroupResolverTestBase
Base class for testing OgGroupResolver plugins.

Namespace

Drupal\Tests\og\Unit\Plugin\OgGroupResolver

Code

protected abstract function getTestEntityProperties();