3 namespace Drupal\Tests\locale\Functional;
5 use Drupal\Tests\BrowserTestBase;
8 * Tests the locale functionality in the altered file settings form.
12 class LocaleFileSystemFormTest extends BrowserTestBase {
19 public static $modules = ['system'];
24 protected function setUp(){
26 $account = $this->drupalCreateUser(['administer site configuration']);
27 $this->drupalLogin($account);
31 * Tests translation directory settings on the file settings form.
33 public function testFileConfigurationPage() {
34 // By default there should be no setting for the translation directory.
35 $this->drupalGet('admin/config/media/file-system');
36 $this->assertNoFieldByName('translation_path');
38 // With locale module installed, the setting should appear.
39 $module_installer = $this->container->get('module_installer');
40 $module_installer->install(['locale']);
41 $this->rebuildContainer();
42 $this->drupalGet('admin/config/media/file-system');
43 $this->assertFieldByName('translation_path');
45 // The setting should persist.
46 $translation_path = $this->publicFilesDirectory . '/translations_changed';
48 'translation_path' => $translation_path
50 $this->drupalPostForm(NULL, $fields, t('Save configuration'));
51 $this->drupalGet('admin/config/media/file-system');
52 $this->assertFieldByName('translation_path', $translation_path);
53 $this->assertEqual($translation_path, $this->config('locale.settings')->get('translation.path'));