3 namespace Drupal\editor\Tests\Update;
5 use Drupal\system\Tests\Update\UpdatePathTestBase;
8 * Tests Editor module database updates.
12 class EditorUpdateTest extends UpdatePathTestBase {
17 public function setDatabaseDumpFiles() {
18 $this->databaseDumpFiles = [
19 __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
20 // Simulate an un-synchronized environment.
21 __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.editor-editor_update_8001.php',
26 * Tests editor_update_8001().
28 * @see editor_update_8001()
30 public function testEditorUpdate8001() {
31 /** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */
32 $config_factory = $this->container->get('config.factory');
34 $format_basic_html = $config_factory->get('filter.format.basic_html');
35 $editor_basic_html = $config_factory->get('editor.editor.basic_html');
36 $format_full_html = $config_factory->get('filter.format.full_html');
37 $editor_full_html = $config_factory->get('editor.editor.full_html');
39 // Checks if the 'basic_html' format and editor statuses differ.
40 $this->assertTrue($format_basic_html->get('status'));
41 $this->assertFalse($editor_basic_html->get('status'));
42 $this->assertNotIdentical($format_basic_html->get('status'), $editor_basic_html->get('status'));
44 // Checks if the 'full_html' format and editor statuses differ.
45 $this->assertFalse($format_full_html->get('status'));
46 $this->assertTrue($editor_full_html->get('status'));
47 $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'));