public function FileNameTest::testTwoJobsDifferentFileName in TMGMT Translator Smartling 8.3
Same name and namespace in other branches
- 8.4 tests/src/Functional/FileNameTest.php \Drupal\Tests\tmgmt_smartling\Functional\FileNameTest::testTwoJobsDifferentFileName()
Test different file names for different jobs.
File
- tests/
src/ Functional/ FileNameTest.php, line 15
Class
- FileNameTest
- File name tests.
Namespace
Drupal\Tests\tmgmt_smartling\FunctionalCode
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);
}