function FilterAPITest::testCheckMarkupFilterOrder in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/filter/src/Tests/FilterAPITest.php \Drupal\filter\Tests\FilterAPITest::testCheckMarkupFilterOrder()
Tests that the filter order is respected.
File
- core/
modules/ filter/ src/ Tests/ FilterAPITest.php, line 37 - Contains \Drupal\filter\Tests\FilterAPITest.
Class
- FilterAPITest
- Tests the behavior of the API of the Filter module.
Namespace
Drupal\filter\TestsCode
function testCheckMarkupFilterOrder() {
// Create crazy HTML format.
$crazy_format = entity_create('filter_format', array(
'format' => 'crazy',
'name' => 'Crazy',
'weight' => 1,
'filters' => array(
'filter_html_escape' => array(
'weight' => 10,
'status' => 1,
),
'filter_html' => array(
'weight' => -10,
'status' => 1,
'settings' => array(
'allowed_html' => '<p>',
),
),
),
));
$crazy_format
->save();
$text = "<p>Llamas are <not> awesome!</p>";
$expected_filtered_text = "<p>Llamas are awesome!</p>";
$this
->assertEqual(check_markup($text, 'crazy'), $expected_filtered_text, 'Filters applied in correct order.');
}