You are here

public function FileTest::testPrivateUri 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::testPrivateUri()

Tests that private file URIs are properly transformed by prepareRow().

File

core/modules/file/tests/src/Unit/Plugin/migrate/source/d7/FileTest.php, line 75
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 testPrivateUri() {
  $this->source->privatePath = '/path/to/private/files';
  $row = new Row([
    'uri' => 'private://baz.jpeg',
  ], [
    'uri' => [],
  ]);
  $this->source
    ->prepareRow($row);
  $this
    ->assertEquals('/path/to/private/files/baz.jpeg', $row
    ->getSourceProperty('filepath'));
}