function ConfigInstallWebTest::testConfigModuleRequirements

Same name in other branches
  1. 9 core/modules/config/tests/src/Functional/ConfigInstallWebTest.php \Drupal\Tests\config\Functional\ConfigInstallWebTest::testConfigModuleRequirements()
  2. 10 core/modules/config/tests/src/Functional/ConfigInstallWebTest.php \Drupal\Tests\config\Functional\ConfigInstallWebTest::testConfigModuleRequirements()
  3. 11.x core/modules/config/tests/src/Functional/ConfigInstallWebTest.php \Drupal\Tests\config\Functional\ConfigInstallWebTest::testConfigModuleRequirements()

Tests config_requirements().

File

core/modules/config/tests/src/Functional/ConfigInstallWebTest.php, line 211

Class

ConfigInstallWebTest
Tests installation and removal of configuration objects in install, disable and uninstall functionality.

Namespace

Drupal\Tests\config\Functional

Code

public function testConfigModuleRequirements() {
    $this->drupalLogin($this->adminUser);
    $this->drupalPostForm('admin/modules', [
        'modules[config][enable]' => TRUE,
    ], t('Install'));
    $directory = Settings::get('config_sync_directory');
    try {
        \Drupal::service('file_system')->deleteRecursive($directory);
    } catch (FileException $e) {
        // Ignore failed deletes.
    }
    $this->drupalGet('/admin/reports/status');
    $this->assertRaw(t('The directory %directory does not exist.', [
        '%directory' => $directory,
    ]));
}

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