summaryrefslogtreecommitdiffstats
path: root/core/modules/content_translation/tests/src/Kernel/Plugin/migrate/source/d6/BlockTranslationTest.php
blob: 4a0e893191b8697b1f022664d995b21b3d1c2d56 (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
61
62
63
64
65
66
67
68
69
70
71
72
<?php

namespace Drupal\Tests\content_translation\Kernel\Plugin\migrate\source\d6;

use Drupal\Tests\block\Kernel\Plugin\migrate\source\BlockTest;

/**
 * Tests i18n block source plugin.
 *
 * @covers \Drupal\content_translation\Plugin\migrate\source\d6\BlockTranslation
 *
 * @group content_translation
 */
class BlockTranslationTest extends BlockTest {

  /**
   * {@inheritdoc}
   */
  public static $modules = ['content_translation'];

  /**
   * {@inheritdoc}
   */
  public function providerSource() {
    // Test data is the same as BlockTest, but with the addition of i18n_blocks.
    $tests = parent::providerSource();

    // The source data.
    $tests[0]['source_data']['i18n_blocks'] = [
      [
        'ibid' => 1,
        'module' => 'block',
        'delta' => '1',
        'type' => 0,
        'language' => 'fr',
      ],
      [
        'ibid' => 2,
        'module' => 'block',
        'delta' => '2',
        'type' => 0,
        'language' => 'zu',
      ],
    ];

    // The expected results.
    $tests[0]['expected_data'] = [
      [
        'bid' => 1,
        'module' => 'block',
        'delta' => '1',
        'title' => 'Test Title 01',
        'ibid' => 1,
        'type' => '0',
        'language' => 'fr',
      ],
      [
        'bid' => 2,
        'module' => 'block',
        'delta' => '2',
        'theme' => 'garland',
        'title' => 'Test Title 02',
        'ibid' => 2,
        'type' => '0',
        'language' => 'zu',
      ],
    ];

    return $tests;
  }

}