protected function LingotekNodeBulkLocaleTranslationTest::setUp in Lingotek Translation 3.8.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekNodeBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkLocaleTranslationTest::setUp()
- 4.0.x tests/src/Functional/LingotekNodeBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkLocaleTranslationTest::setUp()
- 3.0.x tests/src/Functional/LingotekNodeBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkLocaleTranslationTest::setUp()
- 3.1.x tests/src/Functional/LingotekNodeBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkLocaleTranslationTest::setUp()
- 3.2.x tests/src/Functional/LingotekNodeBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkLocaleTranslationTest::setUp()
- 3.3.x tests/src/Functional/LingotekNodeBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkLocaleTranslationTest::setUp()
- 3.4.x tests/src/Functional/LingotekNodeBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkLocaleTranslationTest::setUp()
- 3.5.x tests/src/Functional/LingotekNodeBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkLocaleTranslationTest::setUp()
- 3.6.x tests/src/Functional/LingotekNodeBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkLocaleTranslationTest::setUp()
- 3.7.x tests/src/Functional/LingotekNodeBulkLocaleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkLocaleTranslationTest::setUp()
Overrides LingotekTestBase::setUp
1 call to LingotekNodeBulkLocaleTranslationTest::setUp()
- LingotekNodeBulkViewsLocaleTranslationTest::setUp in tests/
src/ Functional/ Views/ LingotekNodeBulkViewsLocaleTranslationTest.php
1 method overrides LingotekNodeBulkLocaleTranslationTest::setUp()
- LingotekNodeBulkViewsLocaleTranslationTest::setUp in tests/
src/ Functional/ Views/ LingotekNodeBulkViewsLocaleTranslationTest.php
File
- tests/
src/ Functional/ LingotekNodeBulkLocaleTranslationTest.php, line 28
Class
- LingotekNodeBulkLocaleTranslationTest
- Tests translating a node into locales using the bulk management form.
Namespace
Drupal\Tests\lingotek\FunctionalCode
protected function setUp() : void {
parent::setUp();
// Create a locale outside of Lingotek dashboard.
ConfigurableLanguage::create([
'id' => 'de-at',
'name' => 'German (AT)',
])
->save();
// Create Article node types.
$this
->drupalCreateContentType([
'type' => 'article',
'name' => 'Article',
]);
// Add locales.
// Add locales.
ConfigurableLanguage::createFromLangcode('es')
->setThirdPartySetting('lingotek', 'locale', 'es_AR')
->save();
ConfigurableLanguage::createFromLangcode('es-es')
->setThirdPartySetting('lingotek', 'locale', 'es_ES')
->save();
// Enable translation for the current entity type and ensure the change is
// picked up.
ContentLanguageSettings::loadByEntityTypeBundle('node', 'article')
->setLanguageAlterable(TRUE)
->save();
\Drupal::service('content_translation.manager')
->setEnabled('node', 'article', TRUE);
drupal_static_reset();
\Drupal::entityTypeManager()
->clearCachedDefinitions();
$this
->applyEntityUpdates();
// Rebuild the container so that the new languages are picked up by services
// that hold a list of languages.
$this
->rebuildContainer();
$this
->saveLingotekContentTranslationSettingsForNodeTypes();
}