Skip to content
Snippets Groups Projects
Verified Commit f98eac78 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3496438 by spokje: [random test failure] LanguageNegotiationInfoTest::testInfoAlterations

(cherry picked from commit 329d60ea)
parent 7ae414dd
No related branches found
No related tags found
21 merge requests!12227Issue #3181946 by jonmcl, mglaman,!12079Issue #3523476 by matthiasm11: Add empty check on operator,!12024Fix: DocBlock comment for return value of Drupal\Core\Database\Connection::transactionManager(),!11974Draft: Issue #3495165 by catch, joeyroth, berdir, texas-bronius: Better warning...,!11934Issue #3520997: DefaultLazyPluginCollection unnecessarily instantiates plugins when sorting collection,!11887Issue #3520065: The migrate Row class API is incomplete,!11636Draft: Issue #3515643 by macsim: fieldNameExists method is inconsistent,!11515Issue #3480419 by mondrake, smustgrave, catch: Method...,!11380Issue #3490698 by catch, spokje: Bump MINIMUM_STABILITY back to 'stable' when...,!11281Use Drupal Core Leadership terminology in MAINTAINERS.txt,!11239Issue #3507548: Allow workspace changes listing to show all items, without a pager,!11238Fix issue #3051797,!11213Issue #3506743 by tomislav.matokovic: Increasing the color contrast for the navigation block title against the background of the navigation sidebar to at least 4.5:1,!11147Draft: Try to avoid manually setting required cache contexts,!11108Issue #3490298 by nicxvan: Profiles can be missed in OOP hooks,!11093Drupal on MongoDB 11.1.x,!11017Issue #3502540: Add date filter for moderated content.,!11009Issue #3486972 migrate feed icon,!10999Cleaning up Taxonomy hooks and updating baseline.,!10977Issue #3501457: Fix path used in a A11y Test Admin,!10881Issue #3489329 by mfb, casey: symfony/http-foundation commit 32310ff breaks PathValidator
Pipeline #384424 canceled
Pipeline: drupal

#384426

    ......@@ -73,7 +73,7 @@ protected function setUp(): void {
    $this->submitForm($edit, 'Save');
    // Enable content language negotiation UI.
    \Drupal::state()->set('language_test.content_language_type', TRUE);
    \Drupal::keyValue('language_test')->set('content_language_type', TRUE);
    // Set interface language detection to user and content language detection
    // to URL. Disable inheritance from interface language to ensure content
    ......
    ......@@ -32,7 +32,7 @@ public function pageTop(): void {
    */
    #[Hook('language_types_info')]
    public function languageTypesInfo() {
    if (\Drupal::state()->get('language_test.language_types')) {
    if (\Drupal::keyValue('language_test')->get('language_types')) {
    return [
    'test_language_type' => [
    'name' => t('Test'),
    ......@@ -53,7 +53,7 @@ public function languageTypesInfo() {
    */
    #[Hook('language_types_info_alter')]
    public function languageTypesInfoAlter(array &$language_types): void {
    if (\Drupal::state()->get('language_test.content_language_type')) {
    if (\Drupal::keyValue('language_test')->get('content_language_type')) {
    $language_types[LanguageInterface::TYPE_CONTENT]['locked'] = FALSE;
    unset($language_types[LanguageInterface::TYPE_CONTENT]['fixed']);
    // By default languages are not configurable. Make
    ......@@ -72,7 +72,7 @@ public function languageTypesInfoAlter(array &$language_types): void {
    */
    #[Hook('language_negotiation_info_alter')]
    public function languageNegotiationInfoAlter(array &$negotiation_info): void {
    if (\Drupal::state()->get('language_test.language_negotiation_info_alter')) {
    if (\Drupal::keyValue('language_test')->get('language_negotiation_info_alter')) {
    unset($negotiation_info[LanguageNegotiationUI::METHOD_ID]);
    }
    }
    ......
    ......@@ -51,18 +51,18 @@ protected function languageManager() {
    }
    /**
    * Sets state flags for language_test module.
    * Sets key/value pairs for language_test module.
    *
    * Ensures to correctly update data both in the child site and the test runner
    * environment.
    *
    * @param array $values
    * The key/value pairs to set in state.
    * The key/value pairs to set in the key value store.
    */
    protected function stateSet(array $values): void {
    // Set the new state values.
    $this->container->get('state')->setMultiple($values);
    // Refresh in-memory static state/config caches and static variables.
    protected function keysValuesSet(array $values): void {
    // Set the new key value values.
    $this->container->get('keyvalue')->get('language_test')->setMultiple($values);
    // Refresh in-memory static key value/config caches and static variables.
    $this->refreshVariables();
    // Refresh/rewrite language negotiation configuration, in order to pick up
    // the manipulations performed by language_test module's info alter hooks.
    ......@@ -73,13 +73,13 @@ protected function stateSet(array $values): void {
    * Tests alterations to language types/negotiation info.
    */
    public function testInfoAlterations(): void {
    $this->stateSet([
    $this->keysValuesSet([
    // Enable language_test type info.
    'language_test.language_types' => TRUE,
    'language_types' => TRUE,
    // Enable language_test negotiation info (not altered yet).
    'language_test.language_negotiation_info' => TRUE,
    'language_negotiation_info' => TRUE,
    // Alter LanguageInterface::TYPE_CONTENT to be configurable.
    'language_test.content_language_type' => TRUE,
    'content_language_type' => TRUE,
    ]);
    $this->container->get('module_installer')->install(['language_test']);
    $this->resetAll();
    ......@@ -109,8 +109,8 @@ public function testInfoAlterations(): void {
    // Alter language negotiation info to remove interface language negotiation
    // method.
    $this->stateSet([
    'language_test.language_negotiation_info_alter' => TRUE,
    $this->keysValuesSet([
    'language_negotiation_info_alter' => TRUE,
    ]);
    $negotiation = $this->config('language.types')->get('negotiation.' . $type . '.enabled');
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment