You are here

private function EmbeddedMediaTest::executeEditorCommand in Lightning Media 8.3

Executes a CKEditor command.

Parameters

string $command: The command ID, as known to CKEditor's API.

string $id: (optional) The editor instance ID.

mixed $data: Additional data to pass to the executed command.

1 call to EmbeddedMediaTest::executeEditorCommand()
EmbeddedMediaTest::open in tests/src/FunctionalJavascript/EmbeddedMediaTest.php
Opens the media browser.

File

tests/src/FunctionalJavascript/EmbeddedMediaTest.php, line 148

Class

EmbeddedMediaTest
Tests embedding media items in CKEditor using the media browser.

Namespace

Drupal\Tests\lightning_media\FunctionalJavascript

Code

private function executeEditorCommand($command, $id = NULL, $data = NULL) {
  $js = $this
    ->assertEditor($id);
  $result = $this
    ->getSession()
    ->evaluateScript("{$js}.execCommand('{$command}', " . Json::encode($data) . ')');
  $result = Json::decode($result);
  $this
    ->assertNotEmpty($result);
}