protected function LingotekContactMessageBodyTranslationTest::setUp in Lingotek Translation 3.5.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekContactMessageBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContactMessageBodyTranslationTest::setUp()
- 4.0.x tests/src/Functional/LingotekContactMessageBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContactMessageBodyTranslationTest::setUp()
- 3.0.x tests/src/Functional/LingotekContactMessageBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContactMessageBodyTranslationTest::setUp()
- 3.1.x tests/src/Functional/LingotekContactMessageBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContactMessageBodyTranslationTest::setUp()
- 3.2.x tests/src/Functional/LingotekContactMessageBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContactMessageBodyTranslationTest::setUp()
- 3.3.x tests/src/Functional/LingotekContactMessageBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContactMessageBodyTranslationTest::setUp()
- 3.4.x tests/src/Functional/LingotekContactMessageBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContactMessageBodyTranslationTest::setUp()
- 3.6.x tests/src/Functional/LingotekContactMessageBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContactMessageBodyTranslationTest::setUp()
- 3.7.x tests/src/Functional/LingotekContactMessageBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContactMessageBodyTranslationTest::setUp()
- 3.8.x tests/src/Functional/LingotekContactMessageBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContactMessageBodyTranslationTest::setUp()
Overrides LingotekTestBase::setUp
File
- tests/
src/ Functional/ LingotekContactMessageBodyTranslationTest.php, line 32
Class
- LingotekContactMessageBodyTranslationTest
- Tests translating a field in a contact message.
Namespace
Drupal\Tests\lingotek\FunctionalCode
protected function setUp() : void {
parent::setUp();
// Place the actions and title block.
$this
->drupalPlaceBlock('local_tasks_block');
$this
->drupalPlaceBlock('page_title_block');
ContactForm::create([
'id' => 'contact_message',
'label' => 'Test contact form',
])
->save();
$fieldStorage = FieldStorageConfig::create([
'field_name' => 'field_test',
'entity_type' => 'contact_message',
'type' => 'text',
]);
$fieldStorage
->save();
FieldConfig::create([
'field_storage' => $fieldStorage,
'bundle' => 'contact_message',
])
->save();
// Add a language.
ConfigurableLanguage::createFromLangcode('es')
->setThirdPartySetting('lingotek', 'locale', 'es_MX')
->save();
// This is a hack for avoiding writing different lingotek endpoint mocks.
\Drupal::state()
->set('lingotek.uploaded_content_type', 'contact_message_field');
}