Skip to content
Snippets Groups Projects
Unverified Commit 937d6fed authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3041096 by claudiu.cristea: Convert FilterNoFormatTest to a kernel test

parent 0daec530
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
<?php
namespace Drupal\Tests\filter\Functional;
namespace Drupal\Tests\filter\Kernel;
use Drupal\Tests\BrowserTestBase;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests the behavior of check_markup() when it is called without text format.
*
* @group filter
*/
class FilterNoFormatTest extends BrowserTestBase {
class FilterNoFormatTest extends KernelTestBase {
/**
* Modules to enable.
*
* @var array
* {@inheritdoc}
*/
public static $modules = ['filter'];
......@@ -25,13 +23,15 @@ class FilterNoFormatTest extends BrowserTestBase {
* fallback format.
*/
public function testCheckMarkupNoFormat() {
$this->installConfig(['filter']);
// Create some text. Include some HTML and line breaks, so we get a good
// test of the filtering that is applied to it.
$text = "<strong>" . $this->randomMachineName(32) . "</strong>\n\n<div>" . $this->randomMachineName(32) . "</div>";
// Make sure that when this text is run through check_markup() with no text
// format, it is filtered as though it is in the fallback format.
$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.');
$this->assertEquals(check_markup($text), check_markup($text, filter_fallback_format()));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment