3 namespace Drupal\Tests\system\Functional\Update;
5 use Drupal\filter\Entity\FilterFormat;
6 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
9 * Tests that the allowed html configurations are updated with attributes.
14 class FilterHtmlUpdateTest extends UpdatePathTestBase {
19 public function setDatabaseDumpFiles() {
20 $this->databaseDumpFiles = [
21 __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
26 * Tests system_update_8009().
28 public function testAllowedHtmlUpdate() {
29 // Make sure we have the expected values before the update.
31 'basic_html' => '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h4> <h5> <h6> <p> <br> <span> <img>',
32 'restricted_html' => '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h4> <h5> <h6>',
34 foreach ($filters_before as $name => $before) {
35 $config = FilterFormat::load($name)->toArray();
36 $this->assertIdentical($before, $config['filters']['filter_html']['settings']['allowed_html']);
41 // Make sure we have the expected values after the update.
43 'basic_html' => '<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h4 id> <h5 id> <h6 id> <p> <br> <span> <img src alt height width data-align data-caption>',
44 'restricted_html' => '<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h4 id> <h5 id> <h6 id>',
46 foreach ($filters_after as $name => $after) {
47 $config = FilterFormat::load($name)->toArray();
48 $this->assertIdentical($after, $config['filters']['filter_html']['settings']['allowed_html']);