function EntityFieldTest::testDataTypes
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php \Drupal\KernelTests\Core\Entity\EntityFieldTest::testDataTypes()
- 8.9.x core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php \Drupal\KernelTests\Core\Entity\EntityFieldTest::testDataTypes()
- 11.x core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php \Drupal\KernelTests\Core\Entity\EntityFieldTest::testDataTypes()
Makes sure data types are correctly derived for all entity types.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Entity/ EntityFieldTest.php, line 657
Class
- EntityFieldTest
- Tests the Entity Field API.
Namespace
Drupal\KernelTests\Core\EntityCode
public function testDataTypes() : void {
$types = \Drupal::typedDataManager()->getDefinitions();
foreach (entity_test_entity_types() as $entity_type) {
$this->assertNotEmpty($types['entity:' . $entity_type]['class'], 'Entity data type registered.');
}
// Check bundle types are provided as well.
entity_test_create_bundle('bundle');
$types = \Drupal::typedDataManager()->getDefinitions();
$this->assertNotEmpty($types['entity:entity_test:bundle']['class'], 'Entity bundle data type registered.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.