dc3324ced931eb5dd7ac84a9b0f1fde5bac49944
[yaffs-website] / web / core / modules / language / tests / src / Functional / Update / LanguageSelectWidgetUpdateTest.php
1 <?php
2
3 namespace Drupal\Tests\language\Functional\Update;
4
5 use Drupal\Core\Entity\Entity\EntityFormDisplay;
6 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
7
8 /**
9  * Tests the update path for the language_select widget.
10  *
11  * @group Update
12  * @group legacy
13  */
14 class LanguageSelectWidgetUpdateTest extends UpdatePathTestBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   protected function setDatabaseDumpFiles() {
20     $this->databaseDumpFiles = [
21       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz',
22     ];
23   }
24
25   /**
26    * Tests language_post_update_language_select_widget().
27    */
28   public function testLanguagePostUpdateLanguageSelectWidget() {
29     // Tests before the update.
30     $content_before = EntityFormDisplay::load('node.page.default')->get('content');
31     $this->assertEqual([], $content_before['langcode']['settings']);
32
33     // Run the update.
34     $this->runUpdates();
35
36     // Tests after the update.
37     $content_after = EntityFormDisplay::load('node.page.default')->get('content');
38     $this->assertEqual(['include_locked' => TRUE], $content_after['langcode']['settings']);
39   }
40
41 }