3 namespace Drupal\Tests\link\Unit\Plugin\migrate\process\d6;
5 use Drupal\link\Plugin\migrate\process\d6\FieldLink;
6 use Drupal\Tests\UnitTestCase;
12 class FieldLinkTest extends UnitTestCase {
15 * Test the url transformations in the FieldLink process plugin.
17 * @dataProvider canonicalizeUriDataProvider
19 public function testCanonicalizeUri($url, $expected) {
20 $link_plugin = new FieldLink([], '', [], $this->getMock('\Drupal\migrate\Plugin\MigrationInterface'));
21 $transformed = $link_plugin->transform([
24 'attributes' => serialize([]),
25 ], $this->getMock('\Drupal\migrate\MigrateExecutableInterface'), $this->getMockBuilder('\Drupal\migrate\Row')->disableOriginalConstructor()->getMock(), NULL);
26 $this->assertEquals($expected, $transformed['uri']);
30 * Data provider for testCanonicalizeUri.
32 public function canonicalizeUriDataProvider() {
34 'Simple front-page' => [
38 'Front page with query' => [
42 'No leading forward slash' => [
46 'Leading forward slash' => [
50 'Existing scheme' => [