3 namespace Drupal\Tests\filter\Functional;
5 use Drupal\Tests\BrowserTestBase;
8 * Tests the behavior of check_markup() when it is called without text format.
12 class FilterNoFormatTest extends BrowserTestBase {
19 public static $modules = ['filter'];
22 * Tests text without format.
24 * Tests if text with no format is filtered the same way as text in the
27 public function testCheckMarkupNoFormat() {
28 // Create some text. Include some HTML and line breaks, so we get a good
29 // test of the filtering that is applied to it.
30 $text = "<strong>" . $this->randomMachineName(32) . "</strong>\n\n<div>" . $this->randomMachineName(32) . "</div>";
32 // Make sure that when this text is run through check_markup() with no text
33 // format, it is filtered as though it is in the fallback format.
34 $this->assertEqual(check_markup($text), check_markup($text, filter_fallback_format()), 'Text with no format is filtered the same as text in the fallback format.');