LingotekSettingsTabConfigurationFormTest.php in Lingotek Translation 8
File
src/Tests/Form/LingotekSettingsTabConfigurationFormTest.php
View source
<?php
namespace Drupal\lingotek\Tests\Form;
use Drupal\lingotek\LingotekConfigTranslationServiceInterface;
use Drupal\lingotek\Tests\LingotekTestBase;
class LingotekSettingsTabConfigurationFormTest extends LingotekTestBase {
public function testConfigurationForm() {
$this
->drupalGet('admin/lingotek/settings');
$this
->assertNoFieldChecked('edit-table-configurable-language-enabled');
$edit = [
'table[configurable_language][enabled]' => 1,
'table[configurable_language][profile]' => 'manual',
];
$this
->drupalPostForm(NULL, $edit, 'Save', [], [], 'lingoteksettings-tab-configuration-form');
$this
->assertFieldChecked('edit-table-configurable-language-enabled');
$this
->assertFieldByName('table[configurable_language][profile]', 'manual');
$config_translation = \Drupal::service('lingotek.config_translation');
$lingotek_config = \Drupal::service('lingotek.configuration');
$this
->assertTrue($config_translation
->isEnabled('configurable_language'));
$this
->assertEqual('manual', $lingotek_config
->getConfigEntityDefaultProfileId('configurable_language'));
$this
->assertEqual([
'configurable_language',
], $config_translation
->getEnabledConfigTypes());
}
}