You are here

public function LingotekSystemSiteBulkLocaleTranslationTest::testSourceUpdatedAfterRequestingTranslation in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/LingotekSystemSiteBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekSystemSiteBulkLocaleTranslationTest::testSourceUpdatedAfterRequestingTranslation()
  2. 4.0.x tests/src/Functional/LingotekSystemSiteBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekSystemSiteBulkLocaleTranslationTest::testSourceUpdatedAfterRequestingTranslation()
  3. 3.0.x tests/src/Functional/LingotekSystemSiteBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekSystemSiteBulkLocaleTranslationTest::testSourceUpdatedAfterRequestingTranslation()
  4. 3.1.x tests/src/Functional/LingotekSystemSiteBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekSystemSiteBulkLocaleTranslationTest::testSourceUpdatedAfterRequestingTranslation()
  5. 3.2.x tests/src/Functional/LingotekSystemSiteBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekSystemSiteBulkLocaleTranslationTest::testSourceUpdatedAfterRequestingTranslation()
  6. 3.3.x tests/src/Functional/LingotekSystemSiteBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekSystemSiteBulkLocaleTranslationTest::testSourceUpdatedAfterRequestingTranslation()
  7. 3.5.x tests/src/Functional/LingotekSystemSiteBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekSystemSiteBulkLocaleTranslationTest::testSourceUpdatedAfterRequestingTranslation()
  8. 3.6.x tests/src/Functional/LingotekSystemSiteBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekSystemSiteBulkLocaleTranslationTest::testSourceUpdatedAfterRequestingTranslation()
  9. 3.7.x tests/src/Functional/LingotekSystemSiteBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekSystemSiteBulkLocaleTranslationTest::testSourceUpdatedAfterRequestingTranslation()
  10. 3.8.x tests/src/Functional/LingotekSystemSiteBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekSystemSiteBulkLocaleTranslationTest::testSourceUpdatedAfterRequestingTranslation()

Tests that source is updated after requesting translation.

File

tests/src/Functional/LingotekSystemSiteBulkLocaleTranslationTest.php, line 102

Class

LingotekSystemSiteBulkLocaleTranslationTest
Tests translating a config file into locales using the bulk management form.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testSourceUpdatedAfterRequestingTranslation() {
  $assert_session = $this
    ->assertSession();

  // Login as admin.
  $this
    ->drupalLogin($this->rootUser);

  // Go to the bulk config management page.
  $this
    ->goToConfigBulkManagementForm();
  $basepath = \Drupal::request()
    ->getBasePath();

  // Upload it
  $this
    ->clickLink('EN', 1);
  $this
    ->assertText(t('System information uploaded successfully'));

  // There is a link for checking status.
  $assert_session
    ->linkByHrefExists($basepath . '/admin/lingotek/config/check_upload/system.site_information_settings/system.site_information_settings?destination=' . $basepath . '/admin/lingotek/config/manage');

  // And we can already request a translation.
  $assert_session
    ->linkByHrefExists($basepath . '/admin/lingotek/config/request/system.site_information_settings/system.site_information_settings/de_AT?destination=' . $basepath . '/admin/lingotek/config/manage');

  // Request the German (AT) translation.
  $assert_session
    ->linkByHrefExists($basepath . '/admin/lingotek/config/request/system.site_information_settings/system.site_information_settings/de_AT?destination=' . $basepath . '/admin/lingotek/config/manage');
  $this
    ->clickLink('DE-AT');
  $this
    ->assertText("Translation to de_AT requested successfully");

  // Check that the source status has been updated.
  $assert_session
    ->linkByHrefNotExists($basepath . '/admin/lingotek/config/check_upload/system.site_information_settings/system.site_information_settings?destination=' . $basepath . '/admin/lingotek/config/manage');
}