Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / migrate_drupal / tests / src / Kernel / Plugin / migrate / source / VariableTest.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 source plugin.
9  *
10  * @covers \Drupal\migrate_drupal\Plugin\migrate\source\Variable
11  *
12  * @group migrate_drupal
13  */
14 class VariableTest 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         'id' => 'foo',
37         'foo' => 1,
38         'bar' => FALSE,
39       ],
40     ];
41
42     // The expected count.
43     $tests[0]['expected_count'] = NULL;
44
45     // The source plugin configuration.
46     $tests[0]['configuration']['variables'] = [
47       'foo',
48       'bar',
49     ];
50
51     return $tests;
52   }
53
54 }