You are here

protected function LanguageNegotiationInfoTest::stateSet in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php \Drupal\Tests\language\Functional\LanguageNegotiationInfoTest::stateSet()

Sets state flags for language_test module.

Ensures to correctly update data both in the child site and the test runner environment.

Parameters

array $values: The key/value pairs to set in state.

1 call to LanguageNegotiationInfoTest::stateSet()
LanguageNegotiationInfoTest::testInfoAlterations in core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php
Tests alterations to language types/negotiation info.

File

core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php, line 63

Class

LanguageNegotiationInfoTest
Tests alterations to language types/negotiation info.

Namespace

Drupal\Tests\language\Functional

Code

protected function stateSet(array $values) {

  // Set the new state values.
  $this->container
    ->get('state')
    ->setMultiple($values);

  // Refresh in-memory static state/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.
  $this->container
    ->get('language_negotiator')
    ->purgeConfiguration();
}