private function XBBCodeFilterTest::checkMarkup in Extensible BBCode 8.3
Same name and namespace in other branches
- 4.0.x tests/src/Kernel/XBBCodeFilterTest.php \Drupal\Tests\xbbcode\Kernel\XBBCodeFilterTest::checkMarkup()
Render a text through the filter system, returning the full render array.
Parameters
string $text: The text to be filtered.
string|null $format_id: (optional) The machine name of the filter format to be used to filter the text. Defaults to the fallback format. See filter_fallback_format().
Return value
array The render array, including #markup and #attached.
1 call to XBBCodeFilterTest::checkMarkup()
- XBBCodeFilterTest::testFilter in tests/
src/ Kernel/ XBBCodeFilterTest.php - Test a few basic aspects of the filter.
File
- tests/
src/ Kernel/ XBBCodeFilterTest.php, line 183
Class
- XBBCodeFilterTest
- Test the filter.
Namespace
Drupal\Tests\xbbcode\KernelCode
private function checkMarkup($text, $format_id) : array {
$build = [
'#type' => 'processed_text',
'#text' => $text,
'#format' => $format_id,
];
try {
$this->renderer
->renderPlain($build);
} catch (Exception $e) {
$build['#markup'] = '';
}
return $build;
}