/**
* Tests the Drupal 6 files to Drupal 8 migration.
*/
public function testFiles() { $this->
assertEntity(1, 'Image1.png', 39325, 'public://image-1.png', 'image/png', 1
);
$this->
assertEntity(2, 'Image2.jpg', 1831, 'public://image-2.jpg', 'image/jpeg', 1
);
$this->
assertEntity(3, 'image-3.jpg', 1831, 'public://image-3.jpg', 'image/jpeg', 1
);
$this->
assertEntity(4, 'html-1.txt', 19, 'public://html-1.txt', 'text/plain', 1
);
// Ensure temporary file was not migrated.
$this->
assertNull(File::
load(6
));
$map_table =
$this->
getMigration('d6_file'
)->
getIdMap()->
mapTableName();
$map = \Drupal::
database() ->
select($map_table, 'm'
) ->
fields('m',
['sourceid1', 'destid1'
]) ->
execute() ->
fetchAllKeyed();
$map_expected =
[ // The 4 files from the fixture.
1 => '1',
2 => '2',
// The file updated in migrateDumpAlter().
3 => '3',