function ViewsTestEntity::setMockedBaseFieldDefinitions

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php \Drupal\Tests\views\Kernel\Entity\ViewsTestEntity::setMockedBaseFieldDefinitions()
  2. 10 core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php \Drupal\Tests\views\Kernel\Entity\ViewsTestEntity::setMockedBaseFieldDefinitions()

Sets up the mocked base field definitions.

Parameters

string $entity_type_id: The entity type ID.

array $definitions: The array of base field definitions to mock. These are added to the defaults ones from the parent class.

1 call to ViewsTestEntity::setMockedBaseFieldDefinitions()
EntityViewsDataTest::setUpEntityType in core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php
Mocks an entity type and its base fields.

File

core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php, line 857

Class

ViewsTestEntity
Generic entity class for our test entity types.

Namespace

Drupal\Tests\views\Kernel\Entity

Code

public static function setMockedBaseFieldDefinitions(string $entity_type_id, array $definitions) {
    static::$mockedBaseFieldDefinitions[$entity_type_id] = $definitions;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.