You are here

private function XBBCodeStandardTest::checkMarkup in Extensible BBCode 4.0.x

Same name and namespace in other branches
  1. 8.3 standard/tests/src/Kernel/XBBCodeStandardTest.php \Drupal\Tests\xbbcode_standard\Kernel\XBBCodeStandardTest::checkMarkup()

A variant of check_markup that returns the full element.

This is needed to check the #attached key.

Parameters

string $text: The input text.

string $format_id: The format ID.

Return value

array The render array representing the processed text.

1 call to XBBCodeStandardTest::checkMarkup()
XBBCodeStandardTest::testTags in standard/tests/src/Kernel/XBBCodeStandardTest.php
Test all of the tags installed by this module.

File

standard/tests/src/Kernel/XBBCodeStandardTest.php, line 270

Class

XBBCodeStandardTest
Test the standard tags provided by XBBCode.

Namespace

Drupal\Tests\xbbcode_standard\Kernel

Code

private function checkMarkup(string $text, string $format_id) : array {
  $build = [
    '#type' => 'processed_text',
    '#text' => $text,
    '#format' => $format_id,
    '#filter_types_to_skip' => [],
    '#langcode' => '',
  ];
  \Drupal::service('renderer')
    ->renderPlain($build);
  return $build;
}