public function LingotekTranslationStatusFormatterTest::testStatusForMissingLanguage in Lingotek Translation 8.2
Same name and namespace in other branches
- 4.0.x tests/src/Functional/FieldFormatters/LingotekTranslationStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekTranslationStatusFormatterTest::testStatusForMissingLanguage()
- 3.0.x tests/src/Functional/FieldFormatters/LingotekTranslationStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekTranslationStatusFormatterTest::testStatusForMissingLanguage()
- 3.1.x tests/src/Functional/FieldFormatters/LingotekTranslationStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekTranslationStatusFormatterTest::testStatusForMissingLanguage()
- 3.2.x tests/src/Functional/FieldFormatters/LingotekTranslationStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekTranslationStatusFormatterTest::testStatusForMissingLanguage()
- 3.3.x tests/src/Functional/FieldFormatters/LingotekTranslationStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekTranslationStatusFormatterTest::testStatusForMissingLanguage()
- 3.4.x tests/src/Functional/FieldFormatters/LingotekTranslationStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekTranslationStatusFormatterTest::testStatusForMissingLanguage()
- 3.5.x tests/src/Functional/FieldFormatters/LingotekTranslationStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekTranslationStatusFormatterTest::testStatusForMissingLanguage()
- 3.6.x tests/src/Functional/FieldFormatters/LingotekTranslationStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekTranslationStatusFormatterTest::testStatusForMissingLanguage()
- 3.7.x tests/src/Functional/FieldFormatters/LingotekTranslationStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekTranslationStatusFormatterTest::testStatusForMissingLanguage()
- 3.8.x tests/src/Functional/FieldFormatters/LingotekTranslationStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekTranslationStatusFormatterTest::testStatusForMissingLanguage()
File
- tests/
src/ Functional/ FieldFormatters/ LingotekTranslationStatusFormatterTest.php, line 82
Class
- LingotekTranslationStatusFormatterTest
- Tests the Lingotek translation status field formatter.
Namespace
Drupal\Tests\lingotek\Functional\FieldFormattersCode
public function testStatusForMissingLanguage() {
$basepath = \Drupal::request()
->getBasePath();
// Create a node.
$edit = [];
$edit['title[0][value]'] = 'Llamas are cool';
$edit['body[0][value]'] = 'Llamas are very cool';
$edit['langcode[0][value]'] = 'en';
$edit['lingotek_translation_management[lingotek_translation_profile]'] = 'automatic';
$this
->saveAndPublishNodeForm($edit);
$this
->assertSession()
->addressEquals('/node/1');
$node = Node::load(1);
/** @var \Drupal\lingotek\LingotekContentTranslationServiceInterface $service */
$service = \Drupal::service('lingotek.content_translation');
$service
->setTargetStatus($node, 'nb_NO', Lingotek::STATUS_READY);
$this
->drupalGet('/metadata/1');
$this
->assertSession()
->responseContains('Lingotek translation status');
// ToDo: Can be changed when 8.7.x is not supported.
// $this->assertSession()->responseContains('<div><a href="' . $basepath . '/admin/lingotek/entity/add_target/dummy-document-hash-id/es_MX?destination=' . $basepath . '/metadata/1" class="language-icon target-request" title="Spanish - Request translation">ES</a></div>');
$this
->assertSession()
->responseContains('<div class="field__item"><a href="' . $basepath . '/admin/lingotek/entity/add_target/dummy-document-hash-id/es_MX?destination=' . $basepath . '/metadata/1" class="language-icon target-request" title="Spanish - Request translation">ES</a></div>');
}