public function EntityDefinitionUpdateTest::testEntityTypeUpdateWithEntityStorageChange in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php \Drupal\KernelTests\Core\Entity\EntityDefinitionUpdateTest::testEntityTypeUpdateWithEntityStorageChange()
- 9 core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php \Drupal\KernelTests\Core\Entity\EntityDefinitionUpdateTest::testEntityTypeUpdateWithEntityStorageChange()
Tests updating entity schema when there are entity storage changes.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Entity/ EntityDefinitionUpdateTest.php, line 138
Class
- EntityDefinitionUpdateTest
- Tests EntityDefinitionUpdateManager functionality.
Namespace
Drupal\KernelTests\Core\EntityCode
public function testEntityTypeUpdateWithEntityStorageChange() {
// Update the entity type to be revisionable and try to apply the update.
// It's expected to throw an exception.
$entity_type = $this
->getUpdatedEntityTypeDefinition(TRUE, FALSE);
try {
$this->entityDefinitionUpdateManager
->updateEntityType($entity_type);
$this
->fail('EntityStorageException thrown when trying to apply an update that requires shared table schema changes.');
} catch (EntityStorageException $e) {
// Expected exception; just continue testing.
}
}