summaryrefslogtreecommitdiffstats
path: root/core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateBlockContentTranslationTest.php
blob: 2612d928a87051d677d479b683f3eaf554b6da3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php

namespace Drupal\Tests\content_translation\Kernel\Migrate\d6;

use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;

/**
 * Tests migration of i18n block translations.
 *
 * @group migrate_drupal_6
 */
class MigrateBlockContentTranslationTest extends MigrateDrupal6TestBase {

  /**
   * {@inheritdoc}
   */
  public static $modules = [
    'aggregator',
    'book',
    'block',
    'comment',
    'forum',
    'views',
    'block_content',
    'content_translation',
    'language',
    'statistics',
    'taxonomy',
  ];

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();
    $this->installConfig(['block']);
    $this->installConfig(['block_content']);
    $this->installEntitySchema('block_content');

    $this->executeMigrations([
      'd6_filter_format',
      'block_content_type',
      'block_content_body_field',
      'd6_custom_block',
      'd6_user_role',
      'd6_block',
      'd6_block_translation',
    ]);
    block_rebuild();
  }

  /**
   * Tests the migration of block title translation.
   */
  public function testBlockContentTranslation() {
    $config = $this->container->get('language_manager')->getLanguageConfigOverride('zu', 'block.block.user_1');
    $this->assertSame('zu - Test Title 02', $config->get('settings.label'));
  }

}