public function FreelinkingManagerTest::parseTargetProvider in Freelinking 4.0.x
Same name and namespace in other branches
- 8.3 tests/src/Unit/FreelinkingManagerTest.php \Drupal\Tests\freelinking\Unit\FreelinkingManagerTest::parseTargetProvider()
Provide test parameters and expected values for testParseTarget().
Return value
array An array of test parameters and expected values.
File
- tests/
src/ Unit/ FreelinkingManagerTest.php, line 79
Class
- FreelinkingManagerTest
- Tests the freelinking plugin manager.
Namespace
Drupal\Tests\freelinking\UnitCode
public function parseTargetProvider() {
return [
[
[
'dest' => 'nid:2',
'text' => 'Special title',
'tooltip' => 'tooltip',
'other' => [],
],
'nid:2|Special title|tooltip',
],
[
[
'dest' => 'nid:2',
'text' => NULL,
'tooltip' => NULL,
'other' => [],
],
'nid:2',
],
[
[
'dest' => 'external:http://example.com?id=12345',
'text' => '1',
'tooltip' => NULL,
'other' => [],
],
'external:http://example.com?id=12345|1',
],
[
[
'dest' => 'external:http://example.com?id=12345&q=%E2%99%A5#fragment',
'text' => 'Title',
'tooltip' => 'Tooltip',
'arbitrary' => 'value',
'other' => [
'Other',
],
],
'external:http://example.com?id=12345&q=%E2%99%A5#fragment|Title|Tooltip|arbitrary=value|Other',
],
];
}