diff --git a/.drone.yml b/.drone.yml index d8f5846e..890bcca8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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 @@ -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 diff --git a/modules/oe_authentication_user_fields/tests/src/Functional/UserSanitizeCommandTest.php b/modules/oe_authentication_user_fields/tests/src/Functional/UserSanitizeCommandTest.php index 1e19cef8..fae91413 100755 --- a/modules/oe_authentication_user_fields/tests/src/Functional/UserSanitizeCommandTest.php +++ b/modules/oe_authentication_user_fields/tests/src/Functional/UserSanitizeCommandTest.php @@ -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; diff --git a/tests/Kernel/EuLoginEventSubscriberTest.php b/tests/Kernel/EuLoginEventSubscriberTest.php index 4a426d79..dd004d64 100644 --- a/tests/Kernel/EuLoginEventSubscriberTest.php +++ b/tests/Kernel/EuLoginEventSubscriberTest.php @@ -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'); } /** diff --git a/tests/Kernel/LoginBlockTest.php b/tests/Kernel/LoginBlockTest.php index ed5db0ed..be9c8858 100644 --- a/tests/Kernel/LoginBlockTest.php +++ b/tests/Kernel/LoginBlockTest.php @@ -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. @@ -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([ @@ -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); } }