protected function importFile($translated_file, $translated_text, JobInterface $job) {
// To test the upload form functionality, navigate to the edit form.
$this
->drupalGet($job
->toUrl());
$edit = array(
'files[file]' => $translated_file,
);
$this
->submitForm($edit, 'Import');
// Make sure the translations have been imported correctly.
$this
->assertSession()
->responseNotContains('title="In progress"');
// @todo: Enable this assertion once new releases for views and entity
// module are out.
//$this->assertSession()->pageTextContains('Needs review');
// Review both items.
list($item1, $item2) = array_values($job
->getItems());
$this
->drupalGet($item1
->toUrl());
foreach ($translated_text[1] as $key => $value) {
$this
->assertSession()
->responseContains(Html::escape($value));
}
foreach ($translated_text[2] as $key => $value) {
$this
->assertSession()
->responseNotContains(Html::escape($value));
}
$this
->submitForm([], 'Save as completed');
// Review both items.
$this
->drupalGet($item2
->toUrl());
foreach ($translated_text[1] as $key => $value) {
$this
->assertSession()
->responseNotContains(Html::escape($value));
}
foreach ($translated_text[2] as $key => $value) {
$this
->assertSession()
->responseContains(Html::escape($value));
}
$this
->submitForm([], 'Save as completed');
// @todo: Enable this assertion once new releases for views and entity
// module are out.
//$this->assertSession()->pageTextContains('Accepted');
$this
->assertSession()
->pageTextContains('Finished');
$this
->assertSession()
->responseNotContains('title="Needs review"');
}