ConfigAfterInstallerTestBase.php in Drupal 9
File
core/tests/Drupal/FunctionalTests/Installer/ConfigAfterInstallerTestBase.php
View source
<?php
namespace Drupal\FunctionalTests\Installer;
use Drupal\Core\Config\FileStorage;
use Drupal\Core\Config\InstallStorage;
use Drupal\Core\Config\StorageInterface;
use Drupal\KernelTests\AssertConfigTrait;
abstract class ConfigAfterInstallerTestBase extends InstallerTestBase {
use AssertConfigTrait;
protected function assertInstalledConfig(array $skipped_config) {
$this
->addToAssertionCount(1);
$active_config_storage = $this->container
->get('config.storage');
$config_manager = $this->container
->get('config.manager');
$default_install_path = 'core/profiles/' . $this->profile . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY;
$profile_config_storage = new FileStorage($default_install_path, StorageInterface::DEFAULT_COLLECTION);
foreach ($profile_config_storage
->listAll() as $config_name) {
$result = $config_manager
->diff($profile_config_storage, $active_config_storage, $config_name);
$this
->assertConfigDiff($result, $config_name, $skipped_config);
}
}
}