You are here

public function FieldLinkTest::testCanonicalizeUri in Drupal 8

Same name in this branch
  1. 8 core/modules/link/tests/src/Unit/Plugin/migrate/process/FieldLinkTest.php \Drupal\Tests\link\Unit\Plugin\migrate\process\FieldLinkTest::testCanonicalizeUri()
  2. 8 core/modules/link/tests/src/Unit/Plugin/migrate/process/d6/FieldLinkTest.php \Drupal\Tests\link\Unit\Plugin\migrate\process\d6\FieldLinkTest::testCanonicalizeUri()

Test the url transformations in the FieldLink process plugin.

@dataProvider canonicalizeUriDataProvider

File

core/modules/link/tests/src/Unit/Plugin/migrate/process/d6/FieldLinkTest.php, line 19

Class

FieldLinkTest
@group Link @group legacy

Namespace

Drupal\Tests\link\Unit\Plugin\migrate\process\d6

Code

public function testCanonicalizeUri($url, $expected) {
  $link_plugin = new FieldLink([], '', [], $this
    ->createMock('\\Drupal\\migrate\\Plugin\\MigrationInterface'));
  $transformed = $link_plugin
    ->transform([
    'url' => $url,
    'title' => '',
    'attributes' => serialize([]),
  ], $this
    ->createMock('\\Drupal\\migrate\\MigrateExecutableInterface'), $this
    ->getMockBuilder('\\Drupal\\migrate\\Row')
    ->disableOriginalConstructor()
    ->getMock(), NULL);
  $this
    ->assertEquals($expected, $transformed['uri']);
}