public function HierarchicalTermFormatterTest::dataProvider in Hierarchical Term Formatter 8
Provides data for testFormatter().
File
- tests/
src/ Functional/ HierarchicalTermFormatterTest.php, line 138
Class
- HierarchicalTermFormatterTest
- Verifies Hierarchical Term Formatter.
Namespace
Drupal\Tests\hierarchical_term_formatter\FunctionalCode
public function dataProvider() {
$data = [];
$data[] = [
'1.1.1.1',
[
'all' => '1 » 1.1 » 1.1.1 » 1.1.1.1',
'linked' => [
'items' => [
'1',
'1.1',
'1.1.1',
'1.1.1.1',
],
'separator' => ' » ',
],
'nonroot_only' => '1.1 » 1.1.1 » 1.1.1.1',
'parents_only' => '1 » 1.1 » 1.1.1',
'reversed' => '1.1.1.1 » 1.1.1 » 1.1 » 1',
'root_only' => '1',
'selected_only' => '1.1.1.1',
'separator' => '1 | 1.1 | 1.1.1 | 1.1.1.1',
],
];
$data[] = [
'1.1.1.2',
[
'all' => '1 » 1.1 » 1.1.1 » 1.1.1.2',
'linked' => [
'items' => [
'1',
'1.1',
'1.1.1',
'1.1.1.2',
],
'separator' => ' » ',
],
'nonroot_only' => '1.1 » 1.1.1 » 1.1.1.2',
'parents_only' => '1 » 1.1 » 1.1.1',
'reversed' => '1.1.1.2 » 1.1.1 » 1.1 » 1',
'root_only' => '1',
'selected_only' => '1.1.1.2',
'separator' => '1 | 1.1 | 1.1.1 | 1.1.1.2',
],
];
$data[] = [
'1.1.2',
[
'all' => '1 » 1.1 » 1.1.2',
'linked' => [
'items' => [
'1',
'1.1',
'1.1.2',
],
'separator' => ' » ',
],
'nonroot_only' => '1.1 » 1.1.2',
'parents_only' => '1 » 1.1',
'reversed' => '1.1.2 » 1.1 » 1',
'root_only' => '1',
'selected_only' => '1.1.2',
'separator' => '1 | 1.1 | 1.1.2',
],
];
$data[] = [
'2',
[
'all' => '2',
'linked' => [
'items' => [
'2',
],
'separator' => ' » ',
],
'reversed' => '2',
'root_only' => '2',
'selected_only' => '2',
'separator' => '2',
],
];
$data[] = [
'2.2',
[
'all' => '2 » 2.2',
'linked' => [
'items' => [
'2',
'2.2',
],
'separator' => ' » ',
],
'nonroot_only' => '2.2',
'parents_only' => '2',
'reversed' => '2.2 » 2',
'root_only' => '2',
'selected_only' => '2.2',
'separator' => '2 | 2.2',
],
];
return $data;
}