You are here

protected function MigrateUpgradeTestBase::assertFileMigrations in Drupal 9

Checks public and private files are copied but not temporary files.

1 call to MigrateUpgradeTestBase::assertFileMigrations()
FilePathTest::testFilePath in core/modules/migrate_drupal_ui/tests/src/Functional/d7/FilePathTest.php
Executes all steps of migrations upgrade.

File

core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php, line 344

Class

MigrateUpgradeTestBase
Provides a base class for testing migration upgrades in the UI.

Namespace

Drupal\Tests\migrate_drupal_ui\Functional

Code

protected function assertFileMigrations() {
  $fs = \Drupal::service('file_system');
  $files = $this
    ->getManagedFiles();
  foreach ($files as $file) {
    preg_match('/^(private|public|temporary):/', $file['uri'], $matches);
    $scheme = $matches[1];
    $filepath = $fs
      ->realpath($file['uri']);
    if ($scheme === 'temporary') {
      $this
        ->assertFileDoesNotExist($filepath);
    }
    else {
      $this
        ->assertFileExists($filepath);
    }
  }
}