function DiskSpaceValidatorTest::testDiskSpaceValidationDuringPreApply
Tests disk space validation during pre-apply.
@dataProvider providerDiskSpaceValidation
Parameters
bool $shared_disk: Whether the root and vendor directories are on the same logical disk.
array $free_space: The free space that should be reported for various paths. The keys are the paths, and the values are the free space that should be reported, in a format that can be parsed by \Drupal\Component\Utility\Bytes::toNumber().
\Drupal\package_manager\ValidationResult[] $expected_results: The expected validation results.
File
-
core/
modules/ package_manager/ tests/ src/ Kernel/ DiskSpaceValidatorTest.php, line 176
Class
- DiskSpaceValidatorTest
- @covers \Drupal\package_manager\Validator\DiskSpaceValidator @group package_manager @internal
Namespace
Drupal\Tests\package_manager\KernelCode
public function testDiskSpaceValidationDuringPreApply(bool $shared_disk, array $free_space, array $expected_results) : void {
$free_space = array_flip($this->resolvePlaceholdersInArrayValuesWithRealPaths(array_flip($free_space)));
$this->addEventTestListener(function () use ($shared_disk, $free_space) : void {
/** @var \Drupal\Tests\package_manager\Kernel\TestDiskSpaceValidator $validator */
$validator = $this->container
->get(DiskSpaceValidator::class);
$validator->sharedDisk = $shared_disk;
$validator->freeSpace = array_map([
Bytes::class,
'toNumber',
], $free_space);
});
$this->assertResults($expected_results, PreApplyEvent::class);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.