protected function UpgradePathTestBase::variable_set

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

@todo Update for D8 configuration system.

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.

2 calls to UpgradePathTestBase::variable_set()
LanguageUpgradePathTest::testLanguageUrlUpgrade in drupal/core/modules/system/lib/Drupal/system/Tests/Upgrade/LanguageUpgradePathTest.php
Tests language domain upgrade path.
UpgradePathTestBase::setUp in drupal/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php
Overrides Drupal\simpletest\WebTestBase::setUp() for upgrade testing.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php, line 152
Definition of Drupal\system\Tests\Upgrade\UpgradePathTestBase.

Class

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

Namespace

Drupal\system\Tests\Upgrade

Code

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()
      ->delete('variables');
    cache('bootstrap')
      ->delete('variables');
  } catch (Exception $e) {
  }
}