Test the field config entity type for a single checkout.
function testFieldConfigTranslateTabSingleCheckout() {
$this
->loginAsAdmin(array(
'translate configuration',
));
// Add a continuous job.
$job = $this
->createJob('en', 'de', 1, [
'job_type' => Job::TYPE_CONTINUOUS,
]);
$job
->save();
// Go to sources, field configuration list.
$this
->drupalGet('admin/tmgmt/sources/config/field_config');
$this
->assertSession()
->pageTextContains('Configuration ID');
$this
->assertSession()
->pageTextContains('field.field.node.article.body');
$edit = [
'items[field.field.node.article.body]' => TRUE,
];
$this
->submitForm($edit, 'Add to cart');
$this
->clickLink('cart');
$this
->assertSession()
->pageTextContains('Body');
$edit = [
'target_language[]' => 'de',
];
$this
->submitForm($edit, 'Request translation');
// Assert that we cannot add config entities into continuous jobs.
$this
->assertSession()
->pageTextNotContains('Check for continuous jobs');
$this
->assertSession()
->fieldNotExists('add_all_to_continuous_jobs');
// Go to the translate tab.
$this
->drupalGet('admin/structure/types/manage/article/fields/node.article.body/translate');
// Request a german translation.
$this
->submitForm([
'languages[de]' => TRUE,
], 'Request translation');
// Verify that we are on the checkout page.
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->pageTextContains('One job needs to be checked out.');
$this
->submitForm([], 'Submit to provider');
// Verify that the pending translation is shown.
$this
->clickLinkWithImageTitle('Needs review');
$this
->submitForm([], 'Save as completed');
}