You are here

protected function LanguageNegotiationInfoTest::stateSet in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php \Drupal\Tests\language\Functional\LanguageNegotiationInfoTest::stateSet()
  2. 9 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.

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();
}