You are here

public function TranslationRequestManagerTest::testCommitSuccessfulUploadNoSubmissionInRequest in TMGMT Translator Smartling 8.4

Test upload success flow: no submission in request.

File

tests/src/Kernel/TranslationRequestManagerTest.php, line 397

Class

TranslationRequestManagerTest
Tests TranslationRequestManagerTest class.

Namespace

Drupal\Tests\tmgmt_smartling\Kernel

Code

public function testCommitSuccessfulUploadNoSubmissionInRequest() {
  $translation_request = [
    'translationRequestUid' => 'test_translation_request_uid',
    'translationSubmissions' => [],
  ];
  $translation_request_manager_mock = $this
    ->getMockBuilder(TranslationRequestManager::class)
    ->setConstructorArgs([
    $this->apiWrapperMock,
    $this->stateMock,
    $this->loggerMock,
  ])
    ->setMethods([
    'initApiWrapper',
  ])
    ->getMock();
  $translation_request_manager_mock
    ->expects($this
    ->once())
    ->method('initApiWrapper')
    ->with($this->job);
  $this->apiWrapperMock
    ->expects($this
    ->never())
    ->method('updateTranslationRequest');
  $translation_request_manager_mock
    ->commitSuccessfulUpload($this->job, $translation_request);
}