protected function LingotekTaxonomyTermLongTitleTranslationTest::setUp in Lingotek Translation 3.8.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekTaxonomyTermLongTitleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekTaxonomyTermLongTitleTranslationTest::setUp()
- 4.0.x tests/src/Functional/LingotekTaxonomyTermLongTitleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekTaxonomyTermLongTitleTranslationTest::setUp()
- 3.0.x tests/src/Functional/LingotekTaxonomyTermLongTitleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekTaxonomyTermLongTitleTranslationTest::setUp()
- 3.1.x tests/src/Functional/LingotekTaxonomyTermLongTitleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekTaxonomyTermLongTitleTranslationTest::setUp()
- 3.2.x tests/src/Functional/LingotekTaxonomyTermLongTitleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekTaxonomyTermLongTitleTranslationTest::setUp()
- 3.3.x tests/src/Functional/LingotekTaxonomyTermLongTitleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekTaxonomyTermLongTitleTranslationTest::setUp()
- 3.4.x tests/src/Functional/LingotekTaxonomyTermLongTitleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekTaxonomyTermLongTitleTranslationTest::setUp()
- 3.5.x tests/src/Functional/LingotekTaxonomyTermLongTitleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekTaxonomyTermLongTitleTranslationTest::setUp()
- 3.6.x tests/src/Functional/LingotekTaxonomyTermLongTitleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekTaxonomyTermLongTitleTranslationTest::setUp()
- 3.7.x tests/src/Functional/LingotekTaxonomyTermLongTitleTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekTaxonomyTermLongTitleTranslationTest::setUp()
Overrides LingotekTestBase::setUp
File
- tests/
src/ Functional/ LingotekTaxonomyTermLongTitleTranslationTest.php, line 41
Class
- LingotekTaxonomyTermLongTitleTranslationTest
- Tests translating a taxonomy term with a very long title that doesn't fit.
Namespace
Drupal\Tests\lingotek\FunctionalCode
protected function setUp() : void {
parent::setUp();
// Place the actions and title block.
$this
->drupalPlaceBlock('local_tasks_block');
$this
->drupalPlaceBlock('page_title_block');
// Create Article node types.
$this->vocabulary = $this
->createVocabulary();
// Add a language.
ConfigurableLanguage::createFromLangcode('es')
->save();
// Enable translation for the current entity type and ensure the change is
// picked up.
ContentLanguageSettings::loadByEntityTypeBundle('taxonomy_term', $this->vocabulary
->id())
->setLanguageAlterable(TRUE)
->save();
\Drupal::service('content_translation.manager')
->setEnabled('taxonomy_term', $this->vocabulary
->id(), TRUE);
$this
->applyEntityUpdates();
// Rebuild the container so that the new languages are picked up by services
// that hold a list of languages.
$this
->rebuildContainer();
$bundle = $this->vocabulary
->id();
$this
->saveLingotekContentTranslationSettings([
'taxonomy_term' => [
$bundle => [
'profiles' => 'automatic',
'fields' => [
'name' => 1,
'description' => 1,
],
],
],
]);
// This is a hack for avoiding writing different lingotek endpoint mocks.
\Drupal::state()
->set('lingotek.uploaded_content_type', 'taxonomy_term_long_title');
}