function NodeContentTranslationUpdateTest::testContentTranslationDefaultValueBaseFieldOverrideUpdates
Tests that content-translation base field overrides are updated.
See also
node_post_update_modify_base_field_author_override
File
-
core/
modules/ node/ tests/ src/ Functional/ Update/ NodeContentTranslationUpdateTest.php, line 29
Class
- NodeContentTranslationUpdateTest
- Tests updating to Drupal 9 with content-translation for author fields.
Namespace
Drupal\Tests\node\Functional\UpdateCode
public function testContentTranslationDefaultValueBaseFieldOverrideUpdates() {
$config = \Drupal::config('core.base_field_override.node.article.uid');
$this->assertEquals('Drupal\\node\\Entity\\Node::getCurrentUserId', $config->get('default_value_callback'));
$this->runUpdates();
$entity_field_manager = \Drupal::service('entity_field.manager');
$fields = $entity_field_manager->getFieldDefinitions('node', 'article');
$author = $fields['uid'];
$this->assertEquals('Drupal\\node\\Entity\\Node::getDefaultEntityOwner', $author->getDefaultValueCallback());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.