Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / language / tests / src / Functional / Update / LanguageSelectWidgetUpdateTest.php
diff --git a/web/core/modules/language/tests/src/Functional/Update/LanguageSelectWidgetUpdateTest.php b/web/core/modules/language/tests/src/Functional/Update/LanguageSelectWidgetUpdateTest.php
new file mode 100644 (file)
index 0000000..afc8464
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+namespace Drupal\Tests\language\Functional\Update;
+
+use Drupal\Core\Entity\Entity\EntityFormDisplay;
+use Drupal\FunctionalTests\Update\UpdatePathTestBase;
+
+/**
+ * Tests the update path for the language_select widget.
+ *
+ * @group Update
+ */
+class LanguageSelectWidgetUpdateTest extends UpdatePathTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setDatabaseDumpFiles() {
+    $this->databaseDumpFiles = [
+      __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz',
+    ];
+  }
+
+  /**
+   * Tests language_post_update_language_select_widget().
+   */
+  public function testLanguagePostUpdateLanguageSelectWidget() {
+    // Tests before the update.
+    $content_before = EntityFormDisplay::load('node.page.default')->get('content');
+    $this->assertEqual([], $content_before['langcode']['settings']);
+
+    // Run the update.
+    $this->runUpdates();
+
+    // Tests after the update.
+    $content_after = EntityFormDisplay::load('node.page.default')->get('content');
+    $this->assertEqual(['include_locked' => TRUE], $content_after['langcode']['settings']);
+  }
+
+}