Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EWPP-1909: Update to PHP7.4/8.0. #59

Merged
merged 5 commits into from
Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ pipeline:
volumes:
- /cache:/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 install --ansi --no-suggest --no-progress
- composer update --prefer-lowest --prefer-stable --ansi --no-suggest --no-progress
- composer self-update --2
- composer update --prefer-lowest --prefer-stable --ansi --no-progress
when:
matrix:
COMPOSER_BOUNDARY: lowest
Expand All @@ -44,14 +42,16 @@ pipeline:
volumes:
- /cache:/cache
commands:
- composer install --ansi --no-suggest --no-progress
- composer self-update --2
- composer install --ansi --no-progress
when:
matrix:
COMPOSER_BOUNDARY: highest

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:
Expand All @@ -71,4 +71,5 @@ matrix:
- lowest
- highest
PHP_VERSION:
- 7.3
- 7.4
- 8.0
30 changes: 22 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,28 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.3",
"drupal/core": "^8.9 || ^9.1"
"php": ">=7.4",
"drupal/core": "^9.2"
},
"require-dev": {
"composer/installers": "^1.5",
"drupal/core-composer-scaffold": "^8.9 || ^9.1",
"drupal/core-composer-scaffold": "^9.2",
"drupal/config_devel": "^1.2",
"drush/drush": "^10.3",
"openeuropa/code-review": "^1.7",
"openeuropa/drupal-core-require-dev": "^8.9 || ^9.1",
"openeuropa/oe_multilingual": "^1.5",
"openeuropa/task-runner-drupal-project-symlink": "^1.0",
"drupal/core-dev": "^9.2",
"drupal/ctools": "^3.7",
"drupal/token": "^1.10",
"egulias/email-validator": "^2.1.22 || ^3.0",
"openeuropa/oe_multilingual": "^1.10",
"openeuropa/code-review": "^2.0",
"openeuropa/task-runner-drupal-project-symlink": "^1.0.0-beta5",
"phpspec/prophecy-phpunit": "^1 || ^2"
},
"_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 lower version requirement of ctools due to Drupal core 9.2 compatibility.",
"Explicit requirement of token module due to PHP7.4 compatbility."
],
"scripts": {
"post-install-cmd": "./vendor/bin/run drupal:site-setup",
"post-update-cmd": "./vendor/bin/run drupal:site-setup"
Expand Down Expand Up @@ -56,6 +64,12 @@
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"cweagans/composer-patches": true,
"drupal/core-composer-scaffold": true,
"phpro/grumphp": true
}
}
}
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
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
volumes:
- .:/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"
Expand Down
4 changes: 4 additions & 0 deletions grumphp.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ parameters:
- theme
- install
- yml
grumphp:
git_hook_variables:
EXEC_GRUMPHP_COMMAND: 'docker-compose exec -T web'

2 changes: 1 addition & 1 deletion modules/oe_search_demo/oe_search_demo.info.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: OpenEuropa Search Demo
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2
type: module
2 changes: 1 addition & 1 deletion oe_search.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Search features for the OpenEuropa project.
package: OpenEuropa

type: module
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

'interface translation project': oe_search
# The path to the actual translations is defined in
Expand Down
6 changes: 3 additions & 3 deletions tests/src/Functional/SearchBlockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ public function testBlock(): void {
// block.
$this->drupalLogin($this->createUser());
$this->drupalGet('<front>');
$assert_session->elementNotExists('css', '#block-oe-search');
$assert_session->elementNotExists('css', 'div[id^="block-oe-search"]');

$this->drupalLogin($this->createUser(['access content']));
$this->drupalGet('<front>');
$block = $assert_session->elementExists('css', '#block-oe-search');
$block = $assert_session->elementExists('css', 'div[id^="block-oe-search"]');

// Disable redirects to avoid loading web pages outside the test
// environment.
Expand All @@ -77,7 +77,7 @@ public function testBlock(): void {
$this->drupalGet('<front>', [
'language' => \Drupal::languageManager()->getLanguage('fr'),
]);
$block = $assert_session->elementExists('css', '#block-oe-search');
$block = $assert_session->elementExists('css', 'div[id^="block-oe-search"]');
$block->fillField('Search', 'European Commission');
$this->getSession()->getDriver()->getClient()->followRedirects(FALSE);
$block->pressButton('Search');
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Functional/SearchBlockTranslationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function testTranslations(): void {

$this->drupalLogin($this->createUser(['access content']));
$this->drupalGet(Url::fromUserInput('/en/node'));
$block = $assert_session->elementExists('css', '#block-oe-search');
$block = $assert_session->elementExists('css', 'div[id^="block-oe-search"]');
$assert_session->buttonExists('Search', $block);
// Check that the block button is translated in French.
$this->drupalGet(Url::fromUserInput('/fr/node'));
Expand Down