function ResourceTestBase::refreshTestStateAfterRestConfigChange
Same name and namespace in other branches
- 11.x core/modules/rest/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\rest\Functional\ResourceTestBase::refreshTestStateAfterRestConfigChange()
- 10 core/modules/rest/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\rest\Functional\ResourceTestBase::refreshTestStateAfterRestConfigChange()
- 8.9.x core/modules/rest/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\rest\Functional\ResourceTestBase::refreshTestStateAfterRestConfigChange()
Refreshes the state of the tester to be in sync with the testee.
Should be called after every change made to:
- RestResourceConfig entities
1 call to ResourceTestBase::refreshTestStateAfterRestConfigChange()
- MediaResourceTestBase::uploadFile in core/
modules/ media/ tests/ src/ Functional/ Rest/ MediaResourceTestBase.php - Tests the 'file_upload' REST resource plugin.
File
-
core/
modules/ rest/ tests/ src/ Functional/ ResourceTestBase.php, line 169
Class
- ResourceTestBase
- Subclass this for every REST resource, every format and every auth provider.
Namespace
Drupal\Tests\rest\FunctionalCode
protected function refreshTestStateAfterRestConfigChange() {
// Ensure that the cache tags invalidator has its internal values reset.
// Otherwise the http_response cache tag invalidation won't work.
$this->refreshVariables();
// Tests using this base class may trigger route rebuilds due to changes to
// RestResourceConfig entities. Ensure the test generates routes using an
// up-to-date router.
\Drupal::service('router.builder')->rebuildIfNeeded();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.