Chris@0: drupalCreateUser([ Chris@0: 'access site-wide contact form', Chris@0: 'administer languages', Chris@0: ]); Chris@0: $this->drupalLogin($admin_user); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Tests configuration options with language enabled. Chris@0: */ Chris@0: public function testContactLanguage() { Chris@0: // Ensure that contact form by default does not show the language select. Chris@0: $this->drupalGet('contact'); Chris@0: $this->assertResponse(200, 'The page exists'); Chris@0: $this->assertNoField('edit-langcode-0-value'); Chris@0: Chris@0: // Enable language select from content language settings page. Chris@0: $settings_path = 'admin/config/regional/content-language'; Chris@0: $edit['entity_types[contact_message]'] = TRUE; Chris@0: $edit['settings[contact_message][feedback][settings][language][language_alterable]'] = TRUE; Chris@0: $this->drupalPostForm($settings_path, $edit, t('Save configuration')); Chris@0: Chris@0: // Ensure that contact form now shows the language select. Chris@0: $this->drupalGet('contact'); Chris@0: $this->assertResponse(200, 'The page exists'); Chris@0: $this->assertField('edit-langcode-0-value'); Chris@0: } Chris@0: Chris@0: }