You are here

protected function FilePrivateTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/file/tests/src/Functional/FilePrivateTest.php \Drupal\Tests\file\Functional\FilePrivateTest::setUp()
  2. 10 core/modules/file/tests/src/Functional/FilePrivateTest.php \Drupal\Tests\file\Functional\FilePrivateTest::setUp()

Overrides FileFieldTestBase::setUp

File

core/modules/file/tests/src/Functional/FilePrivateTest.php, line 28

Class

FilePrivateTest
Uploads a test to a private node and checks access.

Namespace

Drupal\Tests\file\Functional

Code

protected function setUp() {
  parent::setUp();
  node_access_test_add_field(NodeType::load('article'));
  node_access_rebuild();
  \Drupal::state()
    ->set('node_access_test.private', TRUE);

  // 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();
}