function EntityRepositoryTest::assertEntityType
Same name in other branches
- 8.9.x core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php \Drupal\KernelTests\Core\Entity\EntityRepositoryTest::assertEntityType()
- 10 core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php \Drupal\KernelTests\Core\Entity\EntityRepositoryTest::assertEntityType()
- 11.x core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php \Drupal\KernelTests\Core\Entity\EntityRepositoryTest::assertEntityType()
Asserts that the entity has the expected entity type ID.
@internal
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 306
Class
- EntityRepositoryTest
- Tests the entity repository.
Namespace
Drupal\KernelTests\Core\EntityCode
protected function assertEntityType(?object $entity, string $expected_entity_type_id) : void {
$this->assertInstanceOf(EntityTest::class, $entity);
$this->assertEquals($expected_entity_type_id, $entity->getEntityTypeId());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.