protected function LingotekContentTypeBulkDisabledTargetOverrideTranslationTest::setUp in Lingotek Translation 3.6.x
Same name and namespace in other branches
- 4.0.x tests/src/Functional/LingotekContentTypeBulkDisabledTargetOverrideTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkDisabledTargetOverrideTranslationTest::setUp()
- 3.5.x tests/src/Functional/LingotekContentTypeBulkDisabledTargetOverrideTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkDisabledTargetOverrideTranslationTest::setUp()
- 3.7.x tests/src/Functional/LingotekContentTypeBulkDisabledTargetOverrideTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkDisabledTargetOverrideTranslationTest::setUp()
- 3.8.x tests/src/Functional/LingotekContentTypeBulkDisabledTargetOverrideTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkDisabledTargetOverrideTranslationTest::setUp()
Overrides LingotekTestBase::setUp
File
- tests/
src/ Functional/ LingotekContentTypeBulkDisabledTargetOverrideTranslationTest.php, line 24
Class
- LingotekContentTypeBulkDisabledTargetOverrideTranslationTest
- Tests translating a content type using the bulk management form.
Namespace
Drupal\Tests\lingotek\FunctionalCode
protected function setUp() : void {
parent::setUp();
// Create Article node types.
$type = $this
->drupalCreateContentType([
'type' => 'article',
'name' => 'Article',
]);
// Add a language.
ConfigurableLanguage::createFromLangcode('es')
->setThirdPartySetting('lingotek', 'locale', 'es_MX')
->save();
ConfigurableLanguage::createFromLangcode('ca')
->setThirdPartySetting('lingotek', 'locale', 'ca_ES')
->save();
$profile = LingotekProfile::create([
'label' => 'Profile with disabled targets',
'id' => 'profile_with_disabled_targets',
'project' => 'test_project',
'vault' => 'test_vault',
'auto_upload' => FALSE,
'workflow' => 'test_workflow',
'language_overrides' => [
'es' => [
'overrides' => 'custom',
'custom' => [
'auto_request' => TRUE,
'workflow' => 'test_workflow',
'vault' => 'test_vault',
],
],
'ca' => [
'overrides' => 'disabled',
],
],
]);
$profile
->save();
$this
->saveLingotekConfigTranslationSettings([
'node_type' => 'profile_with_disabled_targets',
]);
// This is a hack for avoiding writing different lingotek endpoint mocks.
\Drupal::state()
->set('lingotek.uploaded_content_type', 'content_type');
}