Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / migrate_drupal / tests / src / Unit / source / VariableTest.php
1 <?php
2
3 namespace Drupal\Tests\migrate_drupal\Unit\source;
4
5 use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
6
7 /**
8  * Tests the variable source plugin.
9  *
10  * @group migrate_drupal
11  */
12 class VariableTest extends MigrateSqlSourceTestCase {
13
14   const PLUGIN_CLASS = 'Drupal\migrate_drupal\Plugin\migrate\source\Variable';
15
16   protected $migrationConfiguration = [
17     'id' => 'test',
18     'highWaterProperty' => ['field' => 'test'],
19     'source' => [
20       'plugin' => 'd6_variable',
21       'variables' => [
22         'foo',
23         'bar',
24       ],
25     ],
26   ];
27
28   protected $expectedResults = [
29     [
30       'id' => 'foo',
31       'foo' => 1,
32       'bar' => FALSE,
33     ],
34   ];
35
36   protected $databaseContents = [
37     'variable' => [
38       ['name' => 'foo', 'value' => 'i:1;'],
39       ['name' => 'bar', 'value' => 'b:0;'],
40     ],
41   ];
42
43 }