/**
* Tests that HTML restrictions and filter types are correct.
*
* @covers \Drupal\filter\Entity\FilterFormat::getHtmlRestrictions
* @covers \Drupal\filter\Entity\FilterFormat::getFilterTypes
*/
public function testFilterFormatAPI() { // Test on filtered_html.
$filtered_html_format = FilterFormat::
load('filtered_html'
);
$this->
assertSame( $filtered_html_format->
getHtmlRestrictions(),
[ 'allowed' =>
[ 'p' => FALSE,
'br' => FALSE,
'strong' => FALSE,
'a' =>
['href' => TRUE, 'hreflang' => TRUE
],
'*' =>
['style' => FALSE, 'on*' => FALSE, 'lang' => TRUE, 'dir' =>
['ltr' => TRUE, 'rtl' => TRUE
]],
],
],
'FilterFormatInterface::getHtmlRestrictions() works as expected for the filtered_html format.'
);