4078782143baec2b27852c774878b6e358e3c8ec
[yaffs-website] / d6 / MigrateBlockContentTranslationTest.php
1 <?php
2
3 namespace Drupal\Tests\block\Kernel\Migrate\d6;
4
5 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
6
7 /**
8  * Tests migration of i18n block translations.
9  *
10  * @group migrate_drupal_6
11  */
12 class MigrateBlockContentTranslationTest extends MigrateDrupal6TestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   public static $modules = [
18     'aggregator',
19     'book',
20     'block',
21     'comment',
22     'forum',
23     'views',
24     'block_content',
25     'content_translation',
26     'language',
27     'statistics',
28     'taxonomy',
29     // Required for translation migrations.
30     'migrate_drupal_multilingual',
31   ];
32
33   /**
34    * {@inheritdoc}
35    */
36   protected function setUp() {
37     parent::setUp();
38     $this->installConfig(['block']);
39     $this->installConfig(['block_content']);
40     $this->installEntitySchema('block_content');
41
42     $this->executeMigrations([
43       'd6_filter_format',
44       'block_content_type',
45       'block_content_body_field',
46       'd6_custom_block',
47       'd6_user_role',
48       'd6_block',
49       'd6_block_translation',
50     ]);
51     block_rebuild();
52   }
53
54   /**
55    * Tests the migration of block title translation.
56    */
57   public function testBlockContentTranslation() {
58     /** @var \Drupal\language\ConfigurableLanguageManagerInterface $language_manager */
59     $language_manager = $this->container->get('language_manager');
60
61     $config = $language_manager->getLanguageConfigOverride('zu', 'block.block.user_1');
62     $this->assertSame('zu - Navigation', $config->get('settings.label'));
63   }
64
65 }