3 namespace Drupal\Tests\field\Functional\Update;
5 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
8 * Tests the update for the 'size' setting of the 'email_default' field widget.
12 class EmailWidgetSizeSettingUpdateTest extends UpdatePathTestBase {
17 protected function setDatabaseDumpFiles() {
18 $this->databaseDumpFiles = [
19 __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
20 __DIR__ . '/../../../fixtures/update/drupal-8.email_widget_size_setting-2578741.php',
25 * Tests field_post_update_email_widget_size_setting().
27 * @see field_post_update_email_widget_size_setting()
29 public function testFieldPostUpdateEmailWidgetSizeSetting() {
30 $configFactory = $this->container->get('config.factory');
32 // Load the 'node.article.default' entity form display and check that the
33 // widget for 'field_email_2578741' does not have a 'size' setting.
34 /** @var \Drupal\Core\Config\Config $config */
35 $config = $configFactory->get('core.entity_form_display.node.article.default');
36 $settings = $config->get('content.field_email_2578741.settings');
37 $this->assertTrue(!isset($settings['size']), 'The size setting does not exist prior to running the update functions.');
42 // Reload the config and check that the 'size' setting has been populated.
43 $config = $configFactory->get('core.entity_form_display.node.article.default');
44 $settings = $config->get('content.field_email_2578741.settings');
45 $this->assertEqual($settings['size'], 60, 'The size setting exists and it has the correct default value.');