trait FileSystemTrait in Acquia Content Hub 8.2
A trait for file system components.
@package Drupal\Tests\acquia_contenthub\Kernel\Core
Hierarchy
- trait \Drupal\Tests\acquia_contenthub\Kernel\Core\FileSystemTrait
2 files declare their use of FileSystemTrait
- FileImportExportTest.php in tests/
src/ Kernel/ FileImportExportTest.php - MediaImportExportTest.php in tests/
src/ Kernel/ MediaImportExportTest.php
File
- tests/
src/ Kernel/ Core/ FileSystemTrait.php, line 10
Namespace
Drupal\Tests\acquia_contenthub\Kernel\CoreView source
trait FileSystemTrait {
/**
* File system component.
*
* @var \Drupal\Core\File\FileSystem
*/
protected $fileSystem;
/**
* Adjust file system for test.
*/
protected function fileSystemSetUp() {
$this
->installEntitySchema('file');
$this
->installSchema('file', [
'file_usage',
]);
$this->fileSystem = \Drupal::service('file_system');
if (version_compare(\Drupal::VERSION, '8.8.0', '<')) {
$this->fileSystem
->mkdir('public://2018-12');
}
$this->fileSystem
->mkdir('public://2020-03');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FileSystemTrait:: |
protected | property | File system component. | |
FileSystemTrait:: |
protected | function | Adjust file system for test. |