You are here

public function UsageTest::testRemoveUsageTemporary in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/file/tests/src/Kernel/UsageTest.php \Drupal\Tests\file\Kernel\UsageTest::testRemoveUsageTemporary()

Tests file usage deletion when files are made temporary.

File

core/modules/file/tests/src/Kernel/UsageTest.php, line 83

Class

UsageTest
Tests file usage functions.

Namespace

Drupal\Tests\file\Kernel

Code

public function testRemoveUsageTemporary() {
  $this
    ->config('file.settings')
    ->set('make_unused_managed_files_temporary', TRUE)
    ->save();
  $file = $this
    ->doTestRemoveUsage();
  $this
    ->assertTrue($file
    ->isTemporary());
}