You are here

public function TranslationRequestManagerTest::testIsTranslationRequestReadyForDownloadStateDeletedFalse in TMGMT Translator Smartling 8.4

Is ready for download: false, state deleted.

File

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

Class

TranslationRequestManagerTest
Tests TranslationRequestManagerTest class.

Namespace

Drupal\Tests\tmgmt_smartling\Kernel

Code

public function testIsTranslationRequestReadyForDownloadStateDeletedFalse() {
  $translation_request_manager_mock = $this
    ->getMockBuilder(TranslationRequestManager::class)
    ->setConstructorArgs([
    $this->apiWrapperMock,
    $this->stateMock,
    $this->loggerMock,
  ])
    ->setMethods([
    'initApiWrapper',
    'getTranslationRequest',
  ])
    ->getMock();
  $translation_request_manager_mock
    ->expects($this
    ->once())
    ->method('initApiWrapper')
    ->with($this->job);
  $translation_request_manager_mock
    ->expects($this
    ->once())
    ->method('getTranslationRequest')
    ->with($this->job)
    ->willReturn([
    'translationRequestUid' => 'test',
    'translationSubmissions' => [
      [
        'state' => TranslationSubmissionStates::STATE_DELETED,
      ],
    ],
  ]);
  $this
    ->assertEquals($translation_request_manager_mock
    ->isTranslationRequestReadyForDownload($this->job), FALSE);
}