diff --git a/core/modules/locale/src/Tests/LocaleFileSystemFormTest.php b/core/modules/locale/src/Tests/LocaleFileSystemFormTest.php index 2437b93..32b44c2 100644 --- a/core/modules/locale/src/Tests/LocaleFileSystemFormTest.php +++ b/core/modules/locale/src/Tests/LocaleFileSystemFormTest.php @@ -10,7 +10,7 @@ use Drupal\simpletest\WebTestBase; /** - * Tests the locale functionality at the altered FileSystemForm. + * Tests the locale functionality in the altered file settings form. * * @group locale */ @@ -24,48 +24,37 @@ class LocaleFileSystemFormTest extends WebTestBase { public static $modules = array('system'); /** - * A user able to create languages and export translations. - */ - protected $adminUser = NULL; - - /** * {@inheritdoc} */ protected function setUp(){ parent::setUp(); - $this->adminUser = $this->drupalCreateUser(array('administer site configuration')); - $this->drupalLogin($this->adminUser); + $account = $this->drupalCreateUser(array('administer site configuration')); + $this->drupalLogin($account); } /** - * Tests translation settings at the FileSystemForm. + * Tests translation directory settings on the file settings form. */ function testFileConfigurationPage() { - // Gets File System Settings Form. + // By default there should be no setting for the translation directory. $this->drupalGet('admin/config/media/file-system'); - - // There is not a translation path field. $this->assertNoFieldByName('translation_path'); - // It enables the module - locale. + // With locale module installed, the setting should appear. $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. + // The setting should persist. $translation_path = $this->publicFilesDirectory . '/translations_changed'; $fields = array( '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); - $this->assertTrue($translation_path == $this->config('locale.settings')->get('translation.path')); + $this->assertEqual($translation_path, \Drupal::configFactory()->reset()->get('locale.settings')->get('translation.path')); } }