function ChainedPlaceholderStrategyTest::testProcessPlaceholdersNoStrategies

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Render/Placeholder/ChainedPlaceholderStrategyTest.php \Drupal\Tests\Core\Render\Placeholder\ChainedPlaceholderStrategyTest::testProcessPlaceholdersNoStrategies()
  2. 10 core/tests/Drupal/Tests/Core/Render/Placeholder/ChainedPlaceholderStrategyTest.php \Drupal\Tests\Core\Render\Placeholder\ChainedPlaceholderStrategyTest::testProcessPlaceholdersNoStrategies()
  3. 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 124

Class

ChainedPlaceholderStrategyTest
@coversDefaultClass \Drupal\Core\Render\Placeholder\ChainedPlaceholderStrategy @group Render

Namespace

Drupal\Tests\Core\Render\Placeholder

Code

public function testProcessPlaceholdersNoStrategies() {
    // 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.