You are here

public function PushBackControllerTest::testPushBackExistingJobWithoutFileUri in TMGMT Translator Smartling 8.4

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/PushBackControllerTest.php \Drupal\Tests\tmgmt_smartling\Functional\PushBackControllerTest::testPushBackExistingJobWithoutFileUri()

Push back existing job without file uri.

File

tests/src/Functional/PushBackControllerTest.php, line 81

Class

PushBackControllerTest
Push back controller tests.

Namespace

Drupal\Tests\tmgmt_smartling\Functional

Code

public function testPushBackExistingJobWithoutFileUri() {
  if (!empty($this->smartlingPluginProviderSettings)) {
    $translator = $this
      ->setUpSmartlingProviderSettings($this->smartlingPluginProviderSettings);
    $job = $this
      ->requestTranslationForNode($this->testNodeId, $this->targetLanguage, $translator);
    $fileName = $job
      ->getTranslatorPlugin()
      ->getFileName($job);
    $this
      ->checkGeneratedFile($fileName, $this->testNodeTitle);
    $this
      ->drupalGet("tmgmt-smartling-callback/{$job->id()}", [
      'query' => [
        'locale' => 'fr-FR',
      ],
    ]);
    $this
      ->assertResponse(404);
  }
  else {
    $this
      ->fail("Smartling settings file for simpletests not found.");
  }
}