function CKEditorTestTrait::assertEditorButtonEnabled

Same name in other branches
  1. 8.9.x core/modules/ckeditor/tests/src/Traits/CKEditorTestTrait.php \Drupal\Tests\ckeditor\Traits\CKEditorTestTrait::assertEditorButtonEnabled()

Asserts a CKEditor button is enabled.

Parameters

string $name: The name of the button, such as `drupallink`, `source`, etc.

string $instance_id: (optional) The CKEditor instance ID. Defaults to 'edit-body-0-value'.

2 calls to CKEditorTestTrait::assertEditorButtonEnabled()
MediaLibraryTest::testButton in core/modules/ckeditor/tests/src/FunctionalJavascript/MediaLibraryTest.php
Tests using DrupalMediaLibrary button to embed media into CKEditor.
MediaTest::testLinkability in core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php
Tests linkability of the CKEditor widget.

File

core/modules/ckeditor/tests/src/Traits/CKEditorTestTrait.php, line 105

Class

CKEditorTestTrait
Provides methods to test CKEditor.

Namespace

Drupal\Tests\ckeditor\Traits

Code

protected function assertEditorButtonEnabled($name, $instance_id = 'edit-body-0-value') {
    $button = $this->getEditorButton($name, $instance_id);
    $this->assertFalse($button->hasClass('cke_button_disabled'));
    $this->assertSame('false', $button->getAttribute('aria-disabled'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.