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 configutations are updated with attributes.
13 class FilterHtmlUpdateTest extends UpdatePathTestBase {
18 public function setDatabaseDumpFiles() {
19 $this->databaseDumpFiles = [
20 __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
25 * Tests system_update_8009().
27 public function testAllowedHtmlUpdate() {
28 // Make sure we have the expected values before the update.
30 'basic_html' => '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h4> <h5> <h6> <p> <br> <span> <img>',
31 'restricted_html' => '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h4> <h5> <h6>',
33 foreach ($filters_before as $name => $before) {
34 $config = FilterFormat::load($name)->toArray();
35 $this->assertIdentical($before, $config['filters']['filter_html']['settings']['allowed_html']);
40 // Make sure we have the expected values after the update.
42 '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>',
43 '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>',
45 foreach ($filters_after as $name => $after) {
46 $config = FilterFormat::load($name)->toArray();
47 $this->assertIdentical($after, $config['filters']['filter_html']['settings']['allowed_html']);