Verified Commit a28c9b38 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3164699 by jungle, ravi.shankar, andregp, kishor_kolekar, sulfikar_s,...

Issue #3164699 by jungle, ravi.shankar, andregp, kishor_kolekar, sulfikar_s, ankithashetty, paulocs, Abhijith S, WagnerMelo, quietone: Fix or ignore 15 words used in Help Topics
parent 1f9f1da2
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -31,8 +31,6 @@ andif
annot
anonyme
anothermodule
anotherwordenglish
anotherwordgerman
antilop
anyall
applix
@@ -49,7 +47,6 @@ arrowstop
arrowthick
arrowthickstop
arrr
asdrsad
assertable
asterix
atsign
@@ -94,7 +91,6 @@ bangpow
barbar
barchart
barfoo
barmm
barqux
bartik
bartik's
@@ -504,7 +500,6 @@ foobarbaz
foobargorilla
foobars
foofoo
foomm
foos
formatless
formattable
@@ -575,7 +570,6 @@ heure
heures
hexcode
hidpi
hilfetestmodul
hilited
hinode
hippopotamidae
@@ -899,15 +893,11 @@ nonconfigurable
nonexistingfilename
nonoptional
nonspacing
nonwordgerman
nonworditem
noquotes
noschema
nosniff
nostart
notag
notawordenglish
notawordgerman
notexisting
nothere
notnull
@@ -1176,7 +1166,6 @@ scorewords
screenreaders
scriptable
scrollbars
sdeeeee
searchdirs
searchfield
sebe
@@ -1233,7 +1222,6 @@ splitbuttons
spreadsheetml
sqlpassword
sqlusername
sqruct
squaresmall
squiz
squizlabs
@@ -1582,7 +1570,6 @@ vxezb
vxfbk
waitfor
wcprops
wcsrefsdf
webassert
webcal
webdriver
@@ -1664,5 +1651,4 @@ zzgroup
åwesome
èxample
über
übersetzung
ȅchȏ
+1 −1
Original line number Diff line number Diff line
@@ -7,5 +7,5 @@ related:
---
{% set help_topic_link = render_var(help_topic_link('help_topics_test.test_urls')) %}
<p>{% trans %}This is a test. It should link to the URL test topic {{ help_topic_link }}. Also there should be a related topic link below to the Help module topic page and the linked topic.{% endtrans %}</p>
<p>{% trans %}Nonworditem totranslate.{% endtrans %}</p>
<p>{% trans %}Non-word-item to translate.{% endtrans %}</p>
<p>{% trans %}Test translation.{% endtrans %}</p>
+6 −4
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@
use Drupal\Core\Link;
use Drupal\help\Plugin\HelpSection\HelpSectionPluginBase;

// cspell:ignore asdrsad barmm foomm sqruct wcsrefsdf sdeeeee

