Skip to content

Commit

Permalink
Merge pull request #186 from openeuropa/OEL-3026
Browse files Browse the repository at this point in the history
OEL-3026: Update to Drupal 10.3
  • Loading branch information
brummbar authored Jun 21, 2024
2 parents 555d8fa + 8df9188 commit 64d9b2b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ services:
- DOCUMENT_ROOT=/test/oe_authentication
- COMPOSERVER=--2
mysql:
image: registry.fpfis.eu/fpfis/sql:percona-5.7
image: git.fpfis.tech.ec.europa.eu/fpfis/dependency_proxy/containers/percona:5.7
command: --innodb-log-file-size=1G --max_allowed_packet=1G --innodb-buffer-pool-size=512M --wait_timeout=3000 --net_write_timeout=3000 --log_error_verbosity=3
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
selenium:
image: registry.fpfis.eu/fpfis/selenium:standalone-chrome-4.1.3-20220405
image: git.fpfis.tech.ec.europa.eu/fpfis/dependency_proxy/containers/selenium/standalone-chrome:4.1.3-20220405
environment:
- DISPLAY=:99
- SCREEN_WIDTH=1440
Expand Down Expand Up @@ -75,11 +75,11 @@ pipeline:

matrix:
include:
- CORE_VERSION: 10.1.0
PHP_VERSION: 8.1
- 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
- CORE_VERSION: 10.3.0
PHP_VERSION: 8.1
- CORE_VERSION: 10.3.0
PHP_VERSION: 8.2
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public function testEuLoginUsersDataSanitization() {
'field_oe_organisation' => 'Lantern',
]);

// We need to write in session table to trigger the table creation.
\Drupal::service('session_handler.storage')->write('some-id', 'serialized-session-data');

$this->drush('sql:sanitize');
$expected = 'The following operations will be performed:' . PHP_EOL;
$expected .= '* Truncate sessions table.' . PHP_EOL;
Expand Down
1 change: 1 addition & 0 deletions tests/Kernel/EuLoginEventSubscriberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class EuLoginEventSubscriberTest extends KernelTestBase {
protected function setUp(): void {
parent::setUp();
$this->installConfig(['cas', 'cas_mock_server', 'oe_authentication']);
$this->installEntitySchema('path_alias');
}

/**
Expand Down
18 changes: 7 additions & 11 deletions tests/Kernel/LoginBlockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

namespace Drupal\Tests\oe_authentication\Kernel;

use Drupal\Core\Url;
use Drupal\Core\Link;
use Drupal\KernelTests\KernelTestBase;
use Drupal\user\Entity\User;
use Symfony\Component\DomCrawler\Crawler;

/**
* Test login block rendering.
Expand Down Expand Up @@ -50,12 +49,11 @@ public function testLoginBlockRendering(): void {
$build = $plugin_block->build();
$block = (string) $renderer->renderRoot($build);

$crawler = new Crawler($block);
$link = Link::createFromRoute('Log in', 'user.login')->toRenderable();
$expected_link = (string) $renderer->renderRoot($link);

// Make sure the login link is present.
$link = $crawler->filter('a');
$this->assertEquals(t('Log in'), $link->text());
$this->assertEquals(Url::fromRoute('user.login')->toString(), $link->attr('href'));
$this->assertEquals($expected_link, $block);

// Create a user to login.
$user1 = User::create([
Expand All @@ -72,12 +70,10 @@ public function testLoginBlockRendering(): void {
// Render the block again.
$build = $plugin_block->build();
$block = (string) $renderer->renderRoot($build);

$link = Link::createFromRoute('Log out', 'user.logout')->toRenderable();
$expected_link = (string) $renderer->renderRoot($link);
// Asserts if the text changed, and log out text is now present.
$crawler = new Crawler($block);
$link = $crawler->filter('a');
$this->assertEquals(t('Log out'), $link->text());
$this->assertEquals(Url::fromRoute('user.logout')->toString(), $link->attr('href'));
$this->assertEquals($expected_link, $block);
}

}

0 comments on commit 64d9b2b

Please sign in to comment.