Commit 579208e4 authored by catch's avatar catch
Browse files

Issue #3271050 by xjm, Wim Leers, bbrala: Update REST and JSON:API Editor...

Issue #3271050 by xjm, Wim Leers, bbrala: Update REST and JSON:API Editor tests to rely on CKEditor 5 instead of CKEditor
parent 650da65b
Loading
Loading
Loading
Loading
+7 −45
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Drupal\Tests\editor\Functional\Rest;

use Drupal\ckeditor5\Plugin\CKEditor5Plugin\Heading;
use Drupal\editor\Entity\Editor;
use Drupal\filter\Entity\FilterFormat;
use Drupal\Tests\rest\Functional\EntityResource\ConfigEntityResourceTestBase;
@@ -14,7 +15,7 @@ abstract class EditorResourceTestBase extends ConfigEntityResourceTestBase {
  /**
   * {@inheritdoc}
   */
  protected static $modules = ['ckeditor', 'editor'];
  protected static $modules = ['ckeditor5', 'editor'];

  /**
   * {@inheritdoc}
@@ -59,7 +60,7 @@ protected function createEntity() {
    // Create a "Camelids" editor.
    $camelids = Editor::create([
      'format' => 'llama',
      'editor' => 'ckeditor',
      'editor' => 'ckeditor5',
    ]);
    $camelids
      ->setImageUploadSettings([
@@ -87,10 +88,10 @@ protected function getExpectedNormalizedEntity() {
          'filter.format.llama',
        ],
        'module' => [
          'ckeditor',
          'ckeditor5',
        ],
      ],
      'editor' => 'ckeditor',
      'editor' => 'ckeditor5',
      'format' => 'llama',
      'image_upload' => [
        'status' => FALSE,
@@ -105,49 +106,10 @@ protected function getExpectedNormalizedEntity() {
      'langcode' => 'en',
      'settings' => [
        'toolbar' => [
          'rows' => [
            [
              [
                'name' => 'Formatting',
                'items' => [
                  'Bold',
                  'Italic',
                ],
              ],
              [
                'name' => 'Links',
                'items' => [
                  'DrupalLink',
                  'DrupalUnlink',
                ],
              ],
              [
                'name' => 'Lists',
                'items' => [
                  'BulletedList',
                  'NumberedList',
                ],
              ],
              [
                'name' => 'Media',
                'items' => [
                  'Blockquote',
                  'DrupalImage',
                ],
              ],
              [
                'name' => 'Tools',
                'items' => [
                  'Source',
                ],
              ],
            ],
          ],
          'items' => ['heading', 'bold', 'italic'],
        ],
        'plugins' => [
          'language' => [
            'language_list' => 'un',
          ],
          'ckeditor5_heading' => Heading::DEFAULT_CONFIGURATION,
        ],
      ],
      'status' => TRUE,
+8 −46
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Drupal\Tests\jsonapi\Functional;

use Drupal\ckeditor5\Plugin\CKEditor5Plugin\Heading;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Url;
@@ -18,7 +19,7 @@ class EditorTest extends ConfigEntityResourceTestBase {
  /**
   * {@inheritdoc}
   */
  protected static $modules = ['filter', 'editor', 'ckeditor'];
  protected static $modules = ['filter', 'editor', 'ckeditor5'];

  /**
   * {@inheritdoc}
@@ -73,7 +74,7 @@ protected function createEntity() {
    // Create a "Camelids" editor.
    $camelids = Editor::create([
      'format' => 'llama',
      'editor' => 'ckeditor',
      'editor' => 'ckeditor5',
    ]);
    $camelids
      ->setImageUploadSettings([
@@ -120,10 +121,10 @@ protected function getExpectedDocument() {
              'filter.format.llama',
            ],
            'module' => [
              'ckeditor',
              'ckeditor5',
            ],
          ],
          'editor' => 'ckeditor',
          'editor' => 'ckeditor5',
          'image_upload' => [
            'status' => FALSE,
            'scheme' => 'public',
@@ -137,49 +138,10 @@ protected function getExpectedDocument() {
          'langcode' => 'en',
          'settings' => [
            'toolbar' => [
              'rows' => [
                [
                  [
                    'name' => 'Formatting',
                    'items' => [
                      'Bold',
                      'Italic',
                    ],
                  ],
                  [
                    'name' => 'Links',
                    'items' => [
                      'DrupalLink',
                      'DrupalUnlink',
                    ],
                  ],
                  [
                    'name' => 'Lists',
                    'items' => [
                      'BulletedList',
                      'NumberedList',
                    ],
                  ],
                  [
                    'name' => 'Media',
                    'items' => [
                      'Blockquote',
                      'DrupalImage',
                    ],
                  ],
                  [
                    'name' => 'Tools',
                    'items' => [
                      'Source',
                    ],
                  ],
                ],
              ],
              'items' => ['heading', 'bold', 'italic'],
            ],
            'plugins' => [
              'language' => [
                'language_list' => 'un',
              ],
              'ckeditor5_heading' => Heading::DEFAULT_CONFIGURATION,
            ],
          ],
          'status' => TRUE,
@@ -223,7 +185,7 @@ protected function createAnotherEntity($key) {

    $entity = Editor::create([
      'format' => 'pachyderm',
      'editor' => 'ckeditor',
      'editor' => 'ckeditor5',
    ]);

    $entity->setImageUploadSettings([