From 2ed4ff09a9310afd30960a3bdefde3248ca2026f Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Mon, 9 Dec 2024 10:19:29 -0500 Subject: [PATCH 01/42] Trying some D11 compatibility --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 16d97e87e7..2ce860df16 100644 --- a/composer.json +++ b/composer.json @@ -27,13 +27,13 @@ "getdkan/pdlt": "^0.1.7", "getdkan/procrastinator": "^5.0.3", "getdkan/rooted-json-data": "^0.2.2", - "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", + "guzzlehttp/guzzle": "^6.5.8 || ^7", "ilbee/csv-response": "^1.2.0", "justinrainbow/json-schema": "^5.2", "m1x0n/opis-json-schema-error-presenter": "^0.5.3", "npm-asset/select2": "^4.0", "oomphinc/composer-installers-extender": "^2.0", - "ramsey/uuid": "^3.8.0", + "ramsey/uuid": "^3.8.0 || ^4", "stolt/json-merge-patch": "^2.0", "symfony/polyfill-php80": "^1.27" }, From 509e22df7ca5067f638d4e2c1460f981c2a2689a Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Mon, 9 Dec 2024 10:58:19 -0500 Subject: [PATCH 02/42] Update dkan.info.yml --- dkan.info.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dkan.info.yml b/dkan.info.yml index e8af44d0d9..857bf97b7e 100644 --- a/dkan.info.yml +++ b/dkan.info.yml @@ -1,7 +1,7 @@ name: DKAN description: 'DKAN Open Data Portal' type: module -core_version_requirement: ^10 +core_version_requirement: ^10 || ^11 package: DKAN dependencies: - dkan:metastore From f614414a390f95b0d9480daaff848ffe136a4bbb Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Mon, 9 Dec 2024 13:33:17 -0500 Subject: [PATCH 03/42] Module versions --- modules/common/common.info.yml | 2 +- modules/data_dictionary_widget/data_dictionary_widget.info.yml | 2 +- modules/datastore/datastore.info.yml | 2 +- modules/dkan_js_frontend/dkan_js_frontend.info.yml | 2 +- modules/harvest/harvest.info.yml | 2 +- modules/json_form_widget/json_form_widget.info.yml | 2 +- modules/metastore/metastore.info.yml | 2 +- .../metastore/modules/metastore_admin/metastore_admin.info.yml | 2 +- .../modules/metastore_facets/metastore_facets.info.yml | 2 +- .../modules/metastore_search/metastore_search.info.yml | 2 +- modules/sample_content/sample_content.info.yml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/common/common.info.yml b/modules/common/common.info.yml index bf58a27d38..763bb84092 100644 --- a/modules/common/common.info.yml +++ b/modules/common/common.info.yml @@ -1,5 +1,5 @@ name: Common description: Provides common utilities, functions, and base api endpoints used by other DKAN modules. type: module -core_version_requirement: ^10 +core_version_requirement: ^10 || ^11 package: DKAN diff --git a/modules/data_dictionary_widget/data_dictionary_widget.info.yml b/modules/data_dictionary_widget/data_dictionary_widget.info.yml index f542fab1aa..5189ecc556 100644 --- a/modules/data_dictionary_widget/data_dictionary_widget.info.yml +++ b/modules/data_dictionary_widget/data_dictionary_widget.info.yml @@ -2,7 +2,7 @@ name: 'Data Dictionary Widget' description: 'Provides a field widget to generate a data-dictionary form' package: DKAN type: module -core_version_requirement: ^9.4 || ^10 +core_version_requirement: ^9.4 || ^10 || ^11 dependencies: - drupal:field - metastore diff --git a/modules/datastore/datastore.info.yml b/modules/datastore/datastore.info.yml index 772b466c4b..f48e0ec854 100755 --- a/modules/datastore/datastore.info.yml +++ b/modules/datastore/datastore.info.yml @@ -1,7 +1,7 @@ name: Datastore description: Provides integration with the datastore library. type: module -core_version_requirement: ^10 +core_version_requirement: ^10 || ^11 package: DKAN dependencies: - dkan:common diff --git a/modules/dkan_js_frontend/dkan_js_frontend.info.yml b/modules/dkan_js_frontend/dkan_js_frontend.info.yml index 114367db58..982eafb4c1 100644 --- a/modules/dkan_js_frontend/dkan_js_frontend.info.yml +++ b/modules/dkan_js_frontend/dkan_js_frontend.info.yml @@ -1,7 +1,7 @@ name: DKAN JS Frontend description: Provides the routing connection between Drupal and a decoupled JavaScript frontend. type: module -core_version_requirement: ^10 +core_version_requirement: ^10 || ^11 dependencies: - drupal:field package: DKAN diff --git a/modules/harvest/harvest.info.yml b/modules/harvest/harvest.info.yml index 78e263d581..47a743462e 100644 --- a/modules/harvest/harvest.info.yml +++ b/modules/harvest/harvest.info.yml @@ -1,7 +1,7 @@ name: Harvest description: Provides integration with the harvest library. type: module -core_version_requirement: ^10 +core_version_requirement: ^10 || ^11 package: DKAN dependencies: - dkan:common diff --git a/modules/json_form_widget/json_form_widget.info.yml b/modules/json_form_widget/json_form_widget.info.yml index c4e2e83e05..94b42a42e5 100644 --- a/modules/json_form_widget/json_form_widget.info.yml +++ b/modules/json_form_widget/json_form_widget.info.yml @@ -2,7 +2,7 @@ name: JSON Form Widget description: Provides a widget for generating a form based on JSON Schema. package: DKAN type: module -core_version_requirement: ^10 +core_version_requirement: ^10 || ^11 dependencies: - select_or_other - select2 diff --git a/modules/metastore/metastore.info.yml b/modules/metastore/metastore.info.yml index 61ad9d380d..79c9587ccd 100644 --- a/modules/metastore/metastore.info.yml +++ b/modules/metastore/metastore.info.yml @@ -1,7 +1,7 @@ name: Metastore description: Provides integration with the metastore library and creates the "Data" content type for storing metadata. type: module -core_version_requirement: ^10 +core_version_requirement: ^10 || ^11 package: DKAN dependencies: - dkan:common diff --git a/modules/metastore/modules/metastore_admin/metastore_admin.info.yml b/modules/metastore/modules/metastore_admin/metastore_admin.info.yml index 5018e61060..9daefa0589 100644 --- a/modules/metastore/modules/metastore_admin/metastore_admin.info.yml +++ b/modules/metastore/modules/metastore_admin/metastore_admin.info.yml @@ -1,7 +1,7 @@ name: Administration description: Provides administrative views for managing dataset content. type: module -core_version_requirement: ^10 +core_version_requirement: ^10 || ^11 dependencies: - dkan:metastore - drupal:breakpoint diff --git a/modules/metastore/modules/metastore_facets/metastore_facets.info.yml b/modules/metastore/modules/metastore_facets/metastore_facets.info.yml index 4e5defc01c..cbc87ca50f 100644 --- a/modules/metastore/modules/metastore_facets/metastore_facets.info.yml +++ b/modules/metastore/modules/metastore_facets/metastore_facets.info.yml @@ -1,7 +1,7 @@ name: DKAN Metastore Facets description: Provides facet blocks for DKAN Metastore Search. type: module -core_version_requirement: ^10 +core_version_requirement: ^10 || ^11 dependencies: - dkan:metastore_search - facets:facets diff --git a/modules/metastore/modules/metastore_search/metastore_search.info.yml b/modules/metastore/modules/metastore_search/metastore_search.info.yml index 4467b37c83..89f2cfdee0 100644 --- a/modules/metastore/modules/metastore_search/metastore_search.info.yml +++ b/modules/metastore/modules/metastore_search/metastore_search.info.yml @@ -1,7 +1,7 @@ name: Search description: Provides an endpoint to perform searches against DKAN's metadata. type: module -core_version_requirement: ^10 +core_version_requirement: ^10 || ^11 dependencies: - dkan:metastore - drupal:search_api diff --git a/modules/sample_content/sample_content.info.yml b/modules/sample_content/sample_content.info.yml index 3395f7e869..ae9a91f943 100644 --- a/modules/sample_content/sample_content.info.yml +++ b/modules/sample_content/sample_content.info.yml @@ -1,7 +1,7 @@ name: Sample Content description: Provides sample content for tests or standing up a demo instance. type: module -core_version_requirement: ^10 +core_version_requirement: ^10 || ^11 package: DKAN dependencies: - dkan:harvest From 22c218bcfc02febd7bd92bb77496321bd20a48da Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Mon, 9 Dec 2024 14:51:49 -0500 Subject: [PATCH 04/42] Fix missing methods in Connection --- modules/common/tests/src/Unit/Connection.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/common/tests/src/Unit/Connection.php b/modules/common/tests/src/Unit/Connection.php index 4ed9b25d73..d99ab9b554 100644 --- a/modules/common/tests/src/Unit/Connection.php +++ b/modules/common/tests/src/Unit/Connection.php @@ -27,6 +27,10 @@ class Connection extends CoreConnection { */ protected $statementClass; + public function upsert($table, array $options = []) { } + + public function schema() { } + /** * {@inheritdoc} */ From 031889e7973a7a5f620e2a3cca8439989306737f Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Tue, 10 Dec 2024 12:04:14 -0500 Subject: [PATCH 05/42] Update phpunit schema --- phpunit.xml | 50 +++++++++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 7b692074e7..0464d58282 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,31 +1,5 @@ - - - - . - - - rector.php - tests - modules/common/tests - modules/datastore/tests - modules/datastore/modules/datastore_mysql_import/tests - modules/dkan_js_frontend/tests - modules/frontend/tests - modules/harvest/tests - modules/json_form_widget/tests - modules/data_dictionary_widget/tests - modules/metastore/tests - modules/metastore/modules/metastore_admin/tests - modules/metastore/modules/metastore_search/tests - modules/sample_content/tests - ./ - - + . @@ -65,4 +39,26 @@ + + + . + + + rector.php + tests + modules/common/tests + modules/datastore/tests + modules/datastore/modules/datastore_mysql_import/tests + modules/dkan_js_frontend/tests + modules/frontend/tests + modules/harvest/tests + modules/json_form_widget/tests + modules/data_dictionary_widget/tests + modules/metastore/tests + modules/metastore/modules/metastore_admin/tests + modules/metastore/modules/metastore_search/tests + modules/sample_content/tests + ./ + + From e56ec7e4552fc32a7c835b177e0a687d42f56b52 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Tue, 10 Dec 2024 12:05:07 -0500 Subject: [PATCH 06/42] Remove LoggerTrait --- modules/common/src/LoggerTrait.php | 123 ------------------ .../tests/src/Traits/LoggerTraitTest.php | 84 ------------ .../common/tests/src/Unit/LoggerTraitTest.php | 30 ----- 3 files changed, 237 deletions(-) delete mode 100644 modules/common/src/LoggerTrait.php delete mode 100644 modules/common/tests/src/Traits/LoggerTraitTest.php delete mode 100644 modules/common/tests/src/Unit/LoggerTraitTest.php diff --git a/modules/common/src/LoggerTrait.php b/modules/common/src/LoggerTrait.php deleted file mode 100644 index b1b0461ec8..0000000000 --- a/modules/common/src/LoggerTrait.php +++ /dev/null @@ -1,123 +0,0 @@ -loggerName = $name; - } - - /** - * Setter. - * - * @param \Drupal\Core\Logger\LoggerChannelFactory $loggerService - * Injected logger factory service. - */ - public function setLoggerFactory(LoggerChannelFactory $loggerService) { - $this->loggerService = $loggerService; - } - - /** - * Private. - */ - protected function log($loggerName, $message, $variables = [], $level = LogLevel::ERROR) { - if ($this->loggerService) { - $this->loggerService->get($loggerName)->log($level, $message, $variables); - } - } - - /** - * Private. - */ - protected function error(string $message, array $context = []) { - - if ($this->loggerService) { - $this->loggerService->get($this->loggerName)->error($message, $context); - } - } - - /** - * Private. - */ - protected function warning(string $message, array $context = []) { - - if ($this->loggerService) { - $this->loggerService->get($this->loggerName)->warning($message, $context); - } - } - - /** - * Private. - */ - protected function notice(string $message, array $context = []) { - - if ($this->loggerService) { - $this->loggerService->get($this->loggerName)->notice($message, $context); - } - } - - /** - * Private. - */ - private function showDebug() { - $this->debug = TRUE; - } - - /** - * Private. - */ - private function debug(string $message = "", array $context = []) { - if ($this->loggerService && $this->debug) { - $m = "@class @function: " . $message; - $c = array_merge($context, - [ - '@class' => static::class, - '@function' => debug_backtrace()[1]['function'], - '@message' => $message, - ] - ); - - $this->loggerService->get($this->loggerName)->notice($m, $c); - } - } - -} diff --git a/modules/common/tests/src/Traits/LoggerTraitTest.php b/modules/common/tests/src/Traits/LoggerTraitTest.php deleted file mode 100644 index 32db7e7c8b..0000000000 --- a/modules/common/tests/src/Traits/LoggerTraitTest.php +++ /dev/null @@ -1,84 +0,0 @@ -getLoggerChain(); - $this->setLoggerFactory($logger->getMock()); - - $context = ['foo' => 'bar']; - $this->log('log name', 'message', $context, 'critical'); - - $this->assertEquals('log name', $logger->getStoredInput('names')[0]); - $this->assertEquals('critical', $logger->getStoredInput('logs')[0]); - $this->assertEquals('message', $logger->getStoredInput('logs')[1]); - $this->assertEquals($context, $logger->getStoredInput('logs')[2]); - } - - /** - * - */ - public function testError() { - $logger = $this->getLoggerChain(); - $this->setLoggerFactory($logger->getMock()); - - $this->error('some error'); - - $this->assertEquals('some error', $logger->getStoredInput('errors')[0]); - } - - /** - * - */ - public function testWarning() { - $logger = $this->getLoggerChain(); - $this->setLoggerFactory($logger->getMock()); - - $this->warning('some warning'); - - $this->assertEquals('some warning', $logger->getStoredInput('warnings')[0]); - } - - /** - * - */ - public function testNotice() { - $logger = $this->getLoggerChain(); - $this->setLoggerFactory($logger->getMock()); - - $this->notice('some notice'); - - $this->assertEquals('some notice', $logger->getStoredInput('notices')[0]); - } - - /** - * Getter. - */ - public function getLoggerChain() { - return (new Chain($this)) - ->add(LoggerChannelFactory::class, 'get', LoggerChannelInterface::class, "names") - ->add(LoggerChannelInterface::class, 'log', NULL, "logs") - ->add(LoggerChannelInterface::class, 'error', NULL, "errors") - ->add(LoggerChannelInterface::class, 'warning', NULL, "warnings") - ->add(LoggerChannelInterface::class, 'notice', NULL, "notices"); - } - -} diff --git a/modules/common/tests/src/Unit/LoggerTraitTest.php b/modules/common/tests/src/Unit/LoggerTraitTest.php deleted file mode 100644 index c76a0fb942..0000000000 --- a/modules/common/tests/src/Unit/LoggerTraitTest.php +++ /dev/null @@ -1,30 +0,0 @@ -add(LoggerChannelFactory::class) - ->getMock(); - - $class = new Logging(); - $class->setLoggerName('blah'); - $class->setLoggerFactory($loggerChannelFactory); - $class->do(); - $this->assertTrue(TRUE); - } - -} From 0e6abaee7044de77b44a0dccb123c0c78daa63d2 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Tue, 10 Dec 2024 12:06:58 -0500 Subject: [PATCH 07/42] Updates to DatastoreServiceTest --- modules/datastore/tests/src/Unit/DatastoreServiceTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/datastore/tests/src/Unit/DatastoreServiceTest.php b/modules/datastore/tests/src/Unit/DatastoreServiceTest.php index 302567b0e2..76e12b85fe 100644 --- a/modules/datastore/tests/src/Unit/DatastoreServiceTest.php +++ b/modules/datastore/tests/src/Unit/DatastoreServiceTest.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\datastore\Unit; -use Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher; use Drupal\Core\Queue\QueueFactory; use Drupal\datastore\Plugin\QueueWorker\ImportJob; use Drupal\datastore\Storage\ImportJobStoreFactory; @@ -25,6 +24,7 @@ use PHPUnit\Framework\TestCase; use Procrastinator\Result; use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\EventDispatcher\EventDispatcher; /** * @covers \Drupal\datastore\DatastoreService @@ -52,7 +52,7 @@ public function testImport() { ->add(ImportService::class, 'getImporter', ImportJob::class) ->add(ImportJob::class, 'getResult', new Result()) ->add(QueueFactory::class, "get", NULL) - ->add(ContainerAwareEventDispatcher::class, "dispatch", NULL); + ->add(EventDispatcher::class, "dispatch", NULL); $service = DatastoreService::create($chain->getMock()); $result = $service->import("1"); @@ -100,7 +100,7 @@ public function testGetDataDictionaryFields() { private function getCommonChain() { $options = (new Options()) - ->add('event_dispatcher', ContainerAwareEventDispatcher::class) + ->add('event_dispatcher', EventDispatcher::class) ->add('dkan.metastore.resource_mapper', ResourceMapper::class) ->add('dkan.datastore.service.resource_localizer', ResourceLocalizer::class) ->add('dkan.datastore.service.factory.import', ImportServiceFactory::class) From da842bb8b38121ef70cb1af9c760ea762461d142 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Tue, 10 Dec 2024 12:07:14 -0500 Subject: [PATCH 08/42] Updates to PostImportTest --- modules/datastore/tests/src/Kernel/Service/PostImportTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/datastore/tests/src/Kernel/Service/PostImportTest.php b/modules/datastore/tests/src/Kernel/Service/PostImportTest.php index 75cbe4c568..ea951a20fb 100644 --- a/modules/datastore/tests/src/Kernel/Service/PostImportTest.php +++ b/modules/datastore/tests/src/Kernel/Service/PostImportTest.php @@ -8,10 +8,13 @@ use Drupal\datastore\PostImportResult; use Drupal\datastore\Service\ResourceProcessor\DictionaryEnforcer; use Drupal\datastore\Service\ResourceProcessor\ResourceDoesNotHaveDictionary; +use Drupal\Core\Database\Query\SelectInterface; +use Drupal\Core\Database\StatementInterface; use Drupal\KernelTests\KernelTestBase; use Drupal\metastore\DataDictionary\DataDictionaryDiscoveryInterface; use Drupal\metastore\ResourceMapper; use Drupal\datastore\Service\PostImport; +use Drupal\sqlite\Driver\Database\sqlite\Connection as SqliteConnection; /** * Tests the PostImport service. From 909ee58a98466aa18c97feebdb437938577b0fdd Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Tue, 10 Dec 2024 12:25:49 -0500 Subject: [PATCH 09/42] Fix deprecations, mostly static providers --- modules/common/tests/src/Unit/Storage/QueryDataProvider.php | 2 +- .../tests/src/Unit/Plugin/QueueWorker/ImportJobTest.php | 2 +- .../src/Unit/Storage/HarvestHashesEntityDatabaseTableTest.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/common/tests/src/Unit/Storage/QueryDataProvider.php b/modules/common/tests/src/Unit/Storage/QueryDataProvider.php index 8c217f5e30..24c0d6ab29 100644 --- a/modules/common/tests/src/Unit/Storage/QueryDataProvider.php +++ b/modules/common/tests/src/Unit/Storage/QueryDataProvider.php @@ -24,7 +24,7 @@ class QueryDataProvider { /** * */ - public function getAllData($return): array { + public static function getAllData(): array { $tests = [ 'noPropertiesQuery', 'propertiesQuery', diff --git a/modules/datastore/tests/src/Unit/Plugin/QueueWorker/ImportJobTest.php b/modules/datastore/tests/src/Unit/Plugin/QueueWorker/ImportJobTest.php index 7dbd0f424a..57868d527c 100644 --- a/modules/datastore/tests/src/Unit/Plugin/QueueWorker/ImportJobTest.php +++ b/modules/datastore/tests/src/Unit/Plugin/QueueWorker/ImportJobTest.php @@ -336,7 +336,7 @@ public static function sanitizeHeaderProvider() { * @dataProvider sanitizeHeaderProvider * @covers ::sanitizeHeader */ - public function testSanitizeHeader($column, $expected) { + public static function testSanitizeHeader($column, $expected) { $this->assertEquals($expected, ImportJob::sanitizeHeader($column)); } diff --git a/modules/harvest/tests/src/Unit/Storage/HarvestHashesEntityDatabaseTableTest.php b/modules/harvest/tests/src/Unit/Storage/HarvestHashesEntityDatabaseTableTest.php index 412a78bfd8..d002172bd3 100644 --- a/modules/harvest/tests/src/Unit/Storage/HarvestHashesEntityDatabaseTableTest.php +++ b/modules/harvest/tests/src/Unit/Storage/HarvestHashesEntityDatabaseTableTest.php @@ -16,10 +16,10 @@ */ class HarvestHashesEntityDatabaseTableTest extends TestCase { - public function providerNotImplementedMethods() { + public static function providerNotImplementedMethods() { return [ ['storeMultiple', [[]]], - ['query', [$this->createStub(Query::class)]], + ['query', [static::createStub(Query::class)]], ['setSchema', [[]]], ['getSchema', []], ]; From fee37e7ab9d15c7afc70e430fdac84c257e67c2d Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Tue, 10 Dec 2024 13:17:33 -0500 Subject: [PATCH 10/42] Remove getMockForAbstractClass from HarvestHashes... --- .../src/Unit/Storage/HarvestHashesEntityDatabaseTableTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/harvest/tests/src/Unit/Storage/HarvestHashesEntityDatabaseTableTest.php b/modules/harvest/tests/src/Unit/Storage/HarvestHashesEntityDatabaseTableTest.php index d002172bd3..d40d2fec09 100644 --- a/modules/harvest/tests/src/Unit/Storage/HarvestHashesEntityDatabaseTableTest.php +++ b/modules/harvest/tests/src/Unit/Storage/HarvestHashesEntityDatabaseTableTest.php @@ -33,7 +33,8 @@ public static function providerNotImplementedMethods() { public function testNotImplementedMethods($method, $arguments) { $table = $this->getMockBuilder(HarvestHashesEntityDatabaseTable::class) ->disableOriginalConstructor() - ->getMockForAbstractClass(); + ->onlyMethods([]) + ->getMock(); $this->expectException(\RuntimeException::class); $this->expectExceptionMessage(HarvestHashesEntityDatabaseTable::class . '::' . $method . ' not yet implemented.'); From e52a2c8f7633ad7d72fca8bbd6e005a92f316e9e Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Tue, 10 Dec 2024 13:20:15 -0500 Subject: [PATCH 11/42] Fix extra static in ImportJobTest --- .../tests/src/Unit/Plugin/QueueWorker/ImportJobTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/datastore/tests/src/Unit/Plugin/QueueWorker/ImportJobTest.php b/modules/datastore/tests/src/Unit/Plugin/QueueWorker/ImportJobTest.php index 57868d527c..7dbd0f424a 100644 --- a/modules/datastore/tests/src/Unit/Plugin/QueueWorker/ImportJobTest.php +++ b/modules/datastore/tests/src/Unit/Plugin/QueueWorker/ImportJobTest.php @@ -336,7 +336,7 @@ public static function sanitizeHeaderProvider() { * @dataProvider sanitizeHeaderProvider * @covers ::sanitizeHeader */ - public static function testSanitizeHeader($column, $expected) { + public function testSanitizeHeader($column, $expected) { $this->assertEquals($expected, ImportJob::sanitizeHeader($column)); } From ea7acd5ca839c3102aecd55fa051f8d388bfb2fd Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Tue, 10 Dec 2024 13:23:14 -0500 Subject: [PATCH 12/42] Fix EventDispatcher dependency in WebServiceApiTest --- .../tests/src/Unit/SqlEndpoint/WebServiceApiTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/datastore/tests/src/Unit/SqlEndpoint/WebServiceApiTest.php b/modules/datastore/tests/src/Unit/SqlEndpoint/WebServiceApiTest.php index 8e15f6117a..bf9be7c70a 100644 --- a/modules/datastore/tests/src/Unit/SqlEndpoint/WebServiceApiTest.php +++ b/modules/datastore/tests/src/Unit/SqlEndpoint/WebServiceApiTest.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\datastore\Unit\SqlEndpoint; -use Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher; use Drupal\Core\Cache\Context\CacheContextsManager; use Drupal\Core\Config\Config; use Drupal\Core\Config\ConfigFactory; @@ -18,6 +17,7 @@ use Drupal\metastore\NodeWrapper\NodeDataFactory; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; @@ -37,7 +37,7 @@ protected function setUp(): void { // Set cache services $options = (new Options) ->add('cache_contexts_manager', CacheContextsManager::class) - ->add('event_dispatcher', ContainerAwareEventDispatcher::class) + ->add('event_dispatcher', EventDispatcher::class) ->index(0); $chain = (new Chain($this)) ->add(ContainerInterface::class, 'get', $options) @@ -102,7 +102,7 @@ public function getCommonMockChain($query = "[SELECT * FROM 123__456][WHERE abc ->add('dkan.metastore.api_response', MetastoreApiResponse::class) ->add("database", Connection::class) ->add('request_stack', RequestStack::class) - ->add('event_dispatcher', ContainerAwareEventDispatcher::class) + ->add('event_dispatcher', EventDispatcher::class) ->add('cache_contexts_manager', CacheContextsManager::class) ->index(0); From cdebac3ba8f35c589751d00addc716242c88ae15 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Tue, 10 Dec 2024 13:31:04 -0500 Subject: [PATCH 13/42] Fix WebServiceApiTest --- .../tests/src/Unit/SqlEndpoint/WebServiceApiTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/datastore/tests/src/Unit/SqlEndpoint/WebServiceApiTest.php b/modules/datastore/tests/src/Unit/SqlEndpoint/WebServiceApiTest.php index bf9be7c70a..b95a8b76f5 100644 --- a/modules/datastore/tests/src/Unit/SqlEndpoint/WebServiceApiTest.php +++ b/modules/datastore/tests/src/Unit/SqlEndpoint/WebServiceApiTest.php @@ -110,11 +110,15 @@ public function getCommonMockChain($query = "[SELECT * FROM 123__456][WHERE abc $row = (object) ['column_1' => "hello", 'column_2' => "goodbye"]; + $request = $this->getMockBuilder(Request::class) + ->onlyMethods(['get', 'getContent']) + ->getMock(); + $request->method('get')->willReturn($query); + $request->method('getContent')->willReturn($body); + return (new Chain($this)) ->add(Container::class, "get", $options) - ->add(RequestStack::class, 'getCurrentRequest', Request::class) - ->add(Request::class, 'get', $query) - ->add(Request::class, 'getContent', $body) + ->add(RequestStack::class, 'getCurrentRequest', $request) ->add(ConfigFactory::class, 'get', Config::class) ->add(Config::class, 'get', 1000) ->add(DatastoreSqlEndpointService::class, 'runQuery', [$row]) From e94343516febb3f85eb508bd936571189bf655e9 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Tue, 10 Dec 2024 15:29:07 -0500 Subject: [PATCH 14/42] Fix DatabaseTableFactoryTest --- .../src/Unit/Storage/DatabaseTableFactoryTest.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/datastore/tests/src/Unit/Storage/DatabaseTableFactoryTest.php b/modules/datastore/tests/src/Unit/Storage/DatabaseTableFactoryTest.php index d4f7e220bd..a2fa66d7fb 100644 --- a/modules/datastore/tests/src/Unit/Storage/DatabaseTableFactoryTest.php +++ b/modules/datastore/tests/src/Unit/Storage/DatabaseTableFactoryTest.php @@ -21,8 +21,9 @@ class DatabaseTableFactoryTest extends TestCase { * Test basic function (no indexer service). */ public function test() { - $connection = (new Chain($this)) - ->add(Connection::class, "__destruct", NULL) + $connection = $this->getMockBuilder(Connection::class) + ->disableOriginalConstructor() + ->onlyMethods([]) ->getMock(); $databaseTable = (new Chain($this)) @@ -31,9 +32,9 @@ public function test() { $builder = $this->getMockBuilder(DatabaseTableFactory::class); $factory = $builder->setConstructorArgs([ - $connection, - $this->createStub(LoggerInterface::class - )]) + $connection, + $this->createStub(LoggerInterface::class), + ]) ->onlyMethods(["getDatabaseTable"]) ->getMock(); From 63716fec1187a59b681e60a8fdd53d5a505fb4bc Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Tue, 10 Dec 2024 15:42:01 -0500 Subject: [PATCH 15/42] Fix DatabaseTableTest --- .../src/Unit/Storage/DatabaseTableTest.php | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/modules/datastore/tests/src/Unit/Storage/DatabaseTableTest.php b/modules/datastore/tests/src/Unit/Storage/DatabaseTableTest.php index 269a7b527d..2f66745a02 100644 --- a/modules/datastore/tests/src/Unit/Storage/DatabaseTableTest.php +++ b/modules/datastore/tests/src/Unit/Storage/DatabaseTableTest.php @@ -7,7 +7,6 @@ use Drupal\Core\Database\DatabaseExceptionWrapper; use Drupal\Core\Database\Query\Insert; use Drupal\Core\Database\Query\Select; -use Drupal\Core\Database\StatementWrapper; use Drupal\common\Storage\Query; use Drupal\datastore\Storage\DatabaseTable; use Drupal\mysql\Driver\Database\mysql\Schema; @@ -104,8 +103,8 @@ public function testRetrieveAll() { $connection = $this->getConnectionChain() ->add(Connection::class, "select", Select::class) ->add(Select::class, "fields", Select::class) - ->add(Select::class, "execute", StatementWrapper::class) - ->add(StatementWrapper::class, 'fetchAll', $sequence) + ->add(Select::class, "execute", StatementInterface::class) + ->add(StatementInterface::class, 'fetchAll', $sequence) ->getMock(); $databaseTable = new DatabaseTable( @@ -128,8 +127,8 @@ public function testStore() { ->add(Connection::class, 'select', Select::class, 'select_1') ->add(Select::class, 'fields', Select::class) ->add(Select::class, 'condition', Select::class) - ->add(Select::class, 'execute', StatementWrapper::class) - ->add(StatementWrapper::class, 'fetch', NULL); + ->add(Select::class, 'execute', StatementInterface::class) + ->add(StatementInterface::class, 'fetch', NULL); $databaseTable = new DatabaseTable( $connectionChain->getMock(), @@ -151,8 +150,8 @@ public function testStoreFieldCountException() { ->add(Connection::class, 'select', Select::class, 'select_1') ->add(Select::class, 'fields', Select::class) ->add(Select::class, 'condition', Select::class) - ->add(Select::class, 'execute', StatementWrapper::class) - ->add(StatementWrapper::class, 'fetch', NULL); + ->add(Select::class, 'execute', StatementInterface::class) + ->add(StatementInterface::class, 'fetch', NULL); $databaseTable = new DatabaseTable( $connectionChain->getMock(), @@ -175,8 +174,8 @@ public function testStoreMultiple() { ->add(Connection::class, 'select', Select::class, 'select_1') ->add(Select::class, 'fields', Select::class) ->add(Select::class, 'condition', Select::class) - ->add(Select::class, 'execute', StatementWrapper::class) - ->add(StatementWrapper::class, 'fetch', NULL); + ->add(Select::class, 'execute', StatementInterface::class) + ->add(StatementInterface::class, 'fetch', NULL); $databaseTable = new DatabaseTable( $connectionChain->getMock(), @@ -203,8 +202,8 @@ public function testStoreMultipleFieldCountException() { ->add(Connection::class, 'select', Select::class, 'select_1') ->add(Select::class, 'fields', Select::class) ->add(Select::class, 'condition', Select::class) - ->add(Select::class, 'execute', StatementWrapper::class) - ->add(StatementWrapper::class, 'fetch', NULL); + ->add(Select::class, 'execute', StatementInterface::class) + ->add(StatementInterface::class, 'fetch', NULL); $databaseTable = new DatabaseTable( $connectionChain->getMock(), @@ -228,8 +227,8 @@ public function testCount() { ->add(Connection::class, 'select', Select::class, 'select_1') ->add(Select::class, 'fields', Select::class) ->add(Select::class, 'countQuery', Select::class) - ->add(Select::class, 'execute', StatementWrapper::class) - ->add(StatementWrapper::class, 'fetchField', 1); + ->add(Select::class, 'execute', StatementInterface::class) + ->add(StatementInterface::class, 'fetchField', 1); $databaseTable = new DatabaseTable( $connectionChain->getMock(), @@ -247,8 +246,8 @@ public function testGetSummary() { ->add(Connection::class, 'select', Select::class, 'select_1') ->add(Select::class, 'fields', Select::class) ->add(Select::class, 'countQuery', Select::class) - ->add(Select::class, 'execute', StatementWrapper::class) - ->add(StatementWrapper::class, 'fetchField', 1); + ->add(Select::class, 'execute', StatementInterface::class) + ->add(StatementInterface::class, 'fetchField', 1); $databaseTable = new DatabaseTable( $connectionChain->getMock(), @@ -294,8 +293,8 @@ public function testPrepareDataJsonDecodeNull() { ->add(Connection::class, 'select', Select::class, 'select_1') ->add(Select::class, 'fields', Select::class) ->add(Select::class, 'condition', Select::class) - ->add(Select::class, 'execute', StatementWrapper::class) - ->add(StatementWrapper::class, 'fetch', NULL); + ->add(Select::class, 'execute', StatementInterface::class) + ->add(StatementInterface::class, 'fetch', NULL); $databaseTable = new DatabaseTable( $connectionChain->getMock(), @@ -318,8 +317,8 @@ public function testPrepareDataNonArray() { ->add(Connection::class, 'select', Select::class, 'select_1') ->add(Select::class, 'fields', Select::class) ->add(Select::class, 'condition', Select::class) - ->add(Select::class, 'execute', StatementWrapper::class) - ->add(StatementWrapper::class, 'fetch', NULL); + ->add(Select::class, 'execute', StatementInterface::class) + ->add(StatementInterface::class, 'fetch', NULL); $databaseTable = new DatabaseTable( $connectionChain->getMock(), @@ -340,8 +339,8 @@ public function testQuery() { ->add(Connection::class, 'select', Select::class, 'select_1') ->add(Select::class, 'fields', Select::class) ->add(Select::class, 'condition', Select::class) - ->add(Select::class, 'execute', StatementWrapper::class) - ->add(StatementWrapper::class, 'fetchAll', []); + ->add(Select::class, 'execute', StatementInterface::class) + ->add(StatementInterface::class, 'fetchAll', []); $databaseTable = new DatabaseTable( $connectionChain->getMock(), @@ -460,9 +459,9 @@ private function getConnectionChain() { return (new Chain($this)) // Construction. ->add(Connection::class, "schema", Schema::class) - ->add(Connection::class, 'query', StatementWrapper::class) + ->add(Connection::class, 'query', StatementInterface::class) ->add(Connection::class, 'getConnectionOptions', ['driver' => 'mysql']) - ->add(StatementWrapper::class, 'fetchAll', + ->add(StatementInterface::class, 'fetchAll', (new Sequence())->add($fieldInfo)->add($indexInfo) ) ->add(Schema::class, "tableExists", TRUE) From 8d77d944388aec79ba9432849259ef474fda852b Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Wed, 11 Dec 2024 15:22:57 -0500 Subject: [PATCH 16/42] Fix SearchTest --- .../modules/metastore_search/tests/src/Unit/SearchTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/metastore/modules/metastore_search/tests/src/Unit/SearchTest.php b/modules/metastore/modules/metastore_search/tests/src/Unit/SearchTest.php index 5955ab5e54..e4849271be 100644 --- a/modules/metastore/modules/metastore_search/tests/src/Unit/SearchTest.php +++ b/modules/metastore/modules/metastore_search/tests/src/Unit/SearchTest.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\metastore_search\Unit; -use Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher; use Drupal\Core\DependencyInjection\Container; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeManager; @@ -19,6 +18,7 @@ use MockChain\Chain; use MockChain\Options; use PHPUnit\Framework\TestCase; +use Symfony\Component\EventDispatcher\EventDispatcher; /** * Class SearchTest. @@ -75,7 +75,7 @@ public function testSearchParameterWithComma() { ->add('dkan.metastore.service', MetastoreService::class) ->add('entity_type.manager', EntityTypeManager::class) ->add('search_api.query_helper', QueryHelperInterface::class) - ->add('event_dispatcher', ContainerAwareEventDispatcher::class) + ->add('event_dispatcher', EventDispatcher::class) ->index(0); $container = (new Chain($this)) @@ -188,7 +188,7 @@ public static function getCommonMockChain(TestCase $case, Options $services = NU 'dkan.metastore.service' => MetastoreService::class, 'entity_type.manager' => EntityTypeManager::class, 'search_api.query_helper' => QueryHelperInterface::class, - 'event_dispatcher' => ContainerAwareEventDispatcher::class, + 'event_dispatcher' => EventDispatcher::class, ]; foreach ($myServices as $serviceName => $class) { From efa09e9be15de2bf466eb88388700b9419ad410c Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Wed, 11 Dec 2024 15:47:42 -0500 Subject: [PATCH 17/42] Fix DataDictionarySettingsForm and test --- .../src/Form/DataDictionarySettingsForm.php | 13 ++++++++++--- .../src/Kernel/DataDictionarySettingsFormTest.php | 7 ++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/modules/metastore/src/Form/DataDictionarySettingsForm.php b/modules/metastore/src/Form/DataDictionarySettingsForm.php index 1e3d2ebdc8..332e287630 100644 --- a/modules/metastore/src/Form/DataDictionarySettingsForm.php +++ b/modules/metastore/src/Form/DataDictionarySettingsForm.php @@ -3,6 +3,7 @@ namespace Drupal\metastore\Form; use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\Config\TypedConfigManagerInterface; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Messenger\MessengerInterface; @@ -39,8 +40,13 @@ class DataDictionarySettingsForm extends ConfigFormBase { * @param \Drupal\metastore\MetastoreService $metastore * The metastore service. */ - public function __construct(ConfigFactoryInterface $config_factory, MessengerInterface $messenger, MetastoreService $metastore) { - parent::__construct($config_factory); + public function __construct( + ConfigFactoryInterface $config_factory, + MessengerInterface $messenger, + MetastoreService $metastore, + TypedConfigManagerInterface $typed_config, + ) { + parent::__construct($config_factory, $typed_config); $this->messenger = $messenger; $this->metastore = $metastore; } @@ -57,7 +63,8 @@ public static function create(ContainerInterface $container) { return new static( $container->get('config.factory'), $container->get('messenger'), - $container->get('dkan.metastore.service') + $container->get('dkan.metastore.service'), + $container->get('config.typed') ); } diff --git a/modules/metastore/tests/src/Kernel/DataDictionarySettingsFormTest.php b/modules/metastore/tests/src/Kernel/DataDictionarySettingsFormTest.php index 3b84e993ea..0577abef40 100644 --- a/modules/metastore/tests/src/Kernel/DataDictionarySettingsFormTest.php +++ b/modules/metastore/tests/src/Kernel/DataDictionarySettingsFormTest.php @@ -222,7 +222,12 @@ protected function setUp(): void { $this->metastore->post('data-dictionary', $data_dict); $this->metastore->publish('data-dictionary', $dict_id); - $this->form = new DataDictionarySettingsForm($this->container->get('config.factory'), $this->container->get('messenger'), $this->container->get('dkan.metastore.service')); + $this->form = new DataDictionarySettingsForm( + $this->container->get('config.factory'), + $this->container->get('messenger'), + $this->container->get('dkan.metastore.service'), + $this->container->get('config.typed') + ); } } From 314c7904af7aa7ce6ba409753ce37cde9f4a2bf0 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Wed, 11 Dec 2024 15:49:02 -0500 Subject: [PATCH 18/42] Fix metastoreServiceTest --- modules/metastore/tests/src/Unit/MetastoreServiceTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/metastore/tests/src/Unit/MetastoreServiceTest.php b/modules/metastore/tests/src/Unit/MetastoreServiceTest.php index 2383d73ab8..7703711315 100644 --- a/modules/metastore/tests/src/Unit/MetastoreServiceTest.php +++ b/modules/metastore/tests/src/Unit/MetastoreServiceTest.php @@ -4,7 +4,6 @@ use ColinODell\PsrTestLogger\TestLogger; use Drupal\Component\DependencyInjection\Container; -use Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher; use Drupal\common\Events\Event; use Drupal\Core\Logger\LoggerChannelInterface; use Drupal\metastore\Exception\ExistingObjectException; @@ -21,6 +20,7 @@ use MockChain\Sequence; use PHPUnit\Framework\TestCase; use RootedData\RootedJsonData; +use Symfony\Component\EventDispatcher\EventDispatcher; /** * @coversDefaultClass \Drupal\metastore\MetastoreService @@ -129,7 +129,7 @@ public function testGetAllException() { $container = self::getCommonMockChain($this, NULL, $logger) ->add(NodeData::class, 'retrieveAll', [json_encode(['foo' => 'bar'])]) ->add(ValidMetadataFactory::class, 'get', $data) - ->add(ContainerAwareEventDispatcher::class, 'dispatch', $sequence) + ->add(EventDispatcher::class, 'dispatch', $sequence) ->getMock(); \Drupal::setContainer($container); @@ -416,7 +416,7 @@ public static function getCommonMockChain(TestCase $case, Options $services = NU $options = (new Options) ->add('dkan.metastore.schema_retriever', SchemaRetriever::class) ->add('dkan.metastore.storage', DataFactory::class) - ->add('event_dispatcher', ContainerAwareEventDispatcher::class) + ->add('event_dispatcher', EventDispatcher::class) ->add('dkan.metastore.valid_metadata', ValidMetadataFactory::class) ->add('dkan.common.logger_channel', LoggerChannelInterface::class) ->index(0); From 768b68b578eb6e72a470036704e804cbb51e9ff8 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Wed, 11 Dec 2024 16:24:39 -0500 Subject: [PATCH 19/42] Fix SimpleSitemapArbitraryLinksAlterTest --- .../tests/src/Unit/SimpleSitemapArbitraryLinksAlterTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/dkan_js_frontend/tests/src/Unit/SimpleSitemapArbitraryLinksAlterTest.php b/modules/dkan_js_frontend/tests/src/Unit/SimpleSitemapArbitraryLinksAlterTest.php index 74331248ad..c898cee335 100644 --- a/modules/dkan_js_frontend/tests/src/Unit/SimpleSitemapArbitraryLinksAlterTest.php +++ b/modules/dkan_js_frontend/tests/src/Unit/SimpleSitemapArbitraryLinksAlterTest.php @@ -56,6 +56,7 @@ public function testSitemapStaticLinks(): void { $container = (new Chain($this)) ->add(Container::class, 'get', $containerOptions) ->add(RequestStack::class, 'getCurrentRequest', (Request::create(self::BASE_URL))) + ->add(LoggerChannelFactory::class, 'get', LoggerChannelInterface::class) ->add(SimpleSitemapSettingsInterface::class, 'get', NULL) ->getMock(); \Drupal::setContainer($container); From b491fe3a6d49417332856a6922d23076d7659770 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Wed, 11 Dec 2024 16:26:08 -0500 Subject: [PATCH 20/42] More EventDispatcher Replacements --- modules/common/tests/src/Unit/Events/EventTest.php | 4 ++-- .../tests/src/Unit/Controller/QueryDownloadControllerTest.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/common/tests/src/Unit/Events/EventTest.php b/modules/common/tests/src/Unit/Events/EventTest.php index 7ddf3297a0..5617a435bb 100644 --- a/modules/common/tests/src/Unit/Events/EventTest.php +++ b/modules/common/tests/src/Unit/Events/EventTest.php @@ -4,10 +4,10 @@ use Drupal\common\EventDispatcherTrait; use Drupal\common\Events\Event; -use Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher; use MockChain\Chain; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\EventDispatcher\EventDispatcher; class EventTest extends TestCase { @@ -19,7 +19,7 @@ public function testDataIntegrityAcrossEventSubscribers() { ->add(Container::class) ->getMock(); - $dispatcher = new ContainerAwareEventDispatcher($containerx); + $dispatcher = new EventDispatcher($containerx); $dispatcher->addListener('test_event', function(Event $event) { $event->setData(1); }); diff --git a/modules/datastore/tests/src/Unit/Controller/QueryDownloadControllerTest.php b/modules/datastore/tests/src/Unit/Controller/QueryDownloadControllerTest.php index bc0cb406aa..711abbb30e 100644 --- a/modules/datastore/tests/src/Unit/Controller/QueryDownloadControllerTest.php +++ b/modules/datastore/tests/src/Unit/Controller/QueryDownloadControllerTest.php @@ -24,6 +24,7 @@ use Psr\Log\LoggerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\HttpFoundation\Request; /** @@ -54,7 +55,7 @@ protected function setUp(): void { // Set cache services $options = (new Options) ->add('cache_contexts_manager', CacheContextsManager::class) - ->add('event_dispatcher', ContainerAwareEventDispatcher::class) + ->add('event_dispatcher', EventDispatcher::class) ->index(0); $chain = (new Chain($this)) ->add(ContainerInterface::class, 'get', $options) From 7dc901c029beb3d1f44a50b46653aab046489e91 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Wed, 11 Dec 2024 16:33:08 -0500 Subject: [PATCH 21/42] Version constraint for datastore_mysql_import.info.yml --- .../datastore_mysql_import/datastore_mysql_import.info.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/datastore/modules/datastore_mysql_import/datastore_mysql_import.info.yml b/modules/datastore/modules/datastore_mysql_import/datastore_mysql_import.info.yml index 3e2c64fafb..11cb69334e 100755 --- a/modules/datastore/modules/datastore_mysql_import/datastore_mysql_import.info.yml +++ b/modules/datastore/modules/datastore_mysql_import/datastore_mysql_import.info.yml @@ -1,7 +1,7 @@ name: Datastore MySQL Import description: Provides a MySQL Importer class. type: module -core_version_requirement: ^10 +core_version_requirement: ^10 || ^11 package: DKAN configure: datastore.mysql_import.settings dependencies: From 853d68d1f82feead818d63c325e2d8f9e914548b Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Wed, 11 Dec 2024 16:38:11 -0500 Subject: [PATCH 22/42] Fixed docs in DataDictionarySettingsForm --- modules/metastore/src/Form/DataDictionarySettingsForm.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/metastore/src/Form/DataDictionarySettingsForm.php b/modules/metastore/src/Form/DataDictionarySettingsForm.php index 332e287630..d61415de55 100644 --- a/modules/metastore/src/Form/DataDictionarySettingsForm.php +++ b/modules/metastore/src/Form/DataDictionarySettingsForm.php @@ -33,12 +33,17 @@ class DataDictionarySettingsForm extends ConfigFormBase { /** * Constructs a \Drupal\Core\Form\ConfigFormBase object. * + * Arg order a little weird because TypedConfigManagerInterface was not + * required when this was first done. + * * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The factory for configuration objects. * @param \Drupal\Core\Messenger\MessengerInterface $messenger * The messenger. * @param \Drupal\metastore\MetastoreService $metastore * The metastore service. + * @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config + * The typed config manager. */ public function __construct( ConfigFactoryInterface $config_factory, From 4eeb1c827f1c4f7a9f985f591b8ed10aa7a53086 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Wed, 11 Dec 2024 22:21:51 -0500 Subject: [PATCH 23/42] Fix HarvestHashesEntityDatabaseTableTest --- .../src/Unit/Storage/HarvestHashesEntityDatabaseTableTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/harvest/tests/src/Unit/Storage/HarvestHashesEntityDatabaseTableTest.php b/modules/harvest/tests/src/Unit/Storage/HarvestHashesEntityDatabaseTableTest.php index d40d2fec09..fde4a3e38b 100644 --- a/modules/harvest/tests/src/Unit/Storage/HarvestHashesEntityDatabaseTableTest.php +++ b/modules/harvest/tests/src/Unit/Storage/HarvestHashesEntityDatabaseTableTest.php @@ -19,7 +19,7 @@ class HarvestHashesEntityDatabaseTableTest extends TestCase { public static function providerNotImplementedMethods() { return [ ['storeMultiple', [[]]], - ['query', [static::createStub(Query::class)]], + ['query', [new Query()]], ['setSchema', [[]]], ['getSchema', []], ]; From 88a38a2a7d4c40979bb1acd81ade20c3f543feba Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Wed, 11 Dec 2024 23:04:05 -0500 Subject: [PATCH 24/42] Fix MySQLQueryTest --- .../src/Unit/DataDictionary/AlterTableQuery/MySQLQueryTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/datastore/tests/src/Unit/DataDictionary/AlterTableQuery/MySQLQueryTest.php b/modules/datastore/tests/src/Unit/DataDictionary/AlterTableQuery/MySQLQueryTest.php index c4d4aa1683..a25a173d5a 100644 --- a/modules/datastore/tests/src/Unit/DataDictionary/AlterTableQuery/MySQLQueryTest.php +++ b/modules/datastore/tests/src/Unit/DataDictionary/AlterTableQuery/MySQLQueryTest.php @@ -47,7 +47,9 @@ public function setUp(): void { */ public function buildConnectionChain(): Chain { return (new Chain($this)) + // Drupal 10 will call getDriverClass, while 11 will call update directly. ->add(Connection::class, 'getDriverClass', UpdateQueryMock::class) + ->add(Connection::class, 'update', UpdateQueryMock::class) ->add(Connection::class, 'prepareStatement', StatementInterface::class, 'prepare') ->add(Connection::class, 'query', StatementInterface::class) ->add(StatementInterface::class, 'execute', TRUE) From e5bf90fc6f0fe6e42b52fde1531203dbe26cb48a Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Thu, 12 Dec 2024 23:25:51 -0500 Subject: [PATCH 25/42] Add phpunit cache to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6829678390..f36b1eb657 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ tagfile /tests/reports /web .phpunit.result.cache +.phpunit.cache docs/build From 59ed5cab846f235df6e9f1950b8c713a0a84add9 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Thu, 12 Dec 2024 23:49:06 -0500 Subject: [PATCH 26/42] Fix file validation in json_form_widget --- modules/json_form_widget/src/WidgetRouter.php | 2 +- modules/json_form_widget/tests/src/Unit/SchemaUiHandlerTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/json_form_widget/src/WidgetRouter.php b/modules/json_form_widget/src/WidgetRouter.php index 379c0a15df..bc2fb397f7 100644 --- a/modules/json_form_widget/src/WidgetRouter.php +++ b/modules/json_form_widget/src/WidgetRouter.php @@ -301,7 +301,7 @@ public function handleUploadOrLinkElement(mixed $spec, array $element) { unset($element['#default_value']); } if (isset($spec->extensions)) { - $element['#upload_validators']['file_validate_extensions'][] = $spec->extensions; + $element['#upload_validators']['FileExtension'] = ['extensions' => $spec->extensions]; } // If a maxlength was set earlier, remove it as it is not allowed here. unset($element['#maxlength']); diff --git a/modules/json_form_widget/tests/src/Unit/SchemaUiHandlerTest.php b/modules/json_form_widget/tests/src/Unit/SchemaUiHandlerTest.php index bb3a09b3a6..a616b54b61 100644 --- a/modules/json_form_widget/tests/src/Unit/SchemaUiHandlerTest.php +++ b/modules/json_form_widget/tests/src/Unit/SchemaUiHandlerTest.php @@ -523,7 +523,7 @@ public function testSchemaUi() { '#uri' => 'https://url.to.api.or.file', '#upload_location' => 'public://uploaded_resources', '#upload_validators' => [ - 'file_validate_extensions' => ['jpg pdf png csv'], + 'FileExtension' => ['jpg pdf png csv'], ], ], ]; From 5843ed631f8474d0bc5dbeafc7982beecb57d059 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Thu, 12 Dec 2024 23:49:42 -0500 Subject: [PATCH 27/42] Temporarily allow dev branch of select2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2ce860df16..82872af8b1 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "ilbee/csv-response": "^1.2.0", "justinrainbow/json-schema": "^5.2", "m1x0n/opis-json-schema-error-presenter": "^0.5.3", - "npm-asset/select2": "^4.0", + "npm-asset/select2": "^4.0 || dev-develop", "oomphinc/composer-installers-extender": "^2.0", "ramsey/uuid": "^3.8.0 || ^4", "stolt/json-merge-patch": "^2.0", From d5b971ba480dc7643d9fa58bf5bef42e9534d3e1 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Fri, 13 Dec 2024 00:17:36 -0500 Subject: [PATCH 28/42] Fix one test --- modules/json_form_widget/tests/src/Unit/SchemaUiHandlerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/json_form_widget/tests/src/Unit/SchemaUiHandlerTest.php b/modules/json_form_widget/tests/src/Unit/SchemaUiHandlerTest.php index a616b54b61..ca217469b9 100644 --- a/modules/json_form_widget/tests/src/Unit/SchemaUiHandlerTest.php +++ b/modules/json_form_widget/tests/src/Unit/SchemaUiHandlerTest.php @@ -523,7 +523,7 @@ public function testSchemaUi() { '#uri' => 'https://url.to.api.or.file', '#upload_location' => 'public://uploaded_resources', '#upload_validators' => [ - 'FileExtension' => ['jpg pdf png csv'], + 'FileExtension' => ['extensions' => 'jpg pdf png csv'], ], ], ]; From 72e5955fb59542ded9591007f9d580866a202d58 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Thu, 19 Dec 2024 10:58:49 -0500 Subject: [PATCH 29/42] Restore connection class --- .../tests/src/Unit/Storage/DatabaseTableFactoryTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/datastore/tests/src/Unit/Storage/DatabaseTableFactoryTest.php b/modules/datastore/tests/src/Unit/Storage/DatabaseTableFactoryTest.php index a2fa66d7fb..31a8bbc42d 100644 --- a/modules/datastore/tests/src/Unit/Storage/DatabaseTableFactoryTest.php +++ b/modules/datastore/tests/src/Unit/Storage/DatabaseTableFactoryTest.php @@ -6,6 +6,7 @@ use Drupal\common\DataResource; use Drupal\datastore\Storage\DatabaseTable; use Drupal\datastore\Storage\DatabaseTableFactory; +use Drupal\sqlite\Driver\Database\sqlite\Connection; use MockChain\Chain; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; From 30d53a7d766112119895f0da642b8673b07e788c Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Thu, 19 Dec 2024 12:32:35 -0500 Subject: [PATCH 30/42] Revert phpunit changes --- phpunit.xml | 50 +++++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 0464d58282..7b692074e7 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,5 +1,31 @@ - + + + + . + + + rector.php + tests + modules/common/tests + modules/datastore/tests + modules/datastore/modules/datastore_mysql_import/tests + modules/dkan_js_frontend/tests + modules/frontend/tests + modules/harvest/tests + modules/json_form_widget/tests + modules/data_dictionary_widget/tests + modules/metastore/tests + modules/metastore/modules/metastore_admin/tests + modules/metastore/modules/metastore_search/tests + modules/sample_content/tests + ./ + + . @@ -39,26 +65,4 @@ - - - . - - - rector.php - tests - modules/common/tests - modules/datastore/tests - modules/datastore/modules/datastore_mysql_import/tests - modules/dkan_js_frontend/tests - modules/frontend/tests - modules/harvest/tests - modules/json_form_widget/tests - modules/data_dictionary_widget/tests - modules/metastore/tests - modules/metastore/modules/metastore_admin/tests - modules/metastore/modules/metastore_search/tests - modules/sample_content/tests - ./ - - From 06cf4c3baa35fcad61eb3096175900fffbe58eab Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Thu, 16 Jan 2025 12:46:57 -0500 Subject: [PATCH 31/42] Use newer select2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 82872af8b1..0433923516 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "drupal/facets": "^3.0@beta", "drupal/moderated_content_bulk_publish": "~2.0.20", "drupal/search_api": "^1.15", - "drupal/select2": "^1.13", + "drupal/select2": "^2.0", "drupal/select_or_other": "^4.2.0", "drupal/views_bulk_operations": "^4.0", "ezyang/htmlpurifier": "^4.11", From eeabfce5f723800d38e553461bf48d6a7a89be71 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Thu, 16 Jan 2025 13:09:24 -0500 Subject: [PATCH 32/42] Fix includes on DatabaseTableFactoryTest --- .../tests/src/Unit/Storage/DatabaseTableFactoryTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/datastore/tests/src/Unit/Storage/DatabaseTableFactoryTest.php b/modules/datastore/tests/src/Unit/Storage/DatabaseTableFactoryTest.php index 31a8bbc42d..d38729c961 100644 --- a/modules/datastore/tests/src/Unit/Storage/DatabaseTableFactoryTest.php +++ b/modules/datastore/tests/src/Unit/Storage/DatabaseTableFactoryTest.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\datastore\Unit\Storage; -use Drupal\Core\Database\Connection; use Drupal\common\DataResource; use Drupal\datastore\Storage\DatabaseTable; use Drupal\datastore\Storage\DatabaseTableFactory; From a4feff01f6fee2fb29a47b61bce4524c47f21e40 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Thu, 16 Jan 2025 13:16:20 -0500 Subject: [PATCH 33/42] Unit tests running again --- .../tests/src/Unit/Controller/QueryControllerTest.php | 3 ++- modules/datastore/tests/src/Unit/Storage/DatabaseTableTest.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/datastore/tests/src/Unit/Controller/QueryControllerTest.php b/modules/datastore/tests/src/Unit/Controller/QueryControllerTest.php index 4f3c9a274e..c56322c2d8 100644 --- a/modules/datastore/tests/src/Unit/Controller/QueryControllerTest.php +++ b/modules/datastore/tests/src/Unit/Controller/QueryControllerTest.php @@ -24,6 +24,7 @@ use Psr\Log\LoggerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; @@ -46,7 +47,7 @@ protected function setUp(): void { // Set cache services. $options = (new Options) ->add('cache_contexts_manager', CacheContextsManager::class) - ->add('event_dispatcher', ContainerAwareEventDispatcher::class) + ->add('event_dispatcher', EventDispatcher::class) ->index(0); $chain = (new Chain($this)) ->add(ContainerInterface::class, 'get', $options) diff --git a/modules/datastore/tests/src/Unit/Storage/DatabaseTableTest.php b/modules/datastore/tests/src/Unit/Storage/DatabaseTableTest.php index 2f66745a02..61fc66d8e9 100644 --- a/modules/datastore/tests/src/Unit/Storage/DatabaseTableTest.php +++ b/modules/datastore/tests/src/Unit/Storage/DatabaseTableTest.php @@ -1,6 +1,6 @@ Date: Thu, 16 Jan 2025 16:43:33 -0500 Subject: [PATCH 34/42] Add D11 to matrix --- .circleci/config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 30f2f6a9e9..4789aa6fb9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -243,6 +243,11 @@ workflows: parameters: dkan_recommended_branch: [ '10.4.x-dev'] php_version: [ '8.3' ] + - phpunit: + matrix: + parameters: + dkan_recommended_branch: [ '11.0.x-dev'] + php_version: [ '8.3' ] - phpunit: matrix: parameters: From 52db0dd35b1f6a685834bf7688bf2d5e561d1f07 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Thu, 16 Jan 2025 17:28:22 -0500 Subject: [PATCH 35/42] Tweaking circleCI --- .circleci/config.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4789aa6fb9..068fcd70c3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,7 +53,8 @@ commands: ddev get https://github.com/GetDKAN/dkan-ddev-addon/archive/refs/heads/<< parameters.addon_branch >>.tar.gz bash -c 'echo COMPOSER_AUTH=$COMPOSER_AUTH' > .ddev/.env # Modify config to use our PHP version. - sed -i 's/^php_version.*$/php_version: "<< parameters.php_version >>"/' .ddev/config.dkan.yaml + ddev config --database=<< parameters.database_version >> + ddev config --php-version << parameters.php_version >> ddev restart ddev status ddev dkan-init --project-version << parameters.dkan_recommended_branch>> --force @@ -122,6 +123,10 @@ jobs: description: 'PHP major.minor for DDev to use.' default: '8.1' type: string + database_version: + description: 'Database version for DDev to use.' + default: 'mysql:5.7' + type: string dkan_recommended_branch: description: 'Branch of getdkan/recommended-project to use.' default: '10.2.x-dev' @@ -189,6 +194,10 @@ jobs: description: 'PHP major.minor for DDev to use.' default: '8.2' type: string + database_version: + description: 'Database version for DDev to use.' + default: 'mysql:5.7' + type: string dkan_recommended_branch: description: 'Branch of getdkan/recommended-project to use.' default: '10.2.x-dev' @@ -248,6 +257,7 @@ workflows: parameters: dkan_recommended_branch: [ '11.0.x-dev'] php_version: [ '8.3' ] + database_version:: [ 'mysql:8.0' ] - phpunit: matrix: parameters: From 20c4e71d90c6a1e48d01274d410e7df0f286f65b Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Thu, 16 Jan 2025 17:31:07 -0500 Subject: [PATCH 36/42] More circleCI --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 068fcd70c3..c41c663c75 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,7 +54,7 @@ commands: bash -c 'echo COMPOSER_AUTH=$COMPOSER_AUTH' > .ddev/.env # Modify config to use our PHP version. ddev config --database=<< parameters.database_version >> - ddev config --php-version << parameters.php_version >> + ddev config --php-version=<< parameters.php_version >> ddev restart ddev status ddev dkan-init --project-version << parameters.dkan_recommended_branch>> --force @@ -142,6 +142,7 @@ jobs: steps: - prepare_build: php_version: << parameters.php_version >> + database_version: << parameters.database_version >> dkan_recommended_branch: << parameters.dkan_recommended_branch >> - prepare_site: upgrade: << parameters.upgrade >> @@ -209,6 +210,7 @@ jobs: steps: - prepare_build: php_version: << parameters.php_version >> + database_version: << parameters.database_version >> dkan_recommended_branch: << parameters.dkan_recommended_branch >> - prepare_site: upgrade: << parameters.upgrade >> From 152e0681240329e196d2d0a268370cd3530a8255 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Thu, 16 Jan 2025 17:31:49 -0500 Subject: [PATCH 37/42] More circleCI --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index c41c663c75..7d8a2fe0c8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,6 +28,10 @@ commands: description: 'PHP major.minor for DDev to use.' default: '8.2' type: string + database_version: + description: 'Database version for DDev to use.' + default: 'mysql:5.7' + type: string addon_branch: description: 'Repo branch name for the DKAN DDev add-on you want to test against.' default: 'main' From 74421684f3dc68443e5a912f728dd06fe0e931bc Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Thu, 16 Jan 2025 17:33:18 -0500 Subject: [PATCH 38/42] Typo --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7d8a2fe0c8..6cc1043af8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -263,7 +263,7 @@ workflows: parameters: dkan_recommended_branch: [ '11.0.x-dev'] php_version: [ '8.3' ] - database_version:: [ 'mysql:8.0' ] + database_version: [ 'mysql:8.0' ] - phpunit: matrix: parameters: From 98a6c9fd2df5ac2dfae7ee30aff0d930cfd331c4 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Fri, 17 Jan 2025 13:33:06 -0500 Subject: [PATCH 39/42] Just test for ya on runner --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6cc1043af8..cdbd3cf999 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,6 +51,7 @@ commands: - run: name: Build site codebase command: | + yq --version which ddev ddev --version ddev config --project-name test-$CIRCLE_WORKFLOW_JOB_ID --project-type drupal9 --docroot docroot --create-docroot From f8c7827042714c4081926e2d8a0e40656ce842f2 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Fri, 17 Jan 2025 13:38:47 -0500 Subject: [PATCH 40/42] Use yq for config --- .circleci/config.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cdbd3cf999..7877b3f8d5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,15 +51,14 @@ commands: - run: name: Build site codebase command: | - yq --version which ddev ddev --version ddev config --project-name test-$CIRCLE_WORKFLOW_JOB_ID --project-type drupal9 --docroot docroot --create-docroot ddev get https://github.com/GetDKAN/dkan-ddev-addon/archive/refs/heads/<< parameters.addon_branch >>.tar.gz bash -c 'echo COMPOSER_AUTH=$COMPOSER_AUTH' > .ddev/.env - # Modify config to use our PHP version. - ddev config --database=<< parameters.database_version >> - ddev config --php-version=<< parameters.php_version >> + # Modify config to use our PHP version and database. + yq '.database.version ="<< parameters.database_version >>"' -i .ddev/config.dkan.yaml + yq '.php_version ="<< parameters.php_version >>"' -i .ddev/config.dkan.yaml ddev restart ddev status ddev dkan-init --project-version << parameters.dkan_recommended_branch>> --force From 927e74d4919bdb6b3115bdfcbb46ad474c1cd134 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Fri, 17 Jan 2025 13:40:58 -0500 Subject: [PATCH 41/42] debug --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7877b3f8d5..14fa41ba3c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,11 +54,12 @@ commands: which ddev ddev --version ddev config --project-name test-$CIRCLE_WORKFLOW_JOB_ID --project-type drupal9 --docroot docroot --create-docroot - ddev get https://github.com/GetDKAN/dkan-ddev-addon/archive/refs/heads/<< parameters.addon_branch >>.tar.gz + ddev add-on get https://github.com/GetDKAN/dkan-ddev-addon/archive/refs/heads/<< parameters.addon_branch >>.tar.gz bash -c 'echo COMPOSER_AUTH=$COMPOSER_AUTH' > .ddev/.env # Modify config to use our PHP version and database. yq '.database.version ="<< parameters.database_version >>"' -i .ddev/config.dkan.yaml yq '.php_version ="<< parameters.php_version >>"' -i .ddev/config.dkan.yaml + cat .ddev/config.dkan.yaml ddev restart ddev status ddev dkan-init --project-version << parameters.dkan_recommended_branch>> --force From b924b342372bb4fd61d66acb53a267a717e2a716 Mon Sep 17 00:00:00 2001 From: Dan Feder Date: Fri, 17 Jan 2025 13:42:37 -0500 Subject: [PATCH 42/42] Fix mysql paramaters --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 14fa41ba3c..4d1728b15d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,7 +30,7 @@ commands: type: string database_version: description: 'Database version for DDev to use.' - default: 'mysql:5.7' + default: '5.7' type: string addon_branch: description: 'Repo branch name for the DKAN DDev add-on you want to test against.' @@ -130,7 +130,7 @@ jobs: type: string database_version: description: 'Database version for DDev to use.' - default: 'mysql:5.7' + default: '5.7' type: string dkan_recommended_branch: description: 'Branch of getdkan/recommended-project to use.' @@ -202,7 +202,7 @@ jobs: type: string database_version: description: 'Database version for DDev to use.' - default: 'mysql:5.7' + default: '5.7' type: string dkan_recommended_branch: description: 'Branch of getdkan/recommended-project to use.' @@ -264,7 +264,7 @@ workflows: parameters: dkan_recommended_branch: [ '11.0.x-dev'] php_version: [ '8.3' ] - database_version: [ 'mysql:8.0' ] + database_version: [ '8.0' ] - phpunit: matrix: parameters: