$this->
fail($message);
} catch (PluginNotFoundException
$e) { // Expected exception; just continue testing.
} // Ensure that a field cannot be installed on non-existing entity type.
$message = 'A field cannot be installed on a non-existing entity type';
try { $storage_definition = BaseFieldDefinition::
create('string'
) ->
setLabel(t('A new revisionable base field'
)) ->
setRevisionable(TRUE
);
$this->entityDefinitionUpdateManager->
installFieldStorageDefinition('bar', 'foo', 'entity_test',
$storage_definition);
$this->
fail($message);
} catch (PluginNotFoundException
$e) { // Expected exception; just continue testing.
} // Ensure that installing an existing entity type is a no-op.
$entity_type =
$this->entityDefinitionUpdateManager->
getEntityType('entity_test_update'
);
$this->entityDefinitionUpdateManager->
installEntityType($entity_type);
$this->
assertTrue($db_schema->
tableExists('entity_test_update'
), 'Installing an existing entity type is a no-op'
);