Skip to content
Snippets Groups Projects
Verified Commit c5444ac6 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 47c383dd
Branches
Tags
20 merge requests!8376Drupal views: adding more granularity to the ‘use ajax’ functionality,!8300Issue #3443586 View area displays even when parent view has no results.,!7567Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7565Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7509Change label "Block description" to "Block type",!7344Issue #3292350 by O'Briat, KlemenDEV, hswong3i, smustgrave, quietone: Update...,!6922Issue #3412959 by quietone, smustgrave, longwave: Fix 12 'un' words,!6848Issue #3417553 by longwave: Remove withConsecutive() in CacheCollectorTest,!6720Revert "Issue #3358581 by pfrenssen, _tarik_, a.dmitriiev, smustgrave:...,!6560Update ClaroPreRender.php, confirming classes provided are in array format,!6528Issue #3414261 by catch: Add authenticated user umami performance tests,!6501Issue #3263668 by omkar-pd, Wim Leers, hooroomoo: Re-enable inline form errors...,!6354Draft: Issue #3380392 by phma: Updating language weight from the overview reverts label if translated,!6324Issue #3416723 by Ludo.R: Provide a "node type" views default argument,!6119Issue #3405704 by Spokje, longwave: symfony/psr-http-message-bridge major version bump,!5950Issue #3403653 by alexpott, longwave: Incorporate improvements to how contrib runs PHPStan to core,!5858Issue #3401971 by fjgarlin: Test-only job shouldn't require constant rebases...,!5716Draft: Issue #3401102 by Spokje, longwave, smustgrave: Nightwatch artifacts on GitLab not retained,!5674Transaction autocommit during shutdown relies on unreliable object destruction order,!5644Issue #3395563 by nireneko, marvil07, lauriii, borisson_, smustgrave, Wim...
Pipeline #47725 canceled
Pipeline: drupal

#47734

    Pipeline: drupal

    #47733

      Pipeline: drupal

      #47732

        +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\node\Entity\NodeType;
        ......@@ -296,30 +298,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