function EntityDefinitionUpdateMultipleTypesTest::testUpdateEntityTypeWithoutInCodeDefinition
Same name and namespace in other branches
- main core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateMultipleTypesTest.php \Drupal\KernelTests\Core\Entity\EntityDefinitionUpdateMultipleTypesTest::testUpdateEntityTypeWithoutInCodeDefinition()
Tests updating an entity type that doesn't exist in code anymore.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Entity/ EntityDefinitionUpdateMultipleTypesTest.php, line 155
Class
- EntityDefinitionUpdateMultipleTypesTest
- Tests EntityDefinitionUpdateManager functionality.
Namespace
Drupal\KernelTests\Core\EntityCode
public function testUpdateEntityTypeWithoutInCodeDefinition() : void {
$entity_type = clone $this->entityTypeManager
->getDefinition('entity_test_update');
// Remove the entity type definition. This is the same thing as removing the
// code that defines it.
$this->deleteEntityType();
// Add an entity index, update the entity type and check that the index has
// been created.
$this->addEntityIndex();
$this->entityDefinitionUpdateManager
->updateEntityType($entity_type);
$this->assertTrue($this->database
->schema()
->indexExists('entity_test_update', 'entity_test_update__new_index'), 'Index created.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.