You are here

protected function CKEditorIntegrationTest::assertCkeditorUndoOrRedo in Entity Embed 8

Asserts the consequences of CKEditor undo/redo actions.

Parameters

string $action: Either 'undo' or 'redo'.

array $contains: The strings the CKEditor instance is expected to contain.

array $not_contains: The strings the CKEditor instance is expected to not contain.

Throws

\Behat\Mink\Exception\ElementNotFoundException

\Behat\Mink\Exception\ResponseTextException

1 call to CKEditorIntegrationTest::assertCkeditorUndoOrRedo()
CKEditorIntegrationTest::testIntegration in tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
Test integration with Filter, Editor and Ckeditor.

File

tests/src/FunctionalJavascript/CKEditorIntegrationTest.php, line 274

Class

CKEditorIntegrationTest
Tests ckeditor integration.

Namespace

Drupal\Tests\entity_embed\FunctionalJavascript

Code

protected function assertCkeditorUndoOrRedo($action, array $contains, array $not_contains) {
  if ($action !== 'undo' && $action !== 'redo') {
    throw new \LogicException();
  }
  $this
    ->pressEditorButton($action);
  $this
    ->getSession()
    ->switchToIFrame('ckeditor');
  foreach ($contains as $string) {
    $this
      ->assertSession()
      ->pageTextContains($string);
  }
  foreach ($not_contains as $string) {
    $this
      ->assertSession()
      ->pageTextNotContains($string);
  }
  $this
    ->getSession()
    ->switchToIFrame();
}