Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
7 merge requests!10011Issue #3200534 by quietone, longwave, Kristen Pol: Use dataprovider for...,!2571Issue #3000717: Missing mapping for "nodereference_url" widget,!2521Issue #3185775: Place Views preview on the side on large monitors,!1603Issue #3231707: mxr576's core patch playground,!1479Issue #3250298: Return empty string "" with JSON Serializer instead of FALSE,!1478Issue #3250298: Return empty string "" with JSON Serializer instead of FALSE,!1203Issue #3236191 Wrong group exposed form widgets and multiple selection error.
Showing
with 77 additions and 43 deletions
......@@ -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'));
}
}
<?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.
......
<?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 {
......
<?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 {
......
<?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.
......
<?php
namespace Drupal\Tests\layout_builder\FunctionalJavascript;
namespace Drupal\Tests\quickedit\FunctionalJavascript;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait;
use Drupal\Tests\field\Traits\EntityReferenceTestTrait;
use Drupal\Tests\quickedit\FunctionalJavascript\QuickEditJavascriptTestBase;
/**
* Tests that Layout Builder functions with Quick Edit.
......@@ -13,7 +12,7 @@
* @covers layout_builder_entity_view_alter()
* @covers layout_builder_quickedit_render_field()
*
* @group layout_builder
* @group quickedit
*/
class LayoutBuilderQuickEditTest extends QuickEditJavascriptTestBase {
......
<?php
namespace Drupal\Tests\image\FunctionalJavascript;
namespace Drupal\Tests\quickedit\FunctionalJavascript;
/**
* @see \Drupal\image\Plugin\InPlaceEditor\Image
......
<?php
namespace Drupal\Tests\image\FunctionalJavascript;
namespace Drupal\Tests\quickedit\FunctionalJavascript;
use Drupal\file\Entity\File;
use Drupal\Tests\image\Kernel\ImageFieldCreationTrait;
use Drupal\Tests\quickedit\FunctionalJavascript\QuickEditJavascriptTestBase;
use Drupal\Tests\TestFileCreationTrait;
/**
* @coversDefaultClass \Drupal\image\Plugin\InPlaceEditor\Image
* @group image
* @group quickedit
*/
class QuickEditImageTest extends QuickEditJavascriptTestBase {
......
<?php
namespace Drupal\Tests\settings_tray\FunctionalJavascript;
namespace Drupal\Tests\quickedit\FunctionalJavascript;
use Drupal\block_content\Entity\BlockContent;
use Drupal\block_content\Entity\BlockContentType;
use Drupal\Tests\settings_tray\FunctionalJavascript\SettingsTrayTestBase;
use Drupal\user\Entity\Role;
/**
* Test Settings Tray and Quick Edit modules integration.
*
* @group settings_tray
* @group quickedit
*/
class QuickEditIntegrationTest extends SettingsTrayTestBase {
class SettingsTrayIntegrationTest extends SettingsTrayTestBase {
/**
* {@inheritdoc}
......
<?php
namespace Drupal\Tests\editor\Kernel;
namespace Drupal\Tests\quickedit\Kernel;
use Drupal\Component\Serialization\Json;
use Drupal\Core\EventSubscriber\AjaxResponseSubscriber;
......@@ -8,7 +8,6 @@
use Drupal\editor\Entity\Editor;
use Drupal\entity_test\Entity\EntityTest;
use Drupal\quickedit\MetadataGenerator;
use Drupal\Tests\quickedit\Kernel\QuickEditTestBase;
use Drupal\quickedit_test\MockQuickEditEntityFieldAccessCheck;
use Drupal\editor\EditorController;
use Symfony\Component\HttpFoundation\Request;
......@@ -19,9 +18,9 @@
/**
* Tests Edit module integration (Editor module's inline editing support).
*
* @group editor
* @group quickedit
*/
class QuickEditIntegrationTest extends QuickEditTestBase {
class EditorIntegrationTest extends QuickEditTestBase {
/**
* {@inheritdoc}
......
<?php
namespace Drupal\Tests\quickedit\Kernel;
use Drupal\Tests\media\Kernel\MediaEmbedFilterTestBase;
/**
* Tests that media embed disables certain integrations.
*
* @coversDefaultClass \Drupal\media\Plugin\Filter\MediaEmbed
* @group quickedit
*/
class MediaEmbedFilterDisabledIntegrationsTest extends MediaEmbedFilterTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'contextual',
'quickedit',
// @see media_test_embed_entity_view_alter()
'media_test_embed',
];
/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$this->container->get('current_user')
->addRole($this->drupalCreateRole([
'access contextual links',
'access in-place editing',
]));
}
/**
* @covers ::renderMedia
* @covers ::disableContextualLinks
*/
public function testDisabledIntegrations() {
$text = $this->createEmbedCode([
'data-entity-type' => 'media',
'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID,
]);
$this->applyFilter($text);
$this->assertCount(1, $this->cssSelect('div[data-media-embed-test-view-mode]'));
$this->assertCount(0, $this->cssSelect('div[data-media-embed-test-view-mode][data-quickedit-entity-id]'));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment