public function EntitySchemaTest::testModifyingTranslatableColumnSchema in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Tests/Entity/EntitySchemaTest.php \Drupal\system\Tests\Entity\EntitySchemaTest::testModifyingTranslatableColumnSchema()
Tests that modifying the UUID field for a translatable entity works.
File
- core/
modules/ system/ src/ Tests/ Entity/ EntitySchemaTest.php, line 129 - Contains \Drupal\system\Tests\Entity\EntitySchemaTest.
Class
- EntitySchemaTest
- Tests adding a custom bundle field.
Namespace
Drupal\system\Tests\EntityCode
public function testModifyingTranslatableColumnSchema() {
$this
->installModule('entity_schema_test');
$this
->updateEntityType(TRUE);
$fields = [
'revision_log',
'uuid',
];
foreach ($fields as $field_name) {
$original_definition = $this->entityManager
->getBaseFieldDefinitions('entity_test')[$field_name];
$new_definition = clone $original_definition;
$new_definition
->setLabel($original_definition
->getLabel() . ', the other one');
$this
->assertTrue($this->entityManager
->getStorage('entity_test')
->requiresFieldDataMigration($new_definition, $original_definition));
}
}