function MigrateUpgradeTestBase::assertFileMigrations

Same name in other branches
  1. 9 core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeTestBase::assertFileMigrations()
  2. 11.x core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeTestBase::assertFileMigrations()

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 348

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);
        }
    }
}

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