You are here

protected function LingotekFieldBodyBulkCancelTest::createAndTranslateFieldWithLinks in Lingotek Translation 3.2.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/LingotekFieldBodyBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkCancelTest::createAndTranslateFieldWithLinks()
  2. 4.0.x tests/src/Functional/LingotekFieldBodyBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkCancelTest::createAndTranslateFieldWithLinks()
  3. 3.0.x tests/src/Functional/LingotekFieldBodyBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkCancelTest::createAndTranslateFieldWithLinks()
  4. 3.1.x tests/src/Functional/LingotekFieldBodyBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkCancelTest::createAndTranslateFieldWithLinks()
  5. 3.3.x tests/src/Functional/LingotekFieldBodyBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkCancelTest::createAndTranslateFieldWithLinks()
  6. 3.4.x tests/src/Functional/LingotekFieldBodyBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkCancelTest::createAndTranslateFieldWithLinks()
  7. 3.5.x tests/src/Functional/LingotekFieldBodyBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkCancelTest::createAndTranslateFieldWithLinks()
  8. 3.6.x tests/src/Functional/LingotekFieldBodyBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkCancelTest::createAndTranslateFieldWithLinks()
  9. 3.7.x tests/src/Functional/LingotekFieldBodyBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkCancelTest::createAndTranslateFieldWithLinks()
  10. 3.8.x tests/src/Functional/LingotekFieldBodyBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkCancelTest::createAndTranslateFieldWithLinks()
2 calls to LingotekFieldBodyBulkCancelTest::createAndTranslateFieldWithLinks()
LingotekFieldBodyBulkCancelTest::testFieldCancel in tests/src/Functional/LingotekFieldBodyBulkCancelTest.php
Tests that a field config can be cancelled using the bulk operations on the management page.
LingotekFieldBodyBulkCancelTest::testFieldCancelTarget in tests/src/Functional/LingotekFieldBodyBulkCancelTest.php
Tests that a field config target can be cancelled using the bulk operations on the management page.

File

tests/src/Functional/LingotekFieldBodyBulkCancelTest.php, line 138

Class

LingotekFieldBodyBulkCancelTest
Tests cancelling a field using the bulk management form.

Namespace

Drupal\Tests\lingotek\Functional

Code

protected function createAndTranslateFieldWithLinks() {
  $assert_session = $this
    ->assertSession();

  // Go to the bulk config management page.
  $this
    ->goToConfigBulkManagementForm('node_fields');
  $basepath = \Drupal::request()
    ->getBasePath();
  $assert_session
    ->linkByHrefExists($basepath . '/admin/lingotek/config/upload/field_config/node.article.body?destination=' . $basepath . '/admin/lingotek/config/manage');

  // Clicking English must init the upload of content.
  $this
    ->clickLink('EN');
  $this
    ->assertText(t('Body uploaded successfully'));

  // There is a link for checking status.
  $this
    ->clickLink('EN');
  $this
    ->assertText('Body status checked successfully');
  $assert_session
    ->linkByHrefExists($basepath . '/admin/lingotek/config/request/field_config/node.article.body/es_ES?destination=' . $basepath . '/admin/lingotek/config/manage');

  // Request the Spanish translation.
  $this
    ->clickLink('ES');
  $this
    ->assertText("Translation to es_ES requested successfully");

  // Check status of the Spanish translation.
  $this
    ->clickLink('ES');
  $this
    ->assertText("Translation to es_ES status checked successfully");

  // Download the Spanish translation.
  $this
    ->clickLink('ES');
  $this
    ->assertText('Translation to es_ES downloaded successfully');
}