/**
 * Provides a searchable help section for testing.
 *
@@ -47,13 +49,13 @@ public function renderTopicForSearch($topic_id, LanguageInterface $language) {
        if ($language->getId() == 'en') {
          return [
            'title' => 'Foo in English title wcsrefsdf',
            'text' => 'Something about foo body notawordenglish sqruct',
            'text' => 'Something about foo body not-a-word-english sqruct',
            'url' => Url::fromUri('https://foo.com'),
          ];
        }
        return [
          'title' => 'Foomm Foreign heading',
          'text' => 'Fake foreign foo text notawordgerman asdrsad',
          'text' => 'Fake foreign foo text not-a-word-german asdrsad',
          'url' => Url::fromUri('https://mm.foo.com'),
        ];

@@ -61,13 +63,13 @@ public function renderTopicForSearch($topic_id, LanguageInterface $language) {
        if ($language->getId() == 'en') {
          return [
            'title' => 'Bar in English',
            'text' => 'Something about bar anotherwordenglish asdrsad',
            'text' => 'Something about bar another-word-english asdrsad',
            'url' => Url::fromUri('https://bar.com'),
          ];
        }
        return [
          'title' => \Drupal::state()->get('help_topics_test:translated_title', 'Barmm Foreign sdeeeee'),
          'text' => 'Fake foreign barmm anotherwordgerman sqruct',
          'text' => 'Fake foreign barmm another-word-german sqruct',
          'url' => Url::fromUri('https://mm.bar.com'),
        ];

+16 −13
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@
use Drupal\Tests\Traits\Core\CronRunTrait;
use Drupal\help_topics\Plugin\Search\HelpSearch;

// cspell:ignore asdrsad barmm foomm hilfetestmodul sdeeeee sqruct
// cspell:ignore wcsrefsdf übersetzung

/**
 * Verifies help topic search.
 *
@@ -63,7 +66,7 @@ protected function setUp(): void {
    // Before running cron, verify that a search returns no results and shows
    // warning.
    $this->drupalGet('search/help');
    $this->submitForm(['keys' => 'notawordenglish'], 'Search');
    $this->submitForm(['keys' => 'not-a-word-english'], 'Search');
    $this->assertSearchResultsCount(0);
    $this->assertSession()->statusMessageContains('Help search is not fully indexed', 'warning');

@@ -83,7 +86,7 @@ protected function setUp(): void {
    $this->assertSession()->pageTextContains('100% of the site has been indexed');
    // Search and verify there is no warning.
    $this->drupalGet('search/help');
    $this->submitForm(['keys' => 'notawordenglish'], 'Search');
    $this->submitForm(['keys' => 'not-a-word-english'], 'Search');
    $this->assertSearchResultsCount(1);
    $this->assertSession()->statusMessageNotContains('Help search is not fully indexed');
  }
@@ -100,26 +103,26 @@ public function testHelpSearch() {
    // by the topics that come from
    // \Drupal\help_topics_test\Plugin\HelpSection\TestHelpSection.
    $this->drupalGet('search/help');
    $this->submitForm(['keys' => 'notawordenglish'], 'Search');
    $this->submitForm(['keys' => 'not-a-word-english'], 'Search');
    $this->assertSearchResultsCount(1);
    $session->linkExists('Foo in English title wcsrefsdf');

    // Same for German.
    $this->drupalGet('search/help', ['language' => $german]);
    $this->submitForm(['keys' => 'notawordgerman'], 'Search');
    $this->submitForm(['keys' => 'not-a-word-german'], 'Search');
    $this->assertSearchResultsCount(1);
    $session->linkExists('Foomm Foreign heading');

    // Verify when we search in English for a word that only exists in German,
    // we get no results.
    $this->drupalGet('search/help');
    $this->submitForm(['keys' => 'notawordgerman'], 'Search');
    $this->submitForm(['keys' => 'not-a-word-german'], 'Search');
    $this->assertSearchResultsCount(0);
    $session->pageTextContains('no results');

    // Same for German.
    $this->drupalGet('search/help', ['language' => $german]);
    $this->submitForm(['keys' => 'notawordenglish'], 'Search');
    $this->submitForm(['keys' => 'not-a-word-english'], 'Search');
    $this->assertSearchResultsCount(0);
    $session->pageTextContains('no results');

@@ -141,7 +144,7 @@ public function testHelpSearch() {
    // that we can search for translated regular help topics, in both English
    // and German.
    $this->drupalGet('search/help');
    $this->submitForm(['keys' => 'nonworditem'], 'Search');
    $this->submitForm(['keys' => 'non-word-item'], 'Search');
    $this->assertSearchResultsCount(1);
    $session->linkExists('ABC Help Test module');
    // Click the link and verify we ended up on the topic page.
@@ -149,7 +152,7 @@ public function testHelpSearch() {
    $session->pageTextContains('This is a test');

    $this->drupalGet('search/help', ['language' => $german]);
    $this->submitForm(['keys' => 'nonwordgerman'], 'Search');
    $this->submitForm(['keys' => 'non-word-german'], 'Search');
    $this->assertSearchResultsCount(1);
    $session->linkExists('ABC-Hilfetestmodul');
    $this->clickLink('ABC-Hilfetestmodul');
@@ -158,13 +161,13 @@ public function testHelpSearch() {
    // Verify that we can search from the admin/help page.
    $this->drupalGet('admin/help');
    $session->pageTextContains('Search help');
    $this->submitForm(['keys' => 'nonworditem'], 'Search');
    $this->submitForm(['keys' => 'non-word-item'], 'Search');
    $this->assertSearchResultsCount(1);
    $session->linkExists('ABC Help Test module');

    // Same for German.
    $this->drupalGet('admin/help', ['language' => $german]);
    $this->submitForm(['keys' => 'nonwordgerman'], 'Search');
    $this->submitForm(['keys' => 'non-word-german'], 'Search');
    $this->assertSearchResultsCount(1);
    $session->linkExists('ABC-Hilfetestmodul');

@@ -228,12 +231,12 @@ public function testHelpSearch() {
    $session->pageTextContains('Search help');

    $this->drupalGet('search/help');
    $this->submitForm(['keys' => 'nonworditem'], 'Search');
    $this->submitForm(['keys' => 'non-word-item'], 'Search');
    $this->assertSearchResultsCount(1);
    $session->linkExists('ABC Help Test module');

    $this->drupalGet('search/help');
    $this->submitForm(['keys' => 'notawordenglish'], 'Search');
    $this->submitForm(['keys' => 'not-a-word-english'], 'Search');
    $this->assertSearchResultsCount(0);
    $session->pageTextContains('no results');

@@ -241,7 +244,7 @@ public function testHelpSearch() {
    // searchable.
    \Drupal::service('module_installer')->uninstall(['help_topics_test']);
    $this->drupalGet('search/help');
    $this->submitForm(['keys' => 'nonworditem'], 'Search');
    $this->submitForm(['keys' => 'non-word-item'], 'Search');
    $this->assertSearchResultsCount(0);
  }

+4 −2
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@

use Drupal\Tests\BrowserTestBase;

// cspell:ignore hilfetestmodul übersetzung

/**
 * Provides a base class for functional help topic tests that use translation.
 *
@@ -73,8 +75,8 @@ protected function installParameters() {
msgid "Test translation."
msgstr "Übersetzung testen."

msgid "Nonworditem totranslate."
msgstr "Nonwordgerman sdfwedrsdf."
msgid "Non-word-item to translate."
msgstr "Non-word-german sdfwedrsdf."

ENDPO;
    include_once $this->root . '/core/includes/install.core.inc';
Loading