protected function RenderElementTypesTest::setUp in Lingotek Translation 3.7.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/Render/Element/RenderElementTypesTest.php \Drupal\Tests\lingotek\Functional\Render\Element\RenderElementTypesTest::setUp()
- 4.0.x tests/src/Functional/Render/Element/RenderElementTypesTest.php \Drupal\Tests\lingotek\Functional\Render\Element\RenderElementTypesTest::setUp()
- 3.0.x tests/src/Functional/Render/Element/RenderElementTypesTest.php \Drupal\Tests\lingotek\Functional\Render\Element\RenderElementTypesTest::setUp()
- 3.1.x tests/src/Functional/Render/Element/RenderElementTypesTest.php \Drupal\Tests\lingotek\Functional\Render\Element\RenderElementTypesTest::setUp()
- 3.2.x tests/src/Functional/Render/Element/RenderElementTypesTest.php \Drupal\Tests\lingotek\Functional\Render\Element\RenderElementTypesTest::setUp()
- 3.3.x tests/src/Functional/Render/Element/RenderElementTypesTest.php \Drupal\Tests\lingotek\Functional\Render\Element\RenderElementTypesTest::setUp()
- 3.4.x tests/src/Functional/Render/Element/RenderElementTypesTest.php \Drupal\Tests\lingotek\Functional\Render\Element\RenderElementTypesTest::setUp()
- 3.5.x tests/src/Functional/Render/Element/RenderElementTypesTest.php \Drupal\Tests\lingotek\Functional\Render\Element\RenderElementTypesTest::setUp()
- 3.6.x tests/src/Functional/Render/Element/RenderElementTypesTest.php \Drupal\Tests\lingotek\Functional\Render\Element\RenderElementTypesTest::setUp()
- 3.8.x tests/src/Functional/Render/Element/RenderElementTypesTest.php \Drupal\Tests\lingotek\Functional\Render\Element\RenderElementTypesTest::setUp()
Overrides LingotekTestBase::setUp
File
- tests/
src/ Functional/ Render/ Element/ RenderElementTypesTest.php, line 26
Class
- RenderElementTypesTest
- Tests the markup of lingotek render element types passed to \Drupal::service('renderer')->render().
Namespace
Drupal\Tests\lingotek\Functional\Render\ElementCode
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
->drupalCreateContentType([
'type' => 'article',
'name' => 'Article',
]);
// Add locales.
ConfigurableLanguage::createFromLangcode('es')
->setThirdPartySetting('lingotek', 'locale', 'es_ES')
->save();
ConfigurableLanguage::createFromLangcode('de')
->setThirdPartySetting('lingotek', 'locale', 'de_DE')
->save();
ConfigurableLanguage::createFromLangcode('ca')
->setThirdPartySetting('lingotek', 'locale', 'ca_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([
'article',
], 'manual');
}