function TokenTest::setupSiteTokens
Sets up the token library to return site tokens.
1 call to TokenTest::setupSiteTokens()
- TokenTest::testReplacePlain in core/
tests/ Drupal/ Tests/ Core/ Utility/ TokenTest.php - Tests replace plain.
File
-
core/
tests/ Drupal/ Tests/ Core/ Utility/ TokenTest.php, line 355
Class
Namespace
Drupal\Tests\Core\UtilityCode
protected function setupSiteTokens() : void {
// The site name is plain text, but the slogan is markup.
$tokens = [
'[site:name]' => 'Your <best> buys',
'[site:slogan]' => Markup::create('We are <b>best</b>'),
];
$this->moduleHandler
->expects($this->any())
->method('invokeAll')
->willReturn($tokens);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.