You are here

public function DirectoryTest::testFileDirectoryTemp in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php \Drupal\KernelTests\Core\File\DirectoryTest::testFileDirectoryTemp()

Ensure that the getTempDirectory() method always returns a value.

File

core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php, line 181

Class

DirectoryTest
Tests operations dealing with directories.

Namespace

Drupal\KernelTests\Core\File

Code

public function testFileDirectoryTemp() {
  $tmp_directory = \Drupal::service('file_system')
    ->getTempDirectory();
  $this
    ->assertNotEmpty($tmp_directory);
  $this
    ->assertEquals($tmp_directory, FileSystem::getOsTemporaryDirectory());
}