You are here

public static function MediaMigrationSourceDatabaseTrait::getFieldDataFieldFileImageAltTextTableData in Media Migration 8

Returns the values for the "field_data_field_file_image_alt_text" DB table.

Parameters

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

Return value

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

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

File

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

Class

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

Namespace

Drupal\Tests\media_migration\Traits

Code

public static function getFieldDataFieldFileImageAltTextTableData(bool $with_alt_data = TRUE) {
  $data = [
    [
      'entity_type' => 'file',
      'bundle' => 'image',
      'deleted' => 0,
      'entity_id' => 1,
      'revision_id' => 1,
      'language' => 'und',
      'delta' => 0,
      'field_file_image_alt_text_value' => $with_alt_data ? 'Alternative text about blue.png' : NULL,
      'field_file_image_alt_text_format' => NULL,
    ],
  ];
  if ($with_alt_data) {
    $data[] = [
      'entity_type' => 'file',
      'bundle' => 'image',
      'deleted' => 0,
      'entity_id' => 3,
      'revision_id' => 3,
      'language' => 'und',
      'delta' => 0,
      'field_file_image_alt_text_value' => 'Alternative text about red.jpeg',
      'field_file_image_alt_text_format' => NULL,
    ];
  }
  return $data;
}