3 namespace Drupal\Tests\link\Unit\Plugin\migrate\process\d6;
5 use Drupal\link\Plugin\migrate\process\d6\FieldLink;
6 use Drupal\Tests\UnitTestCase;
11 class FieldLinkTest extends UnitTestCase {
14 * Test the url transformations in the FieldLink process plugin.
16 * @dataProvider canonicalizeUriDataProvider
18 public function testCanonicalizeUri($url, $expected) {
19 $link_plugin = new FieldLink([], '', [], $this->getMock('\Drupal\migrate\Plugin\MigrationInterface'));
20 $transformed = $link_plugin->transform([
23 'attributes' => serialize([]),
24 ], $this->getMock('\Drupal\migrate\MigrateExecutableInterface'), $this->getMockBuilder('\Drupal\migrate\Row')->disableOriginalConstructor()->getMock(), NULL);
25 $this->assertEquals($expected, $transformed['uri']);
29 * Data provider for testCanonicalizeUri.
31 public function canonicalizeUriDataProvider() {
33 'Simple front-page' => [
37 'Front page with query' => [
41 'No leading forward slash' => [
45 'Leading forward slash' => [
49 'Existing scheme' => [