Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / field / tests / src / Functional / Update / EmailWidgetSizeSettingUpdateTest.php
1 <?php
2
3 namespace Drupal\Tests\field\Functional\Update;
4
5 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
6
7 /**
8  * Tests the update for the 'size' setting of the 'email_default' field widget.
9  *
10  * @group field
11  */
12 class EmailWidgetSizeSettingUpdateTest extends UpdatePathTestBase {
13
14   /**
15    * {@inheritdoc}
16    */
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',
21     ];
22   }
23
24   /**
25    * Tests field_post_update_email_widget_size_setting().
26    *
27    * @see field_post_update_email_widget_size_setting()
28    */
29   public function testFieldPostUpdateEmailWidgetSizeSetting() {
30     $configFactory = $this->container->get('config.factory');
31
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.');
38
39     // Run updates.
40     $this->runUpdates();
41
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.');
46   }
47
48 }