You are here

public function SmartlingTest::testTwoJobsDifferentFileName in TMGMT Translator Smartling 8

Test different file names for different jobs.

File

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

Class

SmartlingTest
Basic tests for the Smartling translator.

Namespace

Drupal\tmgmt_smartling\Tests

Code

public function testTwoJobsDifferentFileName() {
  $translator = $this
    ->setUpSmartlingProviderSettings($this->smartlingPluginProviderSettings);
  $job = $this
    ->requestTranslationForNode($this->testNodeId, $this->targetLanguage, $translator);
  $fileName = $job
    ->getTranslatorPlugin()
    ->getFileName($job);
  $this
    ->assertEqual($fileName, 'JobID1_en_fr.xml');
  $newJob = $this
    ->requestTranslationForNode($this->testNodeId, 'de', $translator);
  $newFileName = $newJob
    ->getTranslatorPlugin()
    ->getFileName($newJob);
  $this
    ->assertEqual($newFileName, 'JobID2_en_de.xml');
  $this
    ->assertNotEqual($job
    ->id(), $newJob
    ->id());
  $this
    ->assertNotEqual($fileName, $newFileName);
}