public static function MigrateFileTest::migrateDumpAlter in Drupal 9
Same name and namespace in other branches
- 8 core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php \Drupal\Tests\file\Kernel\Migrate\d6\MigrateFileTest::migrateDumpAlter()
Allows tests to alter dumps after they have loaded.
Parameters
\Drupal\KernelTests\KernelTestBase $test: The test that is being run.
Overrides MigrateDumpAlterInterface::migrateDumpAlter
File
- core/
modules/ file/ tests/ src/ Kernel/ Migrate/ d6/ MigrateFileTest.php, line 142
Class
- MigrateFileTest
- Test file migration.
Namespace
Drupal\Tests\file\Kernel\Migrate\d6Code
public static function migrateDumpAlter(KernelTestBase $test) {
$db = Database::getConnection('default', 'migrate');
$db
->update('files')
->condition('fid', 3)
->fields([
'filename' => 'image-3.jpg',
'filepath' => 'core/tests/fixtures/files/image-3.jpg',
])
->execute();
$file = (array) $db
->select('files')
->fields('files')
->condition('fid', 5)
->execute()
->fetchObject();
unset($file['fid']);
$db
->insert('files')
->fields($file)
->execute();
return static::$tempFilename;
}