function FieldLinkTest::testCanonicalizeUri
Same name in other branches
- 9 core/modules/link/tests/src/Unit/Plugin/migrate/process/FieldLinkTest.php \Drupal\Tests\link\Unit\Plugin\migrate\process\FieldLinkTest::testCanonicalizeUri()
- 8.9.x core/modules/link/tests/src/Unit/Plugin/migrate/process/FieldLinkTest.php \Drupal\Tests\link\Unit\Plugin\migrate\process\FieldLinkTest::testCanonicalizeUri()
- 8.9.x core/modules/link/tests/src/Unit/Plugin/migrate/process/d6/FieldLinkTest.php \Drupal\Tests\link\Unit\Plugin\migrate\process\d6\FieldLinkTest::testCanonicalizeUri()
- 11.x core/modules/link/tests/src/Unit/Plugin/migrate/process/FieldLinkTest.php \Drupal\Tests\link\Unit\Plugin\migrate\process\FieldLinkTest::testCanonicalizeUri()
Tests the URL transformations in the FieldLink process plugin.
@dataProvider canonicalizeUriDataProvider
File
-
core/
modules/ link/ tests/ src/ Unit/ Plugin/ migrate/ process/ FieldLinkTest.php, line 23
Class
- FieldLinkTest
- @group Link
Namespace
Drupal\Tests\link\Unit\Plugin\migrate\processCode
public function testCanonicalizeUri($url, $expected, $configuration = []) : void {
$link_plugin = new FieldLink($configuration, '', [], $this->createMock(MigrationInterface::class));
$transformed = $link_plugin->transform([
'url' => $url,
'title' => '',
'attributes' => serialize([]),
], $this->createMock(MigrateExecutableInterface::class), $this->getMockBuilder(Row::class)
->disableOriginalConstructor()
->getMock(), NULL);
$this->assertEquals($expected, $transformed['uri']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.