You are here

protected function TestBase::assertEditorValue in The CodeMirror Editor 8

Assets editor value.

2 calls to TestBase::assertEditorValue()
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 133

Class

TestBase
Base class for CodeMirror editor tests.

Namespace

Drupal\Tests\codemirror_editor\FunctionalJavascript

Code

protected function assertEditorValue($expected_value) {
  $script = 'document.querySelector("%s .CodeMirror").CodeMirror.getValue();';
  $script = sprintf($script, $this
    ->getWrapperSelector());
  $value = $this
    ->getSession()
    ->getDriver()
    ->evaluateScript($script);
  self::assertSame($expected_value, $value);
}