protected function LingotekSettingsTabParagraphsIntegrationFormTest::setUp in Lingotek Translation 3.2.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/Form/LingotekSettingsTabParagraphsIntegrationFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabParagraphsIntegrationFormTest::setUp()
- 4.0.x tests/src/Functional/Form/LingotekSettingsTabParagraphsIntegrationFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabParagraphsIntegrationFormTest::setUp()
- 3.0.x tests/src/Functional/Form/LingotekSettingsTabParagraphsIntegrationFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabParagraphsIntegrationFormTest::setUp()
- 3.1.x tests/src/Functional/Form/LingotekSettingsTabParagraphsIntegrationFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabParagraphsIntegrationFormTest::setUp()
- 3.3.x tests/src/Functional/Form/LingotekSettingsTabParagraphsIntegrationFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabParagraphsIntegrationFormTest::setUp()
- 3.4.x tests/src/Functional/Form/LingotekSettingsTabParagraphsIntegrationFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabParagraphsIntegrationFormTest::setUp()
- 3.5.x tests/src/Functional/Form/LingotekSettingsTabParagraphsIntegrationFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabParagraphsIntegrationFormTest::setUp()
- 3.6.x tests/src/Functional/Form/LingotekSettingsTabParagraphsIntegrationFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabParagraphsIntegrationFormTest::setUp()
- 3.7.x tests/src/Functional/Form/LingotekSettingsTabParagraphsIntegrationFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabParagraphsIntegrationFormTest::setUp()
- 3.8.x tests/src/Functional/Form/LingotekSettingsTabParagraphsIntegrationFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekSettingsTabParagraphsIntegrationFormTest::setUp()
Overrides LingotekTestBase::setUp
File
- tests/
src/ Functional/ Form/ LingotekSettingsTabParagraphsIntegrationFormTest.php, line 39
Class
- LingotekSettingsTabParagraphsIntegrationFormTest
- Tests the Lingotek integrations settings form with paragraphs.
Namespace
Drupal\Tests\lingotek\Functional\FormCode
protected function setUp() : void {
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,
]);
// Create Article node types.
$this
->drupalCreateContentType([
'type' => 'article',
'name' => 'Article',
]);
$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();
ContentLanguageSettings::loadByEntityTypeBundle('taxonomy_term', $this->vocabulary
->id())
->setLanguageAlterable(TRUE)
->save();
ContentLanguageSettings::loadByEntityTypeBundle('paragraph', 'image_text')
->setLanguageAlterable(TRUE)
->save();
\Drupal::service('content_translation.manager')
->setEnabled('node', 'article', TRUE);
\Drupal::service('content_translation.manager')
->setEnabled('paragraph', 'image_text', TRUE);
\Drupal::service('content_translation.manager')
->setEnabled('taxonomy_term', $this->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' => 'automatic',
'fields' => [
'title' => 1,
'body' => 1,
],
],
],
'paragraph' => [
'image_text' => [
'fields' => [
'field_image_demo' => [
'title',
'alt',
],
'field_text_demo' => 1,
],
],
],
]);
// Login as admin.
$this
->drupalLogin($this->rootUser);
}