You are here

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

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

Tests that source is updated after requesting translation.

File

tests/src/Functional/LingotekContentTypeBulkLocaleTranslationTest.php, line 120

Class

LingotekContentTypeBulkLocaleTranslationTest
Tests translating a config entity 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('node_type');
  $basepath = \Drupal::request()
    ->getBasePath();

  // Upload it
  $this
    ->clickLink('EN');
  $this
    ->assertText(t('Article uploaded successfully'));

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

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

  // Request the German (AT) translation.
  $assert_session
    ->linkByHrefExists($basepath . '/admin/lingotek/config/request/node_type/article/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/node_type/article?destination=' . $basepath . '/admin/lingotek/config/manage');
}