diff --git a/core/modules/node/src/Tests/Views/NodeLanguageTest.php b/core/modules/node/src/Tests/Views/NodeLanguageTest.php index ac33a59..8a74d3b 100644 --- a/core/modules/node/src/Tests/Views/NodeLanguageTest.php +++ b/core/modules/node/src/Tests/Views/NodeLanguageTest.php @@ -115,11 +115,6 @@ public function testLanguages() { } } - // Test that the language field value is shown. - $this->assertNoText('English', 'English language is not shown on ' . $message); - $this->assertText('French', 'French language is shown on ' . $message); - $this->assertText('Spanish', 'Spanish language is shown on ' . $message); - // Test page sorting, which is by language code, ascending. So the // Spanish nodes should appear before the French nodes. $page = $this->getTextContent(); @@ -137,9 +132,6 @@ public function testLanguages() { $this->drupalGet('test-language/es'); // This time, test just the language field. $message = 'Spanish argument page'; - $this->assertNoText('English', 'English language is not shown on ' . $message); - $this->assertNoText('French', 'French language is not shown on ' . $message); - $this->assertText('Spanish', 'Spanish language is shown on ' . $message); // Test the front page view filter. Only node titles in the current language // should be displayed on the front page by default. @@ -231,13 +223,13 @@ public function testLanguages() { * Tests native name display in language field. */ public function testNativeLanguageField() { + // Check Spanish language display in original English. $this->assertLanguageNames(); - // Modify test view to display native language names and set translations. + // Modify test view to display native language names and set a translation. $config = $this->config('views.view.test_language'); $config->set('display.default.display_options.fields.langcode.settings.native_language', TRUE); $config->save(); - \Drupal::languageManager()->getLanguageConfigOverride('fr', 'language.entity.fr')->set('label', 'Français')->save(); \Drupal::languageManager()->getLanguageConfigOverride('es', 'language.entity.es')->set('label', 'Español')->save(); $this->assertLanguageNames(TRUE); @@ -262,15 +254,11 @@ public function testNativeLanguageField() { protected function assertLanguageNames($native = FALSE) { $this->drupalGet('test-language'); if ($native) { - $this->assertText('Français', 'French language shown translated.'); $this->assertText('Español', 'Spanish language shown translated.'); - $this->assertNoText('French', 'French language not shown in English.'); $this->assertNoText('Spanish', 'Spanish language not shown in English.'); } else { - $this->assertNoText('Français', 'French language not shown translated.'); $this->assertNoText('Español', 'Spanish language not shown translated.'); - $this->assertText('French', 'French language shown in English.'); $this->assertText('Spanish', 'Spanish language shown in English.'); } }