You are here

public function BaseFlowTest::testRequestTranslationWhenOneProviderAvailable in TMGMT Translator Smartling 8.4

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/BaseFlowTest.php \Drupal\Tests\tmgmt_smartling\Functional\BaseFlowTest::testRequestTranslationWhenOneProviderAvailable()

Test request translation when there is one provider in a list.

There was an issue when there is only one provider in the list and system requests translation without checkout settings form.

File

tests/src/Functional/BaseFlowTest.php, line 46

Class

BaseFlowTest
Basic flow tests.

Namespace

Drupal\Tests\tmgmt_smartling\Functional

Code

public function testRequestTranslationWhenOneProviderAvailable() {
  if (!empty($this->smartlingPluginProviderSettings)) {
    $this
      ->drupalPostForm('/admin/tmgmt/translators/manage/smartling', $this->smartlingPluginProviderSettings, t('Save'));
    $this
      ->drupalPostForm('/admin/tmgmt/translators/manage/local/delete', [], t('Delete'));
    $this
      ->drupalPostForm('/admin/tmgmt/translators/manage/file/delete', [], t('Delete'));
    $this
      ->drupalPostForm('/admin/tmgmt/translators/manage/test_translator/delete', [], t('Delete'));
    $this
      ->drupalPostForm('/admin/tmgmt/sources', [
      'items[1]' => 1,
      'target_language' => 'de',
    ], t('Request translation'));
    $this
      ->assertText('One job needs to be checked out.');
    $this
      ->assertText('Create new job');
    $this
      ->assertText('Add to job');
  }
  else {
    $this
      ->fail("Smartling settings file for simpletests not found.");
  }
}