function AllowedTagsXssTraitDeprecateTest::testDeprecation
@expectedDeprecation Drupal\Core\Field\AllowedTagsXssTrait::fieldFilterXss is deprecated in drupal:8.0.0 and is removed in drupal:9.0.0. Use \Drupal\Core\Field\FieldFilteredMarkup::create() instead. @expectedDeprecation Drupal\Core\Field\AllowedTagsXssTrait::allowedTags is deprecated in drupal:8.0.0 and is removed in drupal:9.0.0. Use \Drupal\Core\Field\FieldFilteredMarkup::allowedTags() instead. @expectedDeprecation Drupal\Core\Field\AllowedTagsXssTrait::displayAllowedTags is deprecated in drupal:8.0.0 and is removed in drupal:9.0.0. Use \Drupal\Core\Field\FieldFilteredMarkup::displayAllowedTags() instead.
File
-
core/
tests/ Drupal/ Tests/ Core/ Field/ AllowedTagsXssTraitDeprecateTest.php, line 22
Class
- AllowedTagsXssTraitDeprecateTest
- Tests AllowedTagsXssTrait.
Namespace
Drupal\Tests\Core\FieldCode
public function testDeprecation() {
$deprecated = new FieldDeprecateAllowedTagsXssTraitClass();
$this->assertSame('Test string', (string) $deprecated->fieldFilterXss('<object>Test string</object>'));
$this->assertSame(FieldFilteredMarkup::allowedTags(), $deprecated->allowedTags());
$this->assertSame(FieldFilteredMarkup::displayAllowedTags(), $deprecated->displayAllowedTags());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.