public function LoggingTest::setUp in TMGMT Translator Smartling 8.4
Same name and namespace in other branches
- 8.3 tests/src/Functional/LoggingTest.php \Drupal\Tests\tmgmt_smartling\Functional\LoggingTest::setUp()
Overrides DrupalWebTestCase::setUp()
Overrides SmartlingTestBase::setUp
File
- tests/
src/ Functional/ LoggingTest.php, line 23
Class
- LoggingTest
- Logging tests.
Namespace
Drupal\Tests\tmgmt_smartling\FunctionalCode
public function setUp() {
parent::setUp();
// Create queue table (it doesn't exist for simpletests somehow).
$uploadQueue = new DatabaseQueue('tmgmt_extension_suit_upload', Database::getConnection());
$database_schema = Drupal::database()
->schema();
try {
if (!$database_schema
->tableExists('queue')) {
$schema_definition = $uploadQueue
->schemaDefinition();
$database_schema
->createTable('queue', $schema_definition);
}
} catch (SchemaObjectExistsException $e) {
}
$this
->drupalPostForm('/admin/tmgmt/translators/manage/smartling', [
'settings[project_id]' => $this->smartlingPluginProviderSettings['settings[project_id]'],
'settings[user_id]' => $this->smartlingPluginProviderSettings['settings[user_id]'],
'settings[token_secret]' => $this->smartlingPluginProviderSettings['settings[token_secret]'],
'settings[contextUsername]' => $this->smartlingPluginProviderSettings['settings[contextUsername]'],
'settings[context_silent_user_switching]' => $this->smartlingPluginProviderSettings['settings[context_silent_user_switching]'],
'settings[retrieval_type]' => $this->smartlingPluginProviderSettings['settings[retrieval_type]'],
'settings[auto_authorize_locales]' => $this->smartlingPluginProviderSettings['settings[auto_authorize_locales]'],
'settings[callback_url_use]' => $this->smartlingPluginProviderSettings['settings[callback_url_use]'],
'settings[callback_url_host]' => $this->smartlingPluginProviderSettings['settings[callback_url_host]'],
'settings[scheme]' => $this->smartlingPluginProviderSettings['settings[scheme]'],
'settings[custom_regexp_placeholder]' => $this->smartlingPluginProviderSettings['settings[custom_regexp_placeholder]'],
'settings[translatable_attributes]' => $this->smartlingPluginProviderSettings['settings[translatable_attributes]'],
'settings[exclude_translatable_attributes]' => $this->smartlingPluginProviderSettings['settings[exclude_translatable_attributes]'],
'settings[force_block_for_tags]' => $this->smartlingPluginProviderSettings['settings[force_block_for_tags]'],
], t('Save'));
}