class InstallerConfigDirectorySetNoDirectoryTest

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/FunctionalTests/Installer/InstallerConfigDirectorySetNoDirectoryTest.php \Drupal\FunctionalTests\Installer\InstallerConfigDirectorySetNoDirectoryTest

Tests the installer when a custom config directory set up but does not exist.

@group Installer

Hierarchy

Expanded class hierarchy of InstallerConfigDirectorySetNoDirectoryTest

File

core/tests/Drupal/FunctionalTests/Installer/InstallerConfigDirectorySetNoDirectoryTest.php, line 12

Namespace

Drupal\FunctionalTests\Installer
View source
class InstallerConfigDirectorySetNoDirectoryTest extends InstallerTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';
  
  /**
   * The sync directory created during the install.
   *
   * @var string
   */
  protected $syncDirectory;
  
  /**
   * {@inheritdoc}
   */
  protected function prepareEnvironment() {
    parent::prepareEnvironment();
    $this->syncDirectory = $this->publicFilesDirectory . '/config_' . Crypt::randomBytesBase64() . '/sync';
    $this->settings['settings']['config_sync_directory'] = (object) [
      'value' => $this->syncDirectory,
      'required' => TRUE,
    ];
  }
  
  /**
   * Verifies that installation succeeded.
   */
  public function testInstaller() {
    $this->assertSession()
      ->addressEquals('user/1');
    $this->assertSession()
      ->statusCodeEquals(200);
    $this->assertDirectoryExists($this->syncDirectory);
  }

}

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