You are here

public function FileCopyTest::testNonExistentSourceFile in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php \Drupal\Tests\migrate\Kernel\process\FileCopyTest::testNonExistentSourceFile()

Tests that non-existent files throw an exception.

File

core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php, line 163

Class

FileCopyTest
Tests the file_copy process plugin.

Namespace

Drupal\Tests\migrate\Kernel\process

Code

public function testNonExistentSourceFile() {
  $source = '/non/existent/file';
  $this
    ->expectException(MigrateException::class);
  $this
    ->expectExceptionMessage("File '/non/existent/file' does not exist");
  $this
    ->doTransform($source, 'public://wontmatter.jpg');
}