updated core to 8.6.3
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
* Reacts on a change in the editor element.
|
||||
*
|
||||
* @param {HTMLElement} element
|
||||
* The element where the change occured.
|
||||
* The element where the change occurred.
|
||||
* @param {function} callback
|
||||
* Callback called with the value of the editor.
|
||||
*
|
||||
|
||||
@@ -24,6 +24,10 @@ class CKEditorPlugin extends Plugin {
|
||||
/**
|
||||
* The plugin ID.
|
||||
*
|
||||
* This MUST match the name of the CKEditor plugin itself (written in
|
||||
* JavaScript). Otherwise CKEditor will throw JavaScript errors when it runs,
|
||||
* because it fails to load this CKEditor plugin.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $id;
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\editor\Entity\Editor;
|
||||
|
||||
/**
|
||||
* Defines a "LlamaContextualAndbutton" plugin, with a contextually OR toolbar
|
||||
* Defines a "LlamaContextualAndButton" plugin, with a contextually OR toolbar
|
||||
* builder-enabled "llama" feature.
|
||||
*
|
||||
* @CKEditorPlugin(
|
||||
|
||||
@@ -24,6 +24,13 @@ class CKEditorIntegrationTest extends WebDriverTestBase {
|
||||
*/
|
||||
protected $account;
|
||||
|
||||
/**
|
||||
* The FilterFormat config entity used for testing.
|
||||
*
|
||||
* @var \Drupal\filter\FilterFormatInterface
|
||||
*/
|
||||
protected $filterFormat;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -36,12 +43,12 @@ class CKEditorIntegrationTest extends WebDriverTestBase {
|
||||
parent::setUp();
|
||||
|
||||
// Create a text format and associate CKEditor.
|
||||
$filtered_html_format = FilterFormat::create([
|
||||
$this->filterFormat = FilterFormat::create([
|
||||
'format' => 'filtered_html',
|
||||
'name' => 'Filtered HTML',
|
||||
'weight' => 0,
|
||||
]);
|
||||
$filtered_html_format->save();
|
||||
$this->filterFormat->save();
|
||||
|
||||
Editor::create([
|
||||
'format' => 'filtered_html',
|
||||
@@ -119,4 +126,55 @@ class CKEditorIntegrationTest extends WebDriverTestBase {
|
||||
self::assertEquals($before_url, $after_url, 'History back works.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests if the Image button appears and works as expected.
|
||||
*/
|
||||
public function testDrupalImageDialog() {
|
||||
$session = $this->getSession();
|
||||
$web_assert = $this->assertSession();
|
||||
|
||||
$this->drupalGet('node/add/page');
|
||||
$session->getPage();
|
||||
|
||||
// Asserts the Image button is present in the toolbar.
|
||||
$web_assert->elementExists('css', '#cke_edit-body-0-value .cke_button__drupalimage');
|
||||
|
||||
// Asserts the image dialog opens when clicking the Image button.
|
||||
$this->click('.cke_button__drupalimage');
|
||||
$this->assertNotEmpty($web_assert->waitForElement('css', '.ui-dialog'));
|
||||
|
||||
$web_assert->elementContains('css', '.ui-dialog .ui-dialog-titlebar', 'Insert Image');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests if the Drupal Image Caption plugin appears and works as expected.
|
||||
*/
|
||||
public function testDrupalImageCaptionDialog() {
|
||||
$web_assert = $this->assertSession();
|
||||
|
||||
// Disable the caption filter.
|
||||
$this->filterFormat->setFilterConfig('filter_caption', [
|
||||
'status' => FALSE,
|
||||
]);
|
||||
$this->filterFormat->save();
|
||||
|
||||
// If the caption filter is disabled, its checkbox should be absent.
|
||||
$this->drupalGet('node/add/page');
|
||||
$this->click('.cke_button__drupalimage');
|
||||
$this->assertNotEmpty($web_assert->waitForElement('css', '.ui-dialog'));
|
||||
$web_assert->elementNotExists('css', '.ui-dialog input[name="attributes[hasCaption]"]');
|
||||
|
||||
// Enable the caption filter again.
|
||||
$this->filterFormat->setFilterConfig('filter_caption', [
|
||||
'status' => TRUE,
|
||||
]);
|
||||
$this->filterFormat->save();
|
||||
|
||||
// If the caption filter is enabled, its checkbox should be present.
|
||||
$this->drupalGet('node/add/page');
|
||||
$this->click('.cke_button__drupalimage');
|
||||
$this->assertNotEmpty($web_assert->waitForElement('css', '.ui-dialog'));
|
||||
$web_assert->elementExists('css', '.ui-dialog input[name="attributes[hasCaption]"]');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user