diff --git a/composer.json b/composer.json index 519cad137..bea2452bb 100644 --- a/composer.json +++ b/composer.json @@ -92,7 +92,8 @@ "[#UHF-7008] Admin toolbar and contextual links should always be rendered in the admin language (https://www.drupal.org/project/drupal/issues/2313309)": "https://www.drupal.org/files/issues/2023-12-19/2313309-179.patch", "[#UHF-9388] Process configuration translation files for custom modules (https://www.drupal.org/i/2845437)": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/fd68277191b8f8ec290e53b5fbbae699b2260384/patches/drupal-2845437-process-custom-module-translation-config-10.3.x.patch", "[#UHF-9690] Allow updating lists when switching from allowed values to allowed values function (https://www.drupal.org/i/2873353)": "https://www.drupal.org/files/issues/2021-05-18/allow-allowed-values-function-update-D9-2873353_1.patch", - "[#UHF-9952, #UHF-9980] Duplicate
tags (https://www.drupal.org/i/3083786)": "https://www.drupal.org/files/issues/2024-08-08/3083786--mr-8066--10-3-backport.patch" + "[#UHF-9952, #UHF-9980] Duplicate
tags (https://www.drupal.org/i/3083786)": "https://www.drupal.org/files/issues/2024-08-08/3083786--mr-8066--10-3-backport.patch", + "[#UHF-10716] Ensure consistent ordering when calculating library asset order (https://www.drupal.org/i/3467860)": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/955e2fc9493c6574ab070187b8a5a8634da7daab/patches/drupal-3467860-optimized-js-assets-mismatch.patch" }, "drupal/default_content": { "https://www.drupal.org/project/default_content/issues/2640734#comment-14638943": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/main/patches/default_content_2.0.0-alpha2-2640734_manual_imports-e164a354.patch" diff --git a/helfi_platform_config.module b/helfi_platform_config.module index 22c7ee45b..e4e06a6d7 100644 --- a/helfi_platform_config.module +++ b/helfi_platform_config.module @@ -7,7 +7,6 @@ declare(strict_types=1); -use Drupal\block\Entity\Block; use Drupal\Core\Access\AccessResult; use Drupal\Core\Breadcrumb\Breadcrumb; use Drupal\Core\Entity\ContentEntityInterface; @@ -20,6 +19,7 @@ use Drupal\Core\Link; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Url; +use Drupal\block\Entity\Block; use Drupal\helfi_api_base\Environment\Project; use Drupal\helfi_platform_config\DTO\ParagraphTypeCollection; use Drupal\helfi_platform_config\EntityVersionMatcher; diff --git a/modules/hdbt_admin_tools/src/Form/UserLoginLink.php b/modules/hdbt_admin_tools/src/Form/UserLoginLink.php index f11e91e7d..70813910e 100644 --- a/modules/hdbt_admin_tools/src/Form/UserLoginLink.php +++ b/modules/hdbt_admin_tools/src/Form/UserLoginLink.php @@ -23,7 +23,7 @@ public function getFormId(): string { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface $form_state, AccountInterface $user = NULL): array { + public function buildForm(array $form, FormStateInterface $form_state, ?AccountInterface $user = NULL): array { if ($user) { $form_state->set('account', $user); $form['#title'] = $this->t('Reset password'); diff --git a/modules/hdbt_admin_tools/src/Plugin/CKEditorPlugin/HDSButtonCKEditor.php b/modules/hdbt_admin_tools/src/Plugin/CKEditorPlugin/HDSButtonCKEditor.php index 95b9171a8..71f500e17 100644 --- a/modules/hdbt_admin_tools/src/Plugin/CKEditorPlugin/HDSButtonCKEditor.php +++ b/modules/hdbt_admin_tools/src/Plugin/CKEditorPlugin/HDSButtonCKEditor.php @@ -2,10 +2,10 @@ namespace Drupal\hdbt_admin_tools\Plugin\CKEditorPlugin; -use Drupal\ckeditor\CKEditorPluginContextualInterface; -use Drupal\ckeditor\CKEditorPluginInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\PluginBase; +use Drupal\ckeditor\CKEditorPluginContextualInterface; +use Drupal\ckeditor\CKEditorPluginInterface; use Drupal\editor\Entity\Editor; /** diff --git a/modules/hdbt_admin_tools/src/Plugin/CKEditorPlugin/LanguageSelector.php b/modules/hdbt_admin_tools/src/Plugin/CKEditorPlugin/LanguageSelector.php index 2dc4adb0b..0791fcef2 100644 --- a/modules/hdbt_admin_tools/src/Plugin/CKEditorPlugin/LanguageSelector.php +++ b/modules/hdbt_admin_tools/src/Plugin/CKEditorPlugin/LanguageSelector.php @@ -4,10 +4,10 @@ namespace Drupal\hdbt_admin_tools\Plugin\CKEditorPlugin; -use Drupal\ckeditor\CKEditorPluginBase; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Language\LanguageManager; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\ckeditor\CKEditorPluginBase; use Drupal\editor\Entity\Editor; /** diff --git a/modules/hdbt_admin_tools/src/Plugin/CKEditorPlugin/QuoteCKEditorButton.php b/modules/hdbt_admin_tools/src/Plugin/CKEditorPlugin/QuoteCKEditorButton.php index d1efb4dad..f551cbea5 100644 --- a/modules/hdbt_admin_tools/src/Plugin/CKEditorPlugin/QuoteCKEditorButton.php +++ b/modules/hdbt_admin_tools/src/Plugin/CKEditorPlugin/QuoteCKEditorButton.php @@ -2,8 +2,8 @@ namespace Drupal\hdbt_admin_tools\Plugin\CKEditorPlugin; -use Drupal\ckeditor\CKEditorPluginBase; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\ckeditor\CKEditorPluginBase; /** * Defines the "quote" plugin. diff --git a/modules/helfi_ckeditor/helfi_ckeditor.module b/modules/helfi_ckeditor/helfi_ckeditor.module index 3a7bffe38..da35577ed 100644 --- a/modules/helfi_ckeditor/helfi_ckeditor.module +++ b/modules/helfi_ckeditor/helfi_ckeditor.module @@ -7,8 +7,8 @@ declare(strict_types=1); -use Drupal\ckeditor5\Plugin\CKEditor5PluginDefinition; use Drupal\Core\Language\LanguageInterface; +use Drupal\ckeditor5\Plugin\CKEditor5PluginDefinition; /** * Modify the list of available CKEditor 5 plugins. diff --git a/modules/helfi_ckeditor/src/Plugin/CKEditor5Plugin/HelfiLanguageSelector.php b/modules/helfi_ckeditor/src/Plugin/CKEditor5Plugin/HelfiLanguageSelector.php index a63c193da..9caf65484 100644 --- a/modules/helfi_ckeditor/src/Plugin/CKEditor5Plugin/HelfiLanguageSelector.php +++ b/modules/helfi_ckeditor/src/Plugin/CKEditor5Plugin/HelfiLanguageSelector.php @@ -4,9 +4,9 @@ namespace Drupal\helfi_ckeditor\Plugin\CKEditor5Plugin; -use Drupal\ckeditor5\Plugin\CKEditor5PluginDefault; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Language\LanguageManager; +use Drupal\ckeditor5\Plugin\CKEditor5PluginDefault; use Drupal\editor\EditorInterface; /** diff --git a/modules/helfi_ckeditor/src/Plugin/CKEditor5Plugin/HelfiLink.php b/modules/helfi_ckeditor/src/Plugin/CKEditor5Plugin/HelfiLink.php index fb62e2eba..7eac14850 100644 --- a/modules/helfi_ckeditor/src/Plugin/CKEditor5Plugin/HelfiLink.php +++ b/modules/helfi_ckeditor/src/Plugin/CKEditor5Plugin/HelfiLink.php @@ -4,13 +4,13 @@ namespace Drupal\helfi_ckeditor\Plugin\CKEditor5Plugin; +use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\ckeditor5\HTMLRestrictions; use Drupal\ckeditor5\Plugin\CKEditor5PluginConfigurableTrait; use Drupal\ckeditor5\Plugin\CKEditor5PluginDefault; use Drupal\ckeditor5\Plugin\CKEditor5PluginDefinition; use Drupal\ckeditor5\Plugin\CKEditor5PluginElementsSubsetInterface; -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\editor\EditorInterface; use Drupal\helfi_api_base\Link\InternalDomainResolver; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/modules/helfi_etusivu_entities/src/Plugin/ExternalEntities/StorageClient/EtusivuJsonApiEntityBase.php b/modules/helfi_etusivu_entities/src/Plugin/ExternalEntities/StorageClient/EtusivuJsonApiEntityBase.php index 15eeae225..490b784fd 100644 --- a/modules/helfi_etusivu_entities/src/Plugin/ExternalEntities/StorageClient/EtusivuJsonApiEntityBase.php +++ b/modules/helfi_etusivu_entities/src/Plugin/ExternalEntities/StorageClient/EtusivuJsonApiEntityBase.php @@ -100,7 +100,7 @@ public static function create( /** * {@inheritdoc} */ - public function loadMultiple(array $ids = NULL) : array { + public function loadMultiple(?array $ids = NULL) : array { $ids = $ids ?: []; $query = [ diff --git a/modules/helfi_etusivu_entities/tests/src/Functional/LocalEntitiesTest.php b/modules/helfi_etusivu_entities/tests/src/Functional/LocalEntitiesTest.php index 835b4b9a9..f17e44af6 100644 --- a/modules/helfi_etusivu_entities/tests/src/Functional/LocalEntitiesTest.php +++ b/modules/helfi_etusivu_entities/tests/src/Functional/LocalEntitiesTest.php @@ -4,11 +4,11 @@ namespace Drupal\Tests\helfi_etusivu_entities\Functional; -use Drupal\language\Entity\ConfigurableLanguage; -use Drupal\node\NodeInterface; -use Drupal\Tests\block\Traits\BlockCreationTrait; use Drupal\Tests\BrowserTestBase; +use Drupal\Tests\block\Traits\BlockCreationTrait; use Drupal\Tests\node\Traits\NodeCreationTrait; +use Drupal\language\Entity\ConfigurableLanguage; +use Drupal\node\NodeInterface; use Drupal\user\Entity\Role; /** diff --git a/modules/helfi_etusivu_entities/tests/src/Kernel/EtusivuJsonApiEntityTest.php b/modules/helfi_etusivu_entities/tests/src/Kernel/EtusivuJsonApiEntityTest.php index 76696b255..1eb6b368f 100644 --- a/modules/helfi_etusivu_entities/tests/src/Kernel/EtusivuJsonApiEntityTest.php +++ b/modules/helfi_etusivu_entities/tests/src/Kernel/EtusivuJsonApiEntityTest.php @@ -6,12 +6,12 @@ use Drupal\Core\Cache\CacheTagsInvalidatorInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\helfi_api_base\Environment\EnvironmentEnum; -use Drupal\helfi_api_base\Environment\Project; -use Drupal\helfi_etusivu_entities\Plugin\ExternalEntities\StorageClient\Announcements; use Drupal\KernelTests\KernelTestBase; use Drupal\Tests\helfi_api_base\Traits\ApiTestTrait; use Drupal\Tests\helfi_api_base\Traits\EnvironmentResolverTrait; +use Drupal\helfi_api_base\Environment\EnvironmentEnum; +use Drupal\helfi_api_base\Environment\Project; +use Drupal\helfi_etusivu_entities\Plugin\ExternalEntities\StorageClient\Announcements; use GuzzleHttp\Psr7\Response; /** diff --git a/modules/helfi_media_chart/tests/src/Functional/MediaChartTest.php b/modules/helfi_media_chart/tests/src/Functional/MediaChartTest.php index c4ffb75d3..bc7aee39f 100644 --- a/modules/helfi_media_chart/tests/src/Functional/MediaChartTest.php +++ b/modules/helfi_media_chart/tests/src/Functional/MediaChartTest.php @@ -5,9 +5,9 @@ namespace Drupal\Tests\helfi_media_chart\Functional; use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig; -use Drupal\Tests\BrowserTestBase; /** * Tests media chart functionality. diff --git a/modules/helfi_media_chart/tests/src/Unit/UrlParserTraitTest.php b/modules/helfi_media_chart/tests/src/Unit/UrlParserTraitTest.php index 6bb2bf919..320c40103 100644 --- a/modules/helfi_media_chart/tests/src/Unit/UrlParserTraitTest.php +++ b/modules/helfi_media_chart/tests/src/Unit/UrlParserTraitTest.php @@ -4,8 +4,8 @@ namespace Drupal\Tests\helfi_media_chart\Unit; -use Drupal\helfi_media_chart\UrlParserTrait; use Drupal\Tests\UnitTestCase; +use Drupal\helfi_media_chart\UrlParserTrait; /** * Tests UrlParserTrait. diff --git a/modules/helfi_media_map/tests/src/Functional/MediaMapTest.php b/modules/helfi_media_map/tests/src/Functional/MediaMapTest.php index 1360ebe6d..203c13b7f 100644 --- a/modules/helfi_media_map/tests/src/Functional/MediaMapTest.php +++ b/modules/helfi_media_map/tests/src/Functional/MediaMapTest.php @@ -5,9 +5,9 @@ namespace Drupal\Tests\helfi_media_map\Functional; use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; use Drupal\media\Entity\Media; use Drupal\media\Entity\MediaType; -use Drupal\Tests\BrowserTestBase; /** * Tests media map functionality. diff --git a/modules/helfi_media_map/tests/src/Unit/UrlParserTraitTest.php b/modules/helfi_media_map/tests/src/Unit/UrlParserTraitTest.php index e5af02a15..00a46e177 100644 --- a/modules/helfi_media_map/tests/src/Unit/UrlParserTraitTest.php +++ b/modules/helfi_media_map/tests/src/Unit/UrlParserTraitTest.php @@ -4,8 +4,8 @@ namespace Drupal\Tests\helfi_media_map\Unit; -use Drupal\helfi_media_map\UrlParserTrait; use Drupal\Tests\UnitTestCase; +use Drupal\helfi_media_map\UrlParserTrait; /** * Tests UrlParserTrait. diff --git a/modules/helfi_paragraphs_hearings/src/Plugin/ExternalEntities/StorageClient/Hearings.php b/modules/helfi_paragraphs_hearings/src/Plugin/ExternalEntities/StorageClient/Hearings.php index 9f244e4b5..ae0ac886a 100644 --- a/modules/helfi_paragraphs_hearings/src/Plugin/ExternalEntities/StorageClient/Hearings.php +++ b/modules/helfi_paragraphs_hearings/src/Plugin/ExternalEntities/StorageClient/Hearings.php @@ -73,7 +73,7 @@ public static function create( /** * {@inheritdoc} */ - public function loadMultiple(array $ids = NULL) : array { + public function loadMultiple(?array $ids = NULL) : array { return $this->query(['ids' => $ids]); } diff --git a/modules/helfi_paragraphs_hero/tests/src/Kernel/HeroParagraphTest.php b/modules/helfi_paragraphs_hero/tests/src/Kernel/HeroParagraphTest.php index 9d3b56c4f..2df385201 100644 --- a/modules/helfi_paragraphs_hero/tests/src/Kernel/HeroParagraphTest.php +++ b/modules/helfi_paragraphs_hero/tests/src/Kernel/HeroParagraphTest.php @@ -4,11 +4,11 @@ namespace Drupal\Tests\helfi_paragraphs_hero\Kernel\Entity; +use Drupal\Tests\helfi_paragraphs_hero\Kernel\KernelTestBase; use Drupal\file\Entity\File; use Drupal\helfi_paragraphs_hero\Entity\Hero; use Drupal\media\Entity\Media; use Drupal\paragraphs\Entity\Paragraph; -use Drupal\Tests\helfi_paragraphs_hero\Kernel\KernelTestBase; /** * Tests Hero installation. diff --git a/modules/helfi_paragraphs_news_list/src/ElasticExternalEntityBase.php b/modules/helfi_paragraphs_news_list/src/ElasticExternalEntityBase.php index 8f669f9c5..faa3cce27 100644 --- a/modules/helfi_paragraphs_news_list/src/ElasticExternalEntityBase.php +++ b/modules/helfi_paragraphs_news_list/src/ElasticExternalEntityBase.php @@ -89,7 +89,7 @@ protected function request( /** * {@inheritdoc} */ - public function loadMultiple(array $ids = NULL) : array { + public function loadMultiple(?array $ids = NULL) : array { $data = $this->request([ 'index' => $this->index, 'body' => [ diff --git a/modules/helfi_paragraphs_news_list/tests/src/Kernel/Entity/NewsFeedParagraphTest.php b/modules/helfi_paragraphs_news_list/tests/src/Kernel/Entity/NewsFeedParagraphTest.php index 865bde705..91b6ec3f6 100644 --- a/modules/helfi_paragraphs_news_list/tests/src/Kernel/Entity/NewsFeedParagraphTest.php +++ b/modules/helfi_paragraphs_news_list/tests/src/Kernel/Entity/NewsFeedParagraphTest.php @@ -4,10 +4,10 @@ namespace Drupal\Tests\helfi_paragraphs_news_list\Kernel\Entity; +use Drupal\Tests\helfi_paragraphs_news_list\Kernel\KernelTestBase; use Drupal\external_entities\ExternalEntityStorage; use Drupal\helfi_paragraphs_news_list\Entity\NewsFeedParagraph; use Drupal\paragraphs\Entity\Paragraph; -use Drupal\Tests\helfi_paragraphs_news_list\Kernel\KernelTestBase; /** * Tests NewsFeedParagraph installation. diff --git a/modules/helfi_paragraphs_news_list/tests/src/Kernel/ExternalEntityStorage/StorageClientTestBase.php b/modules/helfi_paragraphs_news_list/tests/src/Kernel/ExternalEntityStorage/StorageClientTestBase.php index 8cae015fd..1aa095977 100644 --- a/modules/helfi_paragraphs_news_list/tests/src/Kernel/ExternalEntityStorage/StorageClientTestBase.php +++ b/modules/helfi_paragraphs_news_list/tests/src/Kernel/ExternalEntityStorage/StorageClientTestBase.php @@ -5,8 +5,8 @@ namespace Drupal\Tests\helfi_paragraphs_news_list\Kernel\ExternalEntityStorage; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\external_entities\ExternalEntityStorage; use Drupal\Tests\helfi_paragraphs_news_list\Kernel\KernelTestBase; +use Drupal\external_entities\ExternalEntityStorage; use Elasticsearch\Client; use Elasticsearch\Common\Exceptions\BadRequest400Exception; use Prophecy\Argument; diff --git a/modules/helfi_paragraphs_news_list/tests/src/Unit/ClientBuilderTest.php b/modules/helfi_paragraphs_news_list/tests/src/Unit/ClientBuilderTest.php index e4a884f34..fe33c1eed 100644 --- a/modules/helfi_paragraphs_news_list/tests/src/Unit/ClientBuilderTest.php +++ b/modules/helfi_paragraphs_news_list/tests/src/Unit/ClientBuilderTest.php @@ -4,10 +4,10 @@ namespace Drupal\Tests\helfi_\Unit; +use Drupal\Tests\UnitTestCase; +use Drupal\Tests\helfi_api_base\Traits\EnvironmentResolverTrait; use Drupal\helfi_api_base\Environment\EnvironmentResolver; use Drupal\helfi_paragraphs_news_list\ClientBuilder; -use Drupal\Tests\helfi_api_base\Traits\EnvironmentResolverTrait; -use Drupal\Tests\UnitTestCase; use Elasticsearch\Client; /** diff --git a/modules/helfi_react_search/src/Plugin/search_api/processor/Coordinates.php b/modules/helfi_react_search/src/Plugin/search_api/processor/Coordinates.php index 5adedacf3..73a47f0a6 100644 --- a/modules/helfi_react_search/src/Plugin/search_api/processor/Coordinates.php +++ b/modules/helfi_react_search/src/Plugin/search_api/processor/Coordinates.php @@ -29,7 +29,7 @@ class Coordinates extends ProcessorPluginBase { /** * {@inheritdoc} */ - public function getPropertyDefinitions(DataSourceInterface $datasource = NULL): array { + public function getPropertyDefinitions(?DataSourceInterface $datasource = NULL): array { $properties = []; if (!$datasource) { diff --git a/modules/helfi_react_search/src/Plugin/search_api/processor/DistrictImageAbsoluteUrl.php b/modules/helfi_react_search/src/Plugin/search_api/processor/DistrictImageAbsoluteUrl.php index d4190285a..e3c05a428 100644 --- a/modules/helfi_react_search/src/Plugin/search_api/processor/DistrictImageAbsoluteUrl.php +++ b/modules/helfi_react_search/src/Plugin/search_api/processor/DistrictImageAbsoluteUrl.php @@ -29,7 +29,7 @@ class DistrictImageAbsoluteUrl extends ProcessorPluginBase { /** * {@inheritdoc} */ - public function getPropertyDefinitions(DatasourceInterface $datasource = NULL) { + public function getPropertyDefinitions(?DatasourceInterface $datasource = NULL) { $properties = []; if ($datasource) { diff --git a/modules/helfi_react_search/src/Plugin/search_api/processor/MediaReferenceToObject.php b/modules/helfi_react_search/src/Plugin/search_api/processor/MediaReferenceToObject.php index 7adf11765..15406f456 100644 --- a/modules/helfi_react_search/src/Plugin/search_api/processor/MediaReferenceToObject.php +++ b/modules/helfi_react_search/src/Plugin/search_api/processor/MediaReferenceToObject.php @@ -52,7 +52,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - public function getPropertyDefinitions(DataSourceInterface $datasource = NULL): array { + public function getPropertyDefinitions(?DataSourceInterface $datasource = NULL): array { $properties = []; if (!$datasource) { diff --git a/modules/helfi_react_search/src/Plugin/search_api/processor/ProjectExecutionSchedule.php b/modules/helfi_react_search/src/Plugin/search_api/processor/ProjectExecutionSchedule.php index 8a6b2e7e3..89be1ef48 100644 --- a/modules/helfi_react_search/src/Plugin/search_api/processor/ProjectExecutionSchedule.php +++ b/modules/helfi_react_search/src/Plugin/search_api/processor/ProjectExecutionSchedule.php @@ -27,7 +27,7 @@ class ProjectExecutionSchedule extends ProcessorPluginBase { /** * {@inheritdoc} */ - public function getPropertyDefinitions(DatasourceInterface $datasource = NULL) { + public function getPropertyDefinitions(?DatasourceInterface $datasource = NULL) { $properties = []; if ($datasource) { diff --git a/modules/helfi_react_search/src/Plugin/search_api/processor/ProjectImageAbsoluteUrl.php b/modules/helfi_react_search/src/Plugin/search_api/processor/ProjectImageAbsoluteUrl.php index 02d3f20ff..7208cf1ed 100644 --- a/modules/helfi_react_search/src/Plugin/search_api/processor/ProjectImageAbsoluteUrl.php +++ b/modules/helfi_react_search/src/Plugin/search_api/processor/ProjectImageAbsoluteUrl.php @@ -29,7 +29,7 @@ class ProjectImageAbsoluteUrl extends ProcessorPluginBase { /** * {@inheritdoc} */ - public function getPropertyDefinitions(DatasourceInterface $datasource = NULL) { + public function getPropertyDefinitions(?DatasourceInterface $datasource = NULL) { $properties = []; if ($datasource) { diff --git a/modules/helfi_react_search/src/Plugin/search_api/processor/ProjectPlanSchedule.php b/modules/helfi_react_search/src/Plugin/search_api/processor/ProjectPlanSchedule.php index a7a0146f6..efae0baca 100644 --- a/modules/helfi_react_search/src/Plugin/search_api/processor/ProjectPlanSchedule.php +++ b/modules/helfi_react_search/src/Plugin/search_api/processor/ProjectPlanSchedule.php @@ -27,7 +27,7 @@ class ProjectPlanSchedule extends ProcessorPluginBase { /** * {@inheritdoc} */ - public function getPropertyDefinitions(DatasourceInterface $datasource = NULL) { + public function getPropertyDefinitions(?DatasourceInterface $datasource = NULL) { $properties = []; if ($datasource) { diff --git a/modules/helfi_react_search/tests/src/Unit/LinkedEventsTest.php b/modules/helfi_react_search/tests/src/Unit/LinkedEventsTest.php index 775c107ea..6dccf0d98 100644 --- a/modules/helfi_react_search/tests/src/Unit/LinkedEventsTest.php +++ b/modules/helfi_react_search/tests/src/Unit/LinkedEventsTest.php @@ -11,14 +11,14 @@ use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageManagerInterface; +use Drupal\Tests\UnitTestCase; +use Drupal\Tests\helfi_api_base\Traits\ApiTestTrait; use Drupal\helfi_api_base\ApiClient\ApiClient; use Drupal\helfi_api_base\ApiClient\ApiResponse; use Drupal\helfi_api_base\Environment\EnvironmentResolver; use Drupal\helfi_api_base\Environment\EnvironmentResolverInterface; use Drupal\helfi_api_base\Environment\Project; use Drupal\helfi_react_search\LinkedEvents; -use Drupal\Tests\helfi_api_base\Traits\ApiTestTrait; -use Drupal\Tests\UnitTestCase; use GuzzleHttp\ClientInterface; use GuzzleHttp\Psr7\Response; use Prophecy\PhpUnit\ProphecyTrait; @@ -115,8 +115,8 @@ private function getTimeMock(int $expectedTime) : ObjectProphecy { */ private function getApiClientMock( ClientInterface $httpClient, - TimeInterface $time = NULL, - EnvironmentResolverInterface $environmentResolver = NULL, + ?TimeInterface $time = NULL, + ?EnvironmentResolverInterface $environmentResolver = NULL, ): ApiClient { if (!$time) { $time = $this->getTimeMock(time())->reveal(); @@ -154,8 +154,8 @@ private function getApiClientMock( */ private function getSut( ApiClient $client, - LanguageManagerInterface $languageManager = NULL, - LoggerInterface $logger = NULL, + ?LanguageManagerInterface $languageManager = NULL, + ?LoggerInterface $logger = NULL, ) : LinkedEvents { if (!$languageManager) { diff --git a/modules/helfi_react_search/tests/src/Unit/SearchApiIndexItemTest.php b/modules/helfi_react_search/tests/src/Unit/SearchApiIndexItemTest.php index 016251568..04f448e27 100644 --- a/modules/helfi_react_search/tests/src/Unit/SearchApiIndexItemTest.php +++ b/modules/helfi_react_search/tests/src/Unit/SearchApiIndexItemTest.php @@ -6,13 +6,13 @@ use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Tests\UnitTestCase; use Drupal\helfi_react_search\Plugin\DebugDataItem\SearchApiIndex; use Drupal\search_api\Entity\SearchApiConfigEntityStorage; use Drupal\search_api\IndexInterface; use Drupal\search_api\SearchApiException; use Drupal\search_api\ServerInterface; use Drupal\search_api\Tracker\TrackerInterface; -use Drupal\Tests\UnitTestCase; use Prophecy\PhpUnit\ProphecyTrait; /** diff --git a/modules/helfi_tpr_config/src/Drush/Commands/RemoveNonHelsinkiTPRUnitsCommands.php b/modules/helfi_tpr_config/src/Drush/Commands/RemoveNonHelsinkiTPRUnitsCommands.php index 42fa139fd..77a128580 100644 --- a/modules/helfi_tpr_config/src/Drush/Commands/RemoveNonHelsinkiTPRUnitsCommands.php +++ b/modules/helfi_tpr_config/src/Drush/Commands/RemoveNonHelsinkiTPRUnitsCommands.php @@ -4,9 +4,9 @@ namespace Drupal\helfi_tpr_config\Drush\Commands; -use Drupal\content_lock\ContentLock\ContentLock; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; +use Drupal\content_lock\ContentLock\ContentLock; use Drush\Attributes\Command; use Drush\Commands\AutowireTrait; use Drush\Commands\DrushCommands; diff --git a/modules/helfi_tpr_config/tests/src/Functional/EntityOgImageTest.php b/modules/helfi_tpr_config/tests/src/Functional/EntityOgImageTest.php index 59bcfc731..f92a3d574 100644 --- a/modules/helfi_tpr_config/tests/src/Functional/EntityOgImageTest.php +++ b/modules/helfi_tpr_config/tests/src/Functional/EntityOgImageTest.php @@ -4,11 +4,11 @@ namespace Drupal\Tests\helfi_tpr_config\Functional; +use Drupal\Tests\BrowserTestBase; +use Drupal\Tests\TestFileCreationTrait; use Drupal\file\Entity\File; use Drupal\helfi_tpr\Entity\Unit; use Drupal\media\Entity\Media; -use Drupal\Tests\BrowserTestBase; -use Drupal\Tests\TestFileCreationTrait; /** * Tests default og image. diff --git a/patches/drupal-3467860-optimized-js-assets-mismatch.patch b/patches/drupal-3467860-optimized-js-assets-mismatch.patch new file mode 100644 index 000000000..c5c835d22 --- /dev/null +++ b/patches/drupal-3467860-optimized-js-assets-mismatch.patch @@ -0,0 +1,374 @@ +diff --git a/core/core.libraries.yml b/core/core.libraries.yml +index d6136b22aa..8151d7e33e 100644 +--- a/core/core.libraries.yml ++++ b/core/core.libraries.yml +@@ -823,8 +823,7 @@ drupal.touchevents-test: + drupal.vertical-tabs: + version: VERSION + js: +- # Load before core/drupal.collapse. +- misc/vertical-tabs.js: { weight: -1 } ++ misc/vertical-tabs.js: {} + css: + component: + misc/vertical-tabs.css: {} +diff --git a/core/lib/Drupal/Core/Asset/AssetResolver.php b/core/lib/Drupal/Core/Asset/AssetResolver.php +index fcd294a649..8182f2cc59 100644 +--- a/core/lib/Drupal/Core/Asset/AssetResolver.php ++++ b/core/lib/Drupal/Core/Asset/AssetResolver.php +@@ -91,31 +91,77 @@ public function __construct(LibraryDiscoveryInterface $library_discovery, Librar + * $assets = new AttachedAssets(); + * $assets->setLibraries(['core/a', 'core/b', 'core/c']); + * $assets->setAlreadyLoadedLibraries(['core/c']); +- * $resolver->getLibrariesToLoad($assets) === ['core/a', 'core/b', 'core/d'] ++ * $resolver->getLibrariesToLoad($assets, 'js') === ['core/a', 'core/b', 'core/d'] + * @endcode + * ++ * The attached assets tend to be in the order that libraries were attached ++ * during a request. To minimize the number of unique aggregated asset URLs ++ * and files, we normalize the list by filtering out libraries that don't ++ * include the asset type being built as well as ensuring a reliable order of ++ * the libraries based on their dependencies. ++ * + * @param \Drupal\Core\Asset\AttachedAssetsInterface $assets + * The assets attached to the current response. ++ * @param string|null $asset_type ++ * The asset type to load. + * + * @return string[] + * A list of libraries and their dependencies, in the order they should be + * loaded, excluding any libraries that have already been loaded. + */ +- protected function getLibrariesToLoad(AttachedAssetsInterface $assets) { +- // The order of libraries passed in via assets can differ, so to reduce +- // variation, first normalize the requested libraries to the minimal +- // representative set before then expanding the list to include all +- // dependencies. ++ protected function getLibrariesToLoad(AttachedAssetsInterface $assets, ?string $asset_type = NULL) { + // @see Drupal\FunctionalTests\Core\Asset\AssetOptimizationTestUmami + // @todo https://www.drupal.org/project/drupal/issues/1945262 +- $libraries = $assets->getLibraries(); +- if ($libraries) { +- $libraries = $this->libraryDependencyResolver->getMinimalRepresentativeSubset($libraries); ++ $libraries_to_load = array_diff( ++ $this->libraryDependencyResolver->getLibrariesWithDependencies($assets->getLibraries()), ++ $this->libraryDependencyResolver->getLibrariesWithDependencies($assets->getAlreadyLoadedLibraries()) ++ ); ++ if ($asset_type) { ++ $libraries_to_load = $this->filterLibrariesByType($libraries_to_load, $asset_type); + } +- return array_diff( +- $this->libraryDependencyResolver->getLibrariesWithDependencies($libraries), ++ ++ // We now have a complete list of libraries requested. However, this list ++ // could be in any order depending on when libraries were attached during ++ // the page request, which can result in different file contents and URLs ++ // even for an otherwise identical set of libraries. To ensure that any ++ // particular set of libraries results in the same aggregate URL, sort the ++ // libraries, then generate the minimum representative set again. ++ sort($libraries_to_load); ++ $minimum_libraries = $this->libraryDependencyResolver->getMinimalRepresentativeSubset($libraries_to_load); ++ $libraries_to_load = array_diff( ++ $this->libraryDependencyResolver->getLibrariesWithDependencies($minimum_libraries), + $this->libraryDependencyResolver->getLibrariesWithDependencies($assets->getAlreadyLoadedLibraries()) + ); ++ ++ // Now remove any libraries without the relevant asset type again, since ++ // they have been brought back in via dependencies. ++ if ($asset_type) { ++ $libraries_to_load = $this->filterLibrariesByType($libraries_to_load, $asset_type); ++ } ++ ++ return $libraries_to_load; ++ } ++ ++ /** ++ * Filter libraries that don't contain an asset type. ++ * ++ * @param array $libraries ++ * An array of library definitions. ++ * @param string $asset_type ++ * The type of asset, either 'js' or 'css'. ++ * ++ * @return array ++ * The filtered libraries array. ++ */ ++ protected function filterLibrariesByType(array $libraries, string $asset_type): array { ++ foreach ($libraries as $key => $library) { ++ [$extension, $name] = explode('/', $library, 2); ++ $definition = $this->libraryDiscovery->getLibraryByName($extension, $name); ++ if (empty($definition[$asset_type])) { ++ unset($libraries[$key]); ++ } ++ } ++ return $libraries; + } + + /** +@@ -125,15 +171,9 @@ public function getCssAssets(AttachedAssetsInterface $assets, $optimize, ?Langua + if (!$assets->getLibraries()) { + return []; + } +- $libraries_to_load = $this->getLibrariesToLoad($assets); +- foreach ($libraries_to_load as $key => $library) { +- [$extension, $name] = explode('/', $library, 2); +- $definition = $this->libraryDiscovery->getLibraryByName($extension, $name); +- if (empty($definition['css'])) { +- unset($libraries_to_load[$key]); +- } +- } +- $libraries_to_load = array_values($libraries_to_load); ++ // Get the complete list of libraries to load including dependencies. ++ $libraries_to_load = $this->getLibrariesToLoad($assets, 'css'); ++ + if (!$libraries_to_load) { + return []; + } +@@ -157,7 +197,7 @@ public function getCssAssets(AttachedAssetsInterface $assets, $optimize, ?Langua + 'preprocess' => TRUE, + ]; + +- foreach ($libraries_to_load as $key => $library) { ++ foreach ($libraries_to_load as $library) { + [$extension, $name] = explode('/', $library, 2); + $definition = $this->libraryDiscovery->getLibraryByName($extension, $name); + foreach ($definition['css'] as $options) { +@@ -211,7 +251,7 @@ public function getCssAssets(AttachedAssetsInterface $assets, $optimize, ?Langua + protected function getJsSettingsAssets(AttachedAssetsInterface $assets) { + $settings = []; + +- foreach ($this->getLibrariesToLoad($assets) as $library) { ++ foreach ($this->getLibrariesToLoad($assets, 'js') as $library) { + [$extension, $name] = explode('/', $library, 2); + $definition = $this->libraryDiscovery->getLibraryByName($extension, $name); + if (isset($definition['drupalSettings'])) { +@@ -233,24 +273,19 @@ public function getJsAssets(AttachedAssetsInterface $assets, $optimize, ?Languag + $language = $this->languageManager->getCurrentLanguage(); + } + $theme_info = $this->themeManager->getActiveTheme(); +- $libraries_to_load = $this->getLibrariesToLoad($assets); ++ ++ // Get the complete list of libraries to load including dependencies. ++ $libraries_to_load = $this->getLibrariesToLoad($assets, 'js'); + + // Collect all libraries that contain JS assets and are in the header. +- // Also remove any libraries with no JavaScript from the libraries to +- // load. + $header_js_libraries = []; + foreach ($libraries_to_load as $key => $library) { + [$extension, $name] = explode('/', $library, 2); + $definition = $this->libraryDiscovery->getLibraryByName($extension, $name); +- if (empty($definition['js'])) { +- unset($libraries_to_load[$key]); +- continue; +- } + if (!empty($definition['header'])) { + $header_js_libraries[] = $library; + } + } +- $libraries_to_load = array_values($libraries_to_load); + + // If all the libraries to load contained only CSS, there is nothing further + // to do here, so return early. +diff --git a/core/modules/ckeditor5/ckeditor5.libraries.yml b/core/modules/ckeditor5/ckeditor5.libraries.yml +index 70ebcf5170..73d3e7ea00 100644 +--- a/core/modules/ckeditor5/ckeditor5.libraries.yml ++++ b/core/modules/ckeditor5/ckeditor5.libraries.yml +@@ -99,6 +99,7 @@ internal.drupal.ckeditor5.filter.admin: + - core/once + - core/drupal.ajax + - core/drupalSettings ++ - core/drupal.vertical-tabs + + internal.drupal.ckeditor5.table: + css: +diff --git a/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php b/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php +index 31340bf472..a7cec55b3e 100644 +--- a/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php ++++ b/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php +@@ -8,6 +8,8 @@ + use Drupal\Core\Asset\AssetResolver; + use Drupal\Core\Asset\AttachedAssets; + use Drupal\Core\Asset\AttachedAssetsInterface; ++use Drupal\Core\Asset\JsCollectionGrouper; ++use Drupal\Core\Asset\LibraryDependencyResolver; + use Drupal\Core\Cache\MemoryBackend; + use Drupal\Core\Language\LanguageInterface; + use Drupal\Tests\UnitTestCase; +@@ -90,51 +92,74 @@ protected function setUp(): void { + $this->libraryDiscovery = $this->getMockBuilder('Drupal\Core\Asset\LibraryDiscovery') + ->disableOriginalConstructor() + ->getMock(); ++ $this->libraryDiscovery->expects($this->any()) ++ ->method('getLibraryByName') ++ ->willReturnCallback(function ($extension, $name) { ++ return $this->libraries[$extension . '/' . $name]; ++ }); + $this->libraries = [ +- 'drupal' => [ ++ 'core/drupal' => [ + 'version' => '1.0.0', + 'css' => [], + 'js' => +- [ +- 'core/misc/drupal.js' => ['data' => 'core/misc/drupal.js', 'preprocess' => TRUE], +- ], ++ [ ++ 'core/misc/drupal.js' => ['data' => 'core/misc/drupal.js', 'preprocess' => TRUE], ++ ], + 'license' => '', + ], +- 'jquery' => [ ++ 'core/jquery' => [ + 'version' => '1.0.0', + 'css' => [], + 'js' => +- [ +- 'core/misc/jquery.js' => ['data' => 'core/misc/jquery.js', 'minified' => TRUE], +- ], ++ [ ++ 'core/misc/jquery.js' => ['data' => 'core/misc/jquery.js', 'minified' => TRUE], ++ ], + 'license' => '', + ], +- 'llama' => [ ++ 'llama/css' => [ + 'version' => '1.0.0', + 'css' => +- [ +- 'core/misc/llama.css' => ['data' => 'core/misc/llama.css'], +- ], ++ [ ++ 'core/misc/llama.css' => ['data' => 'core/misc/llama.css'], ++ ], + 'js' => [], + 'license' => '', + ], +- 'piggy' => [ ++ 'piggy/css' => [ + 'version' => '1.0.0', + 'css' => +- [ +- 'core/misc/piggy.css' => ['data' => 'core/misc/piggy.css'], ++ [ ++ 'core/misc/piggy.css' => ['data' => 'core/misc/piggy.css'], ++ ], ++ 'js' => [], ++ 'license' => '', ++ ], ++ 'core/ckeditor5' => [ ++ 'remote' => 'https://github.com/ckeditor/ckeditor5', ++ 'version' => '1.0.0', ++ 'license' => '', ++ 'js' => [ ++ 'assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js' => [ ++ 'data' => 'assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js', ++ 'preprocess' => FALSE, ++ 'minified' => TRUE, ++ ], + ], ++ ], ++ 'piggy/ckeditor' => [ ++ 'version' => '1.0.0', ++ 'css' => ++ [ ++ 'core/misc/ckeditor.css' => ['data' => 'core/misc/ckeditor.css'], ++ ], + 'js' => [], + 'license' => '', ++ 'dependencies' => [ ++ 'core/ckeditor5', ++ ], + ], + ]; +- $this->libraryDependencyResolver = $this->createMock('\Drupal\Core\Asset\LibraryDependencyResolverInterface'); +- $this->libraryDependencyResolver->expects($this->any()) +- ->method('getLibrariesWithDependencies') +- ->willReturnArgument(0); +- $this->libraryDependencyResolver->expects($this->any()) +- ->method('getMinimalRepresentativeSubset') +- ->willReturnArgument(0); ++ $this->libraryDependencyResolver = new LibraryDependencyResolver($this->libraryDiscovery); + $this->moduleHandler = $this->createMock('\Drupal\Core\Extension\ModuleHandlerInterface'); + $this->themeManager = $this->createMock('\Drupal\Core\Theme\ThemeManagerInterface'); + $active_theme = $this->getMockBuilder('\Drupal\Core\Theme\ActiveTheme') +@@ -169,22 +194,17 @@ protected function setUp(): void { + * @dataProvider providerAttachedCssAssets + */ + public function testGetCssAssets(AttachedAssetsInterface $assets_a, AttachedAssetsInterface $assets_b, $expected_css_cache_item_count): void { +- $map = [ +- ['core', 'drupal', $this->libraries['drupal']], +- ['core', 'jquery', $this->libraries['jquery']], +- ['llama', 'css', $this->libraries['llama']], +- ['piggy', 'css', $this->libraries['piggy']], +- ]; +- $this->libraryDiscovery->method('getLibraryByName') +- ->willReturnMap($map); +- ++ $this->libraryDiscovery->expects($this->any()) ++ ->method('getLibraryByName') ++ ->willReturnCallback(function ($extension, $name) { ++ return $this->libraries[$extension . '/' . $name]; ++ }); + $this->assetResolver->getCssAssets($assets_a, FALSE, $this->english); + $this->assetResolver->getCssAssets($assets_b, FALSE, $this->english); + $this->assertCount($expected_css_cache_item_count, $this->cache->getAllCids()); + } + + public static function providerAttachedCssAssets() { +- $time = time(); + return [ + 'one js only library and one css only library' => [ + (new AttachedAssets())->setAlreadyLoadedLibraries([])->setLibraries(['core/drupal']), +@@ -204,13 +224,11 @@ public static function providerAttachedCssAssets() { + * @dataProvider providerAttachedJsAssets + */ + public function testGetJsAssets(AttachedAssetsInterface $assets_a, AttachedAssetsInterface $assets_b, $expected_js_cache_item_count, $expected_multilingual_js_cache_item_count): void { +- $map = [ +- ['core', 'drupal', $this->libraries['drupal']], +- ['core', 'jquery', $this->libraries['jquery']], +- ]; +- $this->libraryDiscovery->method('getLibraryByName') +- ->willReturnMap($map); +- ++ $this->libraryDiscovery->expects($this->any()) ++ ->method('getLibraryByName') ++ ->willReturnCallback(function ($extension, $name) { ++ return $this->libraries[$extension . '/' . $name]; ++ }); + $this->assetResolver->getJsAssets($assets_a, FALSE, $this->english); + $this->assetResolver->getJsAssets($assets_b, FALSE, $this->english); + $this->assertCount($expected_js_cache_item_count, $this->cache->getAllCids()); +@@ -238,6 +256,32 @@ public static function providerAttachedJsAssets() { + ]; + } + ++ /** ++ * Test that order of scripts are correct. ++ */ ++ public function testJsAssetsOrder(): void { ++ $time = time(); ++ $assets_a = (new AttachedAssets()) ++ ->setAlreadyLoadedLibraries([]) ++ ->setLibraries(['core/drupal', 'core/ckeditor5', 'core/jquery', 'piggy/ckeditor']) ++ ->setSettings(['currentTime' => $time]); ++ $assets_b = (new AttachedAssets()) ++ ->setAlreadyLoadedLibraries([]) ++ ->setLibraries(['piggy/ckeditor', 'core/drupal', 'core/ckeditor5', 'core/jquery']) ++ ->setSettings(['currentTime' => $time]); ++ $js_assets_a = $this->assetResolver->getJsAssets($assets_a, FALSE, $this->english); ++ $js_assets_b = $this->assetResolver->getJsAssets($assets_b, FALSE, $this->english); ++ ++ $grouper = new JsCollectionGrouper(); ++ ++ $group_a = $grouper->group($js_assets_a[1]); ++ $group_b = $grouper->group($js_assets_b[1]); ++ ++ foreach ($group_a as $key => $value) { ++ $this->assertSame($value['items'], $group_b[$key]['items']); ++ } ++ } ++ + } + + if (!defined('CSS_AGGREGATE_DEFAULT')) { diff --git a/src/ConfigUpdate/ConfigUpdater.php b/src/ConfigUpdate/ConfigUpdater.php index d7d39472d..4c4c05578 100644 --- a/src/ConfigUpdate/ConfigUpdater.php +++ b/src/ConfigUpdate/ConfigUpdater.php @@ -4,9 +4,9 @@ namespace Drupal\helfi_platform_config\ConfigUpdate; -use Drupal\config_rewrite\ConfigRewriterInterface; use Drupal\Core\Config\ConfigInstallerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\config_rewrite\ConfigRewriterInterface; /** * A helper class to deal with config updates. diff --git a/tests/src/Functional/BreadcrumbTest.php b/tests/src/Functional/BreadcrumbTest.php index 767145a8d..f9a053cd5 100644 --- a/tests/src/Functional/BreadcrumbTest.php +++ b/tests/src/Functional/BreadcrumbTest.php @@ -4,14 +4,14 @@ namespace Drupal\Tests\helfi_platform_config\Functional; +use Drupal\Tests\BrowserTestBase; +use Drupal\Tests\system\Functional\Menu\AssertBreadcrumbTrait; use Drupal\helfi_api_base\Environment\EnvironmentResolver; use Drupal\helfi_api_base\Environment\Project; use Drupal\language\Entity\ConfigurableLanguage; use Drupal\node\Entity\Node; use Drupal\node\Entity\NodeType; use Drupal\node\NodeInterface; -use Drupal\Tests\BrowserTestBase; -use Drupal\Tests\system\Functional\Menu\AssertBreadcrumbTrait; /** * Tests breadcrumb. diff --git a/tests/src/Functional/LanguageSwitcherAlterTest.php b/tests/src/Functional/LanguageSwitcherAlterTest.php index 84ac85ce6..29420d667 100644 --- a/tests/src/Functional/LanguageSwitcherAlterTest.php +++ b/tests/src/Functional/LanguageSwitcherAlterTest.php @@ -4,15 +4,15 @@ namespace Drupal\Tests\helfi_platform_config\Functional; +use Drupal\Tests\BrowserTestBase; +use Drupal\Tests\helfi_api_base\Traits\DefaultConfigurationTrait; +use Drupal\Tests\helfi_api_base\Traits\EnvironmentResolverTrait; use Drupal\helfi_api_base\Environment\EnvironmentEnum; use Drupal\helfi_api_base\Environment\Project; use Drupal\language\Entity\ConfigurableLanguage; use Drupal\node\Entity\Node; use Drupal\node\Entity\NodeType; use Drupal\node\NodeInterface; -use Drupal\Tests\BrowserTestBase; -use Drupal\Tests\helfi_api_base\Traits\DefaultConfigurationTrait; -use Drupal\Tests\helfi_api_base\Traits\EnvironmentResolverTrait; /** * Tests the language switcher alter changes affecting anonymous user. diff --git a/tests/src/Functional/MenuLanguageTest.php b/tests/src/Functional/MenuLanguageTest.php index 73e24220e..da2ecd909 100644 --- a/tests/src/Functional/MenuLanguageTest.php +++ b/tests/src/Functional/MenuLanguageTest.php @@ -5,9 +5,9 @@ namespace Drupal\Tests\helfi_platform_config\Functional; use Drupal\Core\Language\LanguageInterface; -use Drupal\menu_link_content\Entity\MenuLinkContent; use Drupal\Tests\content_translation\Functional\ContentTranslationTestBase; use Drupal\Tests\helfi_api_base\Traits\DefaultConfigurationTrait; +use Drupal\menu_link_content\Entity\MenuLinkContent; use Drupal\user\UserInterface; /** diff --git a/tests/src/Kernel/HeroBlockTest.php b/tests/src/Kernel/HeroBlockTest.php index 56e28079d..5a96c4922 100644 --- a/tests/src/Kernel/HeroBlockTest.php +++ b/tests/src/Kernel/HeroBlockTest.php @@ -4,10 +4,10 @@ namespace Drupal\Tests\helfi_platform_config\Kernel; -use Drupal\block\Entity\Block; use Drupal\Core\Field\FieldItemListInterface; -use Drupal\helfi_platform_config\EntityVersionMatcher; use Drupal\KernelTests\Core\Entity\EntityKernelTestBase; +use Drupal\block\Entity\Block; +use Drupal\helfi_platform_config\EntityVersionMatcher; use Drupal\node\Entity\Node; use Drupal\node\NodeInterface; use Prophecy\PhpUnit\ProphecyTrait; diff --git a/tests/src/Unit/OGImageManagerTest.php b/tests/src/Unit/OGImageManagerTest.php index 30119e67b..e894a6acc 100644 --- a/tests/src/Unit/OGImageManagerTest.php +++ b/tests/src/Unit/OGImageManagerTest.php @@ -7,9 +7,9 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\File\FileUrlGeneratorInterface; +use Drupal\Tests\token\Kernel\UnitTest; use Drupal\helfi_platform_config\Token\OGImageBuilderInterface; use Drupal\helfi_platform_config\Token\OGImageManager; -use Drupal\Tests\token\Kernel\UnitTest; use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTrait; use Prophecy\Prophecy\ObjectProphecy;