You are here

protected function TestBase::assertEditorOption in The CodeMirror Editor 8

Assets editor option value.

5 calls to TestBase::assertEditorOption()
EditorTest::testEditor in tests/src/FunctionalJavascript/EditorTest.php
Test callback.
FilterTest::testFilter in tests/src/FunctionalJavascript/FilterTest.php
Test callback.
FormatterTest::assertFormatter in tests/src/FunctionalJavascript/FormatterTest.php
Asserts formatter's output.
SettingsFormTest::testSettingsForm in tests/src/FunctionalJavascript/SettingsFormTest.php
Test callback.
TextEditorTest::testTextEditor in tests/src/FunctionalJavascript/TextEditorTest.php
Test callback.

File

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

Class

TestBase
Base class for CodeMirror editor tests.

Namespace

Drupal\Tests\codemirror_editor\FunctionalJavascript

Code

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