Chris@17: drupalPostForm() with a Chris@17: * changed value would update configuration to reflect that change, but in the Chris@17: * thread that made the call (thread running the test) the changed values Chris@17: * would not be picked up. Chris@17: * Chris@17: * This method clears the cache and loads a fresh copy. Chris@17: */ Chris@17: protected function refreshVariables() { Chris@17: // Clear the tag cache. Chris@17: \Drupal::service('cache_tags.invalidator')->resetChecksums(); Chris@17: foreach (Cache::getBins() as $backend) { Chris@17: if (is_callable([$backend, 'reset'])) { Chris@17: $backend->reset(); Chris@17: } Chris@17: } Chris@17: Chris@17: \Drupal::service('config.factory')->reset(); Chris@17: \Drupal::service('state')->resetCache(); Chris@17: } Chris@17: Chris@17: }