示例#1
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $i = 0;
     foreach (array('af', 'am', 'ar') as $langcode) {
         $language = ConfigurableLanguage::createFromLangcode($langcode);
         $language->set('weight', $i--);
         $language->save();
     }
 }
示例#2
0
 protected function setUp()
 {
     parent::setUp();
     $this->installEntitySchema('entity_test');
     $this->installEntitySchema('configurable_language');
     \Drupal::service('router.builder')->rebuild();
     // In order to reflect the changes for a multilingual site in the container
     // we have to rebuild it.
     ConfigurableLanguage::create(['id' => 'es'])->save();
     ConfigurableLanguage::create(['id' => 'fr'])->save();
     $config = $this->config('language.negotiation');
     $config->set('url.prefixes', ['en' => 'en', 'es' => 'es', 'fr' => 'fr'])->save();
     \Drupal::service('kernel')->rebuildContainer();
     $this->createTranslatableEntity();
 }