You are here

protected function SmartlingTestBase::downloadAndCheckTranslatedFile in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 tests/src/Functional/SmartlingTestBase.php \Drupal\Tests\tmgmt_smartling\Functional\SmartlingTestBase::downloadAndCheckTranslatedFile()

Checks if download was successful.

Parameters

$jobId:

$fileName:

Throws

\Exception

3 calls to SmartlingTestBase::downloadAndCheckTranslatedFile()
BaseFlowTest::testUploadFileAndDownloadTranslation in tests/src/Functional/BaseFlowTest.php
Test upload and download translation.
BaseFlowTest::testUploadXlfChangeToXmlDownloadXlf in tests/src/Functional/BaseFlowTest.php
Test uploading/downloading xlf file: rely on file name in tmgmt_job.
BaseFlowTest::testUploadXmlChangeToXlfDownloadXml in tests/src/Functional/BaseFlowTest.php
Test uploading/downloading xml file: rely on file name in tmgmt_job.

File

tests/src/Functional/SmartlingTestBase.php, line 245

Class

SmartlingTestBase
Basic tests for the Smartling translator.

Namespace

Drupal\Tests\tmgmt_smartling\Functional

Code

protected function downloadAndCheckTranslatedFile($jobId, $fileName) {
  $this
    ->drupalPostForm("admin/tmgmt/jobs/{$jobId}", [], t('Download'));
  $this
    ->drupalGet('admin/reports/dblog');
  $this
    ->assertResponse(200);

  // TODO: don't know why assertLink and assertRaw doesn't work with quoted
  // strings.
  $this
    ->assertRaw('Translation for');
  $this
    ->assertRaw($fileName);
  $this
    ->assertRaw('was successfully downloaded and imported.');
}