Commit e06d49bc authored by catch's avatar catch
Browse files

Issue #3228634 by Spokje, xjm, paulocs, tim.plunkett, Lendude: Move tests for...

Issue #3228634 by Spokje, xjm, paulocs, tim.plunkett, Lendude: Move tests for integrations between QuickEdit and other modules into QuickEdit so that it can more easily be moved into contrib

(cherry picked from commit 02bf7534)
parent 33e68322
Loading
Loading
Loading
Loading
+2 −19
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@ class MediaEmbedFilterDisabledIntegrationsTest extends MediaEmbedFilterTestBase
   */
  protected static $modules = [
    'contextual',
    'quickedit',
    // @see media_test_embed_entity_view_alter()
    'media_test_embed',
  ];
@@ -29,16 +28,14 @@ protected function setUp(): void {
    $this->container->get('current_user')
      ->addRole($this->drupalCreateRole([
        'access contextual links',
        'access in-place editing',
      ]));
  }

  /**
   * @covers ::renderMedia
   * @covers ::disableContextualLinks
   * @dataProvider providerDisabledIntegrations
   */
  public function testDisabledIntegrations($integration_detection_selector) {
  public function testDisabledIntegrations() {
    $text = $this->createEmbedCode([
      'data-entity-type' => 'media',
      'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID,
@@ -46,21 +43,7 @@ public function testDisabledIntegrations($integration_detection_selector) {

    $this->applyFilter($text);
    $this->assertCount(1, $this->cssSelect('div[data-media-embed-test-view-mode]'));
    $this->assertCount(0, $this->cssSelect($integration_detection_selector));
  }

  /**
   * Data provider for testDisabledIntegrations().
   */
  public function providerDisabledIntegrations() {
    return [
      'contextual' => [
        'div[data-media-embed-test-view-mode].contextual-region',
      ],
      'quickedit' => [
        'div[data-media-embed-test-view-mode][data-quickedit-entity-id]',
      ],
    ];
    $this->assertCount(0, $this->cssSelect('div[data-media-embed-test-view-mode].contextual-region'));
  }

}
+3 −3
Original line number Diff line number Diff line
<?php

namespace Drupal\Tests\editor\Functional;
namespace Drupal\Tests\quickedit\Functional;

use Drupal\Component\Serialization\Json;
use Drupal\Core\EventSubscriber\MainContentViewSubscriber;
@@ -10,9 +10,9 @@
/**
 * Tests Quick Edit module integration endpoints.
 *
 * @group editor
 * @group quickedit
 */
class QuickEditIntegrationLoadingTest extends BrowserTestBase {
class EditorIntegrationLoadingTest extends BrowserTestBase {

  /**
   * Modules to enable.
+2 −2
Original line number Diff line number Diff line
<?php

namespace Drupal\Tests\layout_builder\Functional;
namespace Drupal\Tests\quickedit\Functional;

use Drupal\Tests\BrowserTestBase;

/**
 * Tests Layout Builder integration with Quick Edit.
 *
 * @group layout_builder
 * @group quickedit
 */
class LayoutBuilderQuickEditTest extends BrowserTestBase {

+2 −2
Original line number Diff line number Diff line
<?php

namespace Drupal\Tests\image\Functional;
namespace Drupal\Tests\quickedit\Functional;

use Drupal\Component\Serialization\Json;
use Drupal\Tests\BrowserTestBase;
@@ -10,7 +10,7 @@
/**
 * Tests the endpoints used by the "image" in-place editor.
 *
 * @group image
 * @group quickedit
 */
class QuickEditImageControllerTest extends BrowserTestBase {

+3 −3
Original line number Diff line number Diff line
<?php

namespace Drupal\Tests\inline_form_errors\FunctionalJavascript;
namespace Drupal\Tests\quickedit\FunctionalJavascript;

use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
use Drupal\node\Entity\NodeType;
@@ -8,9 +8,9 @@
/**
 * Tests Inline Form Errors compatibility with Quick Edit.
 *
 * @group inline_form_errors
 * @group quickedit
 */
class FormErrorHandlerQuickEditTest extends WebDriverTestBase {
class InlineFormErrorsIntegrationTest extends WebDriverTestBase {

  /**
   * Modules to enable.
Loading