You are here

protected function CKEditorTestTrait::assertEditorButtonDisabled in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/ckeditor/tests/src/Traits/CKEditorTestTrait.php \Drupal\Tests\ckeditor\Traits\CKEditorTestTrait::assertEditorButtonDisabled()

Asserts a CKEditor button is disabled.

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::assertEditorButtonDisabled()
CKEditorIntegrationTest::testButton in core/modules/media_library/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
Tests using DrupalMediaLibrary button to embed media into CKEditor.
CKEditorIntegrationTest::testLinkability in core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
Tests linkability of the CKEditor widget.

File

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

Class

CKEditorTestTrait
Provides methods to test CKEditor.

Namespace

Drupal\Tests\ckeditor\Traits

Code

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