function EditorAddLazyLoadImageFilterUpdateTest::testUpdateLazyImageLoad
Same name in other branches
- 10 core/modules/editor/tests/src/Functional/Update/EditorAddLazyLoadImageFilterUpdateTest.php \Drupal\Tests\editor\Functional\Update\EditorAddLazyLoadImageFilterUpdateTest::testUpdateLazyImageLoad()
Tests upgrading filter settings.
See also
editor_post_update_image_lazy_load()
File
-
core/
modules/ editor/ tests/ src/ Functional/ Update/ EditorAddLazyLoadImageFilterUpdateTest.php, line 36
Class
- EditorAddLazyLoadImageFilterUpdateTest
- Tests adding editor_image_lazy_load filter to editor_file_reference.
Namespace
Drupal\Tests\editor\Functional\UpdateCode
public function testUpdateLazyImageLoad() : void {
$config = $this->config('filter.format.full_html');
$this->assertArrayNotHasKey('filter_image_lazy_load', $config->get('filters'));
$this->runUpdates();
$config = $this->config('filter.format.full_html');
$filters = $config->get('filters');
$this->assertArrayHasKey('filter_image_lazy_load', $filters);
$this->assertEquals($filters['editor_file_reference']['weight'] + 1, $filters['filter_image_lazy_load']['weight']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.