Skip to content
Snippets Groups Projects
Verified Commit f78f93b9 authored by Dave Long's avatar Dave Long
Browse files

Issue #3385834 by vbouchet, joachim: MenuUiNodeTest should use API to set up language

(cherry picked from commit 7a84619f)
parent 2945fff8
No related branches found
No related tags found
7 merge requests!11628Update file MediaLibraryWidget.php,!7564Revert "Issue #3364773 by roshnichordiya, Chris Matthews, thakurnishant_06,...,!5752Issue #3275828 by joachim, quietone, bradjones1, Berdir: document the reason...,!5627Issue #3261805: Field not saved when change of 0 on string start,!5427Issue #3338518: send credentials in ajax if configured in CORS settings.,!5395Issue #3387916 by fjgarlin, Spokje: Each GitLab job exposes user email,!3106Issue #3017548: "Filtered HTML" text format does not support manual teaser break (<!--break-->)
Pipeline #47724 canceled
Pipeline: drupal

#47738

    Pipeline: drupal

    #47737

      Pipeline: drupal

      #47736

        +1
        ......@@ -2,7 +2,9 @@
        namespace Drupal\Tests\menu_ui\Functional;
        use Drupal\Core\Language\LanguageInterface;
        use Drupal\language\Entity\ConfigurableLanguage;
        use Drupal\language\Entity\ContentLanguageSettings;
        use Drupal\menu_link_content\Entity\MenuLinkContent;
        use Drupal\node\Entity\Node;
        use Drupal\Tests\BrowserTestBase;
        ......@@ -294,30 +296,36 @@ public function testMultilingualMenuNodeFormWidget() {
        $config->set('url.prefixes.' . $langcodes[0], $langcodes[0]);
        $config->save();
        $this->rebuildContainer();
        $languages = [];
        foreach ($langcodes as $langcode) {
        $languages[$langcode] = ConfigurableLanguage::load($langcode);
        }
        // Use a UI form submission to make the node type and menu link content entity translatable.
        $this->drupalLogout();
        $this->drupalLogin($this->rootUser);
        $edit = [
        'entity_types[node]' => TRUE,
        'entity_types[menu_link_content]' => TRUE,
        'settings[node][page][settings][language][language_alterable]' => TRUE,
        'settings[node][page][translatable]' => TRUE,
        'settings[node][page][fields][title]' => TRUE,
        'settings[menu_link_content][menu_link_content][translatable]' => TRUE,
        ];
        $this->drupalGet('admin/config/regional/content-language');
        $this->submitForm($edit, 'Save configuration');
        // Enable translation for page.
        $config = ContentLanguageSettings::loadByEntityTypeBundle('node', 'page');
        $config->setDefaultLangcode(LanguageInterface::LANGCODE_SITE_DEFAULT);
        $config->setLanguageAlterable(TRUE);
        $config->save();
        // Log out and back in as normal user.
        $this->drupalLogout();
        $this->drupalLogin($this->editor);
        $content_translation_manager = $this->container->get('content_translation.manager');
        $content_translation_manager->setEnabled('node', 'page', TRUE);
        $content_translation_manager->setBundleTranslationSettings('node', 'page', [
        'untranslatable_fields_hide' => FALSE,
        ]);
        // Enable translation for menu_link_content.
        $config = ContentLanguageSettings::loadByEntityTypeBundle('menu_link_content', 'menu_link_content');
        $config->setDefaultLangcode(LanguageInterface::LANGCODE_SITE_DEFAULT);
        $config->setLanguageAlterable(TRUE);
        $config->save();
        $content_translation_manager = $this->container->get('content_translation.manager');
        $content_translation_manager->setEnabled('menu_link_content', 'menu_link_content', TRUE);
        $content_translation_manager->setBundleTranslationSettings('menu_link_content', 'menu_link_content', [
        'untranslatable_fields_hide' => FALSE,
        ]);
        $this->rebuildContainer();
        // Create a node.
        $node_title = $this->randomMachineName(8);
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment