LingotekSettingsTabConfigurationFormTest.php in Lingotek Translation 3.4.x
Same filename and directory in other branches
- 8.2 tests/src/Functional/Form/LingotekSettingsTabConfigurationFormTest.php
- 4.0.x tests/src/Functional/Form/LingotekSettingsTabConfigurationFormTest.php
- 3.0.x tests/src/Functional/Form/LingotekSettingsTabConfigurationFormTest.php
- 3.1.x tests/src/Functional/Form/LingotekSettingsTabConfigurationFormTest.php
- 3.2.x tests/src/Functional/Form/LingotekSettingsTabConfigurationFormTest.php
- 3.3.x tests/src/Functional/Form/LingotekSettingsTabConfigurationFormTest.php
- 3.5.x tests/src/Functional/Form/LingotekSettingsTabConfigurationFormTest.php
- 3.6.x tests/src/Functional/Form/LingotekSettingsTabConfigurationFormTest.php
- 3.7.x tests/src/Functional/Form/LingotekSettingsTabConfigurationFormTest.php
- 3.8.x tests/src/Functional/Form/LingotekSettingsTabConfigurationFormTest.php
Namespace
Drupal\Tests\lingotek\Functional\FormFile
tests/src/Functional/Form/LingotekSettingsTabConfigurationFormTest.phpView source
<?php
namespace Drupal\Tests\lingotek\Functional\Form;
use Drupal\Tests\lingotek\Functional\LingotekTestBase;
/**
* Tests the Lingotek configuration settings form.
*
* @group lingotek
*/
class LingotekSettingsTabConfigurationFormTest extends LingotekTestBase {
/**
* Test that if there are no entities, there is a proper feedback to the user.
*/
public function testConfigurationForm() {
$this
->drupalGet('admin/lingotek/settings');
// Nothing is selected.
$this
->assertNoFieldChecked('edit-table-configurable-language-enabled');
// Check the configurable language and set the manual profile.
$edit = [
'table[configurable_language][enabled]' => 1,
'table[configurable_language][profile]' => 'manual',
];
$this
->drupalPostForm(NULL, $edit, 'Save', [], 'lingoteksettings-tab-configuration-form');
// The values shown are correct.
$this
->assertFieldChecked('edit-table-configurable-language-enabled');
$this
->assertFieldByName('table[configurable_language][profile]', 'manual');
/** @var \Drupal\lingotek\LingotekConfigTranslationServiceInterface $config_translation */
$config_translation = \Drupal::service('lingotek.config_translation');
/** @var \Drupal\lingotek\LingotekConfigurationServiceInterface $lingotek_config */
$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());
}
}
Classes
Name | Description |
---|---|
LingotekSettingsTabConfigurationFormTest | Tests the Lingotek configuration settings form. |