function TwigIncludeTest::setUpFilesystem

Same name in other branches
  1. 9 core/modules/system/tests/src/Kernel/Theme/TwigIncludeTest.php \Drupal\Tests\system\Kernel\Theme\TwigIncludeTest::setUpFilesystem()
  2. 11.x core/modules/system/tests/src/Kernel/Theme/TwigIncludeTest.php \Drupal\Tests\system\Kernel\Theme\TwigIncludeTest::setUpFilesystem()

Overrides KernelTestBase::setUpFilesystem

File

core/modules/system/tests/src/Kernel/Theme/TwigIncludeTest.php, line 149

Class

TwigIncludeTest
Tests including files in Twig templates.

Namespace

Drupal\Tests\system\Kernel\Theme

Code

protected function setUpFilesystem() : void {
    // Use a real file system and not VFS so that we can include files from the
    // site using @__main__ in a template.
    $public_file_directory = $this->siteDirectory . '/files';
    $private_file_directory = $this->siteDirectory . '/private';
    mkdir($this->siteDirectory, 0775);
    mkdir($this->siteDirectory . '/files', 0775);
    mkdir($this->siteDirectory . '/private', 0775);
    mkdir($this->siteDirectory . '/files/config/sync', 0775, TRUE);
    $this->setSetting('file_public_path', $public_file_directory);
    $this->setSetting('file_private_path', $private_file_directory);
    $this->setSetting('config_sync_directory', $this->siteDirectory . '/files/config/sync');
}

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