function TestSiteInstallCommand::ensureDirectory

Ensures that the sites/simpletest directory exists and is writable.

Parameters

string $root: The Drupal root.

1 call to TestSiteInstallCommand::ensureDirectory()
TestSiteInstallCommand::execute in core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php

File

core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php, line 199

Class

TestSiteInstallCommand
Command to create a test Drupal site.

Namespace

Drupal\TestSite\Commands

Code

protected function ensureDirectory($root) {
  if (!is_writable($root . '/sites/simpletest')) {
    if (!@mkdir($root . '/sites/simpletest')) {
      throw new \RuntimeException($root . '/sites/simpletest must exist and be writable to install a test site');
    }
  }
}

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