Skip to content

Commit

Permalink
Merge pull request #181 from openeuropa/EWPP-3969
Browse files Browse the repository at this point in the history
EWPP-3969: Add Drupal 10.2.x and PHP 8.2 to matrix., drop support for Drush 11.
  • Loading branch information
nagyad authored Feb 14, 2024
2 parents 9987427 + a748bdb commit 0536744
Show file tree
Hide file tree
Showing 36 changed files with 98 additions and 79 deletions.
18 changes: 9 additions & 9 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ services:
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
selenium:
image: registry.fpfis.eu/fpfis/selenium:standalone-chrome-3.141.59-oxygen
shm_size: 2g
image: registry.fpfis.eu/fpfis/selenium:standalone-chrome-4.1.3-20220405
environment:
- DISPLAY=:99
- SE_OPTS=-debug
- SCREEN_WIDTH=1280
- SCREEN_HEIGHT=800
- SCREEN_WIDTH=1440
- SCREEN_HEIGHT=900
- NODE_MAX_INSTANCES=5
- NODE_MAX_SESSION=5

Expand Down Expand Up @@ -77,9 +75,11 @@ pipeline:

matrix:
include:
- CORE_VERSION: 9.4.0
PHP_VERSION: 8.0
- CORE_VERSION: 9.4.0
- CORE_VERSION: 10.1.0
PHP_VERSION: 8.1
- CORE_VERSION: 10.0
- CORE_VERSION: 10.1.0
PHP_VERSION: 8.2
- CORE_VERSION: 10.2.0
PHP_VERSION: 8.1
- CORE_VERSION: 10.2.0
PHP_VERSION: 8.2
24 changes: 24 additions & 0 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,30 @@ default:
base_url: "${drupal.base_url}"
selenium2:
wd_host: '${selenium.host}:${selenium.port}/wd/hub'
capabilities:
browser: chrome
nativeEvents: true
marionette: true
browserName: chrome
version: '*'
extra_capabilities:
chromeOptions:
w3c: false
args:
- '--no-sandbox'
- '--start-maximized'
- '--disable-gpu'
- '--window-size=1440,900'
- '--disable-dev-shm-usage'
- '--disable-setuid-sandbox'
- '--disable-web-security'
- '--DNS-prefetch-disable'
- '--disable-translate'
- '--ignore-certificate-errors'
- '--test-type'
- '--disable-extensions'
- '--incognito'
- '--disable-infobars'
Drupal\DrupalExtension:
api_driver: "drupal"
drupal:
Expand Down
17 changes: 7 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.0",
"php": ">=8.1",
"drupal/cas": "^2.2",
"drupal/core": "^9.4 || ^10"
"drupal/core": "^10"
},
"require-dev": {
"composer/installers": "^1.11",
"drupal/cas_mock_server": "^2.0.1",
"drupal/core-composer-scaffold": "^9.4 || ^10",
"drupal/core-composer-scaffold": "^10",
"drupal/drupal-extension": "^5.0",
"drush/drush": "^11.1 || ^12",
"drush/drush": "^12",
"mikey179/vfsstream": "^1.6.10",
"nikic/php-parser": "^4",
"openeuropa/behat-transformation-context": "^0.2",
"openeuropa/code-review": "^2.0.0-alpha6",
"openeuropa/task-runner-drupal-project-symlink": "^1.0-beta6",
Expand Down Expand Up @@ -55,17 +56,13 @@
},
"_readme": [
"Explicit minimum version requirement of symfony/phpunit-bridge to replace drupal/core-dev testing classes and traits.",
"Explicit requirement of mikey179/vfsstream to remove when drupal/core-dev is reinstated."
"Explicit requirement of mikey179/vfsstream to remove when drupal/core-dev is reinstated.",
"Explicit requirement of nikic/php-parser ^4 as later versions are not compatible with grumphp @see https://github.com/phpro/grumphp/issues/1119"
],
"drupal-scaffold": {
"locations": {
"web-root": "./build"
}
},
"drush": {
"services": {
"drush.services.yml": "^11"
}
}
},
"config": {
Expand Down
13 changes: 3 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,16 @@ services:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
# ports:
# - 3306:3306
# If you would like to see what is going on you can run the following on your host:
# docker run --rm -p 4444:4444 -p 5900:5900 --network="host" selenium/standalone-chrome-debug:latest
# Newer version of this image might run into this issue:
# @link https://github.com/elgalu/docker-selenium/issues/20
# Visit localhost:7900 to access the browser.
selenium:
image: selenium/standalone-chrome-debug:3.141.59-oxygen
expose:
- '4444'
image: selenium/standalone-chrome:4.1.3-20220405
environment:
- DISPLAY=:99
- SE_OPTS=-debug
- SCREEN_WIDTH=1280
- SCREEN_HEIGHT=800
- VNC_NO_PASSWORD=1
ports:
- '4444:4444'
- '5900:5900'
- '7900:7900'
shm_size: 2g

#### Mac users: uncomment the "volumes" key to enable the NFS file sharing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OE Authentication EU Login mock
description: EU Login mock server implementation.
package: OpenEuropa
type: module
core_version_requirement: ^9.4 || ^10
core_version_requirement: ^10
dependencies:
- cas:cas
- cas_mock_server:cas_mock_server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* OpenEuropa Authentication EU Login mock install file.
*/

declare(strict_types = 1);
declare(strict_types=1);

/**
* Implements hook_install().
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_authentication_eulogin_mock\EventSubscriber;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_authentication_eulogin_mock\EventSubscriber;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_authentication_eulogin_mock\Form;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_authentication_eulogin_mock\Form;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_authentication_eulogin_mock\Routing;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\Tests\cas_mock_server\Kernel;

Expand Down
6 changes: 0 additions & 6 deletions modules/oe_authentication_user_fields/drush.services.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ name: OE Authentication User Fields
description: Provides some user basic fields and map them with EU Login attributes.
package: OpenEuropa
type: module
core_version_requirement: ^9.4 || ^10
core_version_requirement: ^10
dependencies:
- oe_authentication:oe_authentication
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* OpenEuropa Authentication User Fields module.
*/

declare(strict_types = 1);
declare(strict_types=1);

use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_authentication_user_fields\Commands\sql;
namespace Drupal\oe_authentication_user_fields\Drush\Commands\sql;

use Consolidation\AnnotatedCommand\CommandData;
use Consolidation\AnnotatedCommand\Hooks\HookManager;
use Drupal\Core\Database\Connection;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drush\Attributes as CLI;
use Drush\Commands\DrushCommands;
use Drush\Drupal\Commands\sql\SanitizeCommands;
use Drush\Drupal\Commands\sql\SanitizePluginInterface;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* Sanitizes the user fields related data.
*/
class UserSanitizeCommand extends DrushCommands implements SanitizePluginInterface {
final class UserSanitizeCommand extends DrushCommands implements SanitizePluginInterface {

/**
* The entity type manager.
Expand Down Expand Up @@ -45,12 +49,24 @@ public function __construct(EntityTypeManagerInterface $entityTypeManager, Conne
}

/**
* Sanitize the user data from the DB.
* Returns a new instance.
*
* @hook post-command sql-sanitize
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
* The Drupal container.
*
* @inheritdoc
* @return static
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('entity_type.manager'),
$container->get('database')
);
}

/**
* {@inheritdoc}
*/
#[CLI\Hook(type: HookManager::POST_COMMAND_HOOK, target: SanitizeCommands::SANITIZE)]
public function sanitize($result, CommandData $commandData) {
$this->connection->update('users_field_data')
->expression('field_oe_firstname', 'CONCAT(:fn_dummy_string, uid)', [
Expand All @@ -74,12 +90,9 @@ public function sanitize($result, CommandData $commandData) {
}

/**
* Sets the output message.
*
* @hook on-event sql-sanitize-confirms
*
* @inheritdoc
* {@inheritdoc}
*/
#[CLI\Hook(type: HookManager::ON_EVENT, target: SanitizeCommands::CONFIRMS)]
public function messages(&$messages, InputInterface $input) {
$messages[] = dt('Sanitise user fields.');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_authentication_user_fields;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_authentication_user_fields\EventSubscriber;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\Tests\oe_authentication_user_fields\Functional;

Expand Down Expand Up @@ -46,13 +46,11 @@ public function testEuLoginUsersDataSanitization() {

$this->drush('sql:sanitize');
$expected = 'The following operations will be performed:' . PHP_EOL;
// An extra newline is added when the command is executed with Drupal 9.x.
// @todo Remove when support for Drupal 9.x is dropped.
$expected .= version_compare(\Drupal::VERSION, '10.0.0', '<') ? PHP_EOL : '';
$expected .= '* Truncate sessions table.' . PHP_EOL;
$expected .= '* Sanitize text fields associated with users.' . PHP_EOL;
$expected .= '* Sanitize user passwords.' . PHP_EOL;
$expected .= '* Sanitize user emails.' . PHP_EOL;
$expected .= '* Preserve user emails and passwords for the specified roles.' . PHP_EOL;
$expected .= '* Sanitise user fields.';
$this->assertOutputEquals($expected);

Expand Down
2 changes: 1 addition & 1 deletion oe_authentication.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ name: OE Authentication
description: Authentication against the OpenEuropa Authentication service.
package: OpenEuropa
type: module
core_version_requirement: ^9.4 || ^10
core_version_requirement: ^10
dependencies:
- cas:cas
2 changes: 1 addition & 1 deletion oe_authentication.install
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* OpenEuropa Authentication install file.
*/

declare(strict_types = 1);
declare(strict_types=1);

use Drupal\cas\Service\CasUserManager;
use Drupal\Core\Field\BaseFieldDefinition;
Expand Down
2 changes: 1 addition & 1 deletion oe_authentication.module
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* OpenEuropa Authentication module.
*/

declare(strict_types = 1);
declare(strict_types=1);

/**
* Implements hook_user_cancel_methods_alter().
Expand Down
2 changes: 1 addition & 1 deletion oe_authentication.post_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Post update functions for OE Authentication module.
*/

declare(strict_types = 1);
declare(strict_types=1);

/**
* Customize error messages that refer to CAS.
Expand Down
2 changes: 1 addition & 1 deletion src/CasProcessor.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_authentication;

Expand Down
2 changes: 1 addition & 1 deletion src/Controller/ProxyCallbackController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_authentication\Controller;

Expand Down
2 changes: 1 addition & 1 deletion src/Controller/RegisterController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_authentication\Controller;

Expand Down
Loading

0 comments on commit 0536744

Please sign in to comment.