Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website] / web / core / modules / filter / tests / src / Functional / FilterNoFormatTest.php
1 <?php
2
3 namespace Drupal\Tests\filter\Functional;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8  * Tests the behavior of check_markup() when it is called without text format.
9  *
10  * @group filter
11  */
12 class FilterNoFormatTest extends BrowserTestBase {
13
14   /**
15    * Modules to enable.
16    *
17    * @var array
18    */
19   public static $modules = ['filter'];
20
21   /**
22    * Tests text without format.
23    *
24    * Tests if text with no format is filtered the same way as text in the
25    * fallback format.
26    */
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>";
31
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.');
35   }
36
37 }