You are here

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

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

File

core/modules/file/tests/src/Unit/Plugin/migrate/source/d7/FileTest.php, line 64
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 testPublicUri() {
  $this->source->publicPath = 'sites/default/files';
  $row = new Row([
    'uri' => 'public://foo.png',
  ], [
    'uri' => [],
  ]);
  $this->source
    ->prepareRow($row);
  $this
    ->assertEquals('sites/default/files/foo.png', $row
    ->getSourceProperty('filepath'));
}