ConfigIgnoreBrowserTestBase.php in Config Ignore 8.3
File
tests/src/Functional/ConfigIgnoreBrowserTestBase.php
View source
<?php
namespace Drupal\Tests\config_ignore\Functional;
use Drupal\Core\Config\ConfigImporter;
use Drupal\Core\Config\FileStorage;
use Drupal\Core\Config\StorageComparer;
use Drupal\Core\Site\Settings;
use Drupal\Tests\BrowserTestBase;
abstract class ConfigIgnoreBrowserTestBase extends BrowserTestBase {
protected static $modules = [
'config_ignore',
];
protected $defaultTheme = 'stark';
public function doImport() {
$storage_comparer = new StorageComparer($this->container
->get('config.import_transformer')
->transform($this->container
->get('config.storage.sync')), $this->container
->get('config.storage'));
$config_importer = new ConfigImporter($storage_comparer
->createChangelist(), $this->container
->get('event_dispatcher'), $this->container
->get('config.manager'), $this->container
->get('lock'), $this->container
->get('config.typed'), $this->container
->get('module_handler'), $this->container
->get('module_installer'), $this->container
->get('theme_handler'), $this->container
->get('string_translation'), $this->container
->get('extension.list.module'));
$config_importer
->reset()
->import();
}
public function doExport() {
$destination_storage = $this->container
->get('config.storage.sync');
$source_storage = $this->container
->get('config.storage.export');
$this
->copyConfig($source_storage, $destination_storage);
}
}