function FieldPluginBaseTest::providerTestRenderAsExternalLinkWithPathAndTokens
Same name in other branches
- 8.9.x core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::providerTestRenderAsExternalLinkWithPathAndTokens()
- 10 core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::providerTestRenderAsExternalLinkWithPathAndTokens()
- 11.x core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::providerTestRenderAsExternalLinkWithPathAndTokens()
Data provider for ::testRenderAsExternalLinkWithPathAndTokens().
Return value
array Test data.
File
-
core/
modules/ views/ tests/ src/ Unit/ Plugin/ field/ FieldPluginBaseTest.php, line 636
Class
- FieldPluginBaseTest
- @coversDefaultClass \Drupal\views\Plugin\views\field\FieldPluginBase @group views
Namespace
Drupal\Tests\views\Unit\Plugin\fieldCode
public function providerTestRenderAsExternalLinkWithPathAndTokens() {
$data = [];
$data[] = [
'{{ foo }}',
[
'{{ foo }}' => 'http://www.drupal.org',
],
'<a href="http://www.drupal.org">value</a>',
[
'context_path' => 'http://www.drupal.org',
],
];
$data[] = [
'{{ foo }}',
[
'{{ foo }}' => '',
],
'value',
[
'context_path' => '',
],
];
$data[] = [
'{{ foo }}',
[
'{{ foo }}' => '',
],
'value',
[
'context_path' => '',
'alter' => [
'external' => TRUE,
],
],
];
$data[] = [
'{{ foo }}',
[
'{{ foo }}' => '/test-path/123',
],
'<a href="/test-path/123">value</a>',
[
'context_path' => '/test-path/123',
],
];
return $data;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.