445f32cec50e79d840988b46039bf5eead3c41f0
[yaffs-website] / web / core / modules / block / tests / src / Kernel / Plugin / migrate / source / d6 / BlockTranslationTest.php
1 <?php
2
3 namespace Drupal\Tests\block\Kernel\Plugin\migrate\source\d6;
4
5 use Drupal\Tests\block\Kernel\Plugin\migrate\source\BlockTest;
6
7 /**
8  * Tests i18n block source plugin.
9  *
10  * @covers \Drupal\block\Plugin\migrate\source\d6\BlockTranslation
11  *
12  * @group content_translation
13  */
14 class BlockTranslationTest extends BlockTest {
15
16   /**
17    * {@inheritdoc}
18    */
19   public static $modules = ['block'];
20
21   /**
22    * {@inheritdoc}
23    */
24   public function providerSource() {
25     // Test data is the same as BlockTest, but with the addition of i18n_blocks.
26     $tests = parent::providerSource();
27
28     // The source data.
29     $tests[0]['source_data']['i18n_blocks'] = [
30       [
31         'ibid' => 1,
32         'module' => 'block',
33         'delta' => '1',
34         'type' => 0,
35         'language' => 'fr',
36       ],
37       [
38         'ibid' => 2,
39         'module' => 'block',
40         'delta' => '2',
41         'type' => 0,
42         'language' => 'zu',
43       ],
44     ];
45     $tests[0]['source_data']['variables'] = [
46       [
47         'name' => 'default_theme',
48         'value' => 's:7:"garland";',
49       ],
50     ];
51     // The expected results.
52     $tests[0]['expected_data'] = [
53       [
54         'bid' => 1,
55         'module' => 'block',
56         'delta' => '1',
57         'title' => 'Test Title 01',
58         'ibid' => 1,
59         'type' => '0',
60         'language' => 'fr',
61         'default_theme' => 'Garland',
62       ],
63       [
64         'bid' => 2,
65         'module' => 'block',
66         'delta' => '2',
67         'theme' => 'garland',
68         'title' => 'Test Title 02',
69         'ibid' => 2,
70         'type' => '0',
71         'language' => 'zu',
72         'default_theme' => 'Garland',
73       ],
74     ];
75
76     return $tests;
77   }
78
79 }