X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fmigrate_drupal%2Ftests%2Fsrc%2FUnit%2Fsource%2Fd6%2FVariableTranslationTest.php;fp=web%2Fcore%2Fmodules%2Fmigrate_drupal%2Ftests%2Fsrc%2FUnit%2Fsource%2Fd6%2FVariableTranslationTest.php;h=152706798c998c6c10402b8c8f5f366b875b4f8a;hp=0000000000000000000000000000000000000000;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/migrate_drupal/tests/src/Unit/source/d6/VariableTranslationTest.php b/web/core/modules/migrate_drupal/tests/src/Unit/source/d6/VariableTranslationTest.php new file mode 100644 index 000000000..152706798 --- /dev/null +++ b/web/core/modules/migrate_drupal/tests/src/Unit/source/d6/VariableTranslationTest.php @@ -0,0 +1,61 @@ + 'test', + 'highWaterProperty' => ['field' => 'test'], + 'source' => [ + 'plugin' => 'variable_translation', + 'variables' => [ + 'site_slogan', + 'site_name', + ], + ], + ]; + + /** + * Expected results from the source. + */ + protected $expectedResults = [ + [ + 'language' => 'fr', + 'site_slogan' => 'Migrate est génial', + 'site_name' => 'nom de site', + ], + [ + 'language' => 'mi', + 'site_slogan' => 'Ko whakamataku heke', + 'site_name' => 'ingoa_pae', + ] + ]; + + /** + * Database contents for tests. + */ + protected $databaseContents = [ + 'i18n_variable' => [ + ['name' => 'site_slogan', 'language' => 'fr', 'value' => 's:19:"Migrate est génial";'], + ['name' => 'site_name', 'language' => 'fr', 'value' => 's:11:"nom de site";'], + ['name' => 'site_slogan', 'language' => 'mi', 'value' => 's:19:"Ko whakamataku heke";'], + ['name' => 'site_name', 'language' => 'mi', 'value' => 's:9:"ingoa_pae";'], + ], + ]; + +}