protected function LingotekTestBase::assertTargetStatus in Lingotek Translation 3.6.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertTargetStatus()
- 4.0.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertTargetStatus()
- 3.0.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertTargetStatus()
- 3.1.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertTargetStatus()
- 3.2.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertTargetStatus()
- 3.3.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertTargetStatus()
- 3.4.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertTargetStatus()
- 3.5.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertTargetStatus()
- 3.7.x tests/src/Functional/LingotekTestBase.php \Drupal\Tests\lingotek\Functional\LingotekTestBase::assertTargetStatus()
- 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
File
- tests/
src/ Functional/ LingotekTestBase.php, line 441
Class
- LingotekTestBase
- Base class for Lingotek test. Performs authorization of the account.
Namespace
Drupal\Tests\lingotek\FunctionalCode
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) . '.');
}
}