function MigrateFileTest::testFileMigration

Same name in other branches
  1. 8.9.x core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileTest.php \Drupal\Tests\file\Kernel\Migrate\d7\MigrateFileTest::testFileMigration()
  2. 10 core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileTest.php \Drupal\Tests\file\Kernel\Migrate\d7\MigrateFileTest::testFileMigration()
  3. 11.x core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileTest.php \Drupal\Tests\file\Kernel\Migrate\d7\MigrateFileTest::testFileMigration()

Tests that all expected files are migrated.

File

core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileTest.php, line 45

Class

MigrateFileTest
Migrates all files in the file_managed table.

Namespace

Drupal\Tests\file\Kernel\Migrate\d7

Code

public function testFileMigration() {
    $this->assertEntity(1, 'cube.jpeg', 'public://cube.jpeg', 'image/jpeg', '3620', '1421727515', '1421727515', '1');
    // Ensure temporary file was not migrated.
    $this->assertNull(File::load(4));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.