You are here

protected function InlineBlockPrivateFilesTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\InlineBlockPrivateFilesTest::setUp()

Overrides InlineBlockTestBase::setUp

File

core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php, line 44

Class

InlineBlockPrivateFilesTest
Test access to private files in block fields on the Layout Builder.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function setUp() {
  parent::setUp();

  // Update the test node type to not create new revisions by default. This
  // allows testing for cases when a new revision is made and when it isn't.
  $node_type = NodeType::load('bundle_with_section_field');
  $node_type
    ->setNewRevision(FALSE);
  $node_type
    ->save();
  $field_settings = [
    'file_extensions' => 'txt',
    'uri_scheme' => 'private',
  ];
  $this
    ->createFileField('field_file', 'block_content', 'basic', $field_settings);
  $this->fileSystem = $this->container
    ->get('file_system');
}