protected function LingotekUtilitiesDisassociateAllDocumentsTest::setUp in Lingotek Translation 4.0.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekUtilitiesDisassociateAllDocumentsTest.php \Drupal\Tests\lingotek\Functional\LingotekUtilitiesDisassociateAllDocumentsTest::setUp()
- 3.0.x tests/src/Functional/LingotekUtilitiesDisassociateAllDocumentsTest.php \Drupal\Tests\lingotek\Functional\LingotekUtilitiesDisassociateAllDocumentsTest::setUp()
- 3.1.x tests/src/Functional/LingotekUtilitiesDisassociateAllDocumentsTest.php \Drupal\Tests\lingotek\Functional\LingotekUtilitiesDisassociateAllDocumentsTest::setUp()
- 3.2.x tests/src/Functional/LingotekUtilitiesDisassociateAllDocumentsTest.php \Drupal\Tests\lingotek\Functional\LingotekUtilitiesDisassociateAllDocumentsTest::setUp()
- 3.3.x tests/src/Functional/LingotekUtilitiesDisassociateAllDocumentsTest.php \Drupal\Tests\lingotek\Functional\LingotekUtilitiesDisassociateAllDocumentsTest::setUp()
- 3.4.x tests/src/Functional/LingotekUtilitiesDisassociateAllDocumentsTest.php \Drupal\Tests\lingotek\Functional\LingotekUtilitiesDisassociateAllDocumentsTest::setUp()
- 3.5.x tests/src/Functional/LingotekUtilitiesDisassociateAllDocumentsTest.php \Drupal\Tests\lingotek\Functional\LingotekUtilitiesDisassociateAllDocumentsTest::setUp()
- 3.6.x tests/src/Functional/LingotekUtilitiesDisassociateAllDocumentsTest.php \Drupal\Tests\lingotek\Functional\LingotekUtilitiesDisassociateAllDocumentsTest::setUp()
- 3.7.x tests/src/Functional/LingotekUtilitiesDisassociateAllDocumentsTest.php \Drupal\Tests\lingotek\Functional\LingotekUtilitiesDisassociateAllDocumentsTest::setUp()
- 3.8.x tests/src/Functional/LingotekUtilitiesDisassociateAllDocumentsTest.php \Drupal\Tests\lingotek\Functional\LingotekUtilitiesDisassociateAllDocumentsTest::setUp()
Overrides LingotekTestBase::setUp
File
- tests/
src/ Functional/ LingotekUtilitiesDisassociateAllDocumentsTest.php, line 36
Class
- LingotekUtilitiesDisassociateAllDocumentsTest
- Tests disassociating all site documents.
Namespace
Drupal\Tests\lingotek\FunctionalCode
protected function setUp() : void {
parent::setUp();
// Create Article node types.
$this
->drupalCreateContentType([
'type' => 'article',
'name' => 'Article',
]);
$this->vocabulary = $this
->createVocabulary();
$vocabulary_id = $this->vocabulary
->id();
// Add a language.
ConfigurableLanguage::createFromLangcode('es')
->save();
// Enable translation for the articles and our vocabulary and ensure the
// change is picked up.
ContentLanguageSettings::loadByEntityTypeBundle('node', 'article')
->setLanguageAlterable(TRUE)
->save();
\Drupal::service('content_translation.manager')
->setEnabled('node', 'article', TRUE);
ContentLanguageSettings::loadByEntityTypeBundle('taxonomy_term', $vocabulary_id)
->setLanguageAlterable(TRUE)
->save();
\Drupal::service('content_translation.manager')
->setEnabled('taxonomy_term', $vocabulary_id, 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
->saveLingotekContentTranslationSettings([
'node' => [
'article' => [
'profiles' => 'manual',
'fields' => [
'title' => 1,
'body' => 1,
],
],
],
'taxonomy_term' => [
$vocabulary_id => [
'profiles' => 'manual',
'fields' => [
'name' => 1,
'description' => 1,
],
],
],
]);
$this
->saveLingotekConfigTranslationSettings([
'node_type' => 'manual',
]);
$this
->translateNodeWithLinks();
$this
->translateTermWithLinks();
$this
->translateSystemSiteConfig();
$this
->translateArticleContentType();
}