function WritableFileSystemValidatorTest::providerWritable
Data provider for testWritable().
Return value
mixed[][] The test cases.
File
-
core/
modules/ package_manager/ tests/ src/ Kernel/ WritableFileSystemValidatorTest.php, line 33
Class
- WritableFileSystemValidatorTest
- Unit tests the file system permissions validator.
Namespace
Drupal\Tests\package_manager\KernelCode
public static function providerWritable() : array {
// @see \Drupal\Tests\package_manager\Traits\ValidationTestTrait::resolvePlaceholdersInArrayValuesWithRealPaths()
$drupal_root_error = t('The Drupal directory "<PROJECT_ROOT>/web" is not writable.');
$vendor_error = t('The vendor directory "<VENDOR_DIR>" is not writable.');
$project_root_error = t('The project root directory "<PROJECT_ROOT>" is not writable.');
$summary = t('The file system is not writable.');
$writable_permission = 0777;
$non_writable_permission = 0550;
return [
'root and vendor are writable, nested web root' => [
$writable_permission,
$writable_permission,
$writable_permission,
'web',
[],
],
'root writable, vendor not writable, nested web root' => [
$writable_permission,
$writable_permission,
$non_writable_permission,
'web',
[
ValidationResult::createError([
$vendor_error,
], $summary),
],
],
'root not writable, vendor writable, nested web root' => [
$non_writable_permission,
$non_writable_permission,
$writable_permission,
'web',
[
ValidationResult::createError([
$drupal_root_error,
$project_root_error,
], $summary),
],
],
'nothing writable, nested web root' => [
$non_writable_permission,
$non_writable_permission,
$non_writable_permission,
'web',
[
ValidationResult::createError([
$drupal_root_error,
$project_root_error,
$vendor_error,
], $summary),
],
],
'root and vendor are writable, non-nested web root' => [
$writable_permission,
$writable_permission,
$writable_permission,
'',
[],
],
'root writable, vendor not writable, non-nested web root' => [
$writable_permission,
$writable_permission,
$non_writable_permission,
'',
[
ValidationResult::createError([
$vendor_error,
], $summary),
],
],
'root not writable, vendor writable, non-nested web root' => [
$non_writable_permission,
$non_writable_permission,
$writable_permission,
'',
[
ValidationResult::createError([
$project_root_error,
], $summary),
],
],
'nothing writable, non-nested web root' => [
$non_writable_permission,
$non_writable_permission,
$non_writable_permission,
'',
[
ValidationResult::createError([
$project_root_error,
$vendor_error,
], $summary),
],
],
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.