function FieldFilteredMarkupTest::providerTestCreate
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Field/FieldFilteredMarkupTest.php \Drupal\Tests\Core\Field\FieldFilteredMarkupTest::providerTestCreate()
- 8.9.x core/tests/Drupal/Tests/Core/Field/FieldFilteredMarkupTest.php \Drupal\Tests\Core\Field\FieldFilteredMarkupTest::providerTestCreate()
- 10 core/tests/Drupal/Tests/Core/Field/FieldFilteredMarkupTest.php \Drupal\Tests\Core\Field\FieldFilteredMarkupTest::providerTestCreate()
Provides data for testCreate().
File
-
core/
tests/ Drupal/ Tests/ Core/ Field/ FieldFilteredMarkupTest.php, line 34
Class
- FieldFilteredMarkupTest
- @coversDefaultClass \Drupal\Core\Field\FieldFilteredMarkup @group Field
Namespace
Drupal\Tests\Core\FieldCode
public static function providerTestCreate() {
$data = [];
$data[] = [
'',
'',
FALSE,
];
// Certain tags are filtered.
$data[] = [
'<script>test string</script>',
'test string',
TRUE,
];
// Certain tags are not filtered.
$data[] = [
'<em>test string</em>',
'<em>test string</em>',
TRUE,
];
// HTML will be normalized.
$data[] = [
'<em>test string',
'<em>test string</em>',
TRUE,
];
// Even safe strings will be escaped.
$safe_string = (new Prophet())->prophesize(MarkupInterface::class);
$safe_string->__toString()
->willReturn('<script>test string</script>');
$data[] = [
$safe_string->reveal(),
'test string',
TRUE,
];
return $data;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.