You are here

protected function LingotekTestBase::assertNoSourceStatus in Lingotek Translation 3.1.x

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

Assert that a content source has not the given status.

Parameters

string $language: The target language.

string $status: The status.

3 calls to LingotekTestBase::assertNoSourceStatus()
LingotekNodeBulkTranslationTest::testCheckSourceStatusActionWithAnError in tests/src/Functional/LingotekNodeBulkTranslationTest.php
Tests that we manage errors when using the Check Source action.
LingotekNodeBulkTranslationTest::testCheckSourceStatusWithAnError in tests/src/Functional/LingotekNodeBulkTranslationTest.php
Tests that we manage errors when using the Check Source link.
LingotekNotEnabledNodeBulkTranslationTest::testNodeTranslationUsingLinks in tests/src/Functional/LingotekNotEnabledNodeBulkTranslationTest.php
Tests that a node can be translated using the links on the management page.

File

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

Class

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

Namespace

Drupal\Tests\lingotek\Functional

Code

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

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