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
12 class i18nVariableTest extends MigrateSqlSourceTestCase {
14 // The plugin system is not working during unit testing so the source plugin
15 // class needs to be manually specified.
16 const PLUGIN_CLASS = 'Drupal\migrate_drupal\Plugin\migrate\source\d6\i18nVariable';
19 * Define bare minimum migration configuration.
21 protected $migrationConfiguration = [
23 'highWaterProperty' => ['field' => 'test'],
25 'plugin' => 'i18n_variable',
34 * Expected results from the source.
36 protected $expectedResults = [
39 'site_slogan' => 'Migrate est génial',
40 'site_name' => 'nom de site',
44 'site_slogan' => 'Ko whakamataku heke',
45 'site_name' => 'ingoa_pae',
50 * Database contents for tests.
52 protected $databaseContents = [
54 ['name' => 'site_slogan', 'language' => 'fr', 'value' => 's:19:"Migrate est génial";'],
55 ['name' => 'site_name', 'language' => 'fr', 'value' => 's:11:"nom de site";'],
56 ['name' => 'site_slogan', 'language' => 'mi', 'value' => 's:19:"Ko whakamataku heke";'],
57 ['name' => 'site_name', 'language' => 'mi', 'value' => 's:9:"ingoa_pae";'],