function EntityTypeTest::setUpEntityType

Same name in this branch
  1. 11.x core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php \Drupal\Tests\Core\Entity\EntityTypeTest::setUpEntityType()
Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Entity/EntityTypeTest.php \Drupal\KernelTests\Core\Entity\EntityTypeTest::setUpEntityType()
  2. 9 core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php \Drupal\Tests\Core\Entity\EntityTypeTest::setUpEntityType()
  3. 8.9.x core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php \Drupal\Tests\Core\Entity\EntityTypeTest::setUpEntityType()
  4. 10 core/tests/Drupal/KernelTests/Core/Entity/EntityTypeTest.php \Drupal\KernelTests\Core\Entity\EntityTypeTest::setUpEntityType()
  5. 10 core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php \Drupal\Tests\Core\Entity\EntityTypeTest::setUpEntityType()

Sets up an EntityType object for a given set of values.

Parameters

array $definition: An array of values to use for the EntityType.

Return value

\Drupal\Core\Entity\EntityTypeInterface

1 call to EntityTypeTest::setUpEntityType()
EntityTypeTest::testIsSerializable in core/tests/Drupal/KernelTests/Core/Entity/EntityTypeTest.php
Tests that the EntityType object can be serialized.

File

core/tests/Drupal/KernelTests/Core/Entity/EntityTypeTest.php, line 26

Class

EntityTypeTest
Tests general features of entity types.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function setUpEntityType($definition) {
    $definition += [
        'id' => 'example_entity_type',
    ];
    return new EntityType($definition);
}

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