summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules')
-rw-r--r--core/modules/block/src/BlockViewBuilder.php6
-rw-r--r--core/modules/block/tests/modules/block_test/src/Hook/BlockTestHooks.php10
-rw-r--r--core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php24
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5HeightTest.php137
-rw-r--r--core/modules/ckeditor5/tests/src/Nightwatch/Tests/ckEditor5EditorHeightTest.js241
-rw-r--r--core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php1
-rw-r--r--core/modules/link/tests/src/Functional/LinkFieldUITest.php1
-rw-r--r--core/modules/locale/src/PoDatabaseWriter.php5
-rw-r--r--core/modules/node/src/Controller/NodeController.php6
-rw-r--r--core/modules/package_manager/tests/src/Kernel/SupportedReleaseValidatorTest.php1
-rw-r--r--core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php1
-rw-r--r--core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php2
-rw-r--r--core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php11
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTest.php1
-rw-r--r--core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php11
15 files changed, 189 insertions, 269 deletions
diff --git a/core/modules/block/src/BlockViewBuilder.php b/core/modules/block/src/BlockViewBuilder.php
index f33092de869..b5a1e464346 100644
--- a/core/modules/block/src/BlockViewBuilder.php
+++ b/core/modules/block/src/BlockViewBuilder.php
@@ -67,7 +67,11 @@ class BlockViewBuilder extends EntityViewBuilder implements TrustedCallbackInter
if ($plugin instanceof MainContentBlockPluginInterface || $plugin instanceof TitleBlockPluginInterface) {
// Immediately build a #pre_render-able block, since this block cannot
// be built lazily.
- $build[$entity_id] += static::buildPreRenderableBlock($entity, $this->moduleHandler());
+ $cacheableMetadata = CacheableMetadata::createFromRenderArray($build[$entity_id]);
+ $preRenderableBlock = static::buildPreRenderableBlock($entity, $this->moduleHandler());
+ $cacheableMetadata->addCacheableDependency(CacheableMetadata::createFromRenderArray($preRenderableBlock));
+ $build[$entity_id] += $preRenderableBlock;
+ $cacheableMetadata->applyTo($build[$entity_id]);
}
else {
// Assign a #lazy_builder callback, which will generate a #pre_render-
diff --git a/core/modules/block/tests/modules/block_test/src/Hook/BlockTestHooks.php b/core/modules/block/tests/modules/block_test/src/Hook/BlockTestHooks.php
index 19afd070f9d..7954c270df2 100644
--- a/core/modules/block/tests/modules/block_test/src/Hook/BlockTestHooks.php
+++ b/core/modules/block/tests/modules/block_test/src/Hook/BlockTestHooks.php
@@ -37,6 +37,16 @@ class BlockTestHooks {
}
/**
+ * Implements hook_block_view_BASE_BLOCK_ID_alter().
+ *
+ * @see \Drupal\Tests\block\Kernel\BlockViewBuilderTest::testBlockViewBuilderCacheTitleBlock()
+ */
+ #[Hook('block_view_page_title_block_alter')]
+ public function blockViewPageTitleBlockAlter(array &$build, BlockPluginInterface $block): void {
+ $build['#cache']['tags'][] = 'custom_cache_tag';
+ }
+
+ /**
* Implements hook_block_build_BASE_BLOCK_ID_alter().
*/
#[Hook('block_build_test_cache_alter')]
diff --git a/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php b/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
index d93e1f819ea..377cd31deac 100644
--- a/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
+++ b/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
@@ -164,6 +164,30 @@ class BlockViewBuilderTest extends KernelTestBase {
}
/**
+ * Tests title block render cache handling.
+ *
+ * @see \Drupal\block_test\Hook\BlockTestHooks::blockViewPageTitleBlockAlter()
+ */
+ public function testBlockViewBuilderCacheTitleBlock(): void {
+ // Create title block.
+ $this->block = $this->controller->create([
+ 'id' => 'test_block_title',
+ 'theme' => 'stark',
+ 'plugin' => 'page_title_block',
+ ]);
+ $this->block->save();
+
+ $entity = Block::load('test_block_title');
+ $builder = \Drupal::entityTypeManager()->getViewBuilder('block');
+ $output = $builder->view($entity, 'block');
+
+ $this->assertSame(
+ ['block_view', 'config:block.block.test_block_title', 'custom_cache_tag'],
+ $output['#cache']['tags']
+ );
+ }
+
+ /**
* Verifies render cache handling of the block being tested.
*
* @see ::testBlockViewBuilderCache()
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5HeightTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5HeightTest.php
new file mode 100644
index 00000000000..81928b1642b
--- /dev/null
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5HeightTest.php
@@ -0,0 +1,137 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Drupal\Tests\ckeditor5\FunctionalJavascript;
+
+use Drupal\editor\Entity\Editor;
+use Drupal\Tests\ckeditor5\Traits\CKEditor5TestTrait;
+
+/**
+ * Tests ckeditor height respects field rows config.
+ *
+ * @group ckeditor5
+ * @internal
+ */
+class CKEditor5HeightTest extends CKEditor5TestBase {
+
+ use CKEditor5TestTrait;
+
+ /**
+ * Tests editor height respects rows config.
+ */
+ public function testCKEditor5Height(): void {
+ $this->addNewTextFormat();
+ /** @var \Drupal\editor\Entity\Editor $editor */
+ $editor = Editor::load('ckeditor5');
+ $editor->setSettings([
+ 'toolbar' => [
+ 'items' => [
+ 'sourceEditing',
+ ],
+ ],
+ 'plugins' => [
+ 'ckeditor5_sourceEditing' => [
+ 'allowed_tags' => [],
+ ],
+ ],
+ ])->save();
+ $this->drupalGet('/node/add/page');
+ $this->waitForEditor();
+
+ // We expect height to be 320, but test to ensure that it's greater
+ // than 300. We want to ensure that we don't hard code a very specific
+ // value because tests might break if styles change (line-height, etc).
+ // Note that the default height for CKEditor5 is 47px.
+ $this->assertGreaterThan(300, $this->getEditorHeight());
+ // Check source editing height.
+ $this->pressEditorButton('Source');
+ $assert = $this->assertSession();
+ $this->assertNotNull($assert->waitForElementVisible('css', '.ck-source-editing-area'));
+ $this->assertGreaterThan(300, $this->getEditorHeight(TRUE));
+
+ // Test the max height of the editor is less that the window height.
+ $body = \str_repeat('<p>Llamas are cute.</p>', 100);
+ $node = $this->drupalCreateNode([
+ 'body' => $body,
+ ]);
+ $this->drupalGet($node->toUrl('edit-form'));
+ $this->assertLessThan($this->getWindowHeight(), $this->getEditorHeight());
+
+ // Check source editing has a scroll bar.
+ $this->pressEditorButton('Source');
+ $this->assertNotNull($assert->waitForElementVisible('css', '.ck-source-editing-area'));
+ $this->assertTrue($this->isSourceEditingScrollable());
+
+ // Double the editor row count.
+ \Drupal::service('entity_display.repository')->getFormDisplay('node', 'page')
+ ->setComponent('body', [
+ 'type' => 'text_textarea_with_summary',
+ 'settings' => [
+ 'rows' => 18,
+ ],
+ ])
+ ->save();
+ // Check the height of the editor again.
+ $this->drupalGet('/node/add/page');
+ $this->waitForEditor();
+ // We expect height to be 640, but test to ensure that it's greater
+ // than 600. We want to ensure that we don't hard code a very specific
+ // value because tests might break if styles change (line-height, etc).
+ // Note that the default height for CKEditor5 is 47px.
+ $this->assertGreaterThan(600, $this->getEditorHeight());
+ }
+
+ /**
+ * Gets the height of ckeditor.
+ */
+ private function getEditorHeight(bool $sourceEditing = FALSE): int {
+ $selector = $sourceEditing ? '.ck-source-editing-area' : '.ck-editor__editable';
+ $javascript = <<<JS
+ return document.querySelector('$selector').clientHeight;
+ JS;
+ return $this->getSession()->evaluateScript($javascript);
+ }
+
+ /**
+ * Gets the window height.
+ */
+ private function getWindowHeight(): int {
+ $javascript = <<<JS
+ return window.innerHeight;
+ JS;
+ return $this->getSession()->evaluateScript($javascript);
+ }
+
+ /**
+ * Checks that the source editing element is scrollable.
+ */
+ private function isSourceEditingScrollable(): bool {
+ $javascript = <<<JS
+ (function () {
+ const element = document.querySelector('.ck-source-editing-area textarea');
+ const style = window.getComputedStyle(element);
+ if (
+ element.scrollHeight > element.clientHeight &&
+ style.overflow !== 'hidden' &&
+ style['overflow-y'] !== 'hidden' &&
+ style.overflow !== 'clip' &&
+ style['overflow-y'] !== 'clip'
+ ) {
+ if (
+ element === document.scrollingElement ||
+ (style.overflow !== 'visible' &&
+ style['overflow-y'] !== 'visible')
+ ) {
+ return true;
+ }
+ }
+
+ return false;
+ })();
+ JS;
+ $evaluateScript = $this->getSession()->evaluateScript($javascript);
+ return $evaluateScript;
+ }
+
+}
diff --git a/core/modules/ckeditor5/tests/src/Nightwatch/Tests/ckEditor5EditorHeightTest.js b/core/modules/ckeditor5/tests/src/Nightwatch/Tests/ckEditor5EditorHeightTest.js
deleted file mode 100644
index a1b76110eb7..00000000000
--- a/core/modules/ckeditor5/tests/src/Nightwatch/Tests/ckEditor5EditorHeightTest.js
+++ /dev/null
@@ -1,241 +0,0 @@
-// cspell:ignore sourceediting
-
-module.exports = {
- '@tags': ['core', 'ckeditor5'],
- before(browser) {
- browser
- .drupalInstall({ installProfile: 'testing' })
- .drupalInstallModule('ckeditor5', true)
- .drupalInstallModule('field_ui')
- .drupalInstallModule('node', true);
-
- // Set fixed (desktop-ish) size to ensure a maximum viewport.
- browser.window.resize(1920, 1080);
- },
- after(browser) {
- browser.drupalUninstall();
- },
- 'Ensure CKEditor respects field widget row value': (browser) => {
- browser.drupalLoginAsAdmin(() => {
- browser
- // Create new input format.
- .drupalRelativeURL('/admin/config/content/formats/add')
- .waitForElementVisible('[data-drupal-selector="edit-name"]')
- .updateValue('[data-drupal-selector="edit-name"]', 'test')
- .waitForElementVisible('#edit-name-machine-name-suffix')
- .click(
- '[data-drupal-selector="edit-editor-editor"] option[value=ckeditor5]',
- )
- // Wait for CKEditor 5 settings to be visible.
- .waitForElementVisible(
- '[data-drupal-selector="edit-editor-settings-toolbar"]',
- )
- .click('.ckeditor5-toolbar-button-sourceEditing') // Select the Source Editing button.
- // Hit the down arrow key to move it to the toolbar.
- .perform(function () {
- return this.actions().sendKeys(browser.Keys.ARROW_DOWN);
- })
- // Wait for new source editing vertical tab to be present before continuing.
- .waitForElementVisible(
- '[href*=edit-editor-settings-plugins-ckeditor5-sourceediting]',
- )
- .submitForm('input[type="submit"]')
- .waitForElementVisible('[data-drupal-messages]')
- .assert.textContains('[data-drupal-messages]', 'Added text format')
- // Create new content type.
- .drupalRelativeURL('/admin/structure/types/add')
- .waitForElementVisible('[data-drupal-selector="edit-name"]')
- .updateValue('[data-drupal-selector="edit-name"]', 'test')
- .waitForElementVisible('#edit-name-machine-name-suffix') // Wait for machine name to update.
- .submitForm('input[type="submit"]')
- .waitForElementVisible('[data-drupal-messages]')
- .assert.textContains(
- '[data-drupal-messages]',
- 'The content type test has been added',
- )
- // Navigate to the create content page and measure height of the editor.
- .drupalRelativeURL('/node/add/test')
- .waitForElementVisible('.ck-editor__editable')
- .execute(
- // eslint-disable-next-line func-names, prefer-arrow-callback, no-shadow
- function () {
- const height = document.querySelector(
- '.ck-editor__editable',
- ).clientHeight;
-
- // We expect height to be 320, but test to ensure that it's greater
- // than 300. We want to ensure that we don't hard code a very specific
- // value because tests might break if styles change (line-height, etc).
- // Note that the default height for CKEditor5 is 47px.
- return height > 300;
- },
- [],
- (result) => {
- browser.assert.ok(
- result.value,
- 'Editor height is set to 9 rows (default).',
- );
- },
- )
- .click('.ck-source-editing-button')
- .waitForElementVisible('.ck-source-editing-area')
- .execute(
- // eslint-disable-next-line func-names, prefer-arrow-callback, no-shadow
- function () {
- const height = document.querySelector(
- '.ck-source-editing-area',
- ).clientHeight;
-
- // We expect height to be 320, but test to ensure that it's greater
- // than 300. We want to ensure that we don't hard code a very specific
- // value because tests might break if styles change (line-height, etc).
- // Note that the default height for CKEditor5 is 47px.
- return height > 300;
- },
- [],
- (result) => {
- browser.assert.ok(
- result.value,
- 'Source editing height is set to 9 rows (default).',
- );
- },
- )
-
- // Navigate to the create content page and measure max-height of the editor.
- .drupalRelativeURL('/node/add/test')
- .execute(
- // eslint-disable-next-line func-names, prefer-arrow-callback, no-shadow
- function () {
- window.Drupal.CKEditor5Instances.forEach((instance) => {
- instance.setData('<p>Llamas are cute.</p>'.repeat(100));
- });
-
- const height = document.querySelector(
- '.ck-editor__editable',
- ).clientHeight;
-
- return height < window.innerHeight;
- },
- [],
- (result) => {
- browser.assert.ok(
- result.value,
- 'Editor area should never exceed full viewport.',
- );
- },
- )
- // Source Editor textarea should have vertical scrollbar when needed.
- .click('.ck-source-editing-button')
- .waitForElementVisible('.ck-source-editing-area')
- .execute(
- // eslint-disable-next-line func-names, prefer-arrow-callback, no-shadow
- function () {
- function isScrollableY(element) {
- const style = window.getComputedStyle(element);
-
- if (
- element.scrollHeight > element.clientHeight &&
- style.overflow !== 'hidden' &&
- style['overflow-y'] !== 'hidden' &&
- style.overflow !== 'clip' &&
- style['overflow-y'] !== 'clip'
- ) {
- if (
- element === document.scrollingElement ||
- (style.overflow !== 'visible' &&
- style['overflow-y'] !== 'visible')
- ) {
- return true;
- }
- }
-
- return false;
- }
-
- return isScrollableY(
- document.querySelector('.ck-source-editing-area textarea'),
- );
- },
- [],
- (result) => {
- browser.assert.strictEqual(
- result.value,
- true,
- 'Source Editor textarea should have vertical scrollbar when needed.',
- );
- },
- )
-
- // Double the editor row count.
- .drupalRelativeURL('/admin/structure/types/manage/test/form-display')
- .waitForElementVisible(
- '[data-drupal-selector="edit-fields-body-settings-edit"]',
- )
- .click('[data-drupal-selector="edit-fields-body-settings-edit"]')
- .waitForElementVisible(
- '[data-drupal-selector="edit-fields-body-settings-edit-form-settings-rows"]',
- )
- .updateValue(
- '[data-drupal-selector="edit-fields-body-settings-edit-form-settings-rows"]',
- '18',
- )
- // Save field settings.
- .click(
- '[data-drupal-selector="edit-fields-body-settings-edit-form-actions-save-settings"]',
- )
- .waitForElementVisible(
- '[data-drupal-selector="edit-fields-body"] .field-plugin-summary',
- )
- .click('[data-drupal-selector="edit-submit"]')
- .waitForElementVisible('[data-drupal-messages]')
- .assert.textContains(
- '[data-drupal-messages]',
- 'Your settings have been saved',
- )
-
- // Navigate to the create content page and measure height of the editor.
- .drupalRelativeURL('/node/add/test')
- .execute(
- // eslint-disable-next-line func-names, prefer-arrow-callback, no-shadow
- function () {
- const height = document.querySelector(
- '.ck-editor__editable',
- ).clientHeight;
-
- // We expect height to be 640, but test to ensure that it's greater
- // than 600. We want to ensure that we don't hard code a very specific
- // value because tests might break if styles change (line-height, etc).
- // Note that the default height for CKEditor5 is 47px.
- return height > 600;
- },
- [],
- (result) => {
- browser.assert.ok(result.value, 'Editor height is set to 18 rows.');
- },
- )
- .click('.ck-source-editing-button')
- .waitForElementVisible('.ck-source-editing-area')
- .execute(
- // eslint-disable-next-line func-names, prefer-arrow-callback, no-shadow
- function () {
- const height = document.querySelector(
- '.ck-source-editing-area',
- ).clientHeight;
-
- // We expect height to be 640, but test to ensure that it's greater
- // than 600. We want to ensure that we don't hard code a very specific
- // value because tests might break if styles change (line-height, etc).
- // Note that the default height for CKEditor5 is 47px.
- return height > 600;
- },
- [],
- (result) => {
- browser.assert.ok(
- result.value,
- 'Source editing height is set to 18 rows (default).',
- );
- },
- );
- });
- },
-};
diff --git a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php
index fe5ff0ca062..54fdf4b0d21 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php
@@ -10,7 +10,6 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
/**
* Tests the migration of language negotiation.
*
- * @group #slow
* @group migrate_drupal_7
*/
class MigrateLanguageNegotiationSettingsTest extends MigrateDrupal7TestBase {
diff --git a/core/modules/link/tests/src/Functional/LinkFieldUITest.php b/core/modules/link/tests/src/Functional/LinkFieldUITest.php
index 5c78abc2391..694fb6b3677 100644
--- a/core/modules/link/tests/src/Functional/LinkFieldUITest.php
+++ b/core/modules/link/tests/src/Functional/LinkFieldUITest.php
@@ -15,7 +15,6 @@ use Drupal\Tests\field_ui\Traits\FieldUiTestTrait;
* Tests link field UI functionality.
*
* @group link
- * @group #slow
*/
class LinkFieldUITest extends BrowserTestBase {
diff --git a/core/modules/locale/src/PoDatabaseWriter.php b/core/modules/locale/src/PoDatabaseWriter.php
index 7e7340cf107..436d710d7ba 100644
--- a/core/modules/locale/src/PoDatabaseWriter.php
+++ b/core/modules/locale/src/PoDatabaseWriter.php
@@ -198,10 +198,15 @@ class PoDatabaseWriter implements PoWriterInterface {
* {@inheritdoc}
*/
public function writeItems(PoReaderInterface $reader, $count = -1) {
+ // Processing multiple writes in a transaction is quicker than committing
+ // each individual write.
+ $transaction = \Drupal::database()->startTransaction();
$forever = $count == -1;
while (($count-- > 0 || $forever) && ($item = $reader->readItem())) {
$this->writeItem($item);
}
+ // Commit the transaction.
+ unset($transaction);
}
/**
diff --git a/core/modules/node/src/Controller/NodeController.php b/core/modules/node/src/Controller/NodeController.php
index 87c9586daee..d5a35f64285 100644
--- a/core/modules/node/src/Controller/NodeController.php
+++ b/core/modules/node/src/Controller/NodeController.php
@@ -196,10 +196,12 @@ class NodeController extends ControllerBase implements ContainerInjectionInterfa
'username' => $this->renderer->renderInIsolation($username),
'message' => ['#markup' => $revision->revision_log->value, '#allowed_tags' => Xss::getHtmlTagList()],
],
+ // @todo Fix this properly in https://www.drupal.org/project/drupal/issues/3227637.
+ '#cache' => [
+ 'max-age' => 0,
+ ],
],
];
- // @todo Simplify once https://www.drupal.org/node/2334319 lands.
- $this->renderer->addCacheableDependency($column['data'], $username);
$row[] = $column;
if ($is_current_revision) {
diff --git a/core/modules/package_manager/tests/src/Kernel/SupportedReleaseValidatorTest.php b/core/modules/package_manager/tests/src/Kernel/SupportedReleaseValidatorTest.php
index 2e9a0977fa3..90348cdfdd3 100644
--- a/core/modules/package_manager/tests/src/Kernel/SupportedReleaseValidatorTest.php
+++ b/core/modules/package_manager/tests/src/Kernel/SupportedReleaseValidatorTest.php
@@ -13,6 +13,7 @@ use Drupal\Tests\package_manager\Traits\FixtureUtilityTrait;
* @coversDefaultClass \Drupal\package_manager\Validator\SupportedReleaseValidator
* @group #slow
* @group package_manager
+ * @group #slow
* @internal
*/
class SupportedReleaseValidatorTest extends PackageManagerKernelTestBase {
diff --git a/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php b/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php
index be5d811fe54..d5cc9759ab1 100644
--- a/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php
+++ b/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php
@@ -13,7 +13,6 @@ use Drupal\Tests\Traits\Core\PathAliasTestTrait;
/**
* URL alias migration.
*
- * @group #slow
* @group migrate_drupal_6
*/
class MigrateUrlAliasTest extends MigrateDrupal6TestBase {
diff --git a/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
index 98c1a093a44..2ce434e0fd3 100644
--- a/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
+++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
@@ -562,7 +562,7 @@ class GDToolkit extends ImageToolkitBase {
}
$tempFile = fopen('php://memory', 'r+');
- $supported = imageavif(imagecreatetruecolor(1, 1), $tempFile, 0, 10) && fstat($tempFile)['size'] > 0;
+ $supported = function_exists('imageavif') && imageavif(imagecreatetruecolor(1, 1), $tempFile, 0, 10) && fstat($tempFile)['size'] > 0;
fclose($tempFile);
return $supported;
diff --git a/core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php b/core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php
index 82d866e985e..6c8c42da59e 100644
--- a/core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php
+++ b/core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php
@@ -77,8 +77,6 @@ class DateFormatAccessControlHandlerTest extends KernelTestBase {
* An array of test cases.
*/
public static function providerTestAccess(): array {
- $originalContainer = \Drupal::hasContainer() ? \Drupal::getContainer() : NULL;
-
$c = new ContainerBuilder();
$cache_contexts_manager = (new Prophet())->prophesize(CacheContextsManager::class);
$cache_contexts_manager->assertValidTokens()->willReturn(TRUE);
@@ -86,7 +84,7 @@ class DateFormatAccessControlHandlerTest extends KernelTestBase {
$c->set('cache_contexts_manager', $cache_contexts_manager);
\Drupal::setContainer($c);
- $data = [
+ return [
'No permission + unlocked' => [
[],
'unlocked',
@@ -124,13 +122,6 @@ class DateFormatAccessControlHandlerTest extends KernelTestBase {
AccessResult::allowed()->addCacheContexts(['user.permissions']),
],
];
-
- // Restore the original container if needed.
- if ($originalContainer) {
- \Drupal::setContainer($originalContainer);
- }
-
- return $data;
}
}
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTest.php
index 511778daf20..1d9654dd505 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTest.php
@@ -10,7 +10,6 @@ use Drupal\node\Entity\Node;
/**
* Upgrade taxonomy term node associations.
*
- * @group #slow
* @group migrate_drupal_6
*/
class MigrateTermNodeTest extends MigrateDrupal6TestBase {
diff --git a/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php b/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php
index 180edc868f6..e46fbcf417b 100644
--- a/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php
+++ b/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php
@@ -124,8 +124,6 @@ class WorkflowAccessControlHandlerTest extends KernelTestBase {
* An array of test data.
*/
public static function checkAccessProvider() {
- $originalContainer = \Drupal::hasContainer() ? \Drupal::getContainer() : NULL;
-
$container = new ContainerBuilder();
$cache_contexts_manager = (new Prophet())->prophesize(CacheContextsManager::class);
$cache_contexts_manager->assertValidTokens()->willReturn(TRUE);
@@ -133,7 +131,7 @@ class WorkflowAccessControlHandlerTest extends KernelTestBase {
$container->set('cache_contexts_manager', $cache_contexts_manager);
\Drupal::setContainer($container);
- $data = [
+ return [
'Admin view' => [
'adminUser',
'view',
@@ -277,13 +275,6 @@ class WorkflowAccessControlHandlerTest extends KernelTestBase {
AccessResult::allowed()->addCacheContexts(['user.permissions']),
],
];
-
- // Restore the original container if needed.
- if ($originalContainer) {
- \Drupal::setContainer($originalContainer);
- }
-
- return $data;
}
}