protected function LingotekWorkbenchModerationSettingsTest::setUp in Lingotek Translation 3.5.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekWorkbenchModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationSettingsTest::setUp()
- 4.0.x tests/src/Functional/LingotekWorkbenchModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationSettingsTest::setUp()
- 3.1.x tests/src/Functional/LingotekWorkbenchModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationSettingsTest::setUp()
- 3.2.x tests/src/Functional/LingotekWorkbenchModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationSettingsTest::setUp()
- 3.3.x tests/src/Functional/LingotekWorkbenchModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationSettingsTest::setUp()
- 3.4.x tests/src/Functional/LingotekWorkbenchModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationSettingsTest::setUp()
- 3.6.x tests/src/Functional/LingotekWorkbenchModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationSettingsTest::setUp()
- 3.7.x tests/src/Functional/LingotekWorkbenchModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationSettingsTest::setUp()
- 3.8.x tests/src/Functional/LingotekWorkbenchModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationSettingsTest::setUp()
Overrides LingotekTestBase::setUp
File
- tests/
src/ Functional/ LingotekWorkbenchModerationSettingsTest.php, line 34
Class
- LingotekWorkbenchModerationSettingsTest
- Tests setting up the integration with workbench moderation.
Namespace
Drupal\Tests\lingotek\FunctionalCode
protected function setUp() : void {
parent::setUp();
$this
->drupalCreateContentType([
'type' => 'article',
'name' => 'Article',
]);
$this
->drupalCreateContentType([
'type' => 'page',
'name' => 'Page',
]);
$this->vocabulary = $this
->createVocabulary();
// Add a language.
ConfigurableLanguage::createFromLangcode('es')
->setThirdPartySetting('lingotek', 'locale', 'es_MX')
->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);
ContentLanguageSettings::loadByEntityTypeBundle('node', 'page')
->setLanguageAlterable(TRUE)
->save();
\Drupal::service('content_translation.manager')
->setEnabled('node', 'page', TRUE);
ContentLanguageSettings::loadByEntityTypeBundle('user', 'user')
->setLanguageAlterable(TRUE)
->save();
\Drupal::service('content_translation.manager')
->setEnabled('user', 'user', TRUE);
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();
}