You are here

protected function FeedsKernelTestBase::setUpFileFields in Feeds 8.3

Installs a file and image fields (not needed for every kernel test).

1 call to FeedsKernelTestBase::setUpFileFields()
FileTestBase::setUp in tests/src/Kernel/Feeds/Target/FileTestBase.php

File

tests/src/Kernel/FeedsKernelTestBase.php, line 115

Class

FeedsKernelTestBase
Provides a base class for Feeds kernel tests.

Namespace

Drupal\Tests\feeds\Kernel

Code

protected function setUpFileFields() {

  // Create a file field.
  $this
    ->installModule('file');
  $this
    ->installConfig([
    'field',
    'node',
    'file',
  ]);
  $this
    ->installEntitySchema('file');
  $this
    ->installSchema('file', [
    'file_usage',
  ]);
  $this
    ->createFieldWithStorage('field_file', [
    'type' => 'file',
    'bundle' => 'article',
    'field' => [
      'settings' => [
        'file_extensions' => 'txt',
      ],
    ],
  ]);

  // Create an image field.
  $this
    ->installModule('image');
  $this
    ->installConfig([
    'image',
  ]);
  $this
    ->createFieldWithStorage('field_image', [
    'type' => 'image',
    'bundle' => 'article',
    'field' => [
      'settings' => [
        'file_extensions' => 'svg',
      ],
    ],
  ]);
}