function ChainedPlaceholderStrategyTest::testProcessPlaceholdersNoStrategies
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Render/Placeholder/ChainedPlaceholderStrategyTest.php \Drupal\Tests\Core\Render\Placeholder\ChainedPlaceholderStrategyTest::testProcessPlaceholdersNoStrategies()
- 8.9.x core/tests/Drupal/Tests/Core/Render/Placeholder/ChainedPlaceholderStrategyTest.php \Drupal\Tests\Core\Render\Placeholder\ChainedPlaceholderStrategyTest::testProcessPlaceholdersNoStrategies()
- 11.x core/tests/Drupal/Tests/Core/Render/Placeholder/ChainedPlaceholderStrategyTest.php \Drupal\Tests\Core\Render\Placeholder\ChainedPlaceholderStrategyTest::testProcessPlaceholdersNoStrategies()
@covers ::processPlaceholders
File
-
core/
tests/ Drupal/ Tests/ Core/ Render/ Placeholder/ ChainedPlaceholderStrategyTest.php, line 128
Class
- ChainedPlaceholderStrategyTest
- @coversDefaultClass \Drupal\Core\Render\Placeholder\ChainedPlaceholderStrategy @group Render
Namespace
Drupal\Tests\Core\Render\PlaceholderCode
public function testProcessPlaceholdersNoStrategies() : void {
// Placeholders but no strategies defined.
$placeholders = [
'assert-me' => [
'#markup' => 'I-am-a-llama-that-will-lead-to-an-assertion-by-the-chained-placeholder-strategy.',
],
];
$chained_placeholder_strategy = new ChainedPlaceholderStrategy();
$this->expectException(\AssertionError::class);
$this->expectExceptionMessage('At least one placeholder strategy must be present; by default the fallback strategy \\Drupal\\Core\\Render\\Placeholder\\SingleFlushStrategy is always present.');
$chained_placeholder_strategy->processPlaceholders($placeholders);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.