You are here

protected function LingotekFieldBodyBulkTranslationTest::assertLingotekUploadLink in Lingotek Translation 3.6.x

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

Asserts there is a link for uploading the content.

Parameters

int|string $entity_id: The entity ID. Optional, defaults to 1.

string $entity_type_id: The entity type ID. Optional, defaults to node.

string|null $prefix: Language prefix if any. Optional, defaults to NULL.

Overrides LingotekManagementTestTrait::assertLingotekUploadLink

12 calls to LingotekFieldBodyBulkTranslationTest::assertLingotekUploadLink()
LingotekFieldBodyBulkTranslationTest::testRequestAllTranslationsWithActionWithADocumentArchivedError in tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php
Tests that we manage errors when using the request all translations action.
LingotekFieldBodyBulkTranslationTest::testRequestAllTranslationsWithActionWithADocumentLockedError in tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php
Tests that we manage errors when using the request all translations action.
LingotekFieldBodyBulkTranslationTest::testRequestAllTranslationsWithActionWithAnError in tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php
Tests that we manage errors when using the request all translations action.
LingotekFieldBodyBulkTranslationTest::testRequestAllTranslationsWithActionWithAPaymentRequiredError in tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php
Tests that we manage errors when using the request all translations action.
LingotekFieldBodyBulkTranslationTest::testRequestTranslationWithActionWithADocumentArchivedError in tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php
Tests that we manage errors when using the request translation action.

... See full list

File

tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php, line 1645

Class

LingotekFieldBodyBulkTranslationTest
Tests translating a field using the bulk management form.

Namespace

Drupal\Tests\lingotek\Functional

Code

protected function assertLingotekUploadLink($entity_id = 'node.article.body', $entity_type_id = 'field_config', $prefix = NULL, $destination_entity_type_id = NULL, $destination_entity_id = NULL) {
  $assert_session = $this
    ->assertSession();
  $basepath = \Drupal::request()
    ->getBasePath();
  $languagePrefix = $prefix === NULL ? '' : '/' . $prefix;
  $destination_entity_type_id = $destination_entity_type_id ?: $entity_type_id;
  $href = $basepath . $languagePrefix . '/admin/lingotek/config/upload/' . $entity_type_id . '/' . $entity_id;
  if ($destination = $this
    ->getDestination($destination_entity_type_id, $prefix)) {
    $href .= $destination;
  }
  $assert_session
    ->linkByHrefExists($href);
}