You are here

protected function SmartlingTestBase::downloadAndCheckTranslatedFile in TMGMT Translator Smartling 8.2

Checks if download was successful.

Parameters

$jobId:

$fileName:

Throws

\Exception

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

File

src/Tests/SmartlingTestBase.php, line 206

Class

SmartlingTestBase
Basic tests for the Smartling translator.

Namespace

Drupal\tmgmt_smartling\Tests

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.');
}