Skip to content

Commit

Permalink
Merge pull request #52 from openeuropa/EWPP-1706
Browse files Browse the repository at this point in the history
EWPP-1706: Fixing test page navigation in other languages.
  • Loading branch information
upchuk authored Nov 8, 2021
2 parents 93bc233 + a87dba0 commit a7959bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ vendor
yarn.lock
phpunit.xml
docker-compose.*.yml
/.gitattributes
13 changes: 5 additions & 8 deletions tests/src/Functional/SearchBlockTranslationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Drupal\Tests\oe_search\Functional;

use Drupal\Core\Url;
use Drupal\Tests\BrowserTestBase;

/**
Expand All @@ -29,7 +30,7 @@ class SearchBlockTranslationTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->drupalPlaceBlock('oe_search', [
Expand All @@ -55,18 +56,14 @@ public function testTranslations(): void {
$assert_session = $this->assertSession();

$this->drupalLogin($this->createUser(['access content']));
$this->drupalGet('<front>');
$this->drupalGet(Url::fromUserInput('/en/node'));
$block = $assert_session->elementExists('css', '#block-oe-search');
$assert_session->buttonExists('Search', $block);
// Check that the block button is translated in French.
$this->drupalGet('<front>', [
'language' => \Drupal::languageManager()->getLanguage('fr'),
]);
$this->drupalGet(Url::fromUserInput('/fr/node'));
$assert_session->buttonExists('Rechercher', $block);
// And in Italian.
$this->drupalGet('<front>', [
'language' => \Drupal::languageManager()->getLanguage('it'),
]);
$this->drupalGet(Url::fromUserInput('/it/node'));
$assert_session->buttonExists('Cerca', $block);
}

Expand Down

0 comments on commit a7959bf

Please sign in to comment.