protected function UpgradePathTestCase::variable_set

Specialized variable_set() that works even if the child site is not upgraded.

Parameters

$name: The name of the variable to set.

$value: The value to set. This can be any PHP data type; these functions take care of serialization as necessary.

10 calls to UpgradePathTestCase::variable_set()
LocaleUpgradePathTestCase::testLocaleUpgradeDomain in drupal-7.x/modules/simpletest/tests/upgrade/upgrade.locale.test
Test an upgrade with domain-based negotiation.
LocaleUpgradePathTestCase::testLocaleUpgradeDomain in drupal-7.x/modules/simpletest/tests/upgrade/upgrade.locale.test
Test an upgrade with domain-based negotiation.
LocaleUpgradePathTestCase::testLocaleUpgradePathDefault in drupal-7.x/modules/simpletest/tests/upgrade/upgrade.locale.test
Test an upgrade with path-based negotiation.
LocaleUpgradePathTestCase::testLocaleUpgradePathDefault in drupal-7.x/modules/simpletest/tests/upgrade/upgrade.locale.test
Test an upgrade with path-based negotiation.
LocaleUpgradePathTestCase::testLocaleUpgradePathFallback in drupal-7.x/modules/simpletest/tests/upgrade/upgrade.locale.test
Test an upgrade with path-based (with fallback) negotiation.

... See full list

Archivo

drupal-7.x/modules/simpletest/tests/upgrade/upgrade.test, line 169

Class

UpgradePathTestCase
Perform end-to-end tests of the upgrade path.

Código

protected function variable_set($name, $value) {
  db_delete('variable')->condition('name', $name)->execute();
  db_insert('variable')->fields(array(
    'name' => $name,
    'value' => serialize($value),
  ))->execute();

  try {
    cache_clear_all('variables', 'cache');
    cache_clear_all('variables', 'cache_bootstrap');
  }
  // Since cache_bootstrap won't exist in a Drupal 6 site, ignore the
  // exception if the above fails.
  catch (Exception $e) {
  }
}