You are here

public function ThunderJavascriptTestBase::assertCkEditorContent in Thunder 8.4

Same name and namespace in other branches
  1. 8.5 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::assertCkEditorContent()
  2. 8.2 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::assertCkEditorContent()
  3. 8.3 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::assertCkEditorContent()
  4. 6.2.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::assertCkEditorContent()
  5. 6.0.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::assertCkEditorContent()
  6. 6.1.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::assertCkEditorContent()

Assert that CKEditor instance contains correct data.

Parameters

string $ckEditorCssSelector: CSS selector for CKEditor.

string $expectedContent: The expected content.

3 calls to ThunderJavascriptTestBase::assertCkEditorContent()
ParagraphSplitTest::testAddParagraphAfterSplitDataLoss in tests/src/FunctionalJavascript/Integration/ParagraphSplitTest.php
Test if a adding paragraph after split leads to data loss.
ParagraphSplitTest::testParagraphSplitBefore in tests/src/FunctionalJavascript/Integration/ParagraphSplitTest.php
Test split of paragraph before a selection.
ParagraphSplitTest::testParagraphSplitDataLoss in tests/src/FunctionalJavascript/Integration/ParagraphSplitTest.php
Test if a deleted paragraph leads to data loss.

File

tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php, line 315

Class

ThunderJavascriptTestBase
Base class for Thunder Javascript functional tests.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

public function assertCkEditorContent($ckEditorCssSelector, $expectedContent) {
  $ckEditorId = $this
    ->getCkEditorId($ckEditorCssSelector);
  $ckEditorContent = $this
    ->getSession()
    ->getDriver()
    ->evaluateScript("return CKEDITOR.instances[\"{$ckEditorId}\"].getData();");
  static::assertEquals($expectedContent, $ckEditorContent);
}