function FileListingTest::setUp

Same name in other branches
  1. 8.9.x core/modules/file/tests/src/Functional/FileListingTest.php \Drupal\Tests\file\Functional\FileListingTest::setUp()
  2. 10 core/modules/file/tests/src/Functional/FileListingTest.php \Drupal\Tests\file\Functional\FileListingTest::setUp()
  3. 11.x core/modules/file/tests/src/Functional/FileListingTest.php \Drupal\Tests\file\Functional\FileListingTest::setUp()

Overrides FileFieldTestBase::setUp

File

core/modules/file/tests/src/Functional/FileListingTest.php, line 38

Class

FileListingTest
Tests file listing page functionality.

Namespace

Drupal\Tests\file\Functional

Code

protected function setUp() : void {
    parent::setUp();
    // This test expects unused managed files to be marked as a temporary file.
    $this->config('file.settings')
        ->set('make_unused_managed_files_temporary', TRUE)
        ->save();
    $this->adminUser = $this->drupalCreateUser([
        'access files overview',
        'bypass node access',
    ]);
    $this->baseUser = $this->drupalCreateUser();
    $this->createFileField('file', 'node', 'article', [], [
        'file_extensions' => 'txt png',
    ]);
}

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