diff --git a/.drone.yml b/.drone.yml index c86f2bfc..a994495f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,6 +16,7 @@ services: web: image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci environment: + - COMPOSERVER=--2 - DOCUMENT_ROOT=/test/oe_paragraphs - DRUPAL_SPARQL_HOSTNAME=sparql - DRUPAL_SPARQL_PORT=8890 @@ -42,23 +43,25 @@ services: - DBA_PASSWORD=dba pipeline: - composer-install: + composer-install-highest: group: prepare image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci volumes: - /cache/${DRONE_REPO_NAME}:/cache commands: - - composer install --ansi --no-suggest --no-progress + - composer self-update --2 + - composer install --ansi --no-progress + when: + matrix: + COMPOSER_BOUNDARY: highest composer-update-lowest: - group: post-prepare + group: prepare image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci volumes: - /cache/${DRONE_REPO_NAME}:/cache commands: - # @todo remove "composer install" step once the following issue is fixed. - # @link https://webgate.ec.europa.eu/CITnet/jira/browse/OPENEUROPA-1234 - - composer update --prefer-lowest --prefer-stable --ansi --no-suggest --no-progress --no-interaction + - composer update --prefer-lowest --prefer-stable --ansi --no-progress --no-interaction when: matrix: COMPOSER_BOUNDARY: lowest @@ -66,6 +69,7 @@ pipeline: site-install: image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci commands: + - while ! mysqladmin ping -h mysql --silent; do sleep 1; done - ./vendor/bin/run drupal:site-install grumphp: @@ -98,4 +102,5 @@ matrix: - lowest - highest PHP_VERSION: - - 7.3 + - 7.4 + - 8.0 diff --git a/composer.json b/composer.json index c926beac..136dace2 100644 --- a/composer.json +++ b/composer.json @@ -6,46 +6,44 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=7.3", + "php": ">=7.4", "drupal/allowed_formats": "^1.4", - "drupal/core": "^8.9 || ^9.1", + "drupal/core": "^9.2", "drupal/paragraphs": "^1.12", "drupal/typed_link": "^2.0" }, "require-dev": { + "behat/behat": "^3.10", + "behat/mink-extension": "^2.3.1", "composer/installers": "^1.5", - "consolidation/annotated-command": "^2.8.2", + "cweagans/composer-patches": "^1.7", "drupal/address": "^1.9", - "drupal/composite_reference": "^1.0-alpha", + "drupal/composite_reference": "^2.1", "drupal/config_devel": "^1.2", - "drupal/core-composer-scaffold": "^8.9 || ^9.1", - "drupal/drupal-extension": "^4.0", + "drupal/core-composer-scaffold": "^9.2", + "drupal/core-dev": "^9.2", "drupal/description_list_field": "^1.0", + "drupal/drupal-extension": "^4.0", "drupal/entity_browser": "^2.5", "drupal/json_field": "^1.0.0-rc3", - "drupaltest/behat-traits": "dev-GH-6", + "drupaltest/behat-traits": "^0.3", "drush/drush": "^10.3", - "easyrdf/easyrdf": "1.0.0 as 0.9.2", + "egulias/email-validator": "^2.1.22 || ^3.0", "instaclick/php-webdriver": "^1.4.9", - "nikic/php-parser": "^3.0", + "nikic/php-parser": "^4.12.0", "openeuropa/behat-transformation-context": "^0.1", - "openeuropa/code-review": "^1.6", - "openeuropa/drupal-core-require-dev": "^8.9 || ^9.1", - "openeuropa/oe_content": "2.x-dev", - "openeuropa/rdf_skos": "1.0.0-alpha5", - "openeuropa/oe_media": "^1.12", + "openeuropa/code-review": "^2.0", + "openeuropa/oe_content": "^2.8", + "openeuropa/oe_media": "^1.15", "openeuropa/oe_webtools": "^1.12", - "openeuropa/task-runner-drupal-project-symlink": "^1.0", - "phpspec/prophecy-phpunit": "^1 || ^2" + "openeuropa/rdf_skos": "^1.0.0-alpha6", + "openeuropa/task-runner-drupal-project-symlink": "^1.0-beta5", + "phpspec/prophecy-phpunit": "^2", + "symfony/dom-crawler": "^4.4.12" }, "suggest": { "openeuropa/oe_media": "Allows usage of paragraphs with different media attached to it." }, - "_readme": [ - "We explicitly require consolidation/robo to allow lower 'composer update --prefer-lowest' to complete successfully.", - "We explicitly require consolidation/annotated-command to allow lower 'composer update --prefer-lowest' to complete successfully.", - "We explicitly require openeuropa/rdf_skos 1.0.0-alpha5 to use correct interface for class in sparql_entity_storage till new release of openeuropa/oe_content." - ], "scripts": { "post-install-cmd": "./vendor/bin/run drupal:site-setup", "post-update-cmd": "./vendor/bin/run drupal:site-setup" @@ -82,9 +80,19 @@ "locations": { "web-root": "./build" } - } + }, + "_readme": [ + "Explicit requirement for egulias/email-validator due to https://www.drupal.org/project/drupal/issues/3061074#comment-14300579. It can be removed when Drupal core 9.2 support is droppped.", + "Explicit minimum version requirement of behat library due to PHP compatibility.", + "Explicit minimum version requirement for symfony/dom-crawler due to its lower versions using the deprecated function libxml_disable_entity_loader() in PHP8.", + "Explicit requirement of cweagans/composer-patches to allow patches to be applied." + ] }, "repositories": [ + { + "type": "vcs", + "url": "https://git.drupalcode.org/project/description_list_field.git" + }, { "type": "composer", "url": "https://packages.drupal.org/8" @@ -92,6 +100,13 @@ ], "config": { "sort-packages": true, - "discard-changes": true + "discard-changes": true, + "allow-plugins": { + "composer/installers": true, + "drupal/core-composer-scaffold": true, + "cweagans/composer-patches": true, + "dealerdirect/phpcodesniffer-composer-installer": true, + "phpro/grumphp": true + } } } diff --git a/docker-compose.yml b/docker-compose.yml index 985eaa0a..7161d20a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '2' services: web: - image: fpfis/httpd-php-dev:7.3 + image: fpfis/httpd-php-dev:8.0 working_dir: /var/www/html ports: - 8080:8080 @@ -9,6 +9,7 @@ services: - .:/var/www/html # Non Mac users. # - nfsmount:/var/www/html # Mac Users with the nfsmount volume. environment: + COMPOSERVER: "--2" XDEBUG_CONFIG: "client_host=172.17.0.1" # Non-Mac users. # XDEBUG_CONFIG: "client_host=host.docker.internal" # Mac users. XDEBUG_MODE: "develop, debug" diff --git a/grumphp.yml.dist b/grumphp.yml.dist index 7709259b..ca8e793b 100644 --- a/grumphp.yml.dist +++ b/grumphp.yml.dist @@ -13,9 +13,19 @@ parameters: extra_tasks: phpparser: - ignore_patterns: "%tasks.phpcs.ignore_patterns%" + ignore_patterns: + - vendor/ + - build/ visitors: declare_strict_types: ~ - triggered_by: "%tasks.phpcs.triggered_by%" + triggered_by: + - php + - module + - inc + - theme + - install +grumphp: extensions: - OpenEuropa\CodeReview\ExtraTasksExtension + git_hook_variables: + EXEC_GRUMPHP_COMMAND: 'docker-compose exec -T web' diff --git a/modules/oe_paragraphs_banner/oe_paragraphs_banner.info.yml b/modules/oe_paragraphs_banner/oe_paragraphs_banner.info.yml index d77e9e11..3c8b2d73 100644 --- a/modules/oe_paragraphs_banner/oe_paragraphs_banner.info.yml +++ b/modules/oe_paragraphs_banner/oe_paragraphs_banner.info.yml @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Banner type: module description: Provides a Banner paragraph that uses media images. package: OpenEuropa -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 dependencies: - oe_media:oe_media_avportal diff --git a/modules/oe_paragraphs_chart/oe_paragraphs_chart.info.yml b/modules/oe_paragraphs_chart/oe_paragraphs_chart.info.yml index a43e9d42..4a275728 100644 --- a/modules/oe_paragraphs_chart/oe_paragraphs_chart.info.yml +++ b/modules/oe_paragraphs_chart/oe_paragraphs_chart.info.yml @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Chart type: module description: Provides a paragraph type that displays Webtools charts. package: OpenEuropa -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 dependencies: - oe_paragraphs:oe_paragraphs_media_field_storage diff --git a/modules/oe_paragraphs_contact/oe_paragraphs_contact.info.yml b/modules/oe_paragraphs_contact/oe_paragraphs_contact.info.yml index 535f2619..08ca3c2a 100644 --- a/modules/oe_paragraphs_contact/oe_paragraphs_contact.info.yml +++ b/modules/oe_paragraphs_contact/oe_paragraphs_contact.info.yml @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Contact type: module description: Provides a paragraph type that references Contact entities. package: OpenEuropa -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 dependencies: - oe_paragraphs:oe_paragraphs diff --git a/modules/oe_paragraphs_demo/oe_paragraphs_demo.info.yml b/modules/oe_paragraphs_demo/oe_paragraphs_demo.info.yml index ab3f6e4d..9011eaad 100644 --- a/modules/oe_paragraphs_demo/oe_paragraphs_demo.info.yml +++ b/modules/oe_paragraphs_demo/oe_paragraphs_demo.info.yml @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs demo type: module description: Provides a content type using OE Paragraphs for demonstration purposes. package: OpenEuropa -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 dependencies: - drupal:path diff --git a/modules/oe_paragraphs_description_list/oe_paragraphs_description_list.info.yml b/modules/oe_paragraphs_description_list/oe_paragraphs_description_list.info.yml index 03e60df2..14573a8a 100644 --- a/modules/oe_paragraphs_description_list/oe_paragraphs_description_list.info.yml +++ b/modules/oe_paragraphs_description_list/oe_paragraphs_description_list.info.yml @@ -2,7 +2,7 @@ name: 'OpenEuropa Paragraphs Horizontal description list' type: module description: 'Provides Horizontal description list paragraph that renders items grouped in HTML Description list tag.' package: OpenEuropa -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 dependencies: - description_list_field:description_list_field diff --git a/modules/oe_paragraphs_document/oe_paragraphs_document.info.yml b/modules/oe_paragraphs_document/oe_paragraphs_document.info.yml index 0f2a9384..5f023d9b 100644 --- a/modules/oe_paragraphs_document/oe_paragraphs_document.info.yml +++ b/modules/oe_paragraphs_document/oe_paragraphs_document.info.yml @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Document type: module description: Provides a paragraph type that references document media entities. package: OpenEuropa -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 dependencies: - oe_media:oe_media diff --git a/modules/oe_paragraphs_iframe_media/oe_paragraphs_iframe_media.info.yml b/modules/oe_paragraphs_iframe_media/oe_paragraphs_iframe_media.info.yml index 2a4b9f18..6d561a7f 100644 --- a/modules/oe_paragraphs_iframe_media/oe_paragraphs_iframe_media.info.yml +++ b/modules/oe_paragraphs_iframe_media/oe_paragraphs_iframe_media.info.yml @@ -2,7 +2,7 @@ name: 'OpenEuropa Paragraphs Iframe' type: module description: 'Provides an Iframe paragraph that displays an Iframe.' package: OpenEuropa -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 dependencies: - oe_media:oe_media_iframe diff --git a/modules/oe_paragraphs_illustrations_lists/oe_paragraphs_illustrations_lists.info.yml b/modules/oe_paragraphs_illustrations_lists/oe_paragraphs_illustrations_lists.info.yml index cbf56de5..ddafb9c7 100644 --- a/modules/oe_paragraphs_illustrations_lists/oe_paragraphs_illustrations_lists.info.yml +++ b/modules/oe_paragraphs_illustrations_lists/oe_paragraphs_illustrations_lists.info.yml @@ -2,7 +2,7 @@ name: 'OpenEuropa Paragraphs Illustration Lists' type: module description: 'Provides group of Illustration lists paragraphs.' package: OpenEuropa -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 dependencies: - composite_reference:composite_reference diff --git a/modules/oe_paragraphs_illustrations_lists/tests/modules/oe_paragraphs_illustrations_lists_test/oe_paragraphs_illustrations_lists_test.info.yml b/modules/oe_paragraphs_illustrations_lists/tests/modules/oe_paragraphs_illustrations_lists_test/oe_paragraphs_illustrations_lists_test.info.yml index 5db5547e..3a98f81f 100644 --- a/modules/oe_paragraphs_illustrations_lists/tests/modules/oe_paragraphs_illustrations_lists_test/oe_paragraphs_illustrations_lists_test.info.yml +++ b/modules/oe_paragraphs_illustrations_lists/tests/modules/oe_paragraphs_illustrations_lists_test/oe_paragraphs_illustrations_lists_test.info.yml @@ -3,4 +3,4 @@ type: module description: 'Used by the automated tests for the OE Paragraphs Illustration Lists.' package: Testing hidden: true -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 diff --git a/modules/oe_paragraphs_map/oe_paragraphs_map.info.yml b/modules/oe_paragraphs_map/oe_paragraphs_map.info.yml index ffb954df..29d03319 100644 --- a/modules/oe_paragraphs_map/oe_paragraphs_map.info.yml +++ b/modules/oe_paragraphs_map/oe_paragraphs_map.info.yml @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Map type: module description: Provides Map paragraph type that uses map media. package: OpenEuropa -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 dependencies: - oe_paragraphs:oe_paragraphs_media_field_storage diff --git a/modules/oe_paragraphs_media/oe_paragraphs_media.info.yml b/modules/oe_paragraphs_media/oe_paragraphs_media.info.yml index 33502af3..b0ad37e2 100644 --- a/modules/oe_paragraphs_media/oe_paragraphs_media.info.yml +++ b/modules/oe_paragraphs_media/oe_paragraphs_media.info.yml @@ -2,7 +2,7 @@ name: OpenEuropa Text with featured Media paragraph type: module description: Provides Text with Featured Media paragraph that uses media elements. package: OpenEuropa -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 dependencies: - oe_media:oe_media_avportal diff --git a/modules/oe_paragraphs_media_field_storage/oe_paragraphs_media_field_storage.info.yml b/modules/oe_paragraphs_media_field_storage/oe_paragraphs_media_field_storage.info.yml index 40ecf8dc..e6d5a91d 100644 --- a/modules/oe_paragraphs_media_field_storage/oe_paragraphs_media_field_storage.info.yml +++ b/modules/oe_paragraphs_media_field_storage/oe_paragraphs_media_field_storage.info.yml @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Media Field Storage type: module description: Provides storage for field_oe_media field. package: OpenEuropa -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 dependencies: - oe_media:oe_media_avportal diff --git a/modules/oe_paragraphs_social_feed/oe_paragraphs_social_feed.info.yml b/modules/oe_paragraphs_social_feed/oe_paragraphs_social_feed.info.yml index 6502ed9b..adaa719b 100644 --- a/modules/oe_paragraphs_social_feed/oe_paragraphs_social_feed.info.yml +++ b/modules/oe_paragraphs_social_feed/oe_paragraphs_social_feed.info.yml @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Social feed type: module description: Provides Social feed paragraph that uses social feed media type. package: OpenEuropa -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 dependencies: - oe_paragraphs:oe_paragraphs diff --git a/modules/oe_paragraphs_timeline/oe_paragraphs_timeline.info.yml b/modules/oe_paragraphs_timeline/oe_paragraphs_timeline.info.yml index 63d9190f..19c0d262 100644 --- a/modules/oe_paragraphs_timeline/oe_paragraphs_timeline.info.yml +++ b/modules/oe_paragraphs_timeline/oe_paragraphs_timeline.info.yml @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Timeline type: module description: Provides timeline paragraph that uses the timeline field type. package: OpenEuropa -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 dependencies: - oe_paragraphs:oe_paragraphs diff --git a/oe_paragraphs.info.yml b/oe_paragraphs.info.yml index 315ecf4f..a8281171 100644 --- a/oe_paragraphs.info.yml +++ b/oe_paragraphs.info.yml @@ -1,7 +1,7 @@ name: OpenEuropa Paragraphs type: module description: A collection of Paragraph types based on ECL components. -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 package: OpenEuropa dependencies: diff --git a/tests/modules/oe_paragraphs_options_event_test/oe_paragraphs_options_event_test.info.yml b/tests/modules/oe_paragraphs_options_event_test/oe_paragraphs_options_event_test.info.yml index 96609a4b..3af26d23 100644 --- a/tests/modules/oe_paragraphs_options_event_test/oe_paragraphs_options_event_test.info.yml +++ b/tests/modules/oe_paragraphs_options_event_test/oe_paragraphs_options_event_test.info.yml @@ -3,4 +3,4 @@ type: module description: 'Used by the automated tests for the OE Paragraphs allowed values option events tests.' package: Testing hidden: true -core_version_requirement: ^8.9 || ^9.1 +core_version_requirement: ^9.2 diff --git a/tests/src/Functional/ParagraphsTestBase.php b/tests/src/Functional/ParagraphsTestBase.php index a6c7b0bf..aa58aa20 100644 --- a/tests/src/Functional/ParagraphsTestBase.php +++ b/tests/src/Functional/ParagraphsTestBase.php @@ -40,9 +40,7 @@ abstract class ParagraphsTestBase extends BrowserTestBase { protected function setUp(): void { parent::setUp(); - $this->drupalLogin($this->drupalCreateUser([ - 'administer content types', - ])); + $this->drupalLogin($this->drupalCreateUser([], '', TRUE)); $this->drupalCreateContentType([ 'type' => 'paragraphs_test', 'name' => 'Paragraphs Test',