/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); // Determine what database backend is running, and set the skip flag. $this->skipTests = Database::getConnection()->databaseType() !== 'mysql'; // Create some schemas so our export contains tables. $this->installSchema('system', ['key_value_expire', 'sessions']); $this->installSchema('dblog', ['watchdog']); $this->installEntitySchema('block_content'); $this->installEntitySchema('user'); $this->installEntitySchema('file'); $this->installEntitySchema('menu_link_content'); $this->installSchema('system', 'sequences'); // Place some sample config to test for in the export. $this->data = ['foo' => $this->randomMachineName(), 'bar' => $this->randomMachineName()]; $storage = new DatabaseStorage(Database::getConnection(), 'config'); $storage->write('test_config', $this->data); // Create user account with some potential syntax issues. $account = User::create(['mail' => 'q\'uote$dollar@example.com', 'name' => '$dollar']); $account->save(); // Create url_alias (this will create 'url_alias'). $this->container->get('path.alias_storage')->save('/user/' . $account->id(), '/user/example'); // Create a cache table (this will create 'cache_discovery'). \Drupal::cache('discovery')->set('test', $this->data); // These are all the tables that should now be in place. $this->tables = ['block_content', 'block_content_field_data', 'block_content_field_revision', 'block_content_revision', 'cachetags', 'config', 'cache_bootstrap', 'cache_config', 'cache_data', 'cache_discovery', 'cache_entity', 'file_managed', 'key_value_expire', 'menu_link_content', 'menu_link_content_data', 'sequences', 'sessions', 'url_alias', 'user__roles', 'users', 'users_field_data', 'watchdog']; }
/** * {@inheritdoc} */ public function setUp() { parent::setUp(); // Determine what database backend is running, and set the skip flag. $this->skipTests = Database::getConnection()->databaseType() !== 'mysql'; // Create some schemas so our export contains tables. $this->installSchema('system', ['key_value_expire', 'semaphore', 'sessions', 'url_alias']); $this->installSchema('dblog', ['watchdog']); $this->installEntitySchema('block_content'); $this->installEntitySchema('user'); $this->installEntitySchema('file'); $this->installEntitySchema('menu_link_content'); // Place some sample config to test for in the export. $this->data = ['foo' => $this->randomMachineName(), 'bar' => $this->randomMachineName()]; $storage = new DatabaseStorage(Database::getConnection(), 'config'); $storage->write('test_config', $this->data); // Create a cache table (this will create 'cache_discovery'). \Drupal::cache('discovery')->set('test', $this->data); // These are all the tables that should now be in place. $this->tables = ['block_content', 'block_content_field_data', 'block_content_field_revision', 'block_content_revision', 'cachetags', 'config', 'cache_discovery', 'cache_bootstrap', 'file_managed', 'key_value_expire', 'menu_link_content', 'menu_link_content_data', 'semaphore', 'sessions', 'url_alias', 'user__roles', 'users', 'users_field_data', 'watchdog']; }