You are here

protected function DrupalWebTestCase::refreshVariables in SimpleTest 7

Same name and namespace in other branches
  1. 6.2 drupal_web_test_case.php \DrupalWebTestCase::refreshVariables()
  2. 7.2 drupal_web_test_case.php \DrupalWebTestCase::refreshVariables()

Refresh the in-memory set of variables. Useful after a page request is made that changes a variable in a different thread.

In other words calling a settings page with $this->drupalPost() with a changed value would update a variable to reflect that change, but in the thread that made the call (thread running the test) the changed variable would not be picked up.

This method clears the variables cache and loads a fresh copy from the database to ensure that the most up-to-date set of variables is loaded.

7 calls to DrupalWebTestCase::refreshVariables()
DrupalMatchPathTestCase::setUp in tests/path.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
DrupalWebTestCase::drupalGet in ./drupal_web_test_case.php
Retrieves a Drupal path or an absolute path.
DrupalWebTestCase::drupalHead in ./drupal_web_test_case.php
Retrieves only the headers for a Drupal path or an absolute path.
DrupalWebTestCase::drupalPost in ./drupal_web_test_case.php
Execute a POST request on a Drupal page. It will be done as usual POST request with SimpleBrowser.
DrupalWebTestCase::setUp in ./drupal_web_test_case.php
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…

... See full list

File

./drupal_web_test_case.php, line 1148

Class

DrupalWebTestCase
Test case for typical Drupal tests.

Code

protected function refreshVariables() {
  global $conf;
  cache_clear_all('variables', 'cache');
  $conf = variable_initialize();
}