You are here

protected function FileTest::getTargetDefinition in Feeds 8.3

Returns target definition to pass to the target constructor.

Return value

array The target definition for the file target.

Overrides FileTestBase::getTargetDefinition

File

tests/src/Kernel/Feeds/Target/FileTest.php, line 26

Class

FileTest
@coversDefaultClass \Drupal\feeds\Feeds\Target\File @group feeds

Namespace

Drupal\Tests\feeds\Kernel\Feeds\Target

Code

protected function getTargetDefinition() {
  $method = $this
    ->getMethod(File::class, 'prepareTarget')
    ->getClosure();
  $field_definition_mock = $this
    ->getMockFieldDefinition([
    'display_field' => 'false',
    'display_default' => 'false',
    'uri_scheme' => 'public',
    'target_type' => 'file',
    'file_directory' => '[date:custom:Y]-[date:custom:m]',
    'file_extensions' => 'pdf doc docx txt jpg jpeg ppt xls png',
    'max_filesize' => '',
    'description_field' => 'true',
    'handler' => 'default:file',
    'handler_settings' => [],
  ]);
  return $method($field_definition_mock);
}