function PluginBaseTest::providerTestGetAvailableGlobalTokens
Data provider for testGetAvailableGlobalTokens().
Return value
array
- An associative array of token information.
- An array of additional token types.
- The expected tokens.
File
-
core/
modules/ views/ tests/ src/ Unit/ PluginBaseTest.php, line 67
Class
Namespace
Drupal\Tests\views\UnitCode
public static function providerTestGetAvailableGlobalTokens() : array {
return [
'0 global, 0 added' => [
[
'tokens' => [],
],
[],
[],
],
'0 global, 1 added' => [
[
'tokens' => [],
],
[
'date',
],
[],
],
'1 global, 1 added, same' => [
[
'tokens' => [
'date' => 'bar',
],
],
[
'date',
],
[
'date' => 'bar',
],
],
'1 global, 0 added' => [
[
'tokens' => [
'site' => 'foo',
],
],
[],
[
'site' => 'foo',
],
],
'1 global, 1 added' => [
[
'tokens' => [
'site' => 'foo',
],
],
[
'date',
],
[
'site' => 'foo',
],
],
'2 global, 1 added' => [
[
'tokens' => [
'site' => 'foo',
'date' => 'bar',
],
],
[
'date',
],
[
'site' => 'foo',
'date' => 'bar',
],
],
'3 global, 0 added' => [
[
'tokens' => [
'site' => 'foo',
'view' => 'baz',
'date' => 'bar',
],
],
[],
[
'site' => 'foo',
'view' => 'baz',
],
],
'3 global, 1 added' => [
[
'tokens' => [
'site' => 'foo',
'view' => 'baz',
'date' => 'bar',
],
],
[
'date',
],
[
'site' => 'foo',
'view' => 'baz',
'date' => 'bar',
],
],
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.