Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / migrate_drupal / tests / src / Kernel / Plugin / migrate / source / VariableMultiRowTest.php
1 <?php
2
3 namespace Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source;
4
5 use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
6
7 /**
8  * Tests the variable multirow source plugin.
9  *
10  * @covers \Drupal\migrate_drupal\Plugin\migrate\source\VariableMultiRow
11  *
12  * @group migrate_drupal
13  */
14 class VariableMultiRowTest extends MigrateSqlSourceTestBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   public static $modules = ['migrate_drupal'];
20
21   /**
22    * {@inheritdoc}
23    */
24   public function providerSource() {
25     $tests = [];
26
27     // The source data.
28     $tests[0]['source_data']['variable'] = [
29       ['name' => 'foo', 'value' => 'i:1;'],
30       ['name' => 'bar', 'value' => 'b:0;'],
31     ];
32
33     // The expected results.
34     $tests[0]['expected_data'] = [
35       [
36         'name' => 'foo',
37         'value' => 1,
38       ],
39       [
40         'name' => 'bar',
41         'value' => FALSE,
42       ],
43     ];
44
45     // The expected count.
46     $tests[0]['expected_count'] = NULL;
47
48     // The source plugin configuration.
49     $tests[0]['configuration']['variables'] = [
50       'foo',
51       'bar',
52     ];
53
54     return $tests;
55   }
56
57 }