3 namespace Drupal\system\Tests\Update;
5 use Drupal\filter\Entity\FilterFormat;
8 * Tests that the allowed html configutations are updated with attributes.
12 class FilterHtmlUpdateTest extends UpdatePathTestBase {
17 public function setDatabaseDumpFiles() {
18 $this->databaseDumpFiles = [
19 __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
24 * Tests system_update_8009().
26 public function testAllowedHtmlUpdate() {
27 // Make sure we have the expected values before the update.
29 'basic_html' => '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h4> <h5> <h6> <p> <br> <span> <img>',
30 'restricted_html' => '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h4> <h5> <h6>',
32 foreach ($filters_before as $name => $before) {
33 $config = FilterFormat::load($name)->toArray();
34 $this->assertIdentical($before, $config['filters']['filter_html']['settings']['allowed_html']);
39 // Make sure we have the expected values after the update.
41 '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>',
42 '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>',
44 foreach ($filters_after as $name => $after) {
45 $config = FilterFormat::load($name)->toArray();
46 $this->assertIdentical($after, $config['filters']['filter_html']['settings']['allowed_html']);