function ConfigAfterInstallerTestBase::assertInstalledConfig

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Installer/ConfigAfterInstallerTestBase.php \Drupal\FunctionalTests\Installer\ConfigAfterInstallerTestBase::assertInstalledConfig()
  2. 8.9.x core/modules/system/src/Tests/Installer/ConfigAfterInstallerTestBase.php \Drupal\system\Tests\Installer\ConfigAfterInstallerTestBase::assertInstalledConfig()
  3. 8.9.x core/tests/Drupal/FunctionalTests/Installer/ConfigAfterInstallerTestBase.php \Drupal\FunctionalTests\Installer\ConfigAfterInstallerTestBase::assertInstalledConfig()
  4. 11.x core/tests/Drupal/FunctionalTests/Installer/ConfigAfterInstallerTestBase.php \Drupal\FunctionalTests\Installer\ConfigAfterInstallerTestBase::assertInstalledConfig()

Ensures that all the installed config looks like the exported one.

Parameters

array $skipped_config: An array of skipped config.

2 calls to ConfigAfterInstallerTestBase::assertInstalledConfig()
MinimalInstallerTest::testMinimalConfig in core/tests/Drupal/FunctionalTests/Installer/MinimalInstallerTest.php
Ensures that the exported minimal configuration is up to date.
StandardInstallerTest::testStandardConfig in core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php
Ensures that the exported standard configuration is up to date.

File

core/tests/Drupal/FunctionalTests/Installer/ConfigAfterInstallerTestBase.php, line 25

Class

ConfigAfterInstallerTestBase
Provides a class for install profiles to check their installed config.

Namespace

Drupal\FunctionalTests\Installer

Code

protected function assertInstalledConfig(array $skipped_config) {
    $this->addToAssertionCount(1);
    
    /** @var \Drupal\Core\Config\StorageInterface $active_config_storage */
    $active_config_storage = $this->container
        ->get('config.storage');
    
    /** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */
    $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);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.