Commit aac3160d authored by webchick's avatar webchick
Browse files

Issue #2003430 by Wim Leers, ebeyrent, DmitryDrozdik, pwieck: Convert CKEditor...

Issue #2003430 by Wim Leers, ebeyrent, DmitryDrozdik, pwieck: Convert CKEditor tests to use ->container instead of drupal_container().
parent c8a5c8e3
......@@ -47,8 +47,7 @@ function setUp() {
}
function testAdmin() {
$manager = drupal_container()->get('plugin.manager.editor');
$ckeditor = $manager->createInstance('ckeditor');
$ckeditor = $this->container->get('plugin.manager.editor')->createInstance('ckeditor');
$this->drupalLogin($this->admin_user);
$this->drupalGet('admin/config/content/formats/manage/filtered_html');
......@@ -147,7 +146,7 @@ function testAdmin() {
// Now enable the ckeditor_test module, which provides one configurable
// CKEditor plugin — this should not affect the Editor config entity.
module_enable(array('ckeditor_test'));
drupal_container()->get('plugin.manager.ckeditor.plugin')->clearCachedDefinitions();
$this->container->get('plugin.manager.ckeditor.plugin')->clearCachedDefinitions();
$this->drupalGet('admin/config/content/formats/manage/filtered_html');
$ultra_llama_mode_checkbox = $this->xpath('//input[@type="checkbox" and @name="editor[settings][plugins][llama_contextual_and_button][ultra_llama_mode]" and not(@checked)]');
$this->assertTrue(count($ultra_llama_mode_checkbox) === 1, 'The "Ultra llama mode" checkbox exists and is not checked.');
......
......@@ -74,8 +74,7 @@ function setUp() {
$editor->save();
// Create "CKEditor" text editor plugin instance.
$this->manager = $this->container->get('plugin.manager.editor');
$this->ckeditor = $this->manager->createInstance('ckeditor');
$this->ckeditor = $this->container->get('plugin.manager.editor')->createInstance('ckeditor');
}
/**
......@@ -108,8 +107,8 @@ function testGetJSSettings() {
// Customize the configuration: add button, have two contextually enabled
// buttons, and configure a CKEditor plugin setting.
$this->enableModules(array('ckeditor_test'));
$this->manager->clearCachedDefinitions();
$this->ckeditor = $this->manager->createInstance('ckeditor');
$this->container->get('plugin.manager.editor')->clearCachedDefinitions();
$this->ckeditor = $this->container->get('plugin.manager.editor')->createInstance('ckeditor');
$this->container->get('plugin.manager.ckeditor.plugin')->clearCachedDefinitions();
$editor->settings['toolbar']['buttons'][0][] = 'Strike';
$editor->settings['toolbar']['buttons'][1][] = 'Format';
......@@ -218,7 +217,7 @@ function testBuildToolbarJSSetting() {
// Enable the editor_test module, customize further.
$this->enableModules(array('ckeditor_test'));
drupal_container()->get('plugin.manager.ckeditor.plugin')->clearCachedDefinitions();
$this->container->get('plugin.manager.ckeditor.plugin')->clearCachedDefinitions();
$editor->settings['toolbar']['buttons'][0][] = 'Llama';
$editor->save();
$expected[count($expected)-2]['items'][] = 'Llama';
......@@ -248,8 +247,7 @@ function testBuildContentsCssJSSetting() {
*/
function testInternalGetConfig() {
$editor = entity_load('editor', 'filtered_html');
$manager = drupal_container()->get('plugin.manager.ckeditor.plugin');
$internal_plugin = $manager->createInstance('internal');
$internal_plugin = $this->container->get('plugin.manager.ckeditor.plugin')->createInstance('internal');
// Default toolbar.
$expected = $this->getDefaultInternalConfig();
......@@ -267,8 +265,7 @@ function testInternalGetConfig() {
*/
function testStylesComboGetConfig() {
$editor = entity_load('editor', 'filtered_html');
$manager = drupal_container()->get('plugin.manager.ckeditor.plugin');
$stylescombo_plugin = $manager->createInstance('stylescombo');
$stylescombo_plugin = $this->container->get('plugin.manager.ckeditor.plugin')->createInstance('stylescombo');
// Styles dropdown/button enabled: new setting should be present.
$editor->settings['toolbar']['buttons'][0][] = 'Styles';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment