You are here

public static function MediaMigrationSourceDatabaseTrait::getFieldDataFieldFileImageTitleTextTableData in Media Migration 8

Returns values for the "field_data_field_file_image_title_text" DB table.

Parameters

bool $with_title_data: Whether the returned data should should contain a record for some image "title" properties. Defaults to FALSE.

Return value

array[] An array of database table records with values, keyed by the column name.

1 call to MediaMigrationSourceDatabaseTrait::getFieldDataFieldFileImageTitleTextTableData()
FileEntitySourceFieldInstanceTest::providerSource in tests/src/Kernel/Plugin/migrate/source/d7/FileEntitySourceFieldInstanceTest.php
The data provider.

File

tests/src/Traits/MediaMigrationSourceDatabaseTrait.php, line 323

Class

MediaMigrationSourceDatabaseTrait
Source database table values for Media Migration's tests.

Namespace

Drupal\Tests\media_migration\Traits

Code

public static function getFieldDataFieldFileImageTitleTextTableData(bool $with_title_data = TRUE) {
  $data = [
    [
      'entity_type' => 'file',
      'bundle' => 'image',
      'deleted' => 0,
      'entity_id' => 1,
      'revision_id' => 1,
      'language' => 'und',
      'delta' => 0,
      'field_file_image_title_text_value' => $with_title_data ? 'Title copy for blue.png' : NULL,
      'field_file_image_title_text_format' => NULL,
    ],
  ];
  if ($with_title_data) {
    $data[] = [
      'entity_type' => 'file',
      'bundle' => 'image',
      'deleted' => 0,
      'entity_id' => 3,
      'revision_id' => 3,
      'language' => 'und',
      'delta' => 0,
      'field_file_image_title_text_value' => 'Title copy for red.jpeg',
      'field_file_image_title_text_format' => NULL,
    ];
  }
  return $data;
}