Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / taxonomy / tests / src / Kernel / Migrate / d6 / MigrateTaxonomyVocabularyTranslationTest.php
1 <?php
2
3 namespace Drupal\Tests\taxonomy\Kernel\Migrate\d6;
4
5 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
6
7 /**
8  * Migrate taxonomy vocabularies to taxonomy.vocabulary.*.yml.
9  *
10  * @group migrate_drupal_6
11  */
12 class MigrateTaxonomyVocabularyTranslationTest extends MigrateDrupal6TestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   public static $modules = [
18     'config_translation',
19     'language',
20     'taxonomy',
21     // Required for translation migrations.
22     'migrate_drupal_multilingual',
23   ];
24
25   /**
26    * {@inheritdoc}
27    */
28   protected function setUp() {
29     parent::setUp();
30     $this->executeMigrations([
31       'd6_taxonomy_vocabulary',
32       'd6_taxonomy_vocabulary_translation',
33     ]);
34   }
35
36   /**
37    * Tests the Drupal 6 i18n taxonomy vocabularies to Drupal 8 migration.
38    */
39   public function testTaxonomyVocabularyTranslation() {
40     $language_manager = \Drupal::service('language_manager');
41     $config = $language_manager->getLanguageConfigOverride('fr', 'taxonomy.vocabulary.vocabulary_1_i_0_');
42     $this->assertSame('fr - vocabulary 1 (i=0)', $config->get('name'));
43     $config = $language_manager->getLanguageConfigOverride('fr', 'taxonomy.vocabulary.vocabulary_2_i_1_');
44     $this->assertSame('fr - vocabulary 2 (i=1)', $config->get('name'));
45     $config = $language_manager->getLanguageConfigOverride('fr', 'taxonomy.vocabulary.vocabulary_3_i_2_');
46     $this->assertSame('fr - vocabulary 3 (i=2)', $config->get('name'));
47     $config = $language_manager->getLanguageConfigOverride('fr', 'taxonomy.vocabulary.vocabulary_name_much_longer_than');
48     $this->assertSame('Nom de vocabulaire beaucoup plus long que trente-deux caractères', $config->get('name'));
49     $config = $language_manager->getLanguageConfigOverride('fr', 'taxonomy.vocabulary.tags');
50     $this->assertSame('fr - Tags', $config->get('name'));
51   }
52
53 }