$view = Views::
getView('test_example_area'
);
$view->
initHandlers();
$this->
drupalGet('admin/structure/views/nojs/handler/test_example_area/default/empty/test_example'
);
// Test that the list is token present.
$this->
assertSession()->
elementExists('xpath', '//ul[@class="global-tokens"]'
);
$empty_handler = &
$view->empty
['test_example'
];
// Test the list of available tokens.
$available =
$empty_handler->
getAvailableGlobalTokens();
foreach (['site', 'view'
] as $type) { $this->
assertNotEmpty($available[$type]);
$this->
assertIsArray($available[$type]);
// Test that each item exists in the list.
foreach ($available[$type] as $token =>
$info) { $this->
assertSession()->
pageTextContains("[
$type:
$token]"
);
} } // Test the rendered output of a token.