You are here

public function FileTest::testTemporaryUri in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/file/tests/src/Unit/Plugin/migrate/source/d7/FileTest.php \Drupal\Tests\file\Unit\Plugin\migrate\source\d7\FileTest::testTemporaryUri()

Tests that temporary file URIs are property transformed by prepareRow().

File

core/modules/file/tests/src/Unit/Plugin/migrate/source/d7/FileTest.php, line 86
Contains \Drupal\Tests\file\Unit\Plugin\migrate\source\d7\FileTest.

Class

FileTest
Tests D7 file source plugin.

Namespace

Drupal\Tests\file\Unit\Plugin\migrate\source\d7

Code

public function testTemporaryUri() {
  $this->source->temporaryPath = '/tmp';
  $row = new Row([
    'uri' => 'temporary://camelot/lancelot.gif',
  ], [
    'uri' => [],
  ]);
  $this->source
    ->prepareRow($row);
  $this
    ->assertEquals('/tmp/camelot/lancelot.gif', $row
    ->getSourceProperty('filepath'));
}