use Drupal\FunctionalTests\Update\UpdatePathTestBase;
/**
- * Tests system_post_update_add_region_to_entity_displays().
+ * Tests updates for entity displays.
*
* @group Update
+ * @group legacy
*/
class UpdateEntityDisplayTest extends UpdatePathTestBase {
/**
* Tests that entity displays are updated with regions for their fields.
+ *
+ * @see system_post_update_add_region_to_entity_displays()
*/
- public function testUpdate() {
+ public function testRegionUpdate() {
// No region key appears pre-update.
$entity_form_display = EntityFormDisplay::load('node.article.default');
$options = $entity_form_display->getComponent('body');
$this->assertIdentical('content', $options['region']);
}
+ /**
+ * Tests that entity displays are updated to properly store extra fields.
+ *
+ * @see system_post_update_extra_fields()
+ */
+ public function testExtraFieldsUpdate() {
+ $assertion = function ($expected_keys) {
+ $entity_view_display = EntityViewDisplay::load('node.article.default');
+ $this->assertEquals($expected_keys, array_keys($entity_view_display->getComponent('links')));
+ };
+
+ // Before the update extra fields are missing additional configuration.
+ $assertion(['weight', 'region']);
+ $this->runUpdates();
+ // After the update the additional configuration is present.
+ $assertion(['weight', 'region', 'settings', 'third_party_settings']);
+ }
+
}