You are here

public function FileImportExportTest::fileImportExportDataProvider in Acquia Content Hub 8.2

Data provider for testFileImportExport.

Return value

array Test data sets.

File

tests/src/Kernel/FileImportExportTest.php, line 138

Class

FileImportExportTest
Tests that files are properly exported and imported.

Namespace

Drupal\Tests\acquia_contenthub\Kernel

Code

public function fileImportExportDataProvider() {
  $export_uuid_node = [
    'b5ca43f8-adce-411d-a161-aff4eeda5e36',
    '386db454-41ab-4628-b2b1-caae809569a7',
  ];
  $export_uuid_files = [
    'b88f7854-0b14-4993-88ab-f14f9e24c4b3',
    'a5b12985-69f7-46d0-8e3f-a9e940eab99f',
    'f8a90411-8bc0-4e49-a4e5-211add30c654',
  ];
  if (version_compare(\Drupal::VERSION, '8.8.0', '<')) {
    $export_uuid_node = [
      '88be98ad-e1fd-4d81-929a-6a1a444e44ee',
      '6b600947-877a-4512-b054-749ffa1ec821',
    ];
    $export_uuid_files = [
      '0a70f867-cc1f-4eb3-b025-bf6ee9158425',
      'ff3d6699-52d7-4586-ad24-cca8f1b9459b',
      '5021d85b-6784-4185-8b25-d2db32dd5483',
    ];
  }
  return [
    [
      0,
      [
        [
          'type' => 'file',
          'uuid' => $export_uuid_files[0],
          'file' => '%s/misc/1.txt',
        ],
      ],
      'node',
      $export_uuid_node['0'],
    ],
    [
      1,
      [
        [
          'type' => 'file',
          'uuid' => $export_uuid_files[1],
          'file' => '%s/misc/1.txt',
        ],
        [
          'type' => 'file',
          'uuid' => $export_uuid_files[2],
          'file' => '%s/misc/2.txt',
        ],
      ],
      'node',
      $export_uuid_node['1'],
    ],
  ];
}