only in patch2: unchanged: --- /dev/null +++ b/core/modules/locale/src/Tests/LocaleFileSystemFormTest.php @@ -0,0 +1,75 @@ +adminUser = $this->drupalCreateUser(array('administer site configuration')); + $this->drupalLogin($this->adminUser); + } + + /** + * Tests translation settings at the FileSystemForm. + */ + function testFileConfigurationPage() { + // Gets File System Settings Form. + $this->drupalGet('admin/config/media/file-system'); + + // There is not a translation path field. + $this->assertNoFieldByName('translation_path'); + + // It enables the module - locale. + $module_installer = $this->container->get('module_installer'); + $module_installer->install(['locale']); + + // There is the translation path field. + $this->drupalGet('admin/config/media/file-system'); + $this->assertFieldByName('translation_path'); + + // It saves new settings. + $file_path = $this->publicFilesDirectory; + $translation_path = $file_path . '/translations_changed'; + $fields = array( + 'file_temporary_path' => $file_path . '/file_config_page_test/temporary', + 'file_default_scheme' => 'private', + 'translation_path' => $translation_path + ); + $this->drupalPostForm(NULL, $fields, t('Save configuration')); + + // It checks if translation path is saved successuly. + $this->drupalGet('admin/config/media/file-system'); + $this->assertFieldByName('translation_path', $translation_path); + $config_factory = $this->container->get('config.factory'); + $this->assertTrue($translation_path == $config_factory->get('locale.settings')->get('translation.path')); + } + +}