function ConfigInstallWebTest::testConfigModuleRequirements

Same name in other branches
  1. 8.9.x 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 226

Class

ConfigInstallWebTest
Tests configuration objects before and after module install and uninstall.

Namespace

Drupal\Tests\config\Functional

Code

public function testConfigModuleRequirements() {
    $this->drupalLogin($this->adminUser);
    $this->drupalGet('admin/modules');
    $this->submitForm([
        'modules[config][enable]' => TRUE,
    ], '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->assertSession()
        ->pageTextContains("The directory {$directory} does not exist.");
}

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