X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ftaxonomy%2Ftests%2Fsrc%2FKernel%2FPlugin%2Fmigrate%2Fsource%2Fd6%2FVocabularyTranslationTest.php;fp=web%2Fcore%2Fmodules%2Ftaxonomy%2Ftests%2Fsrc%2FKernel%2FPlugin%2Fmigrate%2Fsource%2Fd6%2FVocabularyTranslationTest.php;h=e54eb6ee3f7c309dd3773d1cef69784d10658df6;hp=0000000000000000000000000000000000000000;hb=bfbba508964731508b9bd6d5835c2edc858db95b;hpb=cb9a80db11fc6b014e5b1e693a5a391c95eb5d9a diff --git a/web/core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/VocabularyTranslationTest.php b/web/core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/VocabularyTranslationTest.php new file mode 100644 index 000000000..e54eb6ee3 --- /dev/null +++ b/web/core/modules/taxonomy/tests/src/Kernel/Plugin/migrate/source/d6/VocabularyTranslationTest.php @@ -0,0 +1,125 @@ + 1, + 'objectid' => 1, + 'type' => 'vocabulary', + 'property' => 'name', + 'objectindex' => 1, + 'format' => 0, + ], + [ + 'lid' => 2, + 'objectid' => 2, + 'type' => 'vocabulary', + 'property' => 'name', + 'objectindex' => 2, + 'format' => 0, + ], + ]; + + $tests[0][0]['locales_target'] = [ + [ + 'lid' => 1, + 'language' => 'fr', + 'translation' => 'fr - vocabulary 1', + 'plid' => 0, + 'plural' => 0, + 'i18n_status' => 0, + ], + [ + 'lid' => 2, + 'language' => 'fr', + 'translation' => 'fr - vocabulary 2', + 'plid' => 0, + 'plural' => 0, + 'i18n_status' => 0, + ], + ]; + + $tests[0][0]['vocabulary'] = [ + [ + 'vid' => 1, + 'name' => 'vocabulary 1', + 'description' => 'description of vocabulary 1', + 'help' => 1, + 'relations' => 1, + 'hierarchy' => 1, + 'multiple' => 0, + 'required' => 0, + 'tags' => 0, + 'module' => 'taxonomy', + 'weight' => 4, + 'language' => '', + ], + [ + 'vid' => 2, + 'name' => 'vocabulary 2', + 'description' => 'description of vocabulary 2', + 'help' => 1, + 'relations' => 1, + 'hierarchy' => 1, + 'multiple' => 0, + 'required' => 0, + 'tags' => 0, + 'module' => 'taxonomy', + 'weight' => 5, + 'language' => '', + ], + ]; + + $tests[0]['expected_results'] = [ + [ + 'vid' => 1, + 'name' => 'vocabulary 1', + 'description' => 'description of vocabulary 1', + 'lid' => '1', + 'type' => 'vocabulary', + 'property' => 'name', + 'objectid' => '1', + 'lt_lid' => '1', + 'translation' => 'fr - vocabulary 1', + 'language' => 'fr', + ], + [ + 'vid' => 2, + 'name' => 'vocabulary 2', + 'description' => 'description of vocabulary 2', + 'lid' => '2', + 'type' => 'vocabulary', + 'property' => 'name', + 'objectid' => '2', + 'lt_lid' => '2', + 'translation' => 'fr - vocabulary 2', + 'language' => 'fr', + ], + ]; + return $tests; + } + +}