function FileCopyTest::testNonExistentSourceFile

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php \Drupal\Tests\migrate\Kernel\process\FileCopyTest::testNonExistentSourceFile()
  2. 8.9.x core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php \Drupal\Tests\migrate\Kernel\process\FileCopyTest::testNonExistentSourceFile()
  3. 10 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 165

Class

FileCopyTest
Tests the file_copy process plugin.

Namespace

Drupal\Tests\migrate\Kernel\process

Code

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

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