You are here

protected function EditorLoadingTest::getThingsToCheck in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/editor/tests/src/Functional/EditorLoadingTest.php \Drupal\Tests\editor\Functional\EditorLoadingTest::getThingsToCheck()
2 calls to EditorLoadingTest::getThingsToCheck()
EditorLoadingTest::testLoading in core/modules/editor/tests/src/Functional/EditorLoadingTest.php
Tests loading of text editors.
EditorLoadingTest::testSupportedElementTypes in core/modules/editor/tests/src/Functional/EditorLoadingTest.php
Test supported element types.

File

core/modules/editor/tests/src/Functional/EditorLoadingTest.php, line 297

Class

EditorLoadingTest
Tests loading of text editors.

Namespace

Drupal\Tests\editor\Functional

Code

protected function getThingsToCheck($field_name, $type = 'textarea') {
  $settings = $this
    ->getDrupalSettings();
  return [
    // JavaScript settings.
    $settings,
    // Editor.module's JS settings present.
    isset($settings['editor']),
    // Editor.module's JS present.
    strpos($this
      ->getSession()
      ->getPage()
      ->getContent(), drupal_get_path('module', 'editor') . '/js/editor.js') !== FALSE,
    // Body field.
    $this
      ->xpath('//' . $type . '[@id="edit-' . $field_name . '-0-value"]'),
    // Format selector.
    $this
      ->xpath('//select[contains(@class, "filter-list")]'),
  ];
}