LocaleFileSystemFormTest.php in Zircon Profile 8
File
core/modules/locale/src/Tests/LocaleFileSystemFormTest.php
View source
<?php
namespace Drupal\locale\Tests;
use Drupal\simpletest\WebTestBase;
class LocaleFileSystemFormTest extends WebTestBase {
public static $modules = array(
'system',
);
protected function setUp() {
parent::setUp();
$account = $this
->drupalCreateUser(array(
'administer site configuration',
));
$this
->drupalLogin($account);
}
function testFileConfigurationPage() {
$this
->drupalGet('admin/config/media/file-system');
$this
->assertNoFieldByName('translation_path');
$module_installer = $this->container
->get('module_installer');
$module_installer
->install([
'locale',
]);
$this
->rebuildContainer();
$this
->drupalGet('admin/config/media/file-system');
$this
->assertFieldByName('translation_path');
$translation_path = $this->publicFilesDirectory . '/translations_changed';
$fields = array(
'translation_path' => $translation_path,
);
$this
->drupalPostForm(NULL, $fields, t('Save configuration'));
$this
->drupalGet('admin/config/media/file-system');
$this
->assertFieldByName('translation_path', $translation_path);
$this
->assertEqual($translation_path, $this
->config('locale.settings')
->get('translation.path'));
}
}