public function LingotekFieldBodyTranslationTest::testEditedFieldBodyTranslation in Lingotek Translation 3.1.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testEditedFieldBodyTranslation()
- 4.0.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testEditedFieldBodyTranslation()
- 3.0.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testEditedFieldBodyTranslation()
- 3.2.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testEditedFieldBodyTranslation()
- 3.3.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testEditedFieldBodyTranslation()
- 3.4.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testEditedFieldBodyTranslation()
- 3.5.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testEditedFieldBodyTranslation()
- 3.6.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testEditedFieldBodyTranslation()
- 3.7.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testEditedFieldBodyTranslation()
- 3.8.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testEditedFieldBodyTranslation()
Tests that a config can be translated after edited.
File
- tests/
src/ Functional/ LingotekFieldBodyTranslationTest.php, line 110
Class
- LingotekFieldBodyTranslationTest
- Tests translating a field.
Namespace
Drupal\Tests\lingotek\FunctionalCode
public function testEditedFieldBodyTranslation() {
$assert_session = $this
->assertSession();
// We need a config with translations first.
$this
->testFieldTranslation();
// Add a language so we can check that it's not marked as dirty if there are
// no translations.
ConfigurableLanguage::createFromLangcode('eu')
->setThirdPartySetting('lingotek', 'locale', 'eu_ES')
->save();
// Edit the field.
$edit = [
'label' => 'Contents',
];
$this
->drupalPostForm('/admin/structure/types/manage/article/fields/node.article.body', $edit, t('Save settings'));
$this
->assertText('Saved Contents configuration.');
$this
->clickLink(t('Translate'));
// Check the status is not edited for Vasque, but available to request
// translation.
$assert_session
->linkByHrefExists('/admin/lingotek/config/request/node_fields/node.article.body/eu_ES');
$assert_session
->linkByHrefNotExists('/admin/lingotek/config/request/node_fields/node.article.body/es_MX');
// Recheck status.
$this
->clickLink('Check Download');
$this
->assertText('Translation to es_MX status checked successfully');
// Download the translation.
$this
->clickLink('Download');
$this
->assertText('Translation to es_MX downloaded successfully');
}