You are here

protected function EntityRepositoryTest::assertEntityType in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php \Drupal\KernelTests\Core\Entity\EntityRepositoryTest::assertEntityType()

Asserts that the entity has the expected entity type ID.

Parameters

object|null $entity: An entity object or NULL.

string $expected_entity_type_id: The expected entity type ID.

1 call to EntityRepositoryTest::assertEntityType()
EntityRepositoryTest::testGetActive in core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php
Tests retrieving active variants.

File

core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php, line 304

Class

EntityRepositoryTest
Tests the entity repository.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function assertEntityType($entity, $expected_entity_type_id) {
  $this
    ->assertInstanceOf(EntityTest::class, $entity);
  $this
    ->assertEquals($expected_entity_type_id, $entity
    ->getEntityTypeId());
}