public function FileSystemRequirementsTest::testFileSystemRequirements in Drupal 8
Tests requirements warnings.
@expectedDeprecation The 'system.file' config 'path.temporary' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Set 'file_temp_path' in settings.php instead. See https://www.drupal.org/node/3039255
File
- core/
tests/ Drupal/ KernelTests/ Core/ File/ FileSystemRequirementsTest.php, line 39
Class
- FileSystemRequirementsTest
- @group File @group legacy
Namespace
Drupal\KernelTests\Core\FileCode
public function testFileSystemRequirements() {
$this
->config('system.file')
->set('path.temporary', $this
->randomMachineName())
->save(TRUE);
$requirements = $this
->checkSystemRequirements();
$this
->assertEquals('Deprecated configuration', (string) $requirements['temp_directory']['value']);
$this
->assertEquals('You are using deprecated configuration for the temporary files path.', (string) $requirements['temp_directory']['description'][0]['#markup']);
$this
->assertStringStartsWith('Remove the configuration and add the following', (string) $requirements['temp_directory']['description'][1]['#markup']);
$this
->config('system.file')
->set('path.temporary', FileSystem::getOsTemporaryDirectory())
->save(TRUE);
$requirements = $this
->checkSystemRequirements();
$this
->assertEquals('Deprecated configuration', (string) $requirements['temp_directory']['value']);
$this
->assertEquals('You are using deprecated configuration for the temporary files path.', (string) $requirements['temp_directory']['description'][0]['#markup']);
$this
->assertEquals('Your temporary directory configuration matches the OS default and can be safely removed.', (string) $requirements['temp_directory']['description'][1]['#markup']);
}