function TokenTest::testReplacePlain
Same name in other branches
- 10 core/tests/Drupal/Tests/Core/Utility/TokenTest.php \Drupal\Tests\Core\Utility\TokenTest::testReplacePlain()
- 11.x core/tests/Drupal/Tests/Core/Utility/TokenTest.php \Drupal\Tests\Core\Utility\TokenTest::testReplacePlain()
@covers ::replacePlain
File
-
core/
tests/ Drupal/ Tests/ Core/ Utility/ TokenTest.php, line 300
Class
- TokenTest
- @coversDefaultClass \Drupal\Core\Utility\Token @group Utility
Namespace
Drupal\Tests\Core\UtilityCode
public function testReplacePlain() {
$this->setupSiteTokens();
$base = 'Wow, great "[site:name]" has a slogan "[site:slogan]"';
$plain = $this->token
->replacePlain($base);
$this->assertEquals($plain, 'Wow, great "Your <best> buys" has a slogan "We are best"');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.