function FileSystemTempDirectoryTest::testGetTempDirectoryDeprecation

Tests 'path.temporary' config deprecation.

@group legacy @covers ::getTempDirectory @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/FileSystemTempDirectoryTest.php, line 60

Class

FileSystemTempDirectoryTest
Tests for getTempDirectory on FileSystem.

Namespace

Drupal\KernelTests\Core\File

Code

public function testGetTempDirectoryDeprecation() {
    $tempDir = '/var/tmp/' . $this->randomMachineName();
    $this->config('system.file')
        ->set('path.temporary', $tempDir)
        ->save(TRUE);
    $dir = $this->fileSystem
        ->getTempDirectory();
    $this->assertEquals($tempDir, $dir);
}

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