function 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. 10 core/tests/Drupal/KernelTests/Core/Entity/EntityTypeTest.php \Drupal\KernelTests\Core\Entity\EntityTypeTest::setUpEntityType()
  4. 10 core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php \Drupal\Tests\Core\Entity\EntityTypeTest::setUpEntityType()
  5. 11.x core/tests/Drupal/KernelTests/Core/Entity/EntityTypeTest.php \Drupal\KernelTests\Core\Entity\EntityTypeTest::setUpEntityType()
  6. 11.x 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

37 calls to EntityTypeTest::setUpEntityType()
EntityTypeTest::testConstraintMethods in core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
Tests the constraint methods.
EntityTypeTest::testEntityClassImplements in core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
@covers ::entityClassImplements
EntityTypeTest::testGet in core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
@covers ::get
EntityTypeTest::testGetAccessControlClass in core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
Tests the getAccessControlClass() method.
EntityTypeTest::testGetBundleLabel in core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
Tests the ::getBundleLabel() method.

... See full list

File

core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php, line 27

Class

EntityTypeTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Entity%21EntityType.php/class/EntityType/8.9.x" title="Provides an implementation of an entity type and its metadata." class="local">\Drupal\Core\Entity\EntityType</a> @group Entity

Namespace

Drupal\Tests\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.