protected function setUp() { parent::setUp(); module_load_install('system'); $schema = system_schema(); db_create_table('key_value_expire', $schema['key_value_expire']); }
/** * Returns the table definition for the URL alias fixtures. * * @return array * Table definitions. */ public function tableDefinition() { $tables = array(); module_load_install('system'); $schema = system_schema(); $tables['url_alias'] = $schema['url_alias']; $tables['key_value'] = $schema['key_value']; return $tables; }
protected function setUp() { parent::setUp(); module_load_install('system'); $schema = system_schema(); db_create_table('key_value', $schema['key_value']); $this->container->register('database', 'Drupal\\Core\\Database\\Connection')->setFactoryClass('Drupal\\Core\\Database\\Database')->setFactoryMethod('getConnection')->addArgument('default'); $this->container->register('keyvalue.database', 'Drupal\\Core\\KeyValueStore\\KeyValueDatabaseFactory')->addArgument(new Reference('serialization.phpserialize'))->addArgument(new Reference('database')); $this->container->register('serialization.phpserialize', 'Drupal\\Component\\Serialization\\PhpSerialize'); $this->settingsSet('keyvalue_default', 'keyvalue.database'); }
/** * Returns the table definition for the URL alias fixtures. * * @return array * Table definitions. */ public function tableDefinition() { $tables = array(); // Prime the drupal_get_filename() cache with the location of the system // module as its location is known and shouldn't change. // @todo Remove as part of https://www.drupal.org/node/2186491 drupal_get_filename('module', 'system', 'core/modules/system/system.info.yml'); module_load_install('system'); $schema = system_schema(); $tables['url_alias'] = AliasStorage::schemaDefinition(); $tables['key_value'] = $schema['key_value']; return $tables; }
protected function setUp() { parent::setUp(); // Install system tables to test the key/value storage without installing a // full Drupal environment. module_load_install('system'); $schema = system_schema(); db_create_table('semaphore', $schema['semaphore']); db_create_table('key_value_expire', $schema['key_value_expire']); // Create several objects for testing. for ($i = 0; $i <= 3; $i++) { $this->objects[$i] = $this->randomObject(); } }