3 namespace Drupal\Tests\editor\Functional\Update;
5 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
8 * Tests Editor module database updates.
13 class EditorUpdateTest extends UpdatePathTestBase {
18 public function setDatabaseDumpFiles() {
19 $this->databaseDumpFiles = [
20 __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
21 // Simulate an un-synchronized environment.
22 __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.editor-editor_update_8001.php',
27 * Tests editor_update_8001().
29 * @see editor_update_8001()
31 public function testEditorUpdate8001() {
32 /** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */
33 $config_factory = $this->container->get('config.factory');
35 $format_basic_html = $config_factory->get('filter.format.basic_html');
36 $editor_basic_html = $config_factory->get('editor.editor.basic_html');
37 $format_full_html = $config_factory->get('filter.format.full_html');
38 $editor_full_html = $config_factory->get('editor.editor.full_html');
40 // Checks if the 'basic_html' format and editor statuses differ.
41 $this->assertTrue($format_basic_html->get('status'));
42 $this->assertFalse($editor_basic_html->get('status'));
43 $this->assertNotIdentical($format_basic_html->get('status'), $editor_basic_html->get('status'));
45 // Checks if the 'full_html' format and editor statuses differ.
46 $this->assertFalse($format_full_html->get('status'));
47 $this->assertTrue($editor_full_html->get('status'));
48 $this->assertNotIdentical($format_full_html->get('status'), $editor_full_html->get('status'));
53 // Reload text formats and editors.
54 $format_basic_html = $config_factory->get('filter.format.basic_html');
55 $editor_basic_html = $config_factory->get('editor.editor.basic_html');
56 $format_full_html = $config_factory->get('filter.format.full_html');
57 $editor_full_html = $config_factory->get('editor.editor.full_html');
59 // Checks if the 'basic_html' format and editor statuses are in sync.
60 $this->assertTrue($format_basic_html->get('status'));
61 $this->assertTrue($editor_basic_html->get('status'));
62 $this->assertIdentical($format_basic_html->get('status'), $editor_basic_html->get('status'));
64 // Checks if the 'full_html' format and editor statuses are in sync.
65 $this->assertFalse($format_full_html->get('status'));
66 $this->assertFalse($editor_full_html->get('status'));
67 $this->assertIdentical($format_full_html->get('status'), $editor_full_html->get('status'));