Skip to content
Snippets Groups Projects
Verified Commit 8c01b91e authored by Dave Long's avatar Dave Long
Browse files

Issue #3384935 by vbouchet: ContactLanguageTest should use API to set up language

parent 13cf026d
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
namespace Drupal\Tests\contact\Functional; namespace Drupal\Tests\contact\Functional;
use Drupal\Core\Language\LanguageInterface;
use Drupal\language\Entity\ContentLanguageSettings;
use Drupal\Tests\BrowserTestBase; use Drupal\Tests\BrowserTestBase;
/** /**
...@@ -54,12 +56,11 @@ public function testContactLanguage() { ...@@ -54,12 +56,11 @@ public function testContactLanguage() {
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->assertSession()->fieldNotExists('edit-langcode-0-value'); $this->assertSession()->fieldNotExists('edit-langcode-0-value');
// Enable language select from content language settings page. // Enable language select.
$settings_path = 'admin/config/regional/content-language'; $config = ContentLanguageSettings::loadByEntityTypeBundle('contact_message', 'feedback');
$edit['entity_types[contact_message]'] = TRUE; $config->setDefaultLangcode(LanguageInterface::LANGCODE_SITE_DEFAULT);
$edit['settings[contact_message][feedback][settings][language][language_alterable]'] = TRUE; $config->setLanguageAlterable(TRUE);
$this->drupalGet($settings_path); $config->save();
$this->submitForm($edit, 'Save configuration');
// Ensure that contact form now shows the language select. // Ensure that contact form now shows the language select.
$this->drupalGet('contact'); $this->drupalGet('contact');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment