diff --git a/core/lib/Drupal/Core/Render/Placeholder/PlaceholderStrategyManager.php b/core/lib/Drupal/Core/Render/Placeholder/PlaceholderStrategyManager.php index b24ecc2..0940fd4 100644 --- a/core/lib/Drupal/Core/Render/Placeholder/PlaceholderStrategyManager.php +++ b/core/lib/Drupal/Core/Render/Placeholder/PlaceholderStrategyManager.php @@ -40,7 +40,7 @@ public function processPlaceholders(array $placeholders) { } // Assert that there is at least one strategy. - assert('!empty($this->placeholderStrategies)', 'At least one placeholder strategy needs to be present.'); + assert('!empty($this->placeholderStrategies)', 'At least one placeholder strategy must be present; by default the fallback strategy \Drupal\Core\Render\Placeholder\SingleFlushStrategy is always present.'); $new_placeholders = []; @@ -49,7 +49,7 @@ public function processPlaceholders(array $placeholders) { // and this uses a variation of the "chain of responsibility" design pattern. foreach ($this->placeholderStrategies as $strategy) { $processed_placeholders = $strategy->processPlaceholders($placeholders); - assert('array_intersect_key($processed_placeholders, $placeholders) === $processed_placeholders', 'Processed placeholders need to be a subset of all placeholders.'); + assert('array_intersect_key($processed_placeholders, $placeholders) === $processed_placeholders', 'Processed placeholders must be a subset of all placeholders.'); $placeholders = array_diff_key($placeholders, $processed_placeholders); $new_placeholders += $processed_placeholders; diff --git a/core/tests/Drupal/Tests/Core/Render/Placeholder/PlaceholderStrategyManagerTest.php b/core/tests/Drupal/Tests/Core/Render/Placeholder/PlaceholderStrategyManagerTest.php index 9e2d0f7..387cef5 100644 --- a/core/tests/Drupal/Tests/Core/Render/Placeholder/PlaceholderStrategyManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Render/Placeholder/PlaceholderStrategyManagerTest.php @@ -127,7 +127,7 @@ public function providerProcessPlaceholders() { * @covers ::processPlaceholders * * @expectedException \AssertionError - * @expectedExceptionMessage At least one placeholder strategy needs to be present. + * @expectedExceptionMessage At least one placeholder strategy must be present; by default the fallback strategy \Drupal\Core\Render\Placeholder\SingleFlushStrategy is always present. */ public function testProcessPlaceholdersNoStrategies() { // Placeholders but no strategies defined. @@ -143,7 +143,7 @@ public function testProcessPlaceholdersNoStrategies() { * @covers ::processPlaceholders * * @expectedException \AssertionError - * @expectedExceptionMessage Processed placeholders need to be a subset of all placeholders. + * @expectedExceptionMessage Processed placeholders must be a subset of all placeholders. */ public function testProcessPlaceholdersWithRoguePlaceholderStrategy() { // Placeholders but no strategies defined.