You are here

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

Creates a test entity type.

Parameters

string $entity_type_id: The entity type id.

array $values: The values to be set on the created entity.

Return value

\Drupal\eck\Entity\EckEntityType The created eck entity type.

3 calls to UnitTestBase::createEckEntityType()
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 204

Class

UnitTestBase
Base class for unit tests.

Namespace

Drupal\Tests\eck\Unit

Code

protected function createEckEntityType($entity_type_id, array $values = []) {
  $values = $values + [
    'label' => ucfirst($entity_type_id),
    'id' => $entity_type_id,
  ];
  return new EckEntityType($values, $entity_type_id);
}