You are here

protected function LingotekManagementTestTrait::assertNoLingotekRequestTranslationLink in Lingotek Translation 3.6.x

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

Asserts there is NOT a link for requesting translation for a given locale.

Parameters

string $locale: The locale.

string $document_id: The Lingotek document ID. Optional, defaults to 'dummy-document-hash-id'.

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

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

41 calls to LingotekManagementTestTrait::assertNoLingotekRequestTranslationLink()
ChineseBulkTranslationTest::testNodeTranslationUsingLinks in tests/src/Functional/ChineseBulkTranslationTest.php
Tests that a node can be translated using the links on the management page.
LingotekConfigBulkFormTest::testDisabledLanguage in tests/src/Functional/Form/LingotekConfigBulkFormTest.php
Tests that the config bulk form doesn't show a language if it's disabled.
LingotekContentTypeBulkTranslationTest::testRequestAllTranslationsWithActionWithADocumentArchivedError in tests/src/Functional/LingotekContentTypeBulkTranslationTest.php
Tests that we manage errors when using the request all translations action.
LingotekContentTypeBulkTranslationTest::testRequestTranslationWithActionWithADocumentArchivedError in tests/src/Functional/LingotekContentTypeBulkTranslationTest.php
Tests that we manage errors when using the request translation action.
LingotekContentTypeBulkTranslationTest::testRequestTranslationWithADocumentArchivedError in tests/src/Functional/LingotekContentTypeBulkTranslationTest.php
Tests that we manage errors when using the request translation link.

... See full list

File

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

Class

LingotekManagementTestTrait
Trait with Lingotek management form helpers.

Namespace

Drupal\Tests\lingotek\Functional

Code

protected function assertNoLingotekRequestTranslationLink($locale, $document_id = 'dummy-document-hash-id', $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/add_target/' . $document_id . '/' . $locale;
  if ($destination = $this
    ->getDestination($destination_entity_type_id, $prefix)) {
    $href .= $destination;
  }
  $this
    ->assertNoLinkByHref($href);
}