Pull merge.
[yaffs-website] / web / core / modules / block / tests / src / Kernel / Migrate / d7 / MigrateBlockContentTranslationTest.php
1 <?php
2
3 namespace Drupal\Tests\block\Kernel\Migrate\d7;
4
5 use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
6
7 /**
8  * Tests migration of i18n block translations.
9  *
10  * @group migrate_drupal_7
11  */
12 class MigrateBlockContentTranslationTest extends MigrateDrupal7TestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   public static $modules = [
18     'node',
19     'text',
20     'aggregator',
21     'book',
22     'block',
23     'comment',
24     'forum',
25     'views',
26     'block_content',
27     'config_translation',
28     'content_translation',
29     'language',
30     'statistics',
31     'taxonomy',
32     // Required for translation migrations.
33     'migrate_drupal_multilingual',
34   ];
35
36   /**
37    * {@inheritdoc}
38    */
39   protected function setUp() {
40     parent::setUp();
41     $this->installConfig(['block']);
42     $this->installConfig(['block_content']);
43     $this->installEntitySchema('block_content');
44
45     $this->executeMigrations([
46       'language',
47       'd7_filter_format',
48       'block_content_type',
49       'block_content_body_field',
50       'd7_custom_block',
51       'd7_user_role',
52       'd7_block',
53       'd7_block_translation',
54     ]);
55     block_rebuild();
56   }
57
58   /**
59    * Tests the migration of block title translation.
60    */
61   public function testBlockContentTranslation() {
62     /** @var \Drupal\language\ConfigurableLanguageManagerInterface $language_manager */
63     $language_manager = $this->container->get('language_manager');
64
65     $config = $language_manager->getLanguageConfigOverride('fr', 'block.block.bartik_user_login');
66     $this->assertSame('fr - User login title', $config->get('settings.label'));
67   }
68
69 }