X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Feditor%2Ftests%2Fsrc%2FFunctional%2FUpdate%2FEditorUpdateTest.php;fp=web%2Fcore%2Fmodules%2Feditor%2Ftests%2Fsrc%2FFunctional%2FUpdate%2FEditorUpdateTest.php;h=ad364844edc707fd9db9379eb86437212436d4cc;hp=0000000000000000000000000000000000000000;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/editor/tests/src/Functional/Update/EditorUpdateTest.php b/web/core/modules/editor/tests/src/Functional/Update/EditorUpdateTest.php new file mode 100644 index 000000000..ad364844e --- /dev/null +++ b/web/core/modules/editor/tests/src/Functional/Update/EditorUpdateTest.php @@ -0,0 +1,69 @@ +databaseDumpFiles = [ + __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', + // Simulate an un-synchronized environment. + __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.editor-editor_update_8001.php', + ]; + } + + /** + * Tests editor_update_8001(). + * + * @see editor_update_8001() + */ + public function testEditorUpdate8001() { + /** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */ + $config_factory = $this->container->get('config.factory'); + + $format_basic_html = $config_factory->get('filter.format.basic_html'); + $editor_basic_html = $config_factory->get('editor.editor.basic_html'); + $format_full_html = $config_factory->get('filter.format.full_html'); + $editor_full_html = $config_factory->get('editor.editor.full_html'); + + // Checks if the 'basic_html' format and editor statuses differ. + $this->assertTrue($format_basic_html->get('status')); + $this->assertFalse($editor_basic_html->get('status')); + $this->assertNotIdentical($format_basic_html->get('status'), $editor_basic_html->get('status')); + + // Checks if the 'full_html' format and editor statuses differ. + $this->assertFalse($format_full_html->get('status')); + $this->assertTrue($editor_full_html->get('status')); + $this->assertNotIdentical($format_full_html->get('status'), $editor_full_html->get('status')); + + // Run updates. + $this->runUpdates(); + + // Reload text formats and editors. + $format_basic_html = $config_factory->get('filter.format.basic_html'); + $editor_basic_html = $config_factory->get('editor.editor.basic_html'); + $format_full_html = $config_factory->get('filter.format.full_html'); + $editor_full_html = $config_factory->get('editor.editor.full_html'); + + // Checks if the 'basic_html' format and editor statuses are in sync. + $this->assertTrue($format_basic_html->get('status')); + $this->assertTrue($editor_basic_html->get('status')); + $this->assertIdentical($format_basic_html->get('status'), $editor_basic_html->get('status')); + + // Checks if the 'full_html' format and editor statuses are in sync. + $this->assertFalse($format_full_html->get('status')); + $this->assertFalse($editor_full_html->get('status')); + $this->assertIdentical($format_full_html->get('status'), $editor_full_html->get('status')); + } + +}