You are here

protected function LingotekManagementTestTrait::assertLingotekUploadLink in Lingotek Translation 3.8.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/LingotekManagementTestTrait.php \Drupal\Tests\lingotek\Functional\LingotekManagementTestTrait::assertLingotekUploadLink()
  2. 4.0.x tests/src/Functional/LingotekManagementTestTrait.php \Drupal\Tests\lingotek\Functional\LingotekManagementTestTrait::assertLingotekUploadLink()
  3. 3.0.x tests/src/Functional/LingotekManagementTestTrait.php \Drupal\Tests\lingotek\Functional\LingotekManagementTestTrait::assertLingotekUploadLink()
  4. 3.1.x tests/src/Functional/LingotekManagementTestTrait.php \Drupal\Tests\lingotek\Functional\LingotekManagementTestTrait::assertLingotekUploadLink()
  5. 3.2.x tests/src/Functional/LingotekManagementTestTrait.php \Drupal\Tests\lingotek\Functional\LingotekManagementTestTrait::assertLingotekUploadLink()
  6. 3.3.x tests/src/Functional/LingotekManagementTestTrait.php \Drupal\Tests\lingotek\Functional\LingotekManagementTestTrait::assertLingotekUploadLink()
  7. 3.4.x tests/src/Functional/LingotekManagementTestTrait.php \Drupal\Tests\lingotek\Functional\LingotekManagementTestTrait::assertLingotekUploadLink()
  8. 3.5.x tests/src/Functional/LingotekManagementTestTrait.php \Drupal\Tests\lingotek\Functional\LingotekManagementTestTrait::assertLingotekUploadLink()
  9. 3.6.x tests/src/Functional/LingotekManagementTestTrait.php \Drupal\Tests\lingotek\Functional\LingotekManagementTestTrait::assertLingotekUploadLink()
  10. 3.7.x tests/src/Functional/LingotekManagementTestTrait.php \Drupal\Tests\lingotek\Functional\LingotekManagementTestTrait::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.

121 calls to LingotekManagementTestTrait::assertLingotekUploadLink()
ChineseBulkTranslationTest::testNodeTranslationUsingLinks in tests/src/Functional/ChineseBulkTranslationTest.php
Tests that a node can be translated using the links on the management page.
LingotekEntityTestBulkTranslationTest::testCheckSourceStatusNotCompleted in tests/src/Functional/LingotekEntityTestBulkTranslationTest.php
Tests that all the statuses are set when using the Check Translations action.
LingotekEntityTestBulkTranslationTest::testCheckTranslationsAction in tests/src/Functional/LingotekEntityTestBulkTranslationTest.php
Tests that all the statuses are set when using the Check Translations action.
LingotekEntityTestBulkTranslationTest::testCheckTranslationsWithDownloadedLocales in tests/src/Functional/LingotekEntityTestBulkTranslationTest.php
Tests that current locales are not cleared when checking statuses.
LingotekEntityTestBulkTranslationTest::testEntityTestTranslationUsingActions in tests/src/Functional/LingotekEntityTestBulkTranslationTest.php
Tests that a entity_test_mul can be translated using the actions on the management page.

... See full list

3 methods override LingotekManagementTestTrait::assertLingotekUploadLink()
LingotekContentTypeBulkTranslationTest::assertLingotekUploadLink in tests/src/Functional/LingotekContentTypeBulkTranslationTest.php
Asserts there is a link for uploading the content.
LingotekFieldBodyBulkTranslationTest::assertLingotekUploadLink in tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php
Asserts there is a link for uploading the content.
LingotekSystemSiteBulkTranslationTest::assertLingotekUploadLink in tests/src/Functional/LingotekSystemSiteBulkTranslationTest.php
Asserts there is a link for uploading the content.

File

tests/src/Functional/LingotekManagementTestTrait.php, line 20

Class

LingotekManagementTestTrait
Trait with Lingotek management form helpers.

Namespace

Drupal\Tests\lingotek\Functional

Code

protected function assertLingotekUploadLink($entity_id = 1, $entity_type_id = 'node', $prefix = NULL, $destination_entity_type_id = NULL, $destination_entity_id = NULL) {
  $basepath = \Drupal::request()
    ->getBasePath();
  $languagePrefix = $prefix === NULL ? '' : '/' . $prefix;
  $destination_entity_type_id = $destination_entity_type_id ?: $entity_type_id;
  $href = $basepath . $languagePrefix . '/admin/lingotek/entity/upload/' . $entity_type_id . '/' . $entity_id;
  if ($destination = $this
    ->getDestination($destination_entity_type_id, $prefix)) {
    $href .= $destination;
  }
  $this
    ->assertLinkByHref($href);
}