You are here

private function SmartlingTest::downloadAndCheckTranslatedFile in TMGMT Translator Smartling 8

Checks if download was successful.

Parameters

$jobId:

$fileName:

Throws

\Exception

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

File

src/Tests/SmartlingTest.php, line 196
Contains \Drupal\tmgmt_smartling\Tests\SmartlingTest.

Class

SmartlingTest
Basic tests for the Smartling translator.

Namespace

Drupal\tmgmt_smartling\Tests

Code

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