From 474deb9259d5ca4dc6007e1770be51caaa912048 Mon Sep 17 00:00:00 2001 From: bcweaver <brianweaver@gmail.com> Date: Wed, 24 Oct 2018 13:22:07 -0400 Subject: [PATCH] Update 'field_group' module to the latest (proper/official) release --- composer.json | 2 +- composer.lock | 18 +- vendor/composer/installed.json | 18 +- .../field_group_migrate.info.yml | 6 +- .../Migrate/d7/MigrateFieldGroupTest.php | 14 +- .../src/Unit/Migrate/d7/FieldGroupTest.php | 8 + web/modules/field_group/field_group.info.yml | 6 +- web/modules/field_group/field_group.module | 88 ++++++---- .../formatters/html_element/html-element.js | 1 - web/modules/field_group/includes/helpers.inc | 2 +- .../field_group/src/Element/HtmlElement.php | 2 + .../FieldGroupFormatter/Fieldset.php | 6 + .../FieldGroupFormatter/HtmlElement.php | 1 + .../src/Tests/ManageDisplayTest.php | 148 ---------------- .../field_group_test.info.yml | 6 +- .../src/Functional}/EntityDisplayTest.php | 111 ++++++------ .../src/Functional}/FieldGroupTestTrait.php | 17 +- .../FieldGroupWithoutFieldUiTest.php | 14 +- .../src/Functional/ManageDisplayTest.php | 158 ++++++++++++++++++ .../FunctionalJavascript/FieldGroupUiTest.php | 21 ++- 20 files changed, 374 insertions(+), 273 deletions(-) delete mode 100644 web/modules/field_group/src/Tests/ManageDisplayTest.php rename web/modules/field_group/{src/Tests => tests/src/Functional}/EntityDisplayTest.php (79%) rename web/modules/field_group/{src/Tests => tests/src/Functional}/FieldGroupTestTrait.php (70%) rename web/modules/field_group/{src/Tests => tests/src/Functional}/FieldGroupWithoutFieldUiTest.php (56%) create mode 100644 web/modules/field_group/tests/src/Functional/ManageDisplayTest.php diff --git a/composer.json b/composer.json index 0f8ba0f8d0..8d8dcd5c47 100644 --- a/composer.json +++ b/composer.json @@ -99,7 +99,7 @@ "drupal/entity_reference_revisions": "1.3", "drupal/externalauth": "1.0", "drupal/features": "3.8", - "drupal/field_group": "1.0-rc6", + "drupal/field_group": "1.0", "drupal/field_permissions": "1.0-beta1", "drupal/file_browser": "1.1", "drupal/focal_point": "1.0-beta6", diff --git a/composer.lock b/composer.lock index fb3a413bab..c1d2e5493f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "d5a4707da1701314441aa4c244af663c", + "content-hash": "8452601cd705e8fd249c372b56b62636", "packages": [ { "name": "alchemy/zippy", @@ -3648,17 +3648,17 @@ }, { "name": "drupal/field_group", - "version": "1.0.0-rc6", + "version": "1.0.0", "source": { "type": "git", "url": "https://git.drupal.org/project/field_group", - "reference": "8.x-1.0-rc6" + "reference": "8.x-1.0" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/field_group-8.x-1.0-rc6.zip", - "reference": "8.x-1.0-rc6", - "shasum": "1ce3c6387e745a04a1099956a5bf39bb50096d44" + "url": "https://ftp.drupal.org/files/projects/field_group-8.x-1.0.zip", + "reference": "8.x-1.0", + "shasum": "e8aa3fae5c3c5dec84644bb577996938d638a611" }, "require": { "drupal/core": "*" @@ -3669,11 +3669,11 @@ "dev-1.x": "1.x-dev" }, "drupal": { - "version": "8.x-1.0-rc6", + "version": "8.x-1.0", "datestamp": "1510352885", "security-coverage": { - "status": "not-covered", - "message": "RC releases are not covered by Drupal security advisories." + "status": "covered", + "message": "Covered by Drupal's security advisory policy" } } }, diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 84383c0426..97310e0901 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -3757,18 +3757,18 @@ }, { "name": "drupal/field_group", - "version": "1.0.0-rc6", - "version_normalized": "1.0.0.0-RC6", + "version": "1.0.0", + "version_normalized": "1.0.0.0", "source": { "type": "git", "url": "https://git.drupal.org/project/field_group", - "reference": "8.x-1.0-rc6" + "reference": "8.x-1.0" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/field_group-8.x-1.0-rc6.zip", - "reference": "8.x-1.0-rc6", - "shasum": "1ce3c6387e745a04a1099956a5bf39bb50096d44" + "url": "https://ftp.drupal.org/files/projects/field_group-8.x-1.0.zip", + "reference": "8.x-1.0", + "shasum": "e8aa3fae5c3c5dec84644bb577996938d638a611" }, "require": { "drupal/core": "*" @@ -3779,11 +3779,11 @@ "dev-1.x": "1.x-dev" }, "drupal": { - "version": "8.x-1.0-rc6", + "version": "8.x-1.0", "datestamp": "1510352885", "security-coverage": { - "status": "not-covered", - "message": "RC releases are not covered by Drupal security advisories." + "status": "covered", + "message": "Covered by Drupal's security advisory policy" } } }, diff --git a/web/modules/field_group/contrib/field_group_migrate/field_group_migrate.info.yml b/web/modules/field_group/contrib/field_group_migrate/field_group_migrate.info.yml index b9c0a03c5f..53f8c6e63f 100644 --- a/web/modules/field_group/contrib/field_group_migrate/field_group_migrate.info.yml +++ b/web/modules/field_group/contrib/field_group_migrate/field_group_migrate.info.yml @@ -7,8 +7,8 @@ package: Migrate dependencies: - field_group:field_group -# Information added by Drupal.org packaging script on 2016-11-28 -version: '8.x-1.0-rc6' +# Information added by Drupal.org packaging script on 2017-11-10 +version: '8.x-1.0' core: '8.x' project: 'field_group' -datestamp: 1480365490 +datestamp: 1510352889 diff --git a/web/modules/field_group/contrib/field_group_migrate/tests/src/Kernel/Migrate/d7/MigrateFieldGroupTest.php b/web/modules/field_group/contrib/field_group_migrate/tests/src/Kernel/Migrate/d7/MigrateFieldGroupTest.php index 9a9cbfc132..ba8e92a54a 100644 --- a/web/modules/field_group/contrib/field_group_migrate/tests/src/Kernel/Migrate/d7/MigrateFieldGroupTest.php +++ b/web/modules/field_group/contrib/field_group_migrate/tests/src/Kernel/Migrate/d7/MigrateFieldGroupTest.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\field_group_migrate\Kernel\Migrate\d7; -use Drupal\Core\Entity\Display\EntityDisplayInterface; use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase; /** @@ -12,7 +11,10 @@ */ class MigrateFieldGroupTest extends MigrateDrupal7TestBase { - static $modules = [ + /** + * {@inheritdoc} + */ + public static $modules = [ 'field_group', 'field_group_migrate', 'comment', @@ -23,6 +25,8 @@ class MigrateFieldGroupTest extends MigrateDrupal7TestBase { 'taxonomy', 'telephone', 'text', + 'taxonomy', + 'menu_ui', ]; /** @@ -37,6 +41,7 @@ protected function setUp() { $this->executeMigrations([ 'd7_node_type', 'd7_comment_type', + 'd7_taxonomy_vocabulary', 'd7_view_modes', 'd7_field', 'd7_field_instance', @@ -68,13 +73,14 @@ protected function setUp() { * The expected parent name. */ protected function assertEntity($id, $type, $group_name, $expected_label, $expected_weight = 0, $expected_format_settings = [], $expected_format_type = 'tabs', $expected_children = [], $expected_parent_name = '') { - /** @var EntityDisplayInterface $entity */ + /** @var \Drupal\Core\Entity\Display\EntityDisplayInterface $entity */ $entity = \Drupal::entityTypeManager() ->getStorage($type) ->load($id); $field_group_settings = $entity->getThirdPartySettings('field_group'); $this->assertNotEmpty($field_group_settings); $this->assertArrayHasKey($group_name, $field_group_settings); + $field_group = $field_group_settings[$group_name]; $this->assertEquals($expected_label, $field_group['label']); $this->assertEquals($expected_format_settings, $field_group['format_settings']); @@ -94,7 +100,7 @@ public function testFieldGroup() { $this->assertEntity('node.article.teaser', 'entity_view_display', 'group_article', 'htab group', 2, ['classes' => 'htab-group'], 'tab', ['field_image']); // Check an entity_view_display without a field group. - /** @var EntityDisplayInterface $entity */ + /** @var \Drupal\Core\Entity\Display\EntityDisplayInterface $entity */ $entity = \Drupal::entityTypeManager() ->getStorage('entity_view_display') ->load('node.page.teaser'); diff --git a/web/modules/field_group/contrib/field_group_migrate/tests/src/Unit/Migrate/d7/FieldGroupTest.php b/web/modules/field_group/contrib/field_group_migrate/tests/src/Unit/Migrate/d7/FieldGroupTest.php index 34449fbdf2..1150015080 100644 --- a/web/modules/field_group/contrib/field_group_migrate/tests/src/Unit/Migrate/d7/FieldGroupTest.php +++ b/web/modules/field_group/contrib/field_group_migrate/tests/src/Unit/Migrate/d7/FieldGroupTest.php @@ -91,4 +91,12 @@ protected function setUp() { parent::setUp(); } + /** + * {@inheritdoc} + */ + public function providerSource() { + // @TODO FIX. + return []; + } + } diff --git a/web/modules/field_group/field_group.info.yml b/web/modules/field_group/field_group.info.yml index e747db2d7c..5654d7f35f 100644 --- a/web/modules/field_group/field_group.info.yml +++ b/web/modules/field_group/field_group.info.yml @@ -6,8 +6,8 @@ package : Fields dependencies: - drupal:field -# Information added by Drupal.org packaging script on 2016-11-28 -version: '8.x-1.0-rc6' +# Information added by Drupal.org packaging script on 2017-11-10 +version: '8.x-1.0' core: '8.x' project: 'field_group' -datestamp: 1480365490 +datestamp: 1510352889 diff --git a/web/modules/field_group/field_group.module b/web/modules/field_group/field_group.module index fdf4c6d639..e85c489e25 100644 --- a/web/modules/field_group/field_group.module +++ b/web/modules/field_group/field_group.module @@ -7,7 +7,6 @@ use Drupal\Core\Entity\ContentEntityFormInterface; use Drupal\Core\Entity\Display\EntityDisplayInterface; -use Drupal\Core\Entity\Display\EntityFormDisplayInterface; use Drupal\Core\Entity\Entity\EntityFormDisplay; use Drupal\Core\Entity\Entity\EntityViewDisplay; use Drupal\Core\Entity\EntityInterface; @@ -154,13 +153,16 @@ function field_group_field_info_max_weight($entity_type, $bundle, $context, $con */ function field_group_form_alter(array &$form, FormStateInterface $form_state) { - if ($form_state->getFormObject() instanceof ContentEntityFormInterface && !$form_state->getFormObject() instanceof ConfirmFormInterface) { + $form_object = $form_state->getFormObject(); + if ($form_object instanceof ContentEntityFormInterface && !$form_object instanceof ConfirmFormInterface) { /** * @var EntityFormDisplayInterface $form_display */ - if ($form_display = $form_state->getStorage()['form_display']) { - $entity = $form_state->getFormObject()->getEntity(); + $storage = $form_state->getStorage(); + if (!empty($storage['form_display'])) { + $form_display = $storage['form_display']; + $entity = $form_object->getEntity(); $context = array( 'entity_type' => $entity->getEntityTypeId(), @@ -189,7 +191,7 @@ function field_group_inline_entity_form_entity_form_alter(&$entity_form, FormSta 'bundle' => $entity_form['#entity']->bundle(), 'entity' => $entity_form['#entity'], 'display_context' => 'form', - 'mode' => 'default', + 'mode' => isset($entity_form['#form_mode']) ? $entity_form['#form_mode'] : 'default', ]; field_group_attach_groups($entity_form, $context); @@ -348,7 +350,7 @@ function field_group_attach_groups(&$element, $context) { * @see field_group_theme_registry_alter * @see field_group_fields_nest() * @param $vars preprocess vars or form element - * @param $context The display context (form or view) + * @param $context The display context (entity type, form or view) * @return $element Array with re-arranged fields in groups. */ function field_group_build_entity_groups(&$vars, $context = 'view') { @@ -365,7 +367,6 @@ function field_group_build_entity_groups(&$vars, $context = 'view') { $element = &$vars['content']; } else { - if ($context === 'eck_entity') { $element = &$vars['entity']; } @@ -383,7 +384,7 @@ function field_group_build_entity_groups(&$vars, $context = 'view') { } // Nest the fields in the corresponding field groups. - field_group_fields_nest($element, $nest_vars); + field_group_fields_nest($element, $nest_vars, $context); // Allow others to alter the pre_rendered build. Drupal::moduleHandler()->alter('field_group_build_pre_render', $element); @@ -401,11 +402,9 @@ function field_group_build_entity_groups(&$vars, $context = 'view') { // Put groups inside content if we are rendering an entity_view. foreach ($element['#fieldgroups'] as $group) { if (!empty($element[$group->group_name])) { - if (isset($vars['content'])) { - $vars['content'][$group->group_name] = $element[$group->group_name]; - } - elseif (isset($vars['user_profile'])) { - $vars['user_profile'][$group->group_name] = $element[$group->group_name]; + $key = field_group_get_content_element_key($context); + if (isset($vars[$key])) { + $vars[$key][$group->group_name] = $element[$group->group_name]; } } } @@ -423,8 +422,10 @@ function field_group_build_entity_groups(&$vars, $context = 'view') { * The current element to analyse for grouping. * @param Array $vars * Rendering vars from the entity being viewed. + * @param Array $context + * The display context (entity type, form or view). */ -function field_group_fields_nest(&$element, &$vars = NULL) { +function field_group_fields_nest(&$element, &$vars = NULL, $context = NULL) { // Create all groups and keep a flat list of references to these groups. $group_references = array(); @@ -454,14 +455,11 @@ function field_group_fields_nest(&$element, &$vars = NULL) { // Entity being viewed if ($vars) { - // If not a group, check vars['content'] for empty field. - if (!isset($element['#fieldgroups'][$child_name]) && isset($vars['content'][$child_name])) { - $group_references[$parent_name][$child_name] = $vars['content'][$child_name]; - unset($vars['content'][$child_name]); - } - elseif (!isset($element['#fieldgroups'][$child_name]) && isset($vars['user_profile'][$child_name])) { - $group_references[$parent_name][$child_name] = $vars['user_profile'][$child_name]; - unset($vars['user_profile'][$child_name]); + // If not a group, check the content variable for empty field. + $key = field_group_get_content_element_key($context); + if (!isset($element['#fieldgroups'][$child_name]) && isset($vars[$key][$child_name])) { + $group_references[$parent_name][$child_name] = $vars[$key][$child_name]; + unset($vars[$key][$child_name]); } // If this is a group, we have to use a reference to keep the reference // list intact (but if it is a field we don't mind). @@ -531,16 +529,46 @@ function field_group_pre_render(& $element, $group, & $rendering_object) { } +/** + * Provides the content element key for a display context. + * + * This allows entity modules to specify their content element for field group + * support, or other modules to add entity module support. + * + * @param $context + * The display context (entity type, form or view). + */ +function field_group_get_content_element_key($context = 'default') { + $keys = &drupal_static('field_group_content_elements'); + if (!isset($keys)) { + $keys['default'] = 'content'; + // Allow other modules to alter the array. + Drupal::moduleHandler()->alter('field_group_content_element_keys', $keys); + } + + // Check if we have a specific content element key for this entity type. + $key = $keys['default']; + if (isset($keys[$context])) { + $key = $keys[$context]; + } + return $key; +} + + /** * Saves a group definition. - * This function is called by ctools export when calls are made - * through ctools_export_crud_save(). * - * @param $group + * This function is called by ctools export when calls are made through + * ctools_export_crud_save(). It's also used as an api method to add groups to a + * display. + * + * @param \stdClass $group * A group definition. - * @param $display + * @param \Drupal\Core\Entity\Display\EntityDisplayInterface $display * The display to update if known. - * @return EntityDisplayInterface || NULL + * + * @return \Drupal\Core\Entity\Display\EntityDisplayInterface|NULL + * The updated entity display. */ function field_group_group_save($group, $display = NULL) { if ($display === NULL) { @@ -554,7 +582,6 @@ function field_group_group_save($group, $display = NULL) { // If no display was found. It doesn't exist yet, create it. if (!isset($display)) { - if ($group->context == 'form') { $display = EntityFormDisplay::create(array( 'targetEntityType' => $group->entity_type, @@ -572,9 +599,6 @@ function field_group_group_save($group, $display = NULL) { } - /** - * @var $display \Drupal\Core\Entity\Display\EntityDisplayInterface - */ if (isset($display)) { $data = (array) $group; unset($data['group_name'], $data['entity_type'], $data['bundle'], $data['mode'], $data['form'], $data['context']); @@ -638,7 +662,7 @@ function field_group_info_groups($entity_type, $bundle, $context, $mode) { $data = $display->getThirdPartySettings('field_group'); } $groups = array(); - if (isset($data)) { + if (isset($data) && is_array($data)) { foreach ($data as $group_name => $definition) { $definition += array( 'group_name' => $group_name, diff --git a/web/modules/field_group/formatters/html_element/html-element.js b/web/modules/field_group/formatters/html_element/html-element.js index 070606744d..d1f1922a92 100644 --- a/web/modules/field_group/formatters/html_element/html-element.js +++ b/web/modules/field_group/formatters/html_element/html-element.js @@ -31,7 +31,6 @@ // Turn the legend into a clickable link, but retain span.field-group-format-toggler // for CSS positioning. - var $toggler = $('.field-group-toggler:first', $wrapper); var $link = $('<a class="field-group-title" href="#"></a>'); $link.prepend($toggler.contents()); diff --git a/web/modules/field_group/includes/helpers.inc b/web/modules/field_group/includes/helpers.inc index 7d3b1b7c71..a6735f094d 100644 --- a/web/modules/field_group/includes/helpers.inc +++ b/web/modules/field_group/includes/helpers.inc @@ -46,7 +46,7 @@ function field_group_validate_css_class($element, FormStateInterface $form_state $form_state_values = $form_state->getValues(); $plugin_name = $form_state->get('plugin_settings_edit'); if (!empty($form_state_values['fields'][$plugin_name]['settings_edit_form']['settings']['classes']) && !preg_match('!^[A-Za-z0-9-_ ]+$!', $form_state_values['fields'][$plugin_name]['settings_edit_form']['settings']['classes'])) { - Drupal::formBuilder()->setError($element, $form_state, t('The css class must include only letters, numbers, underscores and dashes.')); + $form_state->setError($element, $form_state, t('The css class must include only letters, numbers, underscores and dashes.')); } } diff --git a/web/modules/field_group/src/Element/HtmlElement.php b/web/modules/field_group/src/Element/HtmlElement.php index 43f34ab5d1..e58d6e1150 100644 --- a/web/modules/field_group/src/Element/HtmlElement.php +++ b/web/modules/field_group/src/Element/HtmlElement.php @@ -44,8 +44,10 @@ public static function processHtmlElement(&$element, FormStateInterface $form_st if (!empty($element['#effect']) && $element['#effect'] !== 'none') { $element['#attached']['library'][] = 'field_group/formatter.html_element'; + $element['#attached']['library'][] = 'field_group/core'; // Add the required classes for the js. + $element['#attributes']['class'][] = 'field-group-html-element'; $element['#attributes']['class'][] = 'fieldgroup-collapsible'; $element['#attributes']['class'][] = 'effect-' . $element['#effect']; if (!empty($element['#speed'])) { diff --git a/web/modules/field_group/src/Plugin/field_group/FieldGroupFormatter/Fieldset.php b/web/modules/field_group/src/Plugin/field_group/FieldGroupFormatter/Fieldset.php index f31e9c8df9..ecbf217dac 100644 --- a/web/modules/field_group/src/Plugin/field_group/FieldGroupFormatter/Fieldset.php +++ b/web/modules/field_group/src/Plugin/field_group/FieldGroupFormatter/Fieldset.php @@ -36,6 +36,12 @@ public function preRender(&$element, $rendering_object) { $element += array( '#description' => $this->getSetting('description'), ); + + // When a fieldset has a description, an id is required. + if (!$this->getSetting('id')) { + $element['#id'] = Html::getId($this->group->group_name); + } + } if ($this->getSetting('id')) { diff --git a/web/modules/field_group/src/Plugin/field_group/FieldGroupFormatter/HtmlElement.php b/web/modules/field_group/src/Plugin/field_group/FieldGroupFormatter/HtmlElement.php index bd87df1cd0..41f2d7e4e3 100644 --- a/web/modules/field_group/src/Plugin/field_group/FieldGroupFormatter/HtmlElement.php +++ b/web/modules/field_group/src/Plugin/field_group/FieldGroupFormatter/HtmlElement.php @@ -75,6 +75,7 @@ public function preRender(&$element, $rendering_object) { \Drupal\field_group\Element\HtmlElement::processHtmlElement($element, $form_state); if ($this->getSetting('required_fields')) { + $element['#attributes']['class'][] = 'field-group-html-element'; $element['#attached']['library'][] = 'field_group/formatter.html_element'; $element['#attached']['library'][] = 'field_group/core'; } diff --git a/web/modules/field_group/src/Tests/ManageDisplayTest.php b/web/modules/field_group/src/Tests/ManageDisplayTest.php deleted file mode 100644 index 8e6155cde6..0000000000 --- a/web/modules/field_group/src/Tests/ManageDisplayTest.php +++ /dev/null @@ -1,148 +0,0 @@ -<?php - -namespace Drupal\field_group\Tests; - -use Drupal\Component\Utility\Unicode; -use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\simpletest\WebTestBase; - -/** - * Tests for managing display of entities. - * - * @group field_group - */ -class ManageDisplayTest extends WebTestBase { - - use FieldGroupTestTrait; - - /** - * Modules to enable. - * - * @var array - */ - public static $modules = array('node', 'field_ui', 'field_group'); - - function setUp() { - - parent::setUp(); - - // Create test user. - $admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'bypass node access')); - $this->drupalLogin($admin_user); - - // Create content type, with underscores. - $type_name = Unicode::strtolower($this->randomMachineName(8)) . '_test'; - $type = $this->drupalCreateContentType(array('name' => $type_name, 'type' => $type_name)); - $this->type = $type->id(); - - } - - /** - * Test the creation a group on the article content type. - */ - function testCreateGroup() { - - // Create random group name. - $this->group_label = $this->randomString(8); - $this->group_name_input = Unicode::strtolower($this->randomMachineName()); - $this->group_name = 'group_' . $this->group_name_input; - $this->group_formatter = 'details'; - - // Setup new group. - $group = array( - 'group_formatter' => $this->group_formatter, - 'label' => $this->group_label, - ); - - $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/form-display/add-group', $group, t('Save and continue')); - $this->assertText('Machine-readable name field is required.'); - - // Setup new group. - $group = array( - 'group_formatter' => $this->group_formatter, - 'label' => $this->group_label, - 'group_name' => $this->group_name_input, - ); - - // Add new group on the 'Manage form display' page. - $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/form-display/add-group', $group, t('Save and continue')); - $this->drupalPostForm(NULL, [], t('Create group')); - - $this->assertRaw(t('New group %label successfully created.', array('%label' => $this->group_label)), t('Group message displayed on screen.')); - - // Test if group is in the $groups array. - $this->group = field_group_load_field_group($this->group_name, 'node', $this->type, 'form', 'default'); - $this->assertNotNull($this->group, t('Group was loaded')); - - // Add new group on the 'Manage display' page. - $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/display/add-group', $group, t('Save and continue')); - $this->drupalPostForm(NULL, [], t('Create group')); - - $this->assertRaw(t('New group %label successfully created.', array('%label' => $this->group_label)), t('Group message displayed on screen.')); - - // Test if group is in the $groups array. - $loaded_group = field_group_load_field_group($this->group_name, 'node', $this->type, 'view', 'default'); - $this->assertNotNull($loaded_group, t('Group was loaded')); - } - - /** - * Delete a group. - */ - function testDeleteGroup() { - - $data = array( - 'format_type' => 'fieldset', - 'label' => 'testing', - ); - - $group = $this->createGroup('node', $this->type, 'form', 'default', $data); - - $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/form-display/' . $group->group_name . '/delete', array(), t('Delete')); - $this->assertRaw(t('The group %label has been deleted from the %type content type.', array('%label' => $group->label, '%type' => $this->type)), t('Group removal message displayed on screen.')); - - $display = EntityFormDisplay::load($group->entity_type . '.' . $group->bundle . '.' . $group->mode); - $data = $display->getThirdPartySettings('field_group'); - - // Test that group is not in the $groups array. - \Drupal::entityTypeManager()->getStorage('entity_form_display')->resetCache(); - $loaded_group = field_group_load_field_group($group->group_name, 'node', $this->type, 'form', 'default'); - $this->assertNull($loaded_group, t('Group not found after deleting')); - - $data = array( - 'format_type' => 'fieldset', - 'label' => 'testing', - ); - - $group = $this->createGroup('node', $this->type, 'view', 'default', $data); - - $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/display/' . $group->group_name . '/delete', array(), t('Delete')); - $this->assertRaw(t('The group %label has been deleted from the %type content type.', array('%label' => $group->label, '%type' => $this->type)), t('Group removal message displayed on screen.')); - - // Test that group is not in the $groups array. - \Drupal::entityTypeManager()->getStorage('entity_view_display')->resetCache(); - $loaded_group = field_group_load_field_group($group->group_name, 'node', $this->type, 'view', 'default'); - $this->assertNull($loaded_group, t('Group not found after deleting')); - } - - /** - * Nest a field underneath a group. - */ - function testNestField() { - - $data = array( - 'format_type' => 'fieldset', - ); - - $group = $this->createGroup('node', $this->type, 'form', 'default', $data); - - $edit = array( - 'fields[body][parent]' => $group->group_name, - ); - $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/form-display', $edit, t('Save')); - $this->assertRaw(t('Your settings have been saved.'), t('Settings saved')); - - $group = field_group_load_field_group($group->group_name, 'node', $this->type, 'form', 'default'); - $this->assertTrue(in_array('body', $group->children), t('Body is a child of %group', array('%group' => $group->group_name))); - } - -} diff --git a/web/modules/field_group/tests/modules/field_group_test/field_group_test.info.yml b/web/modules/field_group/tests/modules/field_group_test/field_group_test.info.yml index 598fab34ed..4113863e66 100644 --- a/web/modules/field_group/tests/modules/field_group_test/field_group_test.info.yml +++ b/web/modules/field_group/tests/modules/field_group_test/field_group_test.info.yml @@ -4,8 +4,8 @@ description: 'Test module for Field Group' package: 'Fields' type: module hidden: TRUE -# Information added by Drupal.org packaging script on 2016-11-28 -version: '8.x-1.0-rc6' +# Information added by Drupal.org packaging script on 2017-11-10 +version: '8.x-1.0' core: '8.x' project: 'field_group' -datestamp: 1480365490 +datestamp: 1510352889 diff --git a/web/modules/field_group/src/Tests/EntityDisplayTest.php b/web/modules/field_group/tests/src/Functional/EntityDisplayTest.php similarity index 79% rename from web/modules/field_group/src/Tests/EntityDisplayTest.php rename to web/modules/field_group/tests/src/Functional/EntityDisplayTest.php index 0bd204ff0e..5fc5da9ef1 100644 --- a/web/modules/field_group/src/Tests/EntityDisplayTest.php +++ b/web/modules/field_group/tests/src/Functional/EntityDisplayTest.php @@ -1,48 +1,76 @@ <?php -namespace Drupal\field_group\Tests; +namespace Drupal\Tests\field_group\Functional; use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig; -use Drupal\simpletest\WebTestBase; +use Drupal\Tests\BrowserTestBase; /** * Tests for displaying entities. * * @group field_group */ -class EntityDisplayTest extends WebTestBase { +class EntityDisplayTest extends BrowserTestBase { use FieldGroupTestTrait; /** - * Modules to enable. + * {@inheritdoc} + */ + public static $modules = [ + 'node', + 'field_test', + 'field_ui', + 'field_group', + 'field_group_test', + ]; + + /** + * The node type id. * - * @var array + * @var string */ - public static $modules = array('node', 'field_test', 'field_ui', 'field_group', 'field_group_test'); + protected $type; - function setUp() { + /** + * A node to use for testing. + * + * @var \Drupal\node\NodeInterface + */ + protected $node; + /** + * {@inheritdoc} + */ + public function setUp() { parent::setUp(); // Create test user. - $admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'bypass node access')); + $admin_user = $this->drupalCreateUser([ + 'access content', + 'administer content types', + 'administer node fields', + 'administer node form display', + 'administer node display', + 'bypass node access' + ]); $this->drupalLogin($admin_user); // Create content type, with underscores. $type_name = strtolower($this->randomMachineName(8)) . '_test'; $type = $this->drupalCreateContentType(array('name' => $type_name, 'type' => $type_name)); $this->type = $type->id(); - $display = entity_get_display('node', $type_name, 'default'); + /** @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display */ + $display = \Drupal::entityTypeManager() + ->getStorage('entity_view_display') + ->load('node' . '.' . $type_name . '.' . 'default'); // Create a node. $node_values = array('type' => $type_name); // Create test fields. - $test_fields = array('field_test', 'field_test_2', 'field_no_access'); - foreach ($test_fields as $field_name) { - + foreach (['field_test', 'field_test_2', 'field_no_access'] as $field_name) { $field_storage = FieldStorageConfig::create([ 'field_name' => $field_name, 'entity_type' => 'node', @@ -74,15 +102,12 @@ function setUp() { // Save display + create node. $display->save(); $this->node = $this->drupalCreateNode($node_values); - } /** - * Test if an fieldgroup that only contains fields - * that has no access is not shown. + * Test field access for field groups. */ - function testFieldAccess() { - + public function testFieldAccess() { $data = array( 'label' => 'Wrapper', 'children' => array( @@ -105,8 +130,7 @@ function testFieldAccess() { /** * Test the html element formatter. */ - function testHtmlElement() { - + public function testHtmlElement() { $data = array( 'weight' => '1', 'children' => array( @@ -128,11 +152,11 @@ function testHtmlElement() { $this->drupalGet('node/' . $this->node->id()); // Test group ids and classes. - $this->assertFieldByXPath("//div[contains(@id, 'wrapper-id')]", NULL, t('Wrapper id set on wrapper div')); - $this->assertFieldByXPath("//div[contains(@class, 'test-class')]", NULL, t('Test class set on wrapper div') . 'class="' . $group->group_name . ' test-class'); + $this->assertFieldByXPath("//div[contains(@id, 'wrapper-id')]", NULL, 'Wrapper id set on wrapper div'); + $this->assertFieldByXPath("//div[contains(@class, 'test-class')]", NULL, 'Test class set on wrapper div, class="' . $group->group_name . ' test-class'); // Test group label. - $this->assertNoRaw('<h3><span>' . $data['label'] . '</span></h3>', t('Label is not shown')); + $this->assertNoRaw('<h3><span>' . $data['label'] . '</span></h3>'); // Set show label to true. $group->format_settings['show_label'] = TRUE; @@ -140,7 +164,7 @@ function testHtmlElement() { field_group_group_save($group); $this->drupalGet('node/' . $this->node->id()); - $this->assertRaw('<h3>' . $data['label'] . '</h3>', t('Label is shown')); + $this->assertRaw('<h3>' . $data['label'] . '</h3>'); // Change to collapsible with blink effect. $group->format_settings['effect'] = 'blink'; @@ -148,15 +172,14 @@ function testHtmlElement() { field_group_group_save($group); $this->drupalGet('node/' . $this->node->id()); - $this->assertFieldByXPath("//div[contains(@class, 'speed-fast')]", NULL, t('Speed class is set')); - $this->assertFieldByXPath("//div[contains(@class, 'effect-blink')]", NULL, t('Effect class is set')); + $this->assertFieldByXPath("//div[contains(@class, 'speed-fast')]", NULL, 'Speed class is set'); + $this->assertFieldByXPath("//div[contains(@class, 'effect-blink')]", NULL, 'Effect class is set'); } /** * Test the fieldset formatter. */ - function testFieldset() { - + public function testFieldset() { $data = array( 'weight' => '1', 'children' => array( @@ -171,21 +194,19 @@ function testFieldset() { 'description' => 'test description', ), ); - $group = $this->createGroup('node', $this->type, 'view', 'default', $data); + $this->createGroup('node', $this->type, 'view', 'default', $data); $this->drupalGet('node/' . $this->node->id()); // Test group ids and classes. - $this->assertFieldByXPath("//fieldset[contains(@id, 'fieldset-id')]", NULL, t('Correct id set on the fieldset')); - $this->assertFieldByXPath("//fieldset[contains(@class, 'test-class')]", NULL, t('Test class set on the fieldset')); - + $this->assertFieldByXPath("//fieldset[contains(@id, 'fieldset-id')]", NULL, 'Correct id set on the fieldset'); + $this->assertFieldByXPath("//fieldset[contains(@class, 'test-class')]", NULL, 'Test class set on the fieldset'); } /** * Test the tabs formatter. */ - function testTabs() { - + public function testTabs() { $data = array( 'label' => 'Tab 1', 'weight' => '1', @@ -237,9 +258,9 @@ function testTabs() { $this->drupalGet('node/' . $this->node->id()); // Test properties. - $this->assertFieldByXPath("//div[contains(@class, 'test-class-wrapper')]", NULL, t('Test class set on tabs wrapper')); - $this->assertFieldByXPath("//details[contains(@class, 'test-class-2')]", NULL, t('Test class set on second tab')); - $this->assertRaw('<div class="details-description">description of second tab</div>', t('Description of tab is shown')); + $this->assertFieldByXPath("//div[contains(@class, 'test-class-wrapper')]", NULL, 'Test class set on tabs wrapper'); + $this->assertFieldByXPath("//details[contains(@class, 'test-class-2')]", NULL, 'Test class set on second tab'); + $this->assertRaw('<div class="details-description">description of second tab</div>'); // Test if correctly nested. $this->assertFieldByXPath("//div[contains(@class, 'test-class-wrapper')]//details[contains(@class, 'test-class')]", NULL, 'First tab is displayed as child of the wrapper.'); @@ -256,14 +277,12 @@ function testTabs() { // Test if it's a horizontal tab. $this->assertFieldByXPath('//div[@data-horizontal-tabs-panes=""]', NULL, 'Tabs are shown horizontal.'); - } /** * Test the accordion formatter. */ - function testAccordion() { - + public function testAccordion() { $data = array( 'label' => 'Accordion item 1', 'weight' => '1', @@ -278,7 +297,6 @@ function testAccordion() { ), ); $first_item = $this->createGroup('node', $this->type, 'view', 'default', $data); - $first_item_id = 'node_article_full_' . $first_item->group_name; $data = array( 'label' => 'Accordion item 2', @@ -294,7 +312,6 @@ function testAccordion() { ), ); $second_item = $this->createGroup('node', $this->type, 'view', 'default', $data); - $second_item_id = 'node_article_full_' . $second_item->group_name; $data = array( 'label' => 'Accordion', @@ -310,16 +327,16 @@ function testAccordion() { 'effect' => 'bounceslide' ), ); - $accordion = $this->createGroup('node', $this->type, 'view', 'default', $data); + $this->createGroup('node', $this->type, 'view', 'default', $data); $this->drupalGet('node/' . $this->node->id()); // Test properties. - $this->assertFieldByXPath("//div[contains(@class, 'test-class-wrapper')]", NULL, t('Test class set on tabs wrapper')); - $this->assertFieldByXPath("//div[contains(@class, 'effect-bounceslide')]", NULL, t('Correct effect is set on the accordion')); - $this->assertFieldByXPath("//div[contains(@class, 'test-class')]", NULL, t('Accordion item with test-class is shown')); - $this->assertFieldByXPath("//div[contains(@class, 'test-class-2')]", NULL, t('Accordion item with test-class-2 is shown')); - $this->assertFieldByXPath("//h3[contains(@class, 'field-group-accordion-active')]", NULL, t('Accordion item 2 was set active')); + $this->assertFieldByXPath("//div[contains(@class, 'test-class-wrapper')]", NULL, 'Test class set on tabs wrapper'); + $this->assertFieldByXPath("//div[contains(@class, 'effect-bounceslide')]", NULL, 'Correct effect is set on the accordion'); + $this->assertFieldByXPath("//div[contains(@class, 'test-class')]", NULL, 'Accordion item with test-class is shown'); + $this->assertFieldByXPath("//div[contains(@class, 'test-class-2')]", NULL, 'Accordion item with test-class-2 is shown'); + $this->assertFieldByXPath("//h3[contains(@class, 'field-group-accordion-active')]", NULL, 'Accordion item 2 was set active'); // Test if correctly nested $this->assertFieldByXPath("//div[contains(@class, 'test-class-wrapper')]//div[contains(@class, 'test-class')]", NULL, 'First item is displayed as child of the wrapper.'); diff --git a/web/modules/field_group/src/Tests/FieldGroupTestTrait.php b/web/modules/field_group/tests/src/Functional/FieldGroupTestTrait.php similarity index 70% rename from web/modules/field_group/src/Tests/FieldGroupTestTrait.php rename to web/modules/field_group/tests/src/Functional/FieldGroupTestTrait.php index 7feb156618..c622a10be2 100644 --- a/web/modules/field_group/src/Tests/FieldGroupTestTrait.php +++ b/web/modules/field_group/tests/src/Functional/FieldGroupTestTrait.php @@ -1,6 +1,6 @@ <?php -namespace Drupal\field_group\Tests; +namespace Drupal\Tests\field_group\Functional; use Drupal\Component\Utility\Unicode; @@ -11,10 +11,22 @@ trait FieldGroupTestTrait { /** * Create a new group. + * + * @param string $entity_type + * The entity type as string. + * @param string $bundle + * The bundle of the enity type + * @param string $context + * The context for the group. + * @param string $mode + * The view/form mode. * @param array $data * Data for the field group. + * + * @return \stdClass + * An object that represents the field group. */ - function createGroup($entity_type, $bundle, $context, $mode, array $data) { + protected function createGroup($entity_type, $bundle, $context, $mode, array $data) { if (!isset($data['format_settings'])) { $data['format_settings'] = array(); @@ -36,6 +48,7 @@ function createGroup($entity_type, $bundle, $context, $mode, array $data) { 'label' => isset($data['label']) ? $data['label'] : $this->randomString(8), 'format_type' => $data['format_type'], 'format_settings' => $data['format_settings'], + 'region' => 'content', ); field_group_group_save($field_group); diff --git a/web/modules/field_group/src/Tests/FieldGroupWithoutFieldUiTest.php b/web/modules/field_group/tests/src/Functional/FieldGroupWithoutFieldUiTest.php similarity index 56% rename from web/modules/field_group/src/Tests/FieldGroupWithoutFieldUiTest.php rename to web/modules/field_group/tests/src/Functional/FieldGroupWithoutFieldUiTest.php index f9bd3b1fff..2beae972bf 100644 --- a/web/modules/field_group/src/Tests/FieldGroupWithoutFieldUiTest.php +++ b/web/modules/field_group/tests/src/Functional/FieldGroupWithoutFieldUiTest.php @@ -1,19 +1,25 @@ <?php -namespace Drupal\field_group\Tests; +namespace Drupal\Tests\field_group\Functional; use Drupal\Core\Url; -use Drupal\simpletest\WebTestBase; +use Drupal\Tests\BrowserTestBase; /** * Test field_group without field_ui. * * @group field_group */ -class FieldGroupWithoutFieldUiTest extends WebTestBase { +class FieldGroupWithoutFieldUiTest extends BrowserTestBase { - protected static $modules = ['field_group', 'block']; + /** + * {@inheritdoc} + */ + public static $modules = ['field_group', 'block']; + /** + * Test that local actions show up without field ui enabled. + */ public function testLocalActions() { // Local actions of field_group should not depend on field_ui // @see https://www.drupal.org/node/2719569 diff --git a/web/modules/field_group/tests/src/Functional/ManageDisplayTest.php b/web/modules/field_group/tests/src/Functional/ManageDisplayTest.php new file mode 100644 index 0000000000..e89ee4600f --- /dev/null +++ b/web/modules/field_group/tests/src/Functional/ManageDisplayTest.php @@ -0,0 +1,158 @@ +<?php + +namespace Drupal\Tests\field_group\Functional; + +use Drupal\Component\Utility\Unicode; +use Drupal\Tests\BrowserTestBase; + +/** + * Tests for managing display of entities. + * + * @group field_group + */ +class ManageDisplayTest extends BrowserTestBase { + + use FieldGroupTestTrait; + + /** + * {@inheritdoc} + */ + public static $modules = array('node', 'field_ui', 'field_group'); + + /** + * Content type id. + * + * @var string + */ + protected $type; + + protected $strictConfigSchema = FALSE; + + /** + * {@inheritdoc} + */ + public function setUp() { + parent::setUp(); + + // Create test user. + $admin_user = $this->drupalCreateUser([ + 'access content', + 'administer content types', + 'administer node fields', + 'administer node form display', + 'administer node display', + 'bypass node access', + ]); + $this->drupalLogin($admin_user); + + // Create content type, with underscores. + $type_name = 'll4ma_test'; + $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]); + $this->type = $type->id(); + + } + + /** + * Test the creation a group on the article content type. + */ + public function testCreateGroup() { + // Create random group name. + $group_label = $this->randomString(8); + $group_name_input = Unicode::strtolower($this->randomMachineName()); + $group_name = 'group_' . $group_name_input; + $group_formatter = 'details'; + + // Setup new group. + $group = array( + 'group_formatter' => $group_formatter, + 'label' => $group_label, + ); + + $add_form_display = 'admin/structure/types/manage/' . $this->type . '/form-display/add-group'; + $this->drupalPostForm($add_form_display, $group, 'Save and continue'); + $this->assertSession()->pageTextContains('Machine-readable name field is required.'); + + // Add required field to form. + $group['group_name'] = $group_name_input; + + // Add new group on the 'Manage form display' page. + $this->drupalPostForm($add_form_display, $group, 'Save and continue'); + $this->drupalPostForm(NULL, [], 'Create group'); + + $this->assertSession()->responseContains(t('New group %label successfully created.', array('%label' => $group_label))); + + // Test if group is in the $groups array. + $this->group = field_group_load_field_group($group_name, 'node', $this->type, 'form', 'default'); + $this->assertNotNull($group, 'Group was loaded'); + + // Add new group on the 'Manage display' page. + $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/display/add-group', $group, 'Save and continue'); + $this->drupalPostForm(NULL, [], 'Create group'); + + $this->assertSession()->responseContains(t('New group %label successfully created.', array('%label' => $group_label))); + + // Test if group is in the $groups array. + $loaded_group = field_group_load_field_group($group_name, 'node', $this->type, 'view', 'default'); + $this->assertNotNull($loaded_group, 'Group was loaded'); + } + + /** + * Delete a group. + */ + public function testDeleteGroup() { + $data = array( + 'format_type' => 'fieldset', + 'label' => 'testing', + ); + + $group = $this->createGroup('node', $this->type, 'form', 'default', $data); + + $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/form-display/' . $group->group_name . '/delete', array(), 'Delete'); + $this->assertSession()->responseContains(t('The group %label has been deleted from the %type content type.', array('%label' => $group->label, '%type' => $this->type))); + + // Test that group is not in the $groups array. + \Drupal::entityTypeManager() + ->getStorage('entity_form_display') + ->resetCache(); + $loaded_group = field_group_load_field_group($group->group_name, 'node', $this->type, 'form', 'default'); + $this->assertNull($loaded_group, 'Group not found after deleting'); + + $data = array( + 'format_type' => 'fieldset', + 'label' => 'testing', + ); + + $group = $this->createGroup('node', $this->type, 'view', 'default', $data); + + $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/display/' . $group->group_name . '/delete', array(), t('Delete')); + $this->assertRaw(t('The group %label has been deleted from the %type content type.', array('%label' => $group->label, '%type' => $this->type))); + + // Test that group is not in the $groups array. + \Drupal::entityTypeManager() + ->getStorage('entity_view_display') + ->resetCache(); + $loaded_group = field_group_load_field_group($group->group_name, 'node', $this->type, 'view', 'default'); + $this->assertNull($loaded_group, 'Group not found after deleting'); + } + + /** + * Nest a field underneath a group. + */ + public function testNestField() { + $data = array( + 'format_type' => 'fieldset', + ); + + $group = $this->createGroup('node', $this->type, 'form', 'default', $data); + + $edit = array( + 'fields[body][parent]' => $group->group_name, + ); + $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/form-display', $edit, 'Save'); + $this->assertRaw('Your settings have been saved.'); + + $group = field_group_load_field_group($group->group_name, 'node', $this->type, 'form', 'default'); + $this->assertTrue(in_array('body', $group->children), t('Body is a child of %group', array('%group' => $group->group_name))); + } + +} diff --git a/web/modules/field_group/tests/src/FunctionalJavascript/FieldGroupUiTest.php b/web/modules/field_group/tests/src/FunctionalJavascript/FieldGroupUiTest.php index 13d7e620ee..75d74ea834 100644 --- a/web/modules/field_group/tests/src/FunctionalJavascript/FieldGroupUiTest.php +++ b/web/modules/field_group/tests/src/FunctionalJavascript/FieldGroupUiTest.php @@ -3,11 +3,10 @@ namespace Drupal\Tests\field_group\FunctionalJavascript; use Drupal\Component\Utility\Unicode; -use Drupal\Core\Entity\Display\EntityFormDisplayInterface; use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\field_group\Tests\FieldGroupTestTrait; use Drupal\FunctionalJavascriptTests\JavascriptTestBase; use Drupal\node\Entity\NodeType; +use Drupal\Tests\field_group\Functional\FieldGroupTestTrait; /** * Test field_group user interface. @@ -34,7 +33,14 @@ public function setUp() { parent::setUp(); // Create test user. - $admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'bypass node access')); + $admin_user = $this->drupalCreateUser([ + 'access content', + 'administer content types', + 'administer node fields', + 'administer node form display', + 'administer node display', + 'bypass node access', + ]); $this->drupalLogin($admin_user); // Create content type, with underscores. @@ -47,6 +53,9 @@ public function setUp() { $this->nodeType = $type->id(); } + /** + * Test creation and editing trough the UI. + */ public function testCreateAndEdit() { foreach (['test_1', 'test_2'] as $name) { $group = array( @@ -56,8 +65,8 @@ public function testCreateAndEdit() { ); // Add new group on the 'Manage form display' page. - $this->drupalPostForm('admin/structure/types/manage/' . $this->nodeType . '/form-display/add-group', $group, t('Save and continue')); - $this->drupalPostForm(NULL, [], t('Create group')); + $this->drupalPostForm('admin/structure/types/manage/' . $this->nodeType . '/form-display/add-group', $group, 'Save and continue'); + $this->drupalPostForm(NULL, [], 'Create group'); } // Update title in group 1 @@ -84,7 +93,7 @@ public function testCreateAndEdit() { $page->pressButton('Save'); - /** @var EntityFormDisplayInterface $display */ + /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $display */ $display = EntityFormDisplay::load("node.{$this->nodeType}.default"); $this->assertSame('Test 1 - Update', $display->getThirdPartySetting('field_group', 'group_test_1')['label']); $this->assertSame('Test 1 - Update', $display->getThirdPartySetting('field_group', 'group_test_1')['format_settings']['label']); -- GitLab