3 namespace Drupal\Tests\migrate_drupal\Unit\source\d6;
5 use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
8 * Tests the variable source plugin.
10 * @group migrate_drupal
13 class i18nVariableTest extends MigrateSqlSourceTestCase {
15 // The plugin system is not working during unit testing so the source plugin
16 // class needs to be manually specified.
17 const PLUGIN_CLASS = 'Drupal\migrate_drupal\Plugin\migrate\source\d6\i18nVariable';
20 * Define bare minimum migration configuration.
22 protected $migrationConfiguration = [
24 'highWaterProperty' => ['field' => 'test'],
26 'plugin' => 'i18n_variable',
35 * Expected results from the source.
37 protected $expectedResults = [
40 'site_slogan' => 'Migrate est génial',
41 'site_name' => 'nom de site',
45 'site_slogan' => 'Ko whakamataku heke',
46 'site_name' => 'ingoa_pae',
51 * Database contents for tests.
53 protected $databaseContents = [
55 ['name' => 'site_slogan', 'language' => 'fr', 'value' => 's:19:"Migrate est génial";'],
56 ['name' => 'site_name', 'language' => 'fr', 'value' => 's:11:"nom de site";'],
57 ['name' => 'site_slogan', 'language' => 'mi', 'value' => 's:19:"Ko whakamataku heke";'],
58 ['name' => 'site_name', 'language' => 'mi', 'value' => 's:9:"ingoa_pae";'],