You are here

public function CkEditorContext::insert in Lightning Core 8

Same name and namespace in other branches
  1. 8.5 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::insert()
  2. 8.2 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::insert()
  3. 8.3 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::insert()
  4. 8.4 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::insert()

Puts text or HTML into a CKEditor instance.

@When I put :text into CKEditor @When I put :text into CKEditor :id

Parameters

string $text: The text (or HTML) to insert into the editor.

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

File

tests/contexts/CkEditorContext.behat.inc, line 47

Class

CkEditorContext
Contains step definitions for working with CKEditor instances.

Namespace

Acquia\LightningExtension\Context

Code

public function insert($text, $id = NULL) {
  $js = $this
    ->assertEditor($id);
  $this
    ->getSession()
    ->executeScript("{$js}.insertHtml('{$text}');");
}