You are here

VariableTest.php in Zircon Profile 8

File

core/modules/migrate_drupal/tests/src/Unit/source/VariableTest.php
View source
<?php

/**
 * @file
 * Contains \Drupal\Tests\migrate_drupal\Unit\source\VariableTest.
 */
namespace Drupal\Tests\migrate_drupal\Unit\source;

use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;

/**
 * Tests the variable source plugin.
 *
 * @group migrate_drupal
 */
class VariableTest extends MigrateSqlSourceTestCase {
  const PLUGIN_CLASS = 'Drupal\\migrate_drupal\\Plugin\\migrate\\source\\Variable';
  protected $migrationConfiguration = array(
    'id' => 'test',
    'highWaterProperty' => array(
      'field' => 'test',
    ),
    'source' => array(
      'plugin' => 'd6_variable',
      'variables' => array(
        'foo',
        'bar',
      ),
    ),
  );
  protected $expectedResults = array(
    array(
      'id' => 'foo',
      'foo' => 1,
      'bar' => FALSE,
    ),
  );
  protected $databaseContents = array(
    'variable' => array(
      array(
        'name' => 'foo',
        'value' => 'i:1;',
      ),
      array(
        'name' => 'bar',
        'value' => 'b:0;',
      ),
    ),
  );

}

Classes

Namesort descending Description
VariableTest Tests the variable source plugin.