You are here

protected function TestBase::editorSetValue in The CodeMirror Editor 8

Sets CodeMirror document value.

2 calls to TestBase::editorSetValue()
EditorTest::testEditor in tests/src/FunctionalJavascript/EditorTest.php
Test callback.
TextEditorTest::testTextEditor in tests/src/FunctionalJavascript/TextEditorTest.php
Test callback.

File

tests/src/FunctionalJavascript/TestBase.php, line 32

Class

TestBase
Base class for CodeMirror editor tests.

Namespace

Drupal\Tests\codemirror_editor\FunctionalJavascript

Code

protected function editorSetValue($value) {
  $script = 'document.querySelector("%s .CodeMirror").CodeMirror.setValue("%s");';
  $script = sprintf($script, $this
    ->getWrapperSelector(), $value);
  $this
    ->getSession()
    ->getDriver()
    ->executeScript($script);
}