Skip to content
Snippets Groups Projects
Verified Commit be281b5f authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3385838 by pooja_sharma, longwave, joachim, smustgrave:...

Issue #3385838 by pooja_sharma, longwave, joachim, smustgrave: PathLanguageTest should use API to set up language
parent 5d987941
No related branches found
No related tags found
20 merge requests!11131[10.4.x-only-DO-NOT-MERGE]: Issue ##2842525 Ajax attached to Views exposed filter form does not trigger callbacks,!9470[10.3.x-only-DO-NOT-MERGE]: #3331771 Fix file_get_contents(): Passing null to parameter,!8736Update the Documention As per the Function uses.,!8513Issue #3453786: DefaultSelection should document why values for target_bundles NULL and [] behave as they do,!3878Removed unused condition head title for views,!3818Issue #2140179: $entity->original gets stale between updates,!3742Issue #3328429: Create item list field formatter for displaying ordered and unordered lists,!3731Claro: role=button on status report items,!3154Fixes #2987987 - CSRF token validation broken on routes with optional parameters.,!3133core/modules/system/css/components/hidden.module.css,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!2812Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2062Issue #3246454: Add weekly granularity to views date sort,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!877Issue #2708101: Default value for link text is not saved,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493
Pipeline #265874 passed with warnings
Pipeline: drupal

#265876

    ......@@ -4,6 +4,10 @@
    namespace Drupal\Tests\path\Functional;
    use Drupal\Core\Language\LanguageInterface;
    use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl;
    use Drupal\user\Entity\User;
    use Drupal\user\Plugin\LanguageNegotiation\LanguageNegotiationUser;
    use Drupal\Tests\content_translation\Traits\ContentTranslationTestTrait;
    /**
    ......@@ -65,9 +69,7 @@ protected function setUp(): void {
    static::createLanguageFromLangcode('fr');
    // Enable URL language detection and selection.
    $edit = ['language_interface[enabled][language-url]' => 1];
    $this->drupalGet('admin/config/regional/language/detection');
    $this->submitForm($edit, 'Save settings');
    $this->container->get('language_negotiator')->saveConfiguration(LanguageInterface::TYPE_URL, [LanguageNegotiationUrl::METHOD_ID => 1]);
    // Enable translation for page node.
    static::enableContentTranslation('node', 'page');
    ......@@ -135,19 +137,13 @@ public function testAliasTranslation(): void {
    // Confirm that the alias works even when changing language negotiation
    // options. Enable User language detection and selection over URL one.
    $edit = [
    'language_interface[enabled][language-user]' => 1,
    'language_interface[weight][language-user]' => -9,
    'language_interface[enabled][language-url]' => 1,
    'language_interface[weight][language-url]' => -8,
    ];
    $this->drupalGet('admin/config/regional/language/detection');
    $this->submitForm($edit, 'Save settings');
    $this->container->get('language_negotiator')->saveConfiguration(LanguageInterface::TYPE_INTERFACE, [LanguageNegotiationUser::METHOD_ID => 1]);
    $this->container->get('language_negotiator')->saveConfiguration(LanguageInterface::TYPE_URL, [LanguageNegotiationUrl::METHOD_ID => 1]);
    // Change user language preference.
    $edit = ['preferred_langcode' => 'fr'];
    $this->drupalGet("user/" . $this->webUser->id() . "/edit");
    $this->submitForm($edit, 'Save');
    $user = User::load($this->webUser->id());
    $user->set('preferred_langcode', 'fr');
    $user->save();
    // Check that the English alias works. In this situation French is the
    // current UI and content language, while URL language is English (since we
    ......@@ -165,9 +161,7 @@ public function testAliasTranslation(): void {
    $this->assertSession()->pageTextContains($english_node_french_translation->body->value);
    // Disable URL language negotiation.
    $edit = ['language_interface[enabled][language-url]' => FALSE];
    $this->drupalGet('admin/config/regional/language/detection');
    $this->submitForm($edit, 'Save settings');
    $this->container->get('language_negotiator')->saveConfiguration(LanguageInterface::TYPE_URL, [LanguageNegotiationUrl::METHOD_ID => FALSE]);
    // Check that the English alias still works.
    $this->drupalGet($english_alias);
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment