Skip to content
Snippets Groups Projects
Verified Commit 97bdbe88 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3393800 by mstrelan, dww, acbramley, amateescu, smustgrave, quietone:...

Issue #3393800 by mstrelan, dww, acbramley, amateescu, smustgrave, quietone: Kernel tests can't use path aliases on entities
parent 6ee5f78c
No related branches found
No related tags found
35 merge requests!12227Issue #3181946 by jonmcl, mglaman,!8528Issue #3456871 by Tim Bozeman: Support NULL services,!8323Fix source code editing and in place front page site studio editing.,!6278Issue #3187770 by godotislate, smustgrave, catch, quietone: Views Rendered...,!3878Removed unused condition head title for views,!38582585169-10.1.x,!3818Issue #2140179: $entity->original gets stale between updates,!3742Issue #3328429: Create item list field formatter for displaying ordered and unordered lists,!3731Claro: role=button on status report items,!3668Resolve #3347842 "Deprecate the trusted",!3651Issue #3347736: Create new SDC component for Olivero (header-search),!3531Issue #3336994: StringFormatter always displays links to entity even if the user in context does not have access,!3478Issue #3337882: Deleted menus are not removed from content type config,!3355Issue #3209129: Scrolling problems when adding a block via layout builder,!3226Issue #2987537: Custom menu link entity type should not declare "bundle" entity key,!3154Fixes #2987987 - CSRF token validation broken on routes with optional parameters.,!3147Issue #3328457: Replace most substr($a, $i) where $i is negative with str_ends_with(),!3146Issue #3328456: Replace substr($a, 0, $i) with str_starts_with(),!3133core/modules/system/css/components/hidden.module.css,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!2812Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL,!2614Issue #2981326: Replace non-test usages of \Drupal::logger() with IoC injection,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2334Issue #3228209: Add hasRole() method to AccountInterface,!2062Issue #3246454: Add weekly granularity to views date sort,!1105Issue #3025039: New non translatable field on translatable content throws error,!1073issue #3191727: Focus states on mobile second level navigation items fixed,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!877Issue #2708101: Default value for link text is not saved,!844Resolve #3036010 "Updaters",!673Issue #3214208: FinishResponseSubscriber could create duplicate headers,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493
Pipeline #67194 passed with warnings
Pipeline: drupal

#67200

    Pipeline: drupal

    #67199

      Pipeline: drupal

      #67198

        +1
        Showing
        with 68 additions and 55 deletions
        ......@@ -34,6 +34,7 @@ class MigrateBlockContentTranslationTest extends MigrateDrupal6TestBase {
        protected function setUp(): void {
        parent::setUp();
        $this->installEntitySchema('block_content');
        $this->installEntitySchema('path_alias');
        $this->installConfig(['block']);
        $this->installConfig(['block_content']);
        $this->container->get('theme_installer')->install(['stark']);
        ......
        ......@@ -32,6 +32,7 @@ class MigrateBlockTest extends MigrateDrupal6TestBase {
        */
        protected function setUp(): void {
        parent::setUp();
        $this->installEntitySchema('path_alias');
        // Install the themes used for this test.
        $this->installEntitySchema('block_content');
        ......
        ......@@ -37,6 +37,7 @@ class MigrateBlockContentTranslationTest extends MigrateDrupal7TestBase {
        protected function setUp(): void {
        parent::setUp();
        $this->installEntitySchema('block_content');
        $this->installEntitySchema('path_alias');
        $this->installConfig(['block']);
        $this->installConfig(['block_content']);
        $this->container->get('theme_installer')->install(['stark']);
        ......
        ......@@ -37,6 +37,7 @@ protected function setUp(): void {
        $this->container->get('theme_installer')->install(['olivero', 'claro']);
        $this->installConfig(static::$modules);
        $this->installEntitySchema('path_alias');
        // Set Olivero and Claro as the default public and admin theme.
        $config = $this->config('system.theme');
        ......
        ......@@ -34,6 +34,7 @@ class MigrateBlockTest extends MigrateDrupal7TestBase {
        */
        protected function setUp(): void {
        parent::setUp();
        $this->installEntitySchema('path_alias');
        // Install the themes used for this test.
        $this->installEntitySchema('block_content');
        ......
        ......@@ -2,7 +2,6 @@
        namespace Drupal\Tests\menu_link_content\Kernel;
        use Drupal\Core\DependencyInjection\ContainerBuilder;
        use Drupal\Core\Menu\MenuTreeParameters;
        use Drupal\menu_link_content\Entity\MenuLinkContent;
        use Drupal\KernelTests\KernelTestBase;
        ......@@ -45,17 +44,6 @@ protected function setUp(): void {
        module_set_weight('menu_link_content', 1);
        }
        /**
        * {@inheritdoc}
        */
        public function register(ContainerBuilder $container) {
        parent::register($container);
        $definition = $container->getDefinition('path_alias.path_processor');
        $definition
        ->addTag('path_processor_inbound', ['priority' => 100]);
        }
        /**
        * Tests the path aliasing changing.
        */
        ......
        <?php
        declare(strict_types = 1);
        namespace Drupal\Tests\path_alias\Kernel;
        use Drupal\entity_test\Entity\EntityTest;
        use Drupal\KernelTests\KernelTestBase;
        use Drupal\Tests\Traits\Core\PathAliasTestTrait;
        /**
        * Tests path alias on entities.
        *
        * @group path_alias
        */
        class EntityAliasTest extends KernelTestBase {
        use PathAliasTestTrait;
        /**
        * {@inheritdoc}
        */
        protected static $modules = [
        'path_alias',
        'entity_test',
        'user',
        ];
        /**
        * {@inheritdoc}
        */
        protected function setUp(): void {
        parent::setUp();
        $this->installEntitySchema('entity_test');
        $this->installEntitySchema('path_alias');
        $this->installEntitySchema('user');
        }
        /**
        * Tests transform.
        */
        public function testEntityAlias(): void {
        EntityTest::create(['id' => 1])->save();
        $this->createPathAlias('/entity_test/1', '/entity-alias');
        $entity = EntityTest::load(1);
        $this->assertSame('/entity-alias', $entity->toUrl()->toString());
        }
        }
        ......@@ -37,7 +37,6 @@ protected function setUp($import_test_views = TRUE): void {
        $this->installConfig(['node', 'filter']);
        $this->installEntitySchema('user');
        $this->installEntitySchema('node');
        $this->installEntitySchema('path_alias');
        $this->createContentType(['type' => 'article']);
        }
        ......
        ......@@ -12,6 +12,13 @@
        */
        class PluginInstanceTest extends ViewsKernelTestBase {
        /**
        * {@inheritdoc}
        */
        protected static $modules = [
        'path_alias',
        ];
        /**
        * All views plugin types.
        *
        ......
        ......@@ -28,7 +28,6 @@ abstract class ViewsKernelTestBase extends KernelTestBase {
        * {@inheritdoc}
        */
        protected static $modules = [
        'path_alias',
        'system',
        'views',
        'views_test_config',
        ......
        ......@@ -20,7 +20,7 @@ class WorkspaceViewsKernelTest extends ViewsKernelTestBase {
        *
        * @var array
        */
        protected static $modules = ['views_ui', 'workspaces'];
        protected static $modules = ['views_ui', 'workspaces', 'path_alias'];
        /**
        * Tests creating a view of workspace entities.
        ......
        ......@@ -120,6 +120,10 @@ protected function setUp(): void {
        // @todo Remove this in https://www.drupal.org/node/3039217.
        $this->installEntitySchema('user');
        // Install the 'path_alias' entity schema because the path alias path
        // processor requires it.
        $this->installEntitySchema('path_alias');
        // Remove demo_umami_content module as its install hook creates content
        // that relies on the presence of entity tables and various other elements
        // not present in a kernel test.
        ......
        ......@@ -40,6 +40,7 @@ protected function setUp(): void {
        parent::setUp();
        $this->routeProvider = \Drupal::service('router.route_provider');
        $this->moduleInfo = \Drupal::service('extension.list.module')->getList();
        $this->installEntitySchema('path_alias');
        }
        /**
        ......
        ......@@ -2,7 +2,6 @@
        namespace Drupal\KernelTests\Core\Routing;
        use Drupal\Core\DependencyInjection\ContainerBuilder;
        use Drupal\KernelTests\KernelTestBase;
        use Drupal\Tests\Traits\Core\PathAliasTestTrait;
        use Symfony\Component\HttpFoundation\Request;
        ......@@ -31,20 +30,6 @@ protected function setUp(): void {
        $this->installEntitySchema('path_alias');
        }
        /**
        * {@inheritdoc}
        */
        public function register(ContainerBuilder $container) {
        parent::register($container);
        // \Drupal\KernelTests\KernelTestBase::register() removes the alias path
        // processor.
        if ($container->hasDefinition('path_alias.path_processor')) {
        $definition = $container->getDefinition('path_alias.path_processor');
        $definition->addTag('path_processor_inbound', ['priority' => 100])->addTag('path_processor_outbound', ['priority' => 300]);
        }
        }
        /**
        * Tests the content negotiation aspect of routing.
        */
        ......
        ......@@ -5,7 +5,6 @@
        use ColinODell\PsrTestLogger\TestLogger;
        use Drupal\Core\Cache\MemoryBackend;
        use Drupal\Core\Database\Database;
        use Drupal\Core\DependencyInjection\ContainerBuilder;
        use Drupal\Core\KeyValueStore\KeyValueMemoryFactory;
        use Drupal\Core\Path\CurrentPathStack;
        use Drupal\Core\Routing\MatcherDumper;
        ......@@ -106,19 +105,6 @@ protected function setUp(): void {
        $this->logger = new TestLogger();
        }
        /**
        * {@inheritdoc}
        */
        public function register(ContainerBuilder $container) {
        parent::register($container);
        // Read the incoming path alias for these tests.
        if ($container->hasDefinition('path_alias.path_processor')) {
        $definition = $container->getDefinition('path_alias.path_processor');
        $definition->addTag('path_processor_inbound');
        }
        }
        /**
        * {@inheritdoc}
        */
        ......
        ......@@ -32,7 +32,7 @@ class Stable9LibraryOverrideTest extends StableLibraryOverrideTestBase {
        /**
        * {@inheritdoc}
        */
        protected static $modules = ['system', 'user', 'path_alias'];
        protected static $modules = ['system', 'user'];
        /**
        * {@inheritdoc}
        ......
        ......@@ -591,16 +591,6 @@ public function register(ContainerBuilder $container) {
        ->addTag('event_subscriber');
        }
        if ($container->hasDefinition('path_alias.path_processor')) {
        // The alias-based processor requires the path_alias entity schema to be
        // installed, so we prevent it from being registered to the path processor
        // manager. We do this by removing the tags that the compiler pass looks
        // for. This means that the URL generator can safely be used within tests.
        $container->getDefinition('path_alias.path_processor')
        ->clearTag('path_processor_inbound')
        ->clearTag('path_processor_outbound');
        }
        // Relax the password hashing cost in tests to avoid performance issues.
        if ($container->hasDefinition('password')) {
        $container->getDefinition('password')
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment