ContactLanguageTest.php in Zircon Profile 8
File
core/modules/contact/src/Tests/ContactLanguageTest.php
View source
<?php
namespace Drupal\contact\Tests;
use Drupal\simpletest\WebTestBase;
class ContactLanguageTest extends WebTestBase {
public static $modules = array(
'contact',
'language',
'contact_test',
);
protected function setUp() {
parent::setUp();
$admin_user = $this
->drupalCreateUser(array(
'access site-wide contact form',
'administer languages',
));
$this
->drupalLogin($admin_user);
}
public function testContactLanguage() {
$this
->drupalGet('contact');
$this
->assertResponse(200, 'The page exists');
$this
->assertNoField('edit-langcode-0-value');
$settings_path = 'admin/config/regional/content-language';
$edit['entity_types[contact_message]'] = TRUE;
$edit['settings[contact_message][feedback][settings][language][language_alterable]'] = TRUE;
$this
->drupalPostForm($settings_path, $edit, t('Save configuration'));
$this
->drupalGet('contact');
$this
->assertResponse(200, 'The page exists');
$this
->assertField('edit-langcode-0-value');
}
}