protected function FileTranslatorTest::importFile in Translation Management Tool 8
2 calls to FileTranslatorTest::importFile()
- FileTranslatorTest::testHTML in translators/tmgmt_file/tests/src/Functional/FileTranslatorTest.php
- Tests export and import for the HTML format.
- FileTranslatorTest::testXLIFF in translators/tmgmt_file/tests/src/Functional/FileTranslatorTest.php
- Tests import and export for the XLIFF format.
File
- translators/tmgmt_file/tests/src/Functional/FileTranslatorTest.php, line 501
Class
- FileTranslatorTest
- Tests for the file translator.
Namespace
Drupal\Tests\tmgmt_file\Functional
Code
protected function importFile($translated_file, $translated_text, JobInterface $job) {
$edit = array(
'files[file]' => $translated_file,
);
$this
->drupalPostForm($job
->toUrl(), $edit, t('Import'));
$this
->assertNoRaw('title="In progress"');
list($item1, $item2) = array_values($job
->getItems());
$this
->drupalGet($item1
->toUrl());
foreach ($translated_text[1] as $key => $value) {
$this
->assertText(Html::escape($value));
}
foreach ($translated_text[2] as $key => $value) {
$this
->assertNoText(Html::escape($value));
}
$this
->drupalPostForm(NULL, array(), t('Save as completed'));
$this
->drupalGet($item2
->toUrl());
foreach ($translated_text[1] as $key => $value) {
$this
->assertNoText(Html::escape($value));
}
foreach ($translated_text[2] as $key => $value) {
$this
->assertText(Html::escape($value));
}
$this
->drupalPostForm(NULL, array(), t('Save as completed'));
$this
->assertText(t('Finished'));
$this
->assertNoRaw('title="Needs review"');
}