public function JobsTest::setUp in TMGMT Translator Smartling 8.4
Same name and namespace in other branches
- 8.3 tests/src/Functional/JobsTest.php \Drupal\Tests\tmgmt_smartling\Functional\JobsTest::setUp()
Overrides DrupalWebTestCase::setUp()
Overrides SmartlingTestBase::setUp
File
- tests/
src/ Functional/ JobsTest.php, line 24
Class
- JobsTest
- Jobs 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]'],
], 'Save');
}