You are here

protected function LingotekTestBase::assertTargetStatus in Lingotek Translation 3.6.x

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

Assert that a content target has the given status.

Parameters

string $language: The target language.

string $status: The status.

136 calls to LingotekTestBase::assertTargetStatus()
LingotekConfigBulkProfileTest::testChangeTranslationProfileBulkAfterCancelling in tests/src/Functional/LingotekConfigBulkProfileTest.php
Tests that the translation profiles can be updated with the bulk actions after cancelling.
LingotekConfigEntityTranslationEditedToPendingTest::testConfigEntityStatusDownloadTarget in tests/src/Functional/LingotekConfigEntityTranslationEditedToPendingTest.php
Tests that a config can be translated using the links on the management page.
LingotekConfigStatusDownloadTargetTest::testConfigStatusDownloadTarget in tests/src/Functional/LingotekConfigStatusDownloadTargetTest.php
Tests that a config can be translated using the links on the management page.
LingotekConfigTranslationEditedToPendingTest::testConfigStatusDownloadTarget in tests/src/Functional/LingotekConfigTranslationEditedToPendingTest.php
Tests that a config can be translated using the links on the management page.
LingotekContentModerationTest::testDownloadWhenContentModerationWasSetupAfterLingotek in tests/src/Functional/LingotekContentModerationTest.php

... See full list

File

tests/src/Functional/LingotekTestBase.php, line 441

Class

LingotekTestBase
Base class for Lingotek test. Performs authorization of the account.

Namespace

Drupal\Tests\lingotek\Functional

Code

protected function assertTargetStatus($language, $status) {
  $status_target = $this
    ->xpath("//a[contains(@class,'language-icon') and contains(@class,'target-" . strtolower($status) . "')  and contains(text(), '" . strtoupper($language) . "')]");

  // If not found, maybe it didn't have a link.
  if (count($status_target) === 1) {
    $this
      ->assertEqual(count($status_target), 1, 'The target ' . strtoupper($language) . ' has been marked with status ' . strtolower($status) . '.');
  }
  elseif (count($status_target) > 1) {
    $this
      ->assertTrue(TRUE, 'The target ' . strtoupper($language) . ' has been marked with status ' . strtolower($status) . '.');
  }
  else {
    $status_target = $this
      ->xpath("//span[contains(@class,'language-icon') and contains(@class,'target-" . strtolower($status) . "')  and contains(text(), '" . strtoupper($language) . "')]");
    $this
      ->assertEqual(count($status_target), 1, 'The target ' . strtoupper($language) . ' has been marked with status ' . strtolower($status) . '.');
  }
}