protected function LingotekWorkbenchModerationCustomMenuLinkTest::setUp in Lingotek Translation 8.2
Same name and namespace in other branches
- 4.0.x tests/src/Functional/LingotekWorkbenchModerationCustomMenuLinkTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationCustomMenuLinkTest::setUp()
- 3.1.x tests/src/Functional/LingotekWorkbenchModerationCustomMenuLinkTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationCustomMenuLinkTest::setUp()
- 3.2.x tests/src/Functional/LingotekWorkbenchModerationCustomMenuLinkTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationCustomMenuLinkTest::setUp()
- 3.3.x tests/src/Functional/LingotekWorkbenchModerationCustomMenuLinkTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationCustomMenuLinkTest::setUp()
- 3.4.x tests/src/Functional/LingotekWorkbenchModerationCustomMenuLinkTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationCustomMenuLinkTest::setUp()
- 3.5.x tests/src/Functional/LingotekWorkbenchModerationCustomMenuLinkTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationCustomMenuLinkTest::setUp()
- 3.6.x tests/src/Functional/LingotekWorkbenchModerationCustomMenuLinkTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationCustomMenuLinkTest::setUp()
- 3.7.x tests/src/Functional/LingotekWorkbenchModerationCustomMenuLinkTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationCustomMenuLinkTest::setUp()
- 3.8.x tests/src/Functional/LingotekWorkbenchModerationCustomMenuLinkTest.php \Drupal\Tests\lingotek\Functional\LingotekWorkbenchModerationCustomMenuLinkTest::setUp()
Overrides LingotekTestBase::setUp
File
- tests/
src/ Functional/ LingotekWorkbenchModerationCustomMenuLinkTest.php, line 24
Class
- LingotekWorkbenchModerationCustomMenuLinkTest
- Tests setting up the integration with workbench moderation.
Namespace
Drupal\Tests\lingotek\FunctionalCode
protected function setUp() {
parent::setUp();
// Place the actions and title block.
$this
->drupalPlaceBlock('page_title_block', [
'region' => 'content',
'weight' => -5,
]);
$this
->drupalPlaceBlock('local_tasks_block', [
'region' => 'content',
'weight' => -10,
]);
// 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('menu_link_content', 'menu_link_content')
->setLanguageAlterable(TRUE)
->save();
\Drupal::service('content_translation.manager')
->setEnabled('menu_link_content', 'menu_link_content', 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([
'menu_link_content' => [
'menu_link_content' => [
'profiles' => 'automatic',
'fields' => [
'title' => 1,
'description' => 1,
],
],
],
]);
}