function DirectoryTest::testFileDirectoryTemp in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Tests/File/DirectoryTest.php \Drupal\system\Tests\File\DirectoryTest::testFileDirectoryTemp()
Ensure that the file_directory_temp() function always returns a value.
File
- core/modules/ system/ src/ Tests/ File/ DirectoryTest.php, line 159 
- Contains \Drupal\system\Tests\File\DirectoryTest.
Class
- DirectoryTest
- Tests operations dealing with directories.
Namespace
Drupal\system\Tests\FileCode
function testFileDirectoryTemp() {
  // Start with an empty variable to ensure we have a clean slate.
  $config = $this
    ->config('system.file');
  $config
    ->set('path.temporary', '')
    ->save();
  $tmp_directory = file_directory_temp();
  $this
    ->assertEqual(empty($tmp_directory), FALSE, 'file_directory_temp() returned a non-empty value.');
  $this
    ->assertEqual($config
    ->get('path.temporary'), $tmp_directory);
}