You are here

protected function UnitTestBase::addEntityToStorage in Entity Construction Kit (ECK) 8

Adds an entity to the mock storage.

3 calls to UnitTestBase::addEntityToStorage()
PermissionsGeneratorTest::givenMultipleEntityTypesWithMixedSettingsGeneratesCorrectPermissions in tests/src/Unit/PermissionsGeneratorTest.php
Tests permission creation for entity types with mixed settings.
PermissionsGeneratorTest::givenSingleEntityTypeGeneratesCorrectPermissions in tests/src/Unit/PermissionsGeneratorTest.php
Tests permission creation for a single entity type.
PermissionsGeneratorTest::givenSingleEntityTypeWithAuthorFieldGeneratesCorrectPermissions in tests/src/Unit/PermissionsGeneratorTest.php
Tests permission creation for an entity type with an author field.

File

tests/src/Unit/UnitTestBase.php, line 189

Class

UnitTestBase
Base class for unit tests.

Namespace

Drupal\Tests\eck\Unit

Code

protected function addEntityToStorage(EntityInterface $entity) {
  $this->entities[$entity
    ->id()] = $entity;
}