You are here

public function FileNameTest::testTwoJobsDifferentFileName in TMGMT Translator Smartling 8.2

Test different file names for different jobs.

File

src/Tests/FileNameTest.php, line 15

Class

FileNameTest
File name tests.

